Detect a zone for catch something with M7

Hi, I’m french (so sorry for my bad english) I’m student in college and I have to make a project. It consist to make robot follow a line (this parts is finished) now i have a zone where we put a can on the target of our mission is to recognize that for use a gripper and catch the can for put it to another zone, so somebody can help for how i can detect the zone please (and I’ve try to find rect but it’s doesn’t really work)

You want to detect the can ? Can you use colors find_blobs() ?

hmm I don’t know does it work on GrayScale ?

Maybe I have to explain all my program so I have make one for detect line with linear regression and i want to add in this program a mean to detect can so i’m in Grayscale so if i have to use color its a little bit probelamtics no ?

Maybe if a put here my code that’s will be better :

Find blobs works in gray_scale too. Same for the linear regression method. Just switch to tracking objects in color and then use the linear regression method with a color range that’s -128,127 for A and B and this will remove the effect of color from the line regression. Then you can look for red in the color image using find_blobs().

thanks but i’ve just a problem if i want an optimal work I didn’t see the can but I can see the square on the ground but not really good, i’ve try to find_rect but find blob can work for that ?

Find blob can find the square on the ground. Just give it different thresholds to look for.