This is the repository for the assignment "発展課題I3: Texture Synthesis".
This is an implementation of texture synthesis with local region extension, based on the lecture slides pages 14 - 19 ("局所的な領域拡張による合成").
I have run the code with imgs/161.jpg, which was taken from https://github.com/1iyiwei/texture/blob/master/data/161.jpg. (To avoid copyright issues, I have not included the image in this repository.) (This is a 64x64 image.)
You can try the same by:
-
Downloading the image from the link above and saving it as
imgs/161.jpg. -
Running the code with:
python v1.py
-
The result will be saved as
imgs/161_128_reconstructed.jpg.- There might be some other images of the intermediate results also saved in the
imgs/directory.
- There might be some other images of the intermediate results also saved in the
NOTE: To search for the best-matched neighborhood in the source image for each pixel in the generated (target) image, I have used a brute-force search. Therefore, it takes a very long time to generate the image.
Here are the results of the texture synthesis using local region extension:
During the texture synthesis process, several observations and potential issues were identified:
-
Random Initialization Artifacts:
- The randomly initialized sections of the target image, i.e., the rightmost 2 columns and the bottommost 2 rows, are noticeably different from the source image. This discrepancy creates visually artifacts that are immediately detectable.
-
Absence of Original Patterns:
- The synthesized image does not adequately reproduce the similar patterns present in the original image. This might be due to an incorrect implementation.
- Related to this, one possible drawback of the algorithm is that an error in generating one pixel can propagate to subsequent pixels, as each pixel is generated based on its predecessors.
-
Long Execution Time:
- The brute-force search for the best-matched neighborhood in the source image for each pixel in the target image takes a long time to execute. For example, the generation of a 64x64 image took 6:21 minutes, and the generation of a 128x128 image took 21:31 minutes.

