Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

How can i measure shape elongation faeture in matlab or python opencv? There is a function library or i have to implement to my own? In case there is no function, i found this definition:

"The less-common elongation shape factor is defined as the square root of the ratio of the two second moments in of the particle around its principal axes"

f_elong = sqrt (i2/i1)

Where i found these first and second moments?

share|improve this question
    
What kind of input do you have? I believe you will need the mass to determine these moments so it will be hard to work with just an image. –  Dennis Jaheruddin Feb 13 '13 at 13:41
    
I work with a binary image set, from that i extract contours (1 contour per image) and retrieve feature like Humoments and solidity, now i need also elongation –  postgres Feb 13 '13 at 13:57
add comment

1 Answer 1

In the Image Processing Toolbox for MATLAB there is a function called regionprops, which may be what you need. It takes a binary image, finds connected components in it, and returns various measurements of each connected component. Here's a list of things it can compute:

Shape Measurements

  'Area'              'EulerNumber'       'Orientation'               
  'BoundingBox'       'Extent'            'Perimeter'          
  'Centroid'          'Extrema'           'PixelIdxList' 
  'ConvexArea'        'FilledArea'        'PixelList'
  'ConvexHull'        'FilledImage'       'Solidity' 
  'ConvexImage'       'Image'             'SubarrayIdx'            
  'Eccentricity'      'MajorAxisLength' 
  'EquivDiameter'     'MinorAxisLength'                   

Pixel Value Measurements (requires grayscale image as an input)

  'MaxIntensity'
  'MeanIntensity'
  'MinIntensity'
  'PixelValues'
  'WeightedCentroid'
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.