Borrar filtros
Borrar filtros

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 visualización (últimos 30 días)
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

Respuestas (1)

Image Analyst
Image Analyst el 22 de En. de 2018
You have the block so just pass it into histogram()
h = histogram(Block(:,:,k+j));
  5 comentarios
Image Analyst
Image Analyst el 23 de En. de 2018
Please define compare mathematically. Do you mean the delta E (color difference), the MSE in RGB space, or what?
teja jayavarapu
teja jayavarapu el 23 de En. de 2018
I know how to compare , but after diving image into blocks (suppose 32 blocks) how to acces each block block of an image to compare with respective block in the database(loaded with images)

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by