项目作者: ofAlpaca

项目描述 :
Texture Transfer
高级语言: C++
项目地址: git://github.com/ofAlpaca/Texture-Transfer.git
创建时间: 2017-06-08T14:31:28Z
项目社区:https://github.com/ofAlpaca/Texture-Transfer

开源协议:

下载


Texture-Transfer

How to find the similar patch?

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)|

Here is some option setting

  1. 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)

Example

Here is the input file, texture_transfer.jpg

texture_transfer

It is the texture file, texture_rice.jpg

texture_rice

And it is the output it would look like

  • Patch size : 16
  • Overlap : 4

texture_transfer_out