# MATLAB: Any way to free hand crop an image

imageimage analysisimage processing

Is there any way to free hand crop on an image? I have an organic shape I want to quickly crop not using the rectangular box that matlab has for cropping. Any way to go about this?

doc imcropdoc impolydoc imfreehand
I = imread('cameraman.tif');imshow(I);h = imfreehand; %draw something M = ~h.createMask();I(M) = 0;imshow(I);