cmucam3-hardware (#1) - simple-track-color does not work as expected (#192) - Message List
Hi!
I just started programming for the CMUcam3. My development environment is working now, and I thought that it would be smart to start out with a simple, yet working program. I first used the cmucam2 emulator, chose some color to track, and used the obtained parameters for the simple-track-color program. Interestingly, the cmucam2gui is able to track the color, but the standalone program is not. I always get
centroid = 88,70 bounding box = 2,0,175,142 num pix= 24675 density = 1004
num pix varies a bit over time, everything else stays nearly the same. I didn't analyse the code precisely yet, but it's disturbing me a bit that the sample program does not behave as expected. Am I doing something wrong? Shouldn't it do the same as the cmucam2 emulator with the graphical user interface? (Using up to date svn.)
Thanks for any hints.
-
Message #486
Can't anybody help me? Did no one ever use this successfuly? It seems to me this is the most obvious application to begin with?
jvm04/23/08 12:12:07 -
-
Message #487
jvm,
Are you saying that the GUI program with CMUCam2 Emulation tracks a given color? But the program you wrote does not... what are you using for servos and are you in an isolated room with a given color only or is there a great variation in contrast and what not? Im curious because I too am trying to track color but feel that the CMUCam2 Emulation should work for what I need my program to do, but the servos are very very choppy and do not seem to stay set on a given object..
camjockey04/24/08 09:41:21 -
-
Message #488
Yes, the GUI programs tracks the color. The color is in clear contrast to everything else, so tracking should be easy, and it works without problems in the GUI application. I do not use any servos - I want to use the standalone program to send messages over RS232 to another processor (which say only "the object is on the left/right side"), but I don't get the sample program working. (I only replaced the "tracking parameters" section with working parameters obtained in the GUI program until now, and the centroid in the debugging output does not change as expected.) I think for you it would also be better if you used the standalone program to set the servo positions, because you can use it without the computer and you'd have the ability to implement some software controler as described in http://en.wikipedia.org/wiki/Controller_%28control_theory%29 to produce more fluent servo movements. Of course, this would be much easier, if the sample program would work, because you'd have only to replace a few lines then ;)
jvm04/24/08 10:00:30 -
-
Message #491
I'll look into this. I think the simple-track color example is using the same functions as the cmucam2-emulation. They should work identically, except that the camera might be configured in a slightly different manner which could change the color bounds.
agr04/26/08 15:10:37 -
-
Message #512
it seems part of the problem is that scratch_x and scratch_y are defined to be only 16 bits. According to the algorithm, values of 200000 or greater should be fairly common. Although it does not totally get it fixed, its most likely part of the problem.
caleb_yau05/06/08 17:28:57 -
Message #496
About this demo on cmucam2 emulation, my servo seem to turn on opposite direction. For example if i move red object to the left, the servo turn right instead following the object.
when i grab the image from cmucam2, i am suspect that cmucam3 should mount upside down to get the servo working right. And still using cmucam2 gui, servo pan hasn't working quite well yet.
I am not sure what everyone get so far with this cmucam2 emulation? Do you have the same problem with me? or it just only me?
wikki04/27/08 03:19:53 -
Message #497
simple-track-color
finally, i manage to get it work.. you need to add few lines. follow link below for full code...
http://www.cmucam.org/discussion/1/198
gosh.. this took me a 3 days to figure out what wrong... :(
now i can start write simple program to drive dc-dc motor. i am thinking to use t_pkt.int_density to let the robot move closer if it is too far or move further if it too close with the camera. Please let me know if you have better idea. Any hints will be appreciated.
cheers,
Ammar
wikki04/27/08 05:02:09 -
-
Message #528
could you track multiple objects of the same color with your program? or only one color objetct per frame?
boris05/14/08 15:36:22 -
-
Message #529
The default code only searches for one point, where the density of pixels within the right color interval is the highest, and for the area in which pixels within the interval are present. You'd 've to define an "object" in this context more closely to track multiple ones. Is an object pixels lying next to each other within the color interval? Usually, there is some noise or areas with different lightning, so one "object" in real world could seem as multiple objects if you just search for color areas. If you know that every object you search is a circle, you could write an algorithm to find these objects, even if the color is not everywhere within the interval, for example. So: no, the default code does not search for multiple objects. But you could try to write code for this purpose, fitting your application.
jvm05/14/08 16:25:30
-
-
Message #498
Thank you very much, this is working for me.
jvm04/27/08 14:34:16
-
-
-
-
-
