MATLAB Answers

Boundary of an image

Hi, How to mark boundary of an image. My given input image is collection of trees and my work is to count the no. of trees. I found the boundary line for each and every tree.. Boundary drawn looks like star shaped.. But i need it in the form of circle..
one circle per tree.
how to do this.
Regards, Siva

  1 Comment

on 27 Jul 2012
regionprops will work

Sign in to comment.

1 Answer

Answer by Ryan
on 27 Jul 2012
Edited by Ryan
on 27 Jul 2012

Utilize the matlab function regionprops(...,'MajorAxisLength'). This will return the diameter of a circle needed to enclose a region. You could also utilize regionprops(...,'BoundingBox') and use the maximum of the height/width as the diameter of the circle. You could then use the center of the 'BoundingBox' or 'centroid' to place the circles accurately for visualization puproses.


Sign in to comment.