efros_freeman  0.1
Macros | Functions
blending.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <float.h>
#include "blending.h"
#include "io_png.h"
Include dependency graph for blending.c:

Go to the source code of this file.

Macros

#define min(a, b)   (a<=b)?(a):(b)
#define max(a, b)   (a>b)?(a):(b)
#define abs(a)   (a<0)?-(a):(a)

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)

Macro Definition Documentation

#define abs (   a)    (a<0)?-(a):(a)

Definition at line 30 of file blending.c.

#define max (   a,
 
)    (a>b)?(a):(b)

Definition at line 29 of file blending.c.

#define min (   a,
 
)    (a<=b)?(a):(b)

Definition at line 28 of file blending.c.

Function Documentation

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.

Author
Lara Raad
Parameters
boundary_maskboundary_mask is the mask used to redefine the ragged edges of the patches
out_imThe synthesized texture
src_imThe input texture sample
patch_srcCorner position of the patch to copy from the input texture sample
tempCorner position of the location were to add the new patch in the output image
psThe size of the patches
psThe overlap size
Date
24/06/2014

Definition at line 51 of file blending.c.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Author
Lara Raad
Parameters
X12-d vector with the x-coordinates that mark out horizontally the first area
Y12-d vector with the y-coordinates that mark out horizontally the first area
X22-d vector with the x-coordinates that mark out horizontally the second area
Y22-d vector with the y-coordinates that mark out horizontally the second area
psThe patch size
boundary_maskMask to filter
kernelThe kernel used to filter the mask
centerThe kernel's center
Date
07/07/2014

Definition at line 158 of file blending.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int smooth_mask ( Image boundary_mask,
int  ps,
int  os,
Corner  temp 
)

This method smoothes the boudary mask using a Gaussian kernel. The transition between the old part and the new part is smoother.

Author
Lara Raad
Parameters
boundary_maskboundary_mask is the mask used to redefine the ragged edges of the patches
psThe patch size
osThe overlap size
tempCorner position of the location were to add the new patch in the output image
Date
07/07/2014

Definition at line 97 of file blending.c.

Here is the call graph for this function:

Here is the caller graph for this function: