How to cut an image manually using pixels values with for loop without imcrop ?

2 Ansichten (letzte 30 Tage)
How can I apply Matlab code to do what the imcrop function does but manually using for loop?

Antworten (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov am 4 Sep. 2021

Image Analyst
Image Analyst am 5 Sep. 2021
Not sure what you mean. How about this
grayImage = imread('moon.tif');
figure(1)
imshow(grayImage)
for k = 1 : 3
uiwait(helpdlg('Drag out a box to crop the image.'));
croppedImage = imcrop(grayImage);
figure(2) % Switch to a figure just for the cropped images only.
subplot(2, 2, k);
imshow(croppedImage); % Display it.
figure(1); % Return to the original image.
end

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by