Matches image patches between two Images.
This is a MATLAB implementation of bruteforce matching between image patches. To get similarity matrix, visit Createsimilaritymatrix(@createsimilaritymatrix)
Salient Features:
- Runs on double datatype images.
- Works between two different images.
- Works between two different sized Images.
- Works on both Grayscale and Color images.
- Works with incomplete images containing nan values, just ignoring them.
- Works with any given mask passed as an argument.
- Handles comparison of l-1, l-2 distances.
Format:
The command line format is as follows. nnf = patchmatch(img_src, img_dst, patchsize, nnk, searchradius, mask, searchstep, includeself, incomplete, threshold, disttype)img_src - input source image (RGB/Grayscale in double datatype)
img_dst - input destination image (RGB/Grayscale in double datatype) (default - img_src)
patchsize - size of search patch (default - 5)
nnk - number of nearest neighbours (default - 5)
searchradius - patch search radius (default - 10)
mask - patch distance weight mask (size - patchsize X patchsize)(default - ones)
searchstep - patch search step (default - 2)
includeself - 0/1 (default - 1)
incomplete - allow nan values in img - 0/1 (default - 0)
threshold - threshold for incomplete image input (default - 0)
disttype - distance type, 0 - LARK / 1 - l1 / 2 - l2 / 3 - poisson (default - 2) (LARK not completely implemented)
nnf - output nearest neighbour field
Examples:
img = double(imresize(imread('lena.png'),0.25));
patchsize = 5; nn = 10;
cnn = patchmatch(img, [], patchsize, nn, 20, [], 1, [], [], [], 2);
visualizer(img, cnn, patchsize);

Authors and Contributors
Sk. Mohammadul Haque (@mohammadul)
Support or Contact
Check out the files in the repository for more details.