2013-11-20 49 views
0

我正在使用算法來確定MATLAB中圖像分析的閾值。該算法測量核內的所有像素強度,並計算用作截斷的值以區分背景噪聲和前景。我知道如何將這個值應用於原子核的圖像,以查看截斷的影響,但我想將閾值應用到網格圖上。一次偶然的機會,沒有人知道如何做到這一點,我不能發表圖片,但是我已經加了我的圖像分析的示例代碼MatLab中的網格圖閾值

example image of nucleus

% First I load image 
i = imread('nucleus.tif') 
% I calculate the value of the threshold using my algorithm using my function 
ci99 = getCI99('nucleus.tif') 
% say for example that the calculated value is 100. I would apply this threshold to the image of the nucleus with the following command 
imshow(picture , [ 100, inf]) % The resulting image only shows pixels at and above the calculated threshold. 

我用下面的代碼,以使核

的網格圖
% Mesh Plot 
I=imread('nucleus.tif'); 
[x,y]=size(I); 
X=1:x; 
Y=1:y; 
[xx,yy]=meshgrid(Y,X); 
i=im2double(I); 
figure;mesh(xx,yy,i); 
colorbar 
figure;imshow(i) 

我想將截斷應用於網格圖,類似於我將閾值應用於原始圖像的方式。

我真的很感激任何幫助。

感謝

回答

0

退房的Matlab clim function

,你應該能夠做到這一點:

clim([min_threshold max_threshold]); 

您也可以通過按住上軸手柄(有點像指針)訪問特定地塊

fig1 = figure; 
ax1 = mesh(xx,yy,i); 
colorbar; 

fig2 = figure; 
ax2 = imshow(i); 

set(ax1, 'clim', [100, inf]); 

握住軸手les讓你可以隨時在任何情節中設置參數,而不僅僅是處理你正在使用的最後一個。

最後注意:嘗試圖像功能,而不是imshow。它不完全相同,但是您可能會發現根本不需要使用圖像處理工具箱。

+2

我很感謝您的迴應Potter。當我嘗試使用您建議的代碼時,出現以下錯誤:使用集合錯誤 找到錯誤的屬性值。 對象名稱:surface 屬性名稱:'CLimInclude'。 – DataTx