问题
I have a code in MATLAB that I have to convert into Octave. I have problems with the following command:
boxes = regionprops (L, 'Solidity')
where L
is a binary image class double.
Octave does not know the 'Solidity'
property . Is there a similar property or a function that I can use to run the code in Octave?
回答1:
According to the definition of 'Solidity' in matlab regionprops this measurement is the Area/ConvexArea.
In order to calculate the ConvexArea
do the following things:
- Get id list of the connected component pixels. Use:
regioprops(I,'PixelIdxList')
- Calculate their
convexhull
. Use:H = convhull (x, y)
- Calculate the area of the
convexhull
. Use:polyarea(convexHullX,convexHullY)
来源:https://stackoverflow.com/questions/39305344/how-to-use-the-solidity-property-of-the-regionprops-function-of-matlab-in-octa