View on GitHub

Patchmatch

BruteForce Image Patchmatch

Download this project as a .zip file Download this project as a tar.gz file

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:

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);
Patchmatch on image lena.png'

Authors and Contributors

Sk. Mohammadul Haque (@mohammadul)

Support or Contact

Check out the files in the repository for more details.