Texture Transfer
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