How to shear an imagesc image
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I have an image, created using imagesc function from a data matrix, like so:
imagesc (myarray, [-50 0]);
which I am then trying to shear by an angle a using the following code:
a = tand(10);
T = maketform('affine', [1 0 0; a 1 0; 0 0 1] );
B = imtransform(A,T,'cubic','FillValues',orange);
orange = [255 127 0]';
figure
imshow(B)
But I keep on failing, as I guess I'm not defining A (my original image created using imagesc) correctly.
Could anyone please explain how to define it correctly so it works as an input for the imtransform function?
Thank you.
2 comentarios
KSSV
el 21 de Oct. de 2021
What error you are getting? You must specify you error along with full code.
Respuestas (1)
Pranjal Kaura
el 26 de Oct. de 2021
Hey Linda,
Using functions 'imtransform' and 'maketform' is not recommended because of compatibilty considerations. You can use 'imwarp' and 'affine2d' instead. Here's a code snippet addressing the changes
a = tand(10);
T = affine2d( [1 0 0; a 1 0; 0 0 1] );
B = imwarp(img,T,'cubic','FillValues',0);
Could you share more information regarding your usecase and why you need 'imagesc' function? Also the complete code, wherein you're defining 'A'.
0 comentarios
Ver también
Categorías
Más información sobre Display 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!