2014-10-07 89 views
5

我繪製功能兩個場景之間這樣的比賽:MatLab減少繪製圖像中的點深度?

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

這normaly工作正常的和Matlab繪製整個比特深度enter image description here

但隨着行數,我將開始看到在減少導致二進制圖像甚至全黑的位深: enter image description here

我知道繪製這麼多行很不理想,但我仍然想知道爲什麼會發生這種情況。是否有任何我應該理解的解釋這種行爲的matlab數字機制?

注意:這只是一個顯示圖像的問題,將它們保存爲.bmp,jpg,...會生成正常圖片。

回答

2

嘗試不同的渲染器?在你的腳本

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

而是使用「OpenGL」的開頭添加這,也嘗試「畫家」和「zbuffer」

+0

尼斯,沒有知道你可以設置渲染器。 zbuffer沒有問題,但:(從matlab docs)'注意:'zbuffer'選項已被刪除。改用'opengl'或'畫家'。':( – McMa 2014-10-07 14:00:43