??? Index exceeds matrix dimensions.

1 回表示 (過去 30 日間)
Tahir
Tahir 2014 年 3 月 28 日
回答済み: Image Analyst 2014 年 3 月 28 日
Hello I am working on a project in which i use deconvolution operation on a image of dataset..I taken code from the website...but when i apply it on my image it give the error "??? Index exceeds matrix dimensions" The code is....
H2 = ones(10,10) ./ 100;
sampleRGB_OD_Blur = zeros(height,width,channel);
for k=1:channel
sampleRGB_OD_Blur(:,:,k) = filter2(H2,sampleRGB_OD(:,:,k),'same');
end
% Manual sampling of three regions of interest from the micrograph to calculate
% relative optical intensity of each stains in three color channels
He = reshape(sampleRGB_OD_Blur(44,348,:),3,1); % ERROR
Eo = reshape(sampleRGB_OD_Blur(361,290,:),3,1);
Bg = reshape(sampleRGB_OD_Blur(425,77,:),3,1);
Please help The complete code is here... http://web.hku.hk/~ccsigma/color-deconv/color-deconv.html

回答 (1 件)

Image Analyst
Image Analyst 2014 年 3 月 28 日
Before the error line, put this line:
whos sampleRGB_OD_Blur
[rows, columns, numberOfColorChannels] = size(sampleRGB_OD_Blur)
Don't use semicolons and look in the command window. What does it say? I bet it will say the size is not as big as 425 rows by 348 columns. After that, check out this link.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by