Error while using rgb2gray
古いコメントを表示
I m trying to accept series of color images and apply edge function on them. this is my code....
if true
for k = 1:10
tifFilename = strcat( num2str(k), '.tif');
[X,map] = imread(tifFilename);
gmap = rgb2gray(map);
BW = edge(gmap,'sobel');
figure, imshow(BW);
end
end
it shows the following error
??? Error using ==> rgb2gray>parse_inputs at 82 MAP must be a m x 3 array.
Error in ==> rgb2gray at 35 X = parse_inputs(varargin{:});
Error in ==> sequenceimageprocessing at 6 gmap = rgb2gray(map);
採用された回答
その他の回答 (1 件)
Azzi Abdelmalek
2013 年 7 月 14 日
Maybe your image is not RGB, check
size(X)
7 件のコメント
Febin Benjamin
2013 年 7 月 14 日
編集済み: Febin Benjamin
2013 年 7 月 14 日
Azzi Abdelmalek
2013 年 7 月 14 日
In windows Matlab command, just to check if your image is nxmx3
Febin Benjamin
2013 年 7 月 14 日
Azzi Abdelmalek
2013 年 7 月 14 日
編集済み: Azzi Abdelmalek
2013 年 7 月 14 日
Nothing, your image is already grayscale
Febin Benjamin
2013 年 7 月 14 日
編集済み: Febin Benjamin
2013 年 7 月 14 日
Azzi Abdelmalek
2013 年 7 月 14 日
Have you the same error message with this case?
Azzi Abdelmalek
2013 年 7 月 14 日
編集済み: Azzi Abdelmalek
2013 年 7 月 14 日
[X,map] = imread(tifFilename)
Check if map is nx3 array
then write
gmap = rgb2gray(map);
カテゴリ
ヘルプ センター および File Exchange で Blue についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!