You are viewing the course site for a past offering of this course. The current offering may be found here.
Lecture 5: Texture Mapping (18)
kmkranen

For anyone interested in how to get around artifacts, one method (that I used in a project last semester) involves overlapping tiles, and follows these steps to remove the artifacts:

  1. Take the sum of squared differences (SSD) between a chosen tile that you wish to overlap (specifically the part of the tile that will overlap), and every possible tile in the source image. Depending on your source image, the amount of possible tiles varies greatly.
  2. Once you have taken the SSD of every possible tile, select the most similar tile (the tile with the minimum SSD). This will be the tile that you will overlap with the original one.
  3. Once the new tile has been selected, take the difference between each tile's overlapping pixels, and square it (element-wise). This serves as a map of the similarity between each tile's pixels in the overlapping area.
  4. Once you have the map, apply a min-cut algorithm to find the optimal dividing line in the overlapping space. On one side of the line, you'll use the pixels of the original tile, and on the other, you'll use the pixels of the new tile! Repeat until you've generated a repeating texture as large as you'd like! This removes many visible edge artifacts that you might have gotten from very straight edges.
rishiarjun

@kmkranen hi, in the algorithm you provided here, I don't fully understand the use of min-cut algorithm. Is it to just to establish the borders within the overlapping pixel space?

kmkranen

@rishiarjun exactly! The min-cut algorithm is typically used to partition the vertices of a graph into two subsets, and is minimal following some metric. In this case, we are using it to partition the similarity map I mentioned above into two subsets (aka create a border between the two tiles) that minimize the difference between pixels on either side of the border. The algorithm will end up deciding on a border that blends the two tiles together as well as they can be.

You must be enrolled in the course to comment