Info

This question is closed. Reopen it to edit or answer.

How to form an image from these processed block so that i can use impixel() function to find the required values on my image??

1 view (last 30 days)
clc;
clear all;
I=imread('D:\Images\Project images\test1.png');
figure,imshow(I)
a=rgb2gray(I);
Converting color to grayscale
a1=imresize(a,[256,256]);
subplot(1,2,1);
imshow(a1);
title('Sample Eye image 1')
a1=double(a1);
a3=uint8(a1);
a1norm=a1/max(max(a1));
figure,imshow(a1norm);
[r c]=size(a1);
Block Size (8x8)
bs1=4;
bs=2;
bs2=2;
nob=(r-1)*(c-1);
nob1=r/bs1*c/bs1;
nob2=r/bs2*c/bs2;
% Dividing the image into 8x8 Blocks
kk=0;
for i=1:(r-1)
for j=1:(c-1)
block4 (:,:,kk+j)= a1norm(((i-1)+1:(i-1)+bs),((j-1)+1:(j-1)+bs));
block5(:,:,kk+j) = mean2(a1norm(((i-1)+1:(i-1)+bs),((j-1)+1:(j-1)+bs)));
block6(:,:,kk+j) = entropy(a1norm(((i-1)+1:(i-1)+bs),((j-1)+1:(j-1)+bs)));
end
kk=kk+(r-1);
end
m1=max(max(block5));
block5=block5/m1;
m2=max(max(block6));
block6=block6/m2;
Here i have processed the image by creating overlapping blocks. So my requirement here is to convert block 6 and block 5 back to images .

Answers (1)

Image Analyst
Image Analyst on 21 Oct 2012
Just don't create blocks in the first place. What's the point? Just assign the single pixel value directly as you determine it.
image(j, i) = a1norm..... etc.

Community Treasure Hunt

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

Start Hunting!