2014年12月15日星期一

contour matlab

[c,h] = contour(u,[0 0],'r')
请问上面代码是什么意思?我查过了没查到。应该是初始轮廓吧!


u是z轴数据所满足的条件,即z轴的数据;[0,0]表示画一条高度为0的等高线,如果想画高度为i 的等高线,改为[i,i],‘r’表示线条用红色显示。
C是等值线矩阵

What is the meaning of this code Img=double(Img(:,:,1))
img(:,:,1) selects the first "pane" of the array "img". If the array only has one pane (e.g., a grayscale image) then that portion is redundant but correct; if the array has multiple panes (e.g., an RGB image), it selects the first of them (probably the Red pane.)

double() indicates that the number values of the input should be examined and a new array the same size be constructed which has the same numeric values but represented as double precision data types. When applied to an image, the implication is most often (but not always!) that the original image array was stored as unsigned 8 bit integers, and now the floating point equivalent is desired. For example, converting an 8 bit integer with value "3" to its floating point equivalent, "3.0". There are various good reasons to do this kind of data type conversion; one of the several common reasons is to be able to do image subtraction and have results come out negative if appropriate (unsigned 8 bit integer subtraction cannot produce negative results and uses 0 where the results would be negative.)
http://www.mathworks.com/matlabcentral/answers/44235-matlab-code-what-is-the-meaning-of-img-double-img-1

没有评论: