what does this error mean and how to fix it the image i imported was rgb and this error popped ,when its gray it works fine

조회 수: 5 (최근 30일)
  댓글 수: 1
Jan
Jan 2023년 1월 13일
편집: Jan 2023년 1월 13일
Please do not post code as screenshots, but as text. Then it can be used to create an answer with copy&paste.
This is not twitter: No # before the tags. Thanks.

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2023년 1월 13일
imshow can handle RGB images as [M x N x 3] arrays and gray scale images as [M x N] matrices. The latter can be a logical matrix also as BW image.
In your code a < 100 creates a logical array of the size [M x N x 3], which is no valid input for imshow. Maybe you want:
double(a < 100)
% Or
any(a < 100, 3)
% or
all(a < 100, 3)

추가 답변 (0개)

카테고리

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