I know I'm cutting it close to competition here but I need to ask-
I'm using the function:
"while(get_object_count(color)>0)" to begin color tracking.
But even when the blob is directly in the line of sight of the camera, it regards the statement as false and promptly ends the loop. Can anyone help???
Are you calling camera_update(); before the while loop? Also, is your color model set correctly?
-Marty Rand
{
Senior programmer at Norman Advanced Robotics
Former senior programmer at Whittier Middle School
Youth Advisory Council
All around nerd
}
I thought the update might be an issue so I tried calling it before the while loop as well as in the while loop itself and it didn't clear up anything. I'm pretty sure the model is set up correctly as well... :(
Hmmm... Try putting the camera_update(); back in the while loop and copy+paste your entire source file to the forum. Maybe there's something else going on.
Braden McDorman
Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.
Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.
We find that the statement
while(get_object_area(CHANNEL, 0) > 1000)
works better. What this does is it tells if the blob of the largest size (0
) of color channelCHANNEL
is greater than 1000. Our team finds this better because tiny blobs can show up all the time and they can interfere with the blob count, even when looking at white space, and this checks that the blob is larger than 1000 pixels, and thus not one of those phantoms. TL;DR this method cuts out some of the camera noise.:3
Also, make sure that you executed
camera_open(LOW_RES);
before any of this, or else the camera will not be on. You could check if your camera is focused too.:3
Accidentally I have come across this website and good to see the details regarding the while loop described https://emeraldcutbezelring.com here. The usage of while in a programming language is specified here and it has a great impact. I am looking for more clarification regarding the topic and keep sharing more details here.