How to use the 'solidity' property of the regionprops function of MATLAB in Octave?

杀马特。学长 韩版系。学妹 提交于 2021-01-28 21:22:29

问题


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:

  1. Get id list of the connected component pixels. Use: regioprops(I,'PixelIdxList')
  2. Calculate their convexhull. Use: H = convhull (x, y)
  3. 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

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