simulink vision

I am currently working on a class project, my goal is to track a color or shape with a camera. Then to receive the coordinates of the object. any assistance would be helpful, including how to track an object by color or shape and how to detect the coordinates.

I have done some work but the built in library seems to be missing some things that i have to extract from demos.


  • Please post your try so that I can help you to understand what is wrong.
  • sorry here is what i was able to get with tracking red. but i am not sure about shapes or a coordinate system.
  • Your result is good.
    I think that, first of all, you have to "clean" the image, so that it remains only the circle.
    You can mantein only the objects that have an area > of a certain threshold, or you can use some morphological operators.
    Then, you can use the function regionprops to find the coordinates of the center of your object.
    For the color you can simply check the value of the centroid pixel.
  • i understand the cleaning part i figured that out, well started to. but the regionprops, i don't i can see using it in matlab but not how to incorporate it into simulink i know that it is possible but i can not figure out how exactly
  • If you search in the matlab help "regionprops simulink" you can figure it out.
  • thanks for the help i think i finally understand i had a little trouble combining the "blob" out put back in because the output size ended up as 50*by like 2 but i got it worked out i will post my final for anyone else reference soon
  • thank you very much for all of your help, the only thing i have left is that i wish to receive the output of blob analysis in x,y cord so that i can use this separately.
  • Your work is very fine!
    What is the problem with the coordinates?
  • i just need the cord output but do not know how to display it, centroid or bbox. i do not know, i am trying to get a numeral display that can be edited. so the way i see it would be like x = 100 , y = 124.
    and if there are multiple targets then each point is needed. i sort of see it in centroid but do not know what can view that.
  • Why don't you use the [u]display[/u] block?
  • because i did not understand that i could. thanks and the way my block library's are i couldn't find it until i knew what i needed because it did not show up. thanks for all of the help and quick responses
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!