论坛有朋友收藏isrgb,isind,isbw函数源码收藏网的吗

查看: 13296|回复: 5|关注: 0
关于isrgb 函数
<h1 style="color:# 麦片财富积分
新手, 积分 5, 距离下一级还需 45 积分
本帖最后由 qqggl 于
10:18 编辑
isrgb函数不能用了,是怎么回事啊,在线等。。。。。
Error using isrgb (line 8)
Function ISRGB has been removed.
&&2012a 版本的真的已经不能用了&&那是说可以不用判断了吗,那我的函数改怎样做修改,惆怅中。。。。。。
<h1 style="color:# 麦片财富积分
关注者: 1
下面是isrgb的源码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
The MathWorks, Inc.&&
%& &$Revision: 1.15.4.2 $&&$Date:
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 =
& &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复制代码
<h1 style="color:# 麦片财富积分
while (((X1(1,Px1-1)&=3)&&(Px1&x1))||((Px1-Px0)&10))%Attempted to access X1(1,641); index out of bounds
&&because size(X1)=[1,640]
<h1 style="color:# 麦片财富积分
标记,:lol:victory:
<h1 style="color:# 麦片财富积分
libralibra 发表于
Function ISRGB has been removed.
这个函数2009的时候已经说要删除了
isrgb无非是为了判断彩色图,用
Thx,我去试试
<h1 style="color:#0 麦片财富积分
关注者: 4
Function ISRGB has been removed.
这个函数2009的时候已经说要删除了
isrgb无非是为了判断彩色图,用
ndims(a)==3可以判断是否是是彩图,但是你的a最好是imread读进来的
因为这是判断矩阵维数,你完全可以自己构造一个3维矩阵
您需要登录后才可以回帖
站长推荐 /3
利用MATLAB进行机器学习
Powered by随时随地,快速访问
只要手机在手,您都可以快速、方便地看贴发帖,与论坛好友收发短消息。
极致优化,畅快"悦"读
独有的论坛界面和触屏设计,手机论坛也变得赏心悦目,操作自如。
即拍即发,分享生活
不管是风景图画,还是新闻现场,拍照发帖一气呵成,让您在论坛出尽风头。
下载客户端后,拍摄二维码快速访问本站:
或者通过以下地址访问:
Powered by您所在位置: &
&nbsp&&nbsp&nbsp&&nbsp
MATLAB函数收藏.doc32页
本文档一共被下载:
次 ,本文档已强制全文免费阅读,若需下载请自行甄别文档质量。
文档加载中...广告还剩秒
需要金币:500 &&
你可能关注的文档:
··········
··········
Matlab函数大全 matlab常用命令参考
1、学会用help和doc函数。
2、输入输出文件:save/load 在屏幕上显示文件:type
3、解线性方程组AX B:X A\B
4、作图时两张曲线合并:hold on或者subplot作子图
5、程序计算时间:tic,toc或者clock
6、变量显示方式更改:format long/short/bank...
7、数组元素求和:sum
8、求数组长度:length 求矩阵维数:size或者ndims
矩阵元素个数:numel
9、函数作图: 饼图:pie/pie3
误差图:errorbar 散点图:scatter/scatter3 直方图:hist 函数图:fplot 动画:movie
10、矩阵分析: 左右翻转:fliplr
上下翻转:flipud
转置:transpose 矩阵求逆:inv 矩阵范数:norm 条件数:cond 初等变换:rref 特征值:eig/eigs
11、特殊矩阵: 元素全为1的矩阵:ones 元素全为0的矩阵:zeros 单位阵:eye 魔方阵:magic 线性变化数组:linspace 聚合矩阵:cat/horzcat/vertcat
12、随机数: 创建一个元素服从均匀分布的随机数数组:rand 创建一个元素服从正态分布的随机数数组:randn 二项分布:binornd
指数分布:exprnd F分布:frnd 几何分布:geornd
超几何分布:hygernd
泊松分布:poissrnd 正态分布:normrnd
离散均匀分布:unidrnd
连续均匀分布:unifrnd
13、清屏:clc
清理内存:clear
14、字体显示变更等:preferences
15、得到一个文件夹的所有文件名:ls
randerr 产生比特误差样本
randint 产生均匀分布的随机整数矩阵
randsrc 根据给定的数字表产生随机矩阵
wgn 产生高斯白噪声
信号分析函数
biterr 计算比特误差数和比特误差率
eyediagram
scatterplot 绘制分布图
symerr 计算符号误差数和符号误差率
compand mu律/A律 压缩/扩张
dpcmdeco DPCM(差分脉冲编码调制)解码
dpcmenco DPCM编码
dpcmopt 优化DPCM参数
lloyds Lloyd法则优化
正在加载中,请稍后...Steve Eddins has developed MATLAB and image processing capabilities for MathWorks since 1993. He also coaches development teams on designing programming interfaces for engineers and scientists. Steve coauthored .
Posted by Steve Eddins,
In a blog comment recently,
about what happened to isrgb.
When you run this function, it issues a warning about being obsolete. Rob asked "What were the toolbox developers thinking?"
The function isrgb is closely related to isgray, isind, and isbw, which are also obsolete. I thought I'd try to explain the original purpose of these functions, as well as why they are now obsolete.
When the Image Processing Toolbox was first being created, in 1992-93, the only MATLAB data type was a two-dimensional, double-precision matrix.
There were no integer arrays, no logical arrays, etc.
Many toolbox functions were intended to operate on more than one type of image: grayscale, indexed, binary, RGB.
Some functions used different algorithms or different defaults, depending upon the input image type.
Such a function might have used isgray, etc., like this:
function B = imfoobar(A)
if isbw(A)
B = do_the_binary_thing(A);
elseif isind(A)
B = do_the_indexed_thing(A);
elseif isgray(A)
B = do_the_grayscale_thing(A);
error('Try, try again');
There were three problems with this coding pattern:
Performance
Undesirable limits on input data
The performance problem was that the is* functions read and performed tests on every matrix value. isbw(A) tested to see if every element of A was either 0 or 1.
isind(A) tested to see if every value was an integer no smaller than 1.
(There were no 0-based uint8 indexed images back then.)
isgray(A) tested to see if every value was in the range [0.0, 1.0].
As we worked to speed up toolbox functions in the mid-90s, it became apparent that these function calls limited how fast we could get.
The ambiguity problem was simply this:
All of these functions would return true for an all-ones matrix.
Also, isgray(A) and isbw(A) would both return true for a matrix containing only zeros and ones.
There was simply no way to reliably distinguish the image types from one another based only on the matrix values.
By this time in the history of MATLAB development, we were beginning to learn hard lessons about ambiguous syntax designs.
Even seemingly benign ambiguities, such as logical indexing, or all those functions that worked down the columns (except when they didn't), were coming back to haunt us.
There's another type of ambiguity associated with these functions.
Consider a 100-by-200-by-3 array, for instance.
Is it an RGB image?
Or a YCbCr image? Maybe it's 3 slices of an MRI, or three frames from a video sequence. The function isrgb can't really tell.
Finally, there was this important principle of Image Processing Toolbox function design:
Except for functions that MUST associate a value with a particular color, toolbox functions should make no particular assumptions about the valid range of input values.
Display functions and colorspace conversions obviously have to assign colors to matrix values.
But most toolbox functions are purely mathematical operations that don't necessarily have anything to do with color, and which can operate on any values.
Convolution (imfilter) is an example.
Our engineering and scientific customers aren't typically doin they are looking at and operating on data using image processing operators.
And their data could be in any range, and often had meaningful physical units.
Because of this principle, most toolbox functions should not impose any kind of data range restriction, and therefore it generally isn't that useful to be calling isgray(A) to see if the input was in the range [0.0, 1.0].
So eventually we deprecated these functions, stopped using them within the toolbox, and modified toolbox syntaxes to remove ambiguities associated with testing for image type.
In most cases, the person writing the code knows the context of how the matrix or multidimensional array was created or obtained, and so knows whether the code should treat the input as RGB or YCbCr or whatever. The most common case where it makes sense to detect the image type is when you are processing image files. For example, you have a directory full of TIFF files, and some are indexed, some are RGB, etc.
In this case, I recommend that you determine the image type directly from the output of imfinfo.
The bottom line is that these functions promise something they can't really deliver.
If the functions weren't deprecated, people would be forever confused about how exactly they are supposed to behave, as well as when they should be used.
You can follow any comments to this entry through the
You can skip to the end and leave a comment. Pinging is currently not allowed.
Thanks for the explanation of how the is* functions evolved, and the lessons you learned from them.
That is exactly what I had in mind when requesting to know &#8220;what they were thinking&#8221; when decisions like these are often made.
Makes sense, and I&#8217;ll be using imfinfo now instead of testing whole matrices.
I was aware of the false positives you could get from them, but honestly had not considered the speed impact.
Dear Mr.Eddins
I am a self_learning about matlab (image toolbox),
i am working on roots of the olive to constract the sub_branchs and main_branchs (length_width)after doing a perfect thresholding to work on binary images
i will really aprciate if you let me in contact while i&#8217;m preparing my algorithms for the roots
Best Regards
Hi steve I have a request
when I have
several 3D cordinate
How I can recive equation of that coordinate
James &#8211; I&#8217;m sorry, but I don&#8217;t understand your question.
It it about image processing, and can you be much more specific?
i mant to perform the ambiguity function on thr evoked potential of EEG signals and use fisher contrast for classification how i find ambiguity function and fisher contrast and perform them on matlab
Hanaa &#8211; I don&#8217;t have information on those terms and operations.
May I suggest that you use libraries, journals, books, and Internet searches?
Since isrgb isnt working anymore, how do we convert an RGB image into Intensity or gray scale image now?
It is not given in the HELP of Matlab 7.1 that I&#8217;m using.
Could you please help me with that?
Pratyusha&Use rgb2gray.
That hasn&#8217;t changed.
Thank you..!
So, I understand that henceforth we need to use &#8216;imfinfo&#8217; ti determine the image type. How do I retrieve any field in the structure returned by &#8216;imfinfo&#8217;. Say I want to know if the image is color or grayscale which is contained in the &#8216;ColorType&#8217; field, how do I retrieve its contents ?
Ram&I suggest that you review the .
Steve, thanks for waking me up. That was so trivial and I ignored to look into doc. It took me 10 secs to get what I wanted :)
Ram&Happy to help.查看: 3239|回复: 4|关注: 0
还有其他函数可以类似isrgb,对一幅图像是否为rgb图像做判...
<h1 style="color:# 麦片财富积分
新手, 积分 5, 距离下一级还需 45 积分
Error using isrgb (line 8)
Function ISRGB has been removed.
%灰度处理axes(handles.axes2);if isrgb(handles.img) & && && &&&y=rgb2gray(handles.img);%RGB
imshow(y);else& & msgbox('这已经是灰度图像','转换失败');end&&
论坛优秀回答者
<h1 style="color:#02 麦片财富积分
关注者: 282
if length(size(ima))==3
disp('RGB format picture')
<h1 style="color:# 麦片财富积分
nice,非常感谢!
MATLAB 图像处理与计算机视觉板块优秀回答者
<h1 style="color:# 麦片财富积分
关注者: 17
if size(img, 3) == 3
<h1 style="color:# 麦片财富积分
if size(img, 3) == 3
thanks:handshake
站长推荐 /3
利用MATLAB进行机器学习
Powered by

我要回帖

更多关于 matlab isind 源码 的文章

 

随机推荐