Dear Team ,
My work is as follows , I've to divide an RGB image (256 x 384) into 6 equal sized(each block size 128 x 128) non-overlapping blocks and apply functions like mean, median on R plane , G plane and B plane separately for each block and compare it with another similar block partitioned image.My doubts:
1. I used cell array for block partition of input image using below code.
img = imresize(I1, [256 384]);
blockSize = 128;
C = mat2cell(img,blockSize*ones(1,size(img,1)/blockSize),blockSize*ones(1,size(img,2)/blockSize),3);
Now i 've find the mean and median of R plane, G plane and B plane for each block. I used the below code
D = cell(2,3);
for i =1:2
for j = 1:3 for k = 1:3 D{i,j} = mean2(C{k}(:,:,1)); /*In this step - I've to find mean, median in one go for each cell - is it possible to call a function here ? I also tried using cellfun(@(x) mean2(x(:)),C) but i dont know how to modify this step for each plane of an RGB image */ endend
end
/* I'm not getting my output here in expected format 🙁
My expected output in cell array format
Block 1 = [Rmean Gmean Bmean Rmedian Gmedian Bmedian]
Block 2 = [Rmean Gmean Bmean Rmedian Gmedian Bmedian] … …
Block 6
2. How to compare blocks of first image against the blocks of second image (one to one comparison) Block 1 (Image 1) –> Block 1 (Image 2)
Block 2 (Image 1) –> Block 2 (Image 2) ….
Block 6 (Image 1) –> Block 6 (Image 2)
Could you suggest me an algorithm for block matching so that i could take it up as a reference for my work . My guide has asked me to go about one to one block matching but i'm bit puzzled about cell array comparison for image retrieval.How does this comparison help in retrieving relevant images?. Request your suggestion and guidance on this.
Regards, Malini
Best Answer