Jump to content
spartakos

exclude objects from FindColorTol?

Recommended Posts

Or just answer the thread so other people can make use of it.

 

You're more than welcome to answer it. I'd rather draw visual representations if I'm going to take the time to re-explain it every time someone asks.

 

Reminds me of a great quote by Kaitnieks

 

"Ask less and read more, that's how you learn things."

Link to comment
Share on other sites

Yet you manage to refer him to your messenger, and this was not to explain/help him?... I would of course answer it, but the fact that I never used SCAR 3.22 makes it quite hard for me to guess what functions it contained.

If the post is clearly a duplicate as you state, a link to the the thread it duplicates would suffice.

 

As for that quote, not all people learn the same way. Asking is often an important part of once learning.

Link to comment
Share on other sites

Yet you manage to refer him to your messenger, and this was not to explain/help him?... I would of course answer it, but the fact that I never used SCAR 3.22 makes it quite hard for me to guess what functions it contained.

If the post is clearly a duplicate as you state, a link to the the thread it duplicates would suffice.

 

As for that quote, not all people learn the same way. Asking is often an important part of once learning.

 

Not that I don't appreciate your criticism of how I deal with people you still completely evaded the fact that my help (or anyone's) is completely voluntary and that it is much more efficient to create visual tutorials that more people will find useful. Not to mention the fact that if someone has less vague [direct] questions it is also more efficient to do so over instant messenger or IRC where, multiple, people can reply i.e. #SCAR irc.scar-divi.com

Link to comment
Share on other sites

That truly depends on the case, a general rule of thumb is splitting + dimension-check (and/or length check).

 

Some simple example (SCAR 3.4):

var
 Colors : TIntArray;
 TPA: TPointArray;
 TP:TPoint;
 ATPA:T2DPointArray;
 i, W,H,x1,y1,x2,y2: Integer;
begin
 Colors := [26367, 13260, 102];
 x1 := 0; x2 := 700;
 y1 := 0; y2 := 700;
 if FindColorsTolEx(TPA, Colors, x1,y1,x2,y2, 20) then
 begin
   // group together points that are close to each other:
   ATPA := SplitTPAEx(TPA, 3,3);

   // for each group...
   for i:=0 to High(ATPA) do
   begin
     // get the dimensions of the group (width, height)..
     TPADimensions(ATPA[i], W,H);
     // if width greater then 9, and less then 31.. same goes for height..
     if InRange(W, 10, 30) and InRange(H, 10, 30) then  
     begin

       // This fits the basic rules.. so it's a bigger chance this is what you are looking for.
       WriteLn('Found');
       TP := TPAMean(ATPA[i]);
       MoveMouse(TP.x, TP.y);
     end;
   end;
 end;
end.

 

Now to get better results, something less general is needed, meaning I would have to see some pictures...

Edited by slacky
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...