efros_freeman
0.1
|
#include "common.h"
Go to the source code of this file.
Functions | |
void | compute_input_patch_norms (Image src_im, long double *patch_normsH, long double *patch_normsV, long double *patch_normsL, int patch_sz, int overlap_sz) |
Computes the squared norms of each RGB patches of the input according to the 3 possible overlap regions.The computation is done in applying the cross-correlation between the extended mask and the sum over the 3 channels of the squares of the pixel values. | |
void | patch_search (Image src_im, Image out_im, Corner temp, int patch_sz, long double *src_patch_normsH, long double *src_patch_normsV, long double *src_patch_normsL, fftwl_complex *fft_srcR, fftwl_complex *fft_srcG, fftwl_complex *fft_srcB, int h_dict, int w_dict, Corner *patch, float tol) |
This function executes the two steps of the patch search procedure: |
This file contains all the functions for the patch search procedure that computes the distance of a patch to all input patches and then randomly pick on of the patches that are close to the minimal distance.
Definition in file patch_search.h.
void compute_input_patch_norms | ( | Image | src_im, |
long double * | patch_normsH, | ||
long double * | patch_normsV, | ||
long double * | patch_normsL, | ||
int | patch_sz, | ||
int | overlap_sz | ||
) |
Computes the squared norms of each RGB patches of the input according to the 3 possible overlap regions.The computation is done in applying the cross-correlation between the extended mask and the sum over the 3 channels of the squares of the pixel values.
src_im | input RGB Image |
patch_normsH | long double image for the horizontal overlap (must be allocated) |
patch_normsV | long double image for the vertical overlap (must be allocated) |
patch_normsL | long double image for the L-shape overlap (must be allocated) |
patch_sz | patch size |
overlap_sz | size of the overlap at the edge of the patch |
Definition at line 136 of file patch_search.c.
void patch_search | ( | Image | src_im, |
Image | out_im, | ||
Corner | temp, | ||
int | patch_sz, | ||
long double * | src_patch_normsH, | ||
long double * | src_patch_normsV, | ||
long double * | src_patch_normsL, | ||
fftwl_complex * | fft_srcR, | ||
fftwl_complex * | fft_srcG, | ||
fftwl_complex * | fft_srcB, | ||
int | h, | ||
int | w, | ||
Corner * | patch, | ||
float | tol | ||
) |
This function executes the two steps of the patch search procedure:
src_im | The input texture sample |
out_im | The currently synthesized texture image (unknown pixels must be set to zero) |
temp | The patch from the output image to compare with those in the texture sample (patch to synthesize) |
patch_sz | The pathc size |
src_patch_normsH,src_patch_normsV,src_patch_normsL | long double arrays corresponding to the norm of input patches for the 3 possible overlap regions |
fft_srcR,fft_srcG,fft_srcB | long double Fourier transforms of the 3 input channels |
h,w | size of the domain of admissible patches |
patch | The position of the picked patch (Corner type) |
tol | The threshold used to select patches from the input image |
Definition at line 413 of file patch_search.c.