Shift the origin (0,0) of the pixels in my image
12 ビュー (過去 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!