How to know the number of bends in polygon of binary image?

2 次查看(过去 30 天)
I want to detect triangle and hexagon. But i cannot detect triangle and hexagon. i used to technique permeter^2/(4*pi*Area) ratio. The ratio valed changes with dimension of the image. So i want to is there any technique for count the number of bends in polygon?

采纳的回答

Matt J
Matt J 2014-1-3
编辑:Matt J 2014-1-3
One approach might be to pass the known coordinates of the points in the polygon through VERT2LCON to obtain inequalities representing the polygon
A*x<=b
The A(i,:) will be the normals to the sides of the polygon so ideally the number of the A(i,:) will be the number of sides of the polygon.
Due to discretization error in the boundaries, it is possible that the routine might think a side of the polygon actually partitions into many more sides, but the false extra sides should have very similar normals. Assuming you know some lower bound on the angle between the sides of the polygon, it shouldn't be too hard to bin the false sides together.
  2 个评论
Image Analyst
Image Analyst 2014-1-3
Sounds like it could be interesting. Uploading a screenshot with a diagram/plot of the polygons might help people understand it better and get you more downloads. Just a suggestion because it is a bit abstract: "polyhedron can be specified as the intersection of a solid polyhedron A*x<=b and a sub-manifold Aeq*x=beq passing through its interior" after reading that, I think a diagram would help.
Matt J
Matt J 2014-1-3
编辑:Matt J 2014-1-3
A fair point. I'll work on that.
For the matter at hand, though, it isn't necessary to understand how A,b interact with Aeq,beq. The polygons here are solid in R^2 and vert2lcon will only return inequality data A,b data (equality data Aeq,beq will be empty).

请先登录,再进行评论。

更多回答(1 个)

Image Analyst
Image Analyst 2014-1-3
The ratio does not change substantially with the dimension of the image. I don't know why you say it does. It is a dimensionless quantity. As long as you have a decent number of pixels it will be the same for a 1 megapixel image, or a 20 megapixel image. Sure it may be different if your triangle or hexagon is only 5 or 10 pixels big, because the shape is so quantized with such a small shape, but as long as you have a good number of pixels, the triangle should give you a higher ratio, like 2 or more. The more circular it gets (like a hexagon is more circular than a triangle), the close to 1 it becomes.
In your earlier post I think I gave you an answer to look in the FAQ for code to find "kinks" in the boundary. You can still use that if you want.

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by