i've 16x16 blocks of the input image and an array of mean values. i want to extract a particular block having same mean value
1 view (last 30 days)
Show older comments
how can i extract the particular blocks having same mean values from all 256 blocks...
the code i wrote is:
for row = 1 : blockSizeR : rows
for col = 1 : blockSizeC : columns
row1 = row;
row2 = row1 + blockSizeR - 1;
row2 = min(rows, row2);
col1 = col;
col2 = col1 + blockSizeC - 1;
col2 = min(columns, col2);
oneBlock = grayImage(row1:row2, col1:col2);
subplot(16,16, blockNumber);
imshow(oneBlock);
Mean(blockNumber) = mean2(oneBlock);
caption=sprintf('\n\nThe mean for block #%d = %f', blockNumber, Mean(blockNumber));
disp(caption);
blockNumber = blockNumber + 1;
end
end
disp('sorted mean values are:');
[S,blockNumber]=sort(Mean);
fprintf('\nBlock #%d = %f\n', [blockNumber(:), S(:)].' );
i want to make a condition so that only those blocks are shown whose Mean value is same.like block 3 and block 34 have mean value 34.56 then only these blocks are shown. rest other blocks are not shown...
plz modify my above code as per my requirement...
reply as soon as ....
4 Comments
Answers (1)
Walter Roberson
on 12 Mar 2013
It is not possible. There are no solutions to your requirements.
3 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!