How to cut an image manually using pixels values with for loop without imcrop ?
3 次查看(过去 30 天)
显示 更早的评论
How can I apply Matlab code to do what the imcrop function does but manually using for loop?
0 个评论
回答(2 个)
Sulaymon Eshkabilov
2021-9-4
Here is a discussion thread that already addressed your question very well: https://www.mathworks.com/matlabcentral/answers/344816-how-to-cut-an-image-by-pixels-without-imcrop?s_tid=answers_rc1-1_p1_MLT
Image Analyst
2021-9-5
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!