MATLAB how to calculate elongation of a BW image

我怕爱的太早我们不能终老 提交于 2019-12-13 19:12:56

问题


I am trying to extract features for a leaf recognition application in MATLAB. I need to get elongation value which is described as the following:

Compute the maximum escape distance dmax = maxX ∈ I d(X,∂I). Elongation is obtained as 1 - 2dmax / D(I) and ranges from 0 to 1. The minimum is achieved for a circular region. Note that the ratio 2dmax/D(I) is the quotient between the diameter of the largest inscribed circle and the diameter of the smallest circumscribed circle.

D(I) is the diameter of the image I. ∂I is border of I.

Pretend a circular shaped image. The furthest point to the border of this shape is the center. This is called as maximum escape distance.

Elongation = 1 - (interior ellipse radius/surrounding ellipse raidus)

regionprops result for the image is below:

 Area: 352085
 Centroid: [311.2075 492.9844]
 BoundingBox: [2.5000 2.5000 586 1139]
 SubarrayIdx: {1x2 cell}
 MajorAxisLength: 869.2058
 MinorAxisLength: 535.2340
 Eccentricity: 0.7879
 Orientation: -85.2073
 ConvexHull: [99x2 double]
 ConvexImage: [1139x586 logical]
 ConvexArea: 403293
 Image: [1139x586 logical]
 FilledImage: [1139x586 logical]
 FilledArea: 352085
 EulerNumber: 1
 Extrema: [8x2 double]
 EquivDiameter: 669.5435
 Solidity: 0.8730
 Extent: 0.5275
 PixelIdxList: [352085x1 double]
 PixelList: [352085x2 double]
 Perimeter: 3.2466e+03

来源:https://stackoverflow.com/questions/30824984/matlab-how-to-calculate-elongation-of-a-bw-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!