i have divided the image into blocks now, i want to access each block individually and i compute histogram how do i access each block
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
a=imread(img);
subplot(4,3,2)
imshow(img)
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0.05 1 0.95]);
[r, c, numOfBands] = size(a);
%dividing image into 8x8 subblocks
bs=8;%block size
nob=(r/bs)*(c/bs);%Total no of blocks
k=0;
for i=1:(r/bs)
for j=1:(c/bs)
Block(:,:,k+j)=a((bs*(i-1)+1:bs*(i-1)+bs),(bs*(j-1)+1:bs*(j-1)+bs));
end
k=k+(r/bs);
end
Antworten (1)
Image Analyst
am 22 Jan. 2018
You have the block so just pass it into histogram()
h = histogram(Block(:,:,k+j));
5 Kommentare
Image Analyst
am 23 Jan. 2018
Please define compare mathematically. Do you mean the delta E (color difference), the MSE in RGB space, or what?
Siehe auch
Kategorien
Mehr zu Get Started with Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!