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
1 次查看(过去 30 天)
显示 更早的评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!