loading
 
Target for multiple object whit same color
Ricardo Sampaio from Portugal  [32 posts]
16 year
Hi there, first post and want to say what and amazing program, im a robot builder for several Robocup classes and this software is just amazing.

For the question. I want to be able to target, whit COG or other multiple items , i can get 1 red, 1blue, 1green, etc, at the same time whit mask and marker .
But is possible to target and get the coordinates for example 3 or 4 red objects?

And when i use mark can i take out the COG but mantain in the marker?

ps.: And if some one could optimize my code i woud aprisiate. :)

thx in advance.


program.robo
Anonymous 16 year
Ricardo

Yes, it is possible to track more than one object but not with the COG. The COG is a full image module that takes into account each pixel. If you segment the image into multiple blobs you can track each separately by using the blob filter. The blob filter can produce an array of COG values for each blob that can be used in VBScript or with the Display Point to show the results. See the attached robofile that we based on yours but reduced it to simplify it to track only red and green objects (this can be extended to track other colored objects).

STeven.

program.robo
Ricardo Sampaio from Portugal  [32 posts] 16 year
Thx for the quick answer this was very useful. RR as lots of parts and its difficult to test everything.
Two more things:
can i get the size of them like the size_box of cog of each one?
and a scrypt to put them in variables.
ex.:
obj1 is red size 30
obj2 is red size 15
obj3 is green size 15
etc.
Anonymous 16 year
Yes, once the blob filter has done its job of removing unwanted blobs add in the Analysis->Geometry module and make sure the "Individual Blobs" checkbox is selected. Then you will have access to a wealth of information about each blob. If you click on the blob in the image screen that interface will update with the current variables for that specific blob that you just clicked on. From there you can use the Write_Variables module to write those values to disk.

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index