Henrike96
Henrike96

Reputation: 33

How to use the 'solidity' property of the regionprops function of MATLAB in 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')

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?

Upvotes: 1

Views: 1711

Answers (1)

Amitay Nachmani
Amitay Nachmani

Reputation: 3279

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)

Upvotes: 2

Related Questions