Borrar filtros
Borrar filtros

I am not able to get cropped image in subplot? How can I display both original image and cropped image in

1 visualización (últimos 30 días)
I=imread('D:\canal images\df.jpg'); imtool(I);
I2=imcrop(I,[]);
subplot(1,2,1); imshow(I); title('Original Image');
subplot(1,2,2); imshow(I2); title('Cropped Image');

Respuestas (1)

Bshara Murr
Bshara Murr el 25 de Nov. de 2017
You need to specify the cropped region first try something like this:
I=imread('D:\canal images\df.jpg'); imtool(I);
I2=imcrop(I,[a b c d]);
subplot(1,2,1); imshow(I); title('Original Image');
subplot(1,2,2); imshow(I2); title('Cropped Image');
where 'a' and 'b' are the starting points 'c' and 'd' are the width and height in pixels.
  2 comentarios
Bshara Murr
Bshara Murr el 25 de Nov. de 2017
Editada: Bshara Murr el 25 de Nov. de 2017
a and b are where you want to start cropping your image, c and d are the dimensions you want you may want to try some values if you have only one image. It depends on what defines your cropped region. You can as well use the data cursor (next to the rotate tool) when you show your image it gives you the x and y coordinates of the pixels

Iniciar sesión para comentar.

Categorías

Más información sobre Image Processing Toolbox 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!

Translated by