while processing a code for Image enhnacement..i am getting the following error could you please explain..?
古いコメントを表示
*Error using rgb2gray>parse_inputs (line 88) RGB must be a m x n x 3 array.
Error in rgb2gray (line 35) X = parse_inputs(varargin{:});*
回答 (2 件)
Iman Ansari
2013 年 4 月 10 日
編集済み: Iman Ansari
2013 年 4 月 10 日
0 投票
The error says why. Your input is not RGB. Try:
size('your input')
Image Analyst
2013 年 4 月 10 日
After you call this line
im1 = imread('D:\12.jp2');
put these lines
[rows, columns, numberOfColorChannels] = size(im1) % No semicolon
if numberOfColorChannels > 1
% Do this only if you want to convert to gray level.
im1 = rgb2gray(im1);
% Optionally, can take the green channel instead of the above line
% im1 = im1(:, :, 2);
end
What does this print out in the command window?
6 件のコメント
Rajat
2013 年 4 月 10 日
Image Analyst
2013 年 4 月 10 日
I'm not Imran, but I looked at it too. It ran (with the peppers.png demo image). Does it do what you told it to? Does it do what you expected it to?
Rajat
2013 年 4 月 10 日
Image Analyst
2013 年 4 月 10 日
But your code does not (yet) take into account the suggestions that I've already given you. Why not? Why do you want other methods when you aren't even trying the one I already gave?
Joe Torr
2015 年 2 月 8 日
I tried your step and it gave me the same error. I wonder if it's the fact that my image is .tiff have something to do with it. I'm just trying a basic step of getting only black and white colors. I started to try gray but that did'nt work as well.
Image Analyst
2015 年 2 月 8 日
Joe, I don't know what you did. Post your own question separately, and attach your code and image and we'll answer it there.
カテゴリ
ヘルプ センター および File Exchange で Color Segmentation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!