efros_freeman
0.1
|
#include "common.h"
Go to the source code of this file.
Functions | |
int | blend_patch (Image boundary_mask, Image *out_im, Image src_im, Corner patch_src, Corner temp, int ps, int os) |
int | smooth_mask (Image *boundary_mask, int ps, int os, Corner temp) |
int | filter_mask (int X1[], int Y1[], int X2[], int Y2[], int ps, Image *boundary_mask, float kernel[], int center) |
int blend_patch | ( | Image | boundary_mask, |
Image * | out_im, | ||
Image | src_im, | ||
Corner | patch_src, | ||
Corner | temp, | ||
int | ps, | ||
int | os | ||
) |
This method blends new block in the output image with the corresponding "new edges" defined by the boudary mask. The new block will be composed of the synthesized part in the top and/or left part of the minimal error cut and of the new block from the source image in the rest, with a mix of both in the transition zone if the smoothed option is set to 1.
boundary_mask | boundary_mask is the mask used to redefine the ragged edges of the patches |
out_im | The synthesized texture |
src_im | The input texture sample |
patch_src | Corner position of the patch to copy from the input texture sample |
temp | Corner position of the location were to add the new patch in the output image |
ps | The size of the patches |
ps | The overlap size |
Definition at line 51 of file blending.c.
int filter_mask | ( | int | X1[], |
int | Y1[], | ||
int | X2[], | ||
int | Y2[], | ||
int | ps, | ||
Image * | boundary_mask, | ||
float | kernel[], | ||
int | center | ||
) |
This method partially filters an image. We pass X1, X2, X3 and X4 to mark out the area we wish to filter. It is done in two steps to to contemplate the L-shaped case. With X1 and Y1 we filter a first area. With X2 ans Y2 we filter a second area. X1 and X2 have the coordinates in x that mark out the first and second area vertically. And Y1 and Y2 the coordinates in y that mark out the first and second area horizontally.
X1 | 2-d vector with the x-coordinates that mark out horizontally the first area |
Y1 | 2-d vector with the y-coordinates that mark out horizontally the first area |
X2 | 2-d vector with the x-coordinates that mark out horizontally the second area |
Y2 | 2-d vector with the y-coordinates that mark out horizontally the second area |
ps | The patch size |
boundary_mask | Mask to filter |
kernel | The kernel used to filter the mask |
center | The kernel's center |
Definition at line 158 of file blending.c.
This method smoothes the boudary mask using a Gaussian kernel. The transition between the old part and the new part is smoother.
boundary_mask | boundary_mask is the mask used to redefine the ragged edges of the patches |
ps | The patch size |
os | The overlap size |
temp | Corner position of the location were to add the new patch in the output image |
Definition at line 97 of file blending.c.