2012-10-20 58 views
8

我在MATLAB 2010b中創建高斯金字塔。我想顯示圖像提到here相同的圖案。在MATLAB中以不同尺寸顯示圖像

我試圖使用imresize,truesize,但獲取所有圖像大小相同。有人可以幫我解決這個問題嗎?

回答

9

您可以使用FEX file「與多個圖像的真實大小imshow」來回答你的問題......

編輯:下面的代碼將在圖的右下部分產生的插曲:

clear imagesCellArray 
mand = imread('mandelbrot_set.jpg'); % read image 
dim = 3; 

[imagesCellArray{1:dim,1:dim}] = deal(mand); % create smaller images by imresize 
for iRow = 1:dim 
    for iCol = 1:dim 
     imagesCellArray{iRow,iCol} = imresize(imagesCellArray{iRow,iCol},1/(1.5*(iCol*iRow))); 
    end 
end 

% plot with imshowTruesize - true aspect ratio is preserved 
margins = [25 25]; 
Handles = imshowTruesize(imagesCellArray,margins); 
for iRow = 1:dim 
    for iCol = 1:dim 
     axis(Handles.hSubplot(iRow,iCol),'on') 
    end 
end 

enter image description here

+0

我不能給定的代碼轉換爲顯示你下imshowTruesize標題(4之一)所示的圖像。它顯示的結果與突出顯示的結果相同(第三個)。 – sattu

+0

嘗試將代碼添加到答案中,它應該生成右下圖。此外,如果這回答了您的問題,您可以選擇接受它,方法是單擊剛纔在#號下面的V標誌 – bla