如何在Octave中使用MATLAB的regionprops函数的'solidity'属性? [英] How to use the 'solidity' property of the regionprops function of MATLAB in Octave?
本文介绍了如何在Octave中使用MATLAB的regionprops函数的'solidity'属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在MATLAB中有一个代码,必须将其转换为Octave.我对以下命令有疑问:
I have a code in MATLAB that I have to convert into Octave. I have problems with the following command:
boxes = regionprops (L, 'Solidity')
其中 L
是二进制图像类double.
where L
is a binary image class double.
八度不知道'Solidity'
属性.是否可以使用类似的属性或函数在Octave中运行代码?
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?
推荐答案
根据matlab regionprops
此度量是Area/ConvexArea.
According to the definition of 'Solidity' in matlab regionprops
this measurement is the Area/ConvexArea.
为了计算 ConvexArea
,请执行以下操作:
In order to calculate the ConvexArea
do the following things:
- 获取已连接组件像素的ID列表.使用:
regioprops(I,'PixelIdxList')
- 计算其
convexhull
.使用:H = convhull(x,y)
- 计算
convexhull
的面积.使用:polyarea(convexHullX,convexHullY)
- 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)
这篇关于如何在Octave中使用MATLAB的regionprops函数的'solidity'属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文