I have an image in which I am trying to find the statistics of the offsets for 8 x 8 patches that are taken by sliding them pixel wise.
To be more clear, what I do is I take a patch and try finding the most similar one in the same image by taking the Euclidean distance of the pixel values and keeping the index of the minimum value. I know how to do this, but what struggles me is that, to keep reliable statistics, I must preclude nearby patches, where I intend to take the distance of preclusion as 8 pixels.
Achieving this in MATLAB with decent vectorization causes algorithmic problems. I use
im2col to vectorize all the patches with
sliding property, and then I take the first patch,
repmat it to the same size, and take the euclidean distance between them and get the
min of it. I repeat the process for all other patches in a for loop and keep the statistics.
Any suggestions on implementing the preclusion of the nearby patches are appreciated.