Hello all! I wanted to compare image al , with another image b, which is a block of image form the previous image al. I tried splitting image al block by block and storing them in 4 different matrices(and implement SSD), which I've programmed below. But when I run them, it looks like its into an infinite loop. Is there any other method to process blocks and match them? Please help.
clear all;close all;al = imread('testimage.jpg');br = uint8(zeros(125, 125, 3));br(1:126, 1:126,:) = al(80:205, 100:225 , :)imtool(al); imtool(br);al= rgb2gray(al);al = im2double(al);br= rgb2gray(br);br = im2double(br);for(i =1:1:126) for (j = 1:1:126) c(i,j) = al(i,j) endendfor(i =99:1:225) for (j = 99:1:225) d(i,j) = al(i,j) endendfor(i =99:1:225) for (j = 1:1:126) e(i,j) = al(i,j) endendfor(i =1:1:126) for (j = 99:1:225) f(i,j) = al(i,j) endend imtool(c); imtool(d); imtool(e); imtool(f)
Best Answer