Shift the origin (0,0) of the pixels in my image
13 次查看(过去 30 天)
显示 更早的评论
Hi,
As an input of my code, I need to have some positions on my picture: the positions are in pixels and the origin (0,0) is in the CORNER top left of my picture
The problem is that when I run my code which maps the positions on my picture, the origin shifts to the bottom left :
So my question is : how could I also shift my input (positions of my picture1) so that it is relevant with the code process?
Thank you for your help, Aude
0 个评论
采纳的回答
Walter Roberson
2017-2-1
set(gca, 'ydir', 'reverse')
3 个评论
Image Analyst
2017-2-2
编辑:Image Analyst
2017-2-2
No. Just put his line of code, exactly as it is , right after you call imshow(). The badly-named "a" (y values) is not used at all in the call to set().
更多回答(2 个)
Camille Marin
2018-4-13
编辑:Camille Marin
2018-4-20
Hello all,
With the same spirit, is it possible to assign specific coordinates to the image's origin in order to use them for an imwarp function ? For instance, I would like to click on my image via the "ginput" function, and I want to assign the X,Y values to the image origin, instead of having it at the top left (1,1).
close all
clearvars
Mire_def= imread ('Couronne_cylindrique_cylindrique_reelle.tif');
%Declaration of the polynomial (4 degree) vectors A & B. Only A has values,
since no modification ocured on the Y axe
A_tot=[- 1.5828, 0.8289, 0, 0,0.0007, 0,0, 0, - 1E-06, 0,0,0,0,3E-10,0];
B=zeros(1,15);
B(3)=1;
tform = images.geotrans.PolynomialTransformation2D(A_tot,B);
xWorldLimits = [-121 647];
yWorldLimits = [-528 240];
RA = imref2d(size(Mire_def),xWorldLimits,yWorldLimits);
Mire_corr=imwarp(Mire_def,RA,tform)
0 个评论
wenjie liu
2019-12-5
will you be able to share code on this? I found usage of finding displacement between two images as well. Thank you.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!