SRL Archive - MSI Suggestions

Color Finding Methods?


Sir R. M8gic1an

2009-09-11 22:49:01

Well, in the function Planning thread, cazax suggested this:


Type
TMSObj = Record
TP : TPoint;
Colors : TIntegerArray;
UpTexts : TStringArray;
W, H : Integer; //For SplitTPAEx or TPAtoATPAEx
End;
And this reminded me of something. SmartColors.

Smart colors is an AI object finding system that moves the colors around in an array, giving priority to those that it finds most often. It is also very fast because it usually searches without tol and is able to find it, if not, it then uses tol and takes into account which color it found.
It also checks that the color is not too common in the MS.


Or should we use a 'normal' finder, that can take any cts, etc?
if so, we should perhaps use TAutoColorInfo, from SRL.

{ type TAutoColorInfo;
Description: Set of information that can be used in some functions. }
type
TAutoColorInfo = record
Name: string;
Color: Integer;
ColorArray: TIntegerArray;
MinCount: Integer;
MaxCount: Integer;
MaxDist: Integer;
MaxDistCenter: Integer;
UpText: string;
UpTextMulti: TStringArray;
HueMod, SatMod: Extended;
LumTol: Integer;
MinR, MaxR, MinG, MaxG, MinB, MaxB: Integer;
MinX, MaxX, MinY, MaxY, MinZ, MaxZ: Extended;
end;

Your thoughts?

~RM

Boreas

2009-09-12 01:54:09

How about both, depending on the object? Or how about a combination of the two, something that can adjust the min/max etc getting more and more accurate.

Wizzup?

2009-09-12 01:56:42

Don't over complicate everything. Simplicity is extremely effective and often better.
Just MO.

Coh3n

2009-09-12 07:51:52

From: Wizzup?
Don't over complicate everything. Simplicity is extremely effective and often better.
Just MO.


I agree. I mean we don't have to make it so complicated that it ends up not working for whatever reason. To be quite honest, I think it would be much more effective to keep it simpler. Not to mention it would be a lot easier for everyone to follow (I think you said something like that in another thread, RM). But then again, you would only have to use certain information when needed, right? It may not hurt to have as much information as we can, as long as it gets used.

Coh3n

Blumblebee

2009-09-12 09:36:16

type
TObjInfo = Record
hue, sat: Extended;
TP: Tpoint;
UpTexts: TstringArray;
col: TIntegerArray;
Lum: Integer;
Width, Height: Integer;
end;

I think Lum, Hue and Sat should be added to Cazax idea as CTS 2 should be the main color finding routine.

n3ss3s

2009-09-12 13:01:36

From: Wizzup?
Don't over complicate everything. Simplicity is extremely effective and often better.
Just MO.



Yeh, don't aim for a library that makes the end user's code closer to something like FindObject(Object), it only doesn't make it boring, but it gives the user less power to customize things (Well, it is an open source lib but lets assume you wouldn't be able to edit it)…

Sir R. M8gic1an

2009-09-12 17:00:47

@Blumblebee: Tol should also be in there ;) and we probably don't need a TIA for colors.
@N3ss: Remember we are not trying to develop an include here,… we are trying to develop a script so big that it needs an include to stay organized.

~RM

Blumblebee

2009-09-12 19:00:49

From: Rasta Magician
@Blumblebee: Tol should also be in there ;) and we probably don't need a TIA for colors.

~RM


doesnt lum = tol? I'm probably wrong but thats what I meant for lum to be :p