How to crop an image and automatically crop another image with same positioning?
Mostrar comentarios más antiguos
i have a GUI like this

how to crop an image from axes, when i click the "crop" button and automatically crop with same position in another image when i click "crop2" button, thanks before,
Respuestas (2)
Sean de Wolski
el 23 de Dic. de 2014
I = imread('cameraman.tif');
II = imread('peppers.png');
II = imresize(II,size(I)); % same size
[Icrop,rect] = imcrop(I);
IIcrop = imcrop(II,rect);
subplot(1,2,1)
imshow(Icrop)
subplot(1,2,2)
imshow(IIcrop)
Chad Greene
el 22 de Dic. de 2014
Editada: Chad Greene
el 22 de Dic. de 2014
0 votos
Those look like Landsat 8 images. With geoimread, you can specify a bounding box of lat/lons or map x/y coordinates and only load pixels corresponding to that bounding box.
Using geoimread, the user could click a "select region" button which you could program to call inputm. When the user's done entering points, she could click "crop" and coordinates from inputm could then be entered into geoimread.
4 comentarios
mike
el 23 de Dic. de 2014
Chad Greene
el 24 de Dic. de 2014
When the user clicks a bounding box in image A (calling inputm), use those coordinates to load only that region in images A and B with geoimread.
mike
el 25 de Dic. de 2014
sandra viaña borja
el 14 de Dic. de 2017
Hello Mike How did you solve this? I have the same problem, and when I get the second image cropped, there is a lillte spatial difference between both images. I will appreciate if you could help me.
Categorías
Más información sobre Image Arithmetic en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!