我正在绘制两个场景之间的特征匹配,如下所示:
%...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 绘制了整个位深度
但是随着行数的增加,我将开始看到位深度的减少导致二进制图像甚至全黑:
我知道绘制这么多线条远非理想,但我仍然想知道为什么会这样。是否有任何我应该理解的 matlab 图形机制来解释这种行为?
注意:这只是显示图像的问题,将它们保存为 .bmp、jpg... 将生成正常的图片。
最佳答案
尝试不同的渲染器?在脚本的开头添加它
h=figure;
set(h,'renderer','opengl');
除了'opengl',还可以尝试'painters'和'zbuffer'
关于MatLab 减少绘图图像中的位深度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26234931/