将图像坐标转换为笛卡尔坐标

时间:2019-06-26 22:30:17

标签: image matlab coordinates

给出一个具有2个点(a_x,a_y)和(b_x,b_y)的图像画布I。图像上的标绘线方向正确。 但是,当我在笛卡尔坐标系中绘制相同的坐标(a和b)时,会得到一条方向错误的线。 我想转换它们与笛卡尔系统匹配的图像坐标。谢谢。

"4{"type":"someType","data":{"subJson":123}}9406"
"22{"type":"SomeOtherType","data":{"subJson":648,"data":{"subSubJson":25}}}125"
"10{"last":79}"

1 个答案:

答案 0 :(得分:0)

imshow生成的图像在左上角具有(0,0)坐标。左下角的法线图。

您可以通过打开图像的轴来查看:

% Create image canvas
canvas = zeros(320, 320);
I = uint8(canvas);
imshow(I)
a_x = 122.6544;
a_y = 234.9782;
b_x = 165.9290;
b_y = 126.9200;
hold on 
plot([a_x, b_x], [a_y, b_y] );

ax = gca;
ax.Visible = 'on';

要更改绘图轴的方向,请使用YDir的{​​{1}}属性:

axes
相关问题