i've a gray scale image and i've divided it into overlapping blocks.
each block i've stored in the form of vector in a matrix B.
From the matrix B ,i've calculated the MEAN, GLCM MEAN and ENTROPY MEAN of each and every blocks.
i want to create a new matrix having MEAN, GLCM MEAN and Entropy meaqn as three columns and number of rows same as B.
the code i wrote is:
for i=1:length(B) %Reading First Vector vector1=B(i,:); match1=i; block1=index(match1); rowstart1=startRow(match1); colstart1=startCol(match1); oneBlock1=grayImage(rowstart1:rowstart1+(blockSizeR-1),colstart1:colstart1+(blockSizeC-1));
%Calculating Mean mean1=floor(mean2(oneBlock1));
%Calculating GLCM Mean glcml1=0; glcmr1=0; glcm1=0;
glcm1=graycomatrix(oneBlock1); for x=1:overlapR for y=1:overlapC glcml1=glcml1+x*glcm1(x,y); glcmr1=glcmr1+y*glcm1(x,y); glcmLR1=abs(glcml1-glcmr1); end end glcmLRD1(index1)=glcmLR1; disp(glcmLRD1);
%Calculating Entropy entropy1=entropyfilt(oneBlock1); entropyMean1(index1)=floor(mean2(entropy1));
%Creating new matrix with 3 columns corresponding to Intensity Mean, GLCM Mean and Entropy Mean newB(index,1)=mean1 newB(index1,1)=glcmLR1 newB(index1,2)=entropyMean1; index1=index1+1; New(rowstart1 : rowstart1 + (blockSizeR - 1), colstart1 : colstart1 + (blockSizeC - 1),[1 2 3])=0; %assign black color end disp(newB);
here newB is my new matrix having columns mean glcm and entropy
but it shows error that the dimension mismatch..
plz help me in solving my problem..
No products are associated with this question.
The variable entrpoyMean1 is not a scalar, as DBSTOP will show you, and therefore
does not make sense. Possibly, you meant to have
Play games and win prizes!Learn more