MATLAB: Cropping a face from an Image

computer visionMATLAB

Hi, so im able to create a bounding box around the faces in an image. Now I would like to crop the image so that I am just left with the images from within the bounding boxes using imcrop. I have so far been unable to do this.
Thank you

Best Answer

I = imread('cameraman.tif');
[J, rect] = imcrop(I);
Perform the crop operation by double-clicking in the crop rectangle or selecting Crop Image on the context menu.
imshow(J) ;
Related Question