what does this line means in the following code? I=I(200:400,250:450,:); and when i change the ratio there comes an error of "index exceeds matrix dimensions"
조회 수: 1(최근 30일)
Andrew Newell 2017년 4월 18일
편집: Andrew Newell 2017년 4월 19일
The function imread retrieves a 3D array consisting of 2D images in various colors or grayscale. The number of these images depends on the size of the third dimension (see Multidimensional arrays). They may, for example, be the red, green and blue components of the total color. The command I=I(200:400,250:450,:) is taking a rectangular sample out of each of these images. As for how regcovsmooth deals with it, this is software from GitHub that I'm not familiar with.
msahar 2017년 4월 18일
편집: msahar 2017년 4월 19일
I am assuming that you are particularly asking about regcovsmooth function. This function is used for preserving image smoothing via region covariances. The output S is the structure component extracted from input image I.
Please read the research paper at the link given below,
Image Analyst 2017년 4월 18일
It probably wants a gray scale image, not a color image. At least that's what I'd try to get rid of the error message.
I = rgb2gray(I);
S = regcovsmooth(I,10,4,0.2,'M1');
By the way, please pick a more descriptive variable name than I. It looks too must like 1 (one) and l (lower case L).