MatLab减少绘制图像中的bitdepth?

时间:2014-10-07 11:27:08

标签: matlab plot

我正在绘制两个场景之间的功能匹配,如下所示:

%...import, preprocessing, and stuff

%"Sandwich" Image1 and Image2 in a new image Image
ImSize=[size(Image1,1)+size(Image2,1),max(size(Image2,2),size(Image2,2))];

Image=zeros(ImSize);
Image(1:size(Image1,1),1:size(Image1,2))=Image1;
Image(size(Image1,1)+1:end,1:size(Image2,2))=Image2;

%show Image
imshow(Image,[]);
hold on

%plot keypoints and matching lines in all colors
cc=hsv(size(Keypoints1,1));

for ii=1:size(Keypoints1,1)

    plot(Keypoints1(ii,1),Keypoints1(ii,2),'o','color',cc(ii,:))
    plot(Keypoints2(ii,1),Keypoints2(ii,2)+size(Image1,1),'o','color',cc(ii,:))

    line([Keypoints1(ii,1),Keypoints2(ii,1)],[Keypoints1(ii,2),Keypoints2(ii,2)+size(Image1,1)],'color',cc(ii,:),'LineWidth',0.5)
end

这个规范工作正常,Matlab绘制了整个bit深度enter image description here

但随着行数的增加,我将开始看到导致二进制图像甚至全黑的bitdepth减少: enter image description here

我知道绘制这么多行并不理想,但我仍然想知道为什么会发生这种情况。是否有任何matlab数据机制我应该理解解释这种行为?

注意:这只是显示图像的问题,将它们保存为.bmp,jpg,...会产生正常的图片。

1 个答案:

答案 0 :(得分:2)

尝试不同的渲染器?在脚本的开头添加它

h=figure;
set(h,'renderer','opengl');

而不是'opengl',也可以试试'painters'和'zbuffer'