|
COG broken, mostly John from United States [5 posts] |
17 year
|
im having trouble with the COG tracking correctly . . .
my method (see included black and white image, blob_find2) gets rid of 99% of the noise and is very robust, meaning i dont need to tweak it for it to work. but for some odd reason, the center of mass module only tracks the blob when it covers 80%+ of the space. otherwise it just hangs in some random location . . .
so i redid it (see black and red image, blob_find1) using the roborealm method, http://www.roborealm.com/tutorial/color_object_tracking_2/slide010.php . the center of mass then works, but that method doesnt get rid of all the noise, making the center of mass mostly wrong.
then i read the documentation some more, and found this:
"Note that based on the way this COG is calculated brighter pixels will exert more pull on the final COG location than darker pixels."
so applying the negative to the image, the center of mass works better, but still is way off too much. (see blob_find3.png)
oh, and the image is me moving a large red object around in my kitchen . . .
thanks,
John
societyofrobots.com
|
|
|
Pictures?? Anonymous |
17 year
|
Hi John,
I don't think the images made it up into the forum. Can you retry posting the blob images? The forum accepts jpg and png images only.
Sounds like you may have had a white on black image issue. The 'on' pixels in RoboRealm are white whereas the 'off' pixels are black. This differs between image processing programs.
If possible please include the originals with the COG labels so that we can try the COG modules on them to better determine what is going wrong.
Thanks.
STeven.
|
|
|
John from United States [5 posts] |
17 year
|
haha ok I think I just forgot to upload them . . .
the fourth new image (blob_find4.png) is something new I just tried and it works. but its still strange the other methods didnt work . . .
|
|
|
COG Issues Anonymous |
17 year
|
John,
thanks for the images ... that helps quite a bit.
The blob image#1 does not find the "correct" COG since there are a couple of blobs that are contributing to the overall COG. Note that the COG takes into account ALL pixels in the image. Thus the displayed COG is correct when you take into account the upper left large blob and the seemingly 4 smaller lower fainter blobs into account. With the COG set to display < 100% of the pixels it becomes somewhat confusing as to what the COG is centering on since it appears to be black space .. but in fact that black space is inbetween the large blob and the smaller blobs. To accurately get the larger blob you would need to eliminate (either by thresholding or other filter) the other smaller blobs.
Blob2 is the black on white issue. A negative flip as you have found out helps to solve this issue. The COG centers on white or 'on' pixels.
Blob3 is the negative of #2 but we still have an issue with too many blobs since the white surrounding rectangle (generated due to the population threshold filter) is causing the COG to again center using too many pixels and be very biased to the center of the screen. If you were to transform->crop the image to 10,10, 310, 220 that would eliminate the white border and correctly display the COG since the only contributing pixels would be from the center blob.
Blob4 ... you got it!
The trick to correct blob centering is to look at all the pixels in the image that are affecting the calculation. If there are too many then the COG appears wrong and you will need to use other filters to remove the unwanted objects.
Thanks for the post!
STeven.
|
|