MatLab 减少绘图图像中的位深度?

标签 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 绘制了整个位深度 enter image description here

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

我知道绘制这么多线条远非理想,但我仍然想知道为什么会这样。是否有任何我应该理解的 matlab 图形机制来解释这种行为?

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

最佳答案

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

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

除了'opengl',还可以尝试'painters'和'zbuffer'

关于MatLab 减少绘图图像中的位深度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26234931/

相关文章:

matlab - MATLAB lsqnonlin 中用户定义的 Jacobean 模式被忽略

matlab - 在matlab中比较两个不同长度的向量

linux - 为 MATLAB 故障转储文件指定输出目录

r - 在R中绘制每月天气数据

matlab - MATLAB 和矢量化循环中的双重求和

matlab - 如何在 Matlab 中将原点设置为轴的中心

r - 使用 R 绘图在 R 中绘制点图

r - 如何在 R 中使用 layout() 函数?

python - 在 basemap 中绘制包裹路径

r - 如何在R中获得abline的梯度