creating new images using new x,y coordinates from a subplot
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi all,
I have created 4 subplots. I am able to manually zoom into each image and find the x,y coordinates using the pop up bar at the top of the image
My issue is this, I want to zoom in to a particular point, and then re-create the 4 subplots at that zoomed in position.
My code so far is-
figure;
subplot(2,2,1); imshow(EdgeS),title('Sobel');
subplot(2,2,2); imshow(EdgeP),title('Prewitt');
subplot(2,2,3); imshow(EdgeR),title('Roberts');
subplot(2,2,4); imshow(EdgeC),title('Canny');
When I click on the image, it gives me [X,Y] [123 456] (obviously not the real coordinates).
Do i need to click in all four courners, or just in one place?
so where would i add my coordinates in my code?
I hope that makes sense!!
cheers
mike
2 comentarios
Holmbrero
el 8 de Dic. de 2020
I think what you are looking for is imcrop:
Icropped = imcrop(I,rect) crops the image I according to the position and dimensions specified in the crop rectangle rect. The cropped image includes all pixels in the input image that are completely or partially enclosed by the rectangle.
The actual size of the output image does not always correspond exactly with the width and height specified by rect. For example, suppose rect is [20 20 40 30], using the default spatial coordinate system. The upper left corner of the specified rectangle is the center of the pixel with spatial (x,y) coordinates (20,20). The lower right corner of the rectangle is the center of the pixel with spatial (x,y) coordinates (60,50). The resulting output image has size 31-by-41 pixels, not 30-by-40 pixels.
Ver también
Categorías
Más información sobre Read, Write, and Modify Image en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!