efros_freeman
0.1
|
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <float.h>
#include "boundary_cut.h"
#include "random_number.h"
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) |
#define | true 1 |
#define | false 0 |
Functions | |
int | cumulative_vertical_error (Image *out_im, Image src_im, Image *E, Image *paths, int ps, int os, int x, int y, Corner patch_src) |
int | cumulative_horizontal_error (Image *out_im, Image src_im, Image *E, Image *paths, int ps, int os, int x, int y, Corner patch_src) |
int | create_vertical_mask (Image *E_V, int ps, int os, Image *boundary_mask, Image paths_V) |
int | create_horizontal_mask (Image *E_H, int ps, int os, Image *boundary_mask, Image paths_H) |
int | create_Lshape_mask (Image *E_V, Image *E_H, int ps, int os, Image *boundary_mask, Image paths_V, Image paths_H) |
int | compute_boundary_mask (Image src_im, Image out_im, Image *boundary_mask, int os, int ps, Corner *temp, Corner patch_src) |
#define abs | ( | a | ) | (a<0)?-(a):(a) |
Definition at line 30 of file boundary_cut.c.
#define false 0 |
Definition at line 32 of file boundary_cut.c.
#define max | ( | a, | |
b | |||
) | (a>b)?(a):(b) |
Definition at line 29 of file boundary_cut.c.
#define min | ( | a, | |
b | |||
) | (a<=b)?(a):(b) |
Definition at line 28 of file boundary_cut.c.
#define true 1 |
Definition at line 31 of file boundary_cut.c.
int compute_boundary_mask | ( | Image | src_im, |
Image | out_im, | ||
Image * | boundary_mask, | ||
int | os, | ||
int | ps, | ||
Corner * | temp, | ||
Corner | patch_src | ||
) |
This method computes the boundary mask needed to then blend correctly the patch in the output texture.
src_im | The input texture sample |
out_im | The synthesized texture |
os | The size of the overlap area betwenn patches |
ps | The size of the patches |
temp | Left top corner position of the patch under construction in the output image |
patch_src | Corner position of the patch to copy from the input texture sample |
Definition at line 519 of file boundary_cut.c.
This method creates the boundary mask for the horizontal overlap.
E_H | The cumulative error across the horizontal overlap arear |
paths_H | The optimal paths to reach the positions of the last column |
ps | Patch size |
os | Overlap size |
boundary_mask | Mask used to redefine the ragged edges of the patches in the blending step |
Definition at line 365 of file boundary_cut.c.
int create_Lshape_mask | ( | Image * | E_V, |
Image * | E_H, | ||
int | ps, | ||
int | os, | ||
Image * | boundary_mask, | ||
Image | paths_V, | ||
Image | paths_H | ||
) |
This method creates the boundary mask for the L-shape overlap.
E_V | Cumulative error across the vertical overlap area |
paths_V | Optimal paths to reach the positions of the first row |
E_H | Cumulative error across the horizontal overlap area |
paths_H | Optimal paths to reach the positions of the first column |
ps | Patch size |
os | Overlap size |
boundary_mask | Mask used to redefine the ragged edges of the patches in the blending step |
Definition at line 437 of file boundary_cut.c.
This method creates the boundary mask for the vertical overlap.
E_V | Cumulative error across the vertical overlap area |
paths_V | Optimal paths to reach the positions of the last row |
ps | Patch size |
os | Overlap size |
boundary_mask | Mask used to redefine the ragged edges of the patches in the blending step |
Definition at line 294 of file boundary_cut.c.
int cumulative_horizontal_error | ( | Image * | out_im, |
Image | src_im, | ||
Image * | E, | ||
Image * | paths, | ||
int | ps, | ||
int | os, | ||
int | x, | ||
int | y, | ||
Corner | patch_src | ||
) |
This method computes the cumulative horizontal error in the overlap region and the corresponding patches to these errors.
src_im | The input texture sample |
out_im | The synthesized texture |
E | E is the cumulative error in the overlap |
paths | paths saves the minimal path to each pixel of the overlap zone |
os | Overlap size |
ps | Patch size |
x | X position of the location were to add the new patch in the output image |
y | Y position of the location were to add the new patch in the output image |
patch_src | Corner position of the patch to copy from the input texture sample |
Definition at line 179 of file boundary_cut.c.
int cumulative_vertical_error | ( | Image * | out_im, |
Image | src_im, | ||
Image * | E, | ||
Image * | paths, | ||
int | ps, | ||
int | os, | ||
int | x, | ||
int | y, | ||
Corner | patch_src | ||
) |
This method computes the cumulative veritcal error in the overlap region and the corresponding patches to these errors.
src_im | The input texture sample |
out_im | The synthesized texture |
E | E is the cumulative error in the overlap |
paths | paths saves the minimal path to each pixel of the overlap zone |
os | Overlap size |
ps | Patch size |
x | X position of the location were to add the new patch in the output image |
y | Y position of the location were to add the new patch in the output image |
patch_src | Corner position of the patch to copy from the input texture sample |
Definition at line 53 of file boundary_cut.c.