First of all, I sum up all the pixel difference in gray scale in a particular patch rectangle between texture and image. Second, find the patch rectangle which has the smallest difference, and that's the most similar part.
difference = |image.pixel(x,y) - texture.pixel(x,y)|
main.exe –i infile –o outfile –t texture_file –p patch_size -r overlap
- -i input file name
- -o output file name
- -t texture file name
- -p patch size (ex.32)
- -r overlap (ex.4)
- Patch size : 16
- Overlap : 4