when i compare a input image with a existing database image this error is shown.what should i do?

조회 수: 1 (최근 30일)
Error using rgb2gray>parse_inputs (line 72)
RGB must be a m x n x 3 array.
Error in rgb2gray (line 52)
isRGB = parse_inputs(X);
Error in main_single (line 6)
if ndims(img) == 3; img = rgb2gray(img); end % Color Images

답변 (1개)

Walter Roberson
Walter Roberson 2020년 5월 2일
You could get that if your img is something by something by 4 or higher.
something by something by 4 can happen with imread() in some cases with RGBA images (TIFF or PNG or BMP or JP2), and with CMYK images (TIFF); https://www.mathworks.com/matlabcentral/answers/457695-how-to-know-if-image-is-rgb#answer_371591

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by