绘图在MATLAB GUI中颠倒显示

时间:2014-05-04 04:15:05

标签: matlab image-processing video-processing

我正致力于人群密度估算的视频监控。我正在为这个项目实现角点检测方法。但是,当我的代码在GUI MATLAB中组合时,我有一个问题,绘图角的显示是颠倒的,并且它没有覆盖在原始图像上。这是我在GUI Matlab中绘制图像的代码。

问题已经解决,这里是正确的代码:

% Find row,col coords.
[r,c] = find(cim2);  

%After getting row and column coordinate, I plot them together in the original image which is
% overlay image and plotting

imshow(inFrame, 'Parent', handles.axes8);
hold on;
p1 = plot([c],[r],'r.');
set(p1, 'Parent', handles.axes8);

感谢@Lokesh的建议。

2 个答案:

答案 0 :(得分:2)

floris很好地解释了你的问题。但是由于缺乏完整的代码,我们无法在我们的系统上执行它。你可以尝试

axis ij

这是与上述答案类似的一些内容。您也可以尝试以下代码。

imshow(inFrame,'Parent',handles.axes8);
hold on;
p1 = plot([c],[r],'r.');
set(p1,'Parent',handles.axes8);

希望这对你有用..让我知道结果..

答案 1 :(得分:1)

imshow反转Y轴。传统上,在图像显示中,屏幕的左上角是(0,0)i(第一个坐标)在屏幕上向下运行,j(第二个坐标)从左到右。

如果您希望图像轴看起来像传统的绘图轴,则可以执行

axis xy

这将"反转"你的形象,将0,0放在左下方。