detect square objects in a binary image

5 ビュー (過去 30 日間)
genesis
genesis 2013 年 11 月 1 日
コメント済み: Image Analyst 2013 年 11 月 1 日
i have previously used regionprops to measure the boundingbox in a binary image. but the thing is sometimes it can detect sometimes it cannot detect the square in the image. is there any more robust way to detect square and obtain its location and dimension?

回答 (2 件)

Jeremy
Jeremy 2013 年 11 月 1 日
I was thinking about this recently, a hough transform could be a very robust way to find squares, if they are not rotated at all it would be fairly quick and would have no trouble with partial or overlapping squares. Are these actual squares or rectangles? I don't know your experience level, but writing a hough transform from scratch can be tough.
  2 件のコメント
genesis
genesis 2013 年 11 月 1 日
they are square exactly but maybe in different orientation i would say my experience is beginner
Image Analyst
Image Analyst 2013 年 11 月 1 日
You forgot to post your image, again.

サインインしてコメントする。


Image Analyst
Image Analyst 2013 年 11 月 1 日
I would not really say that regionprops is a square detector. It characterizes and measures blobs. You need to do something in advance to create a binary image. If you did a good job, then your blob will be square and regionprops will measure it, and all blobs and tell you which are square or not square, but you have to have created the cquare binary blobs in the first place. How you do that is through image processing and what processes you need to use depend on what your square looks like. is it solid, or a perimeter that's "hollow" in the middle? Have you tried the corner() function? It all depends on what your image looks like. An algorithm that's good at detecting a bright square on a black background would not be appropriate for detecting a blue satin fabric patch on a piece of blue knit fabric the same color. You might be able to get by with simple thresholding in the first case, while in the second case you'd need a texture processing method.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by