i've a grayscale image and i've divided into non-overlapping blocks.
i want to color/mark the blocks having same mean value.
can anyone tell me how to do so.. as i m novice to matlab...
if required tell me as soon as possible i can provide you my code.

 채택된 답변

Walter Roberson
Walter Roberson 2013년 3월 8일

0 개 추천

Take the matrix of mean values, and imagesc() it.

댓글 수: 6

sir i've sorted the mean values in the array and when m applying the imagesc() it shows the same image as x n y axis...
like i've an image having block size 8x8...all the blocks have different or same mean value right. now i want to color/mark only those blocks which have same mean values in order to recognize it..
can u help me sir..
i have used the subplot function
subplot(8,8,oneBlock);
where oneBlock is an 8x8 block...
also oneblock=(row1:row2,col1:col2);
subplot() is to create axes, not to plot anything.
If your unsorted array of mean values is (say) "meanvalues" then
imagesc(meanvalues)
angel
angel 2013년 3월 9일
편집: Walter Roberson 2013년 3월 9일
imagesc(meanValues) shows blocks in bar form..i do not want this..
i want those block having same mean values to color the pixel some color for example block 2 and block 5 have mean value 50.6 i want color the pixel of both the block with RED
also if block 5 and block 16 have mean value 34.5 then color the pixel of these block with let say GREEN
can u tell me how to do?
imagesc(meanValues) does not show the blocks in bar form -- not unless you have meanValues as a vector instead of an array.
Follow this example:
fun = @(block_struct) ...
std2(block_struct.data) * ones(size(block_struct.data));
I2 = blockproc('moon.tif',[32 32],fun);
imagesc(I2);
colormap(flag);
angel
angel 2013년 3월 9일
meanValue is array in my code...
u mean i've to convert it into vector form first right?
then apply imagesc(meanValue);
is it this u r saying??
Walter Roberson
Walter Roberson 2013년 3월 9일
No, it needs to be an array.
I suggest you upload an image of the result of imagesc(meanValues)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by