how to select a particular portion in am image automatically?

2 views (last 30 days)
In a video of a man walking in a plain background... i splited that into frames.now i want in each of the frames just to select where the man is? not the other things.. i used imcrop(a) but its manual thing... is any function avail in matlab to select automatically in a rectangular fasion?
Is my question clear? Thanks in advance...!

Accepted Answer

David Legland
David Legland on 21 Sep 2012
Hi,
using imcrop you can also specify the coordinates of the box. Then you do not have to click. But you have to know the position in advance.
If you are looking for a method that detect the position of the man, this is an image segmentation problem. There are various methods in image processing toolbox. One possibility is to try to use graythresh function, together with im2bw. There are other more complicated algorithms, the most appropriate one depends on the kind of image.
You can extract the bounding box of a region with the "regionprops" function, using the 'BoundingBox' tag.
Regards, David

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!