Any way to free hand crop an image?

Technical Source
1 min readFeb 21, 2022

--

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?

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

How do you propose cropping a non-rectangular shape? Do you want to zero out parts that aren’t within in your “cropped” region. An image always has to be rectangular.

doc imcrop
doc impoly
doc imfreehand

If you want to zero out the parts not in the free hand reason. use the createMask method of the freehand region to build a mask of the free hand region. Then negate it and zero everything in it out.

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

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet