imrotate make image blur. Any solution?
Mostrar comentarios más antiguos
I = imread('cameraman.tif');
L = imrotate(I,50);
M= imrotate(L,-50);
imshow(M)
x_corr = normxcorr2(I,M);
[max_c, imax] = max(abs(x_corr(:)))
I tested with above code to see the effect of imrotate had on image. The result if the correlation was 0.94, less than what i expected and the image M was blur.
Any way to rotate the image without effecting its pixel value?
Thanks
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 5 de Jun. de 2011
2 votos
No, the closest you can get to rotating an image without affecting its pixel value is to use a hgtransform -- which will affect the pixels of the displayed image but not the values that are stored in the CData property of the image. The observed image will have blur either way. This is inherent in the representation of data as finite sized non-circular pixels.
1 comentario
Jan
el 6 de Jun. de 2011
+1. The blur is a result of the rotation of a data, which are discretized in rectangles (pixels here). Imagine a 2x2 pixel image: a rotated image *must* be blurred, of course.
You can reduce the effects by increasing the resolution before rotating and decreasing it afterwards again - this is an anti-aliasing method and the Lanczos3 method might be "nice". But unfortunately this will produce other artifacts.
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!