Skip to content

Instantly share code, notes, and snippets.

@40thieves
Created March 21, 2014 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 40thieves/9686823 to your computer and use it in GitHub Desktop.
Save 40thieves/9686823 to your computer and use it in GitHub Desktop.
start_stats = regionprops(im_start_label, 'Centroid', 'ConvexArea', 'BoundingBox'); % Returns a set of properties (defined by the arguments passed in)
end_stats = regionprops(im_end_label, 'Centroid', 'ConvexArea', 'BoundingBox');
[start_max_area, start_max_index] = max([start_stats.ConvexArea]);
[end_max_area, end_max_index] = max([end_stats.ConvexArea]);
start_bound_box = start_stats(start_max_index).BoundingBox;
end_bound_box = end_stats(end_max_index).BoundingBox;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment