MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   Matlab中的二进制图像 (https://www.labfans.com/bbs/showthread.php?t=23467)

poster 2019-12-10 20:41

Matlab中的二进制图像
 
我怎么知道用imread读取的图像在MATLAB中imread为二进制

我是这样做的:

Img = imread(IMGsrc); T = Img== 1 | Img == 0; If min(min(T)) == ?????? imshow(T); end ?????? = ??????



[B]回答:[/B]

您可以通过两种方法测试二进制图像。

最简单的方法是测试图像是否为逻辑数组(逻辑数组由返回二进制图像的图像处理工具箱中的函数返回)

isBinaryImage = islogical(img); 或者,检查所有像素是1还是0

isBinaryImage = all( img(:)==0 | img(:)==1);

[url=https://stackoverflow.com/questions/2886286]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 01:08

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.