function y = isrgb(x)
%ISRGB Return true for RGB image.
% FLAG = ISRGB(A) returns 1 if A is an RGB truecolor image and
% 0 otherwise.
%
% ISRGB uses these criteria to determine if A is an RGB image:
%
% - If A is of class double, all values must be in the range
% [0,1], and A must be M-by-N-by-3.
%
% - If A is of class uint8 or uint16, A must be M-by-N-by-3.
%
% Note that a four-dimensional array that contains multiple RGB
% images returns 0, not 1.
%
% Class Support
% -------------
% A can be of class uint8, uint16, or double. If A is of
% class logical it is considered not to be RGB.
%
% See also ISBW, ISGRAY, ISIND.
% Copyright 1993-2003 The MathWorks, Inc.
% $Revision: 1.15.4.2 $ $Date: 2003/08/23 05:52:55 $
wid = sprintf('Images:%s:obsoleteFunction',mfilename);
str1= sprintf('%s is obsolete and may be removed in the future.',mfilename);
str2 = 'See product release notes for more information.';
warning(wid,'%s\n%s',str1,str2);
y = size(x,3)==3;
if y
if isa(x, 'logical')
y = false;
elseif isa(x, 'double')
% At first just test a small chunk to get a possible quick negative
m = size(x,1);
n = size(x,2);
chunk = x(1:min(m,10),1:min(n,10),:);
y = (min(chunk(:))>=0 && max(chunk(:))<=1);
% If the chunk is an RGB image, test the whole image
if y
y = (min(x(:))>=0 && max(x(:))<=1);
end
end
end
isrgb.zip_isbw_matlab isbw_matlab isbw_matlab中isrgb_site:www.pu
版权申诉
67 浏览量
2022-07-14
02:47:36
上传
评论
收藏 893B ZIP 举报
JonSco
- 粉丝: 72
- 资源: 1万+
最新资源
- Picasso_v3.1 2.ipa
- chromedriver-mac-arm64.zip
- 蓝zapro.apk
- chromedriver-linux64.zip
- UCAS研一深度学习实验-MNIST手写数字识别python源码+详细注释(高分项目)
- 基于Python和PyTorch框架完成的一个手写数字识别实验源码(带MINIST手写数字数据集)+详细注释(高分项目)
- 基于Matlab在MNIST数据集上利用CNN完成手写体数字识别任务,并实现单层CNN反向传播算法+源代码+文档说明(高分项目)
- NVIDIA驱动、CUDA和Pytorch及其依赖
- 基于SVM多特征融合的微表情识别python源码+项目说明+详细注释(高分课程设计)
- html动态爱心代码一(附源码)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈