# Difference between two blocks of images?

1 visualización (últimos 30 días)
Emmanuel el 23 de Oct. de 2014
Editada: Emmanuel el 23 de Oct. de 2014
How can I extract a block of pixels from an image and subtract it with another block of different image to find minimum disparity? my block size is 8. How do I proceed with this?
iteration = 0;
subsub = zeros(8);
subblock = zeros(8);
J = imresize(x, 0.7);
x0 = imrotate(J,30);
r = randi(225-7);
c = randi(225-7); //random block of size 8 from original image
subblock = x(r:r+7, c:c+7);
imshow(subblock);
block = size(x0);
k =1; m= 8;
for i =1:8: (block(1)-7)
for j = k:m
submatrix = x0(i,j); // creating a block from second image
end
for w = 1 : 8
for y = 1:8
diff = (subblock(w,y) - submatrix(w,y))^2; // subtracting two blocks
end
end
k = m+1; // to move to the next block
m = m+8;
end
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Categorías

Más información sobre Computer Vision with Simulink en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by