gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 19:46:52 24 4
gpt4 key购买 nike

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

%...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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com