Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Color tracking. How to detect colors clashing?

$
0
0
So your process should be:

Draw the camera's image.
Scan the image for the pixels that are the best match to the first and second colors.
Record their X and Y positions. (Hint: X1, Y1, X2, Y2.)
Determine the distance between those two points. (Hint: Use the dist() function!)
If the distance is small, (Hint: If( dist( X1, Y1, X2, Y2 ) < someValue ){ )
Then draw something near them (Hint: imageMode(CENTER); image( theImage, X1+X2/2.0, Y1+Y2/2.0); )
That should get you started!

Remember: You don't have to scan the image TWICE! Just ONCE, remembering TWO different "best matching" points.

Viewing all articles
Browse latest Browse all 1768

Trending Articles