Random object detection matlab

前端 未结 2 618
青春惊慌失措
青春惊慌失措 2021-01-24 09:02

I want generate a random image using matlab which contains the object to be detected and the clutter images at random locations. I then want to detect this randomly generated ob

相关标签:
2条回答
  • 2021-01-24 09:14

    Try using the activecontour function from the Image Processing Toolbox.

    0 讨论(0)
  • 2021-01-24 09:20

    You may want to take a look at "Marching Squares" Algorithm. A well documented example is located here: http://devblog.phillipspiess.com/2010/02/23/better-know-an-algorithm-1-marching-squares/
    The coordinates you obtain from the algorithm can then again be used as coordinates on where to place the contour pixels in another image.

    Unfortunately, I cannot provide you with any Matlab-Code (just ported it to Fortran), but given the discussion of the algorithm, it should be straightforward to implement it.
    Some advice from my experience in using the "Marching Squares":

    1. For ease of programming the algorithm, turn the image into a black/white-image first. This provides a concise contour to be detected.
    2. The initial position is critical for the success of the process of detecting the contour. You may want to determine an approximate center of the object (i.e. a cluster) using some kind of filter function. From there you walk in one direction (North, South, West, East) until you hit the boundary and start the algorithm from there.

    edit: Have you seen isocontour in MatlabCentral? http://www.mathworks.com/matlabcentral/fileexcahange/30525-isocontour

    0 讨论(0)
提交回复
热议问题