#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <fftw3.h>
#include "common.h"
#include "quilting.h"
#include "random_number.h"
Go to the source code of this file.
Functions |
Image | initialize (Image src_img, int wp, int wo, int p_row, int p_col, Corner *patch_src) |
void | initialize_image (Image *im, int rows, int cols, int channels) |
void | initialize_image_D (Image_D *im, int rows, int cols, int channels) |
void | initialize_image_LD (Image_LD *im, int rows, int cols, int channels) |
void | initialize_image_UI (Image_UI *im, int rows, int cols, int channels) |
void | create_position_map (Image pos_map) |
int | crop_image (Image *im_crop, Image *im, int M, int N, int C) |
int | update_synth_map (Image *synth_map, Image *pos_map, Corner *leftTop_src, Corner *leftTop_output, int wp, Image binIm) |
char * | remove_ext_filename (char *filename) |
int | im_fft (float *img, fftwl_complex *fft_im, int h, int w) |
Function Documentation
void create_position_map |
( |
Image |
pos_map | ) |
|
This method creates a position map that associates a different color from a continuous colormap to every pixel of the source image
- Author
- Lara Raad
- Parameters
-
pos_map | Position map image |
- Date
- 09/05/2013
Definition at line 174 of file common.c.
int crop_image |
( |
Image * |
im_crop, |
|
|
Image * |
im, |
|
|
int |
M, |
|
|
int |
N, |
|
|
int |
C |
|
) |
| |
This method crops an image to be of size MxNxC
- Author
- Lara Raad
- Parameters
-
im | Image to crop |
M,N,C | Size of the cropped image |
im_crop | The cropped image |
- Date
- 09/08/2013
Definition at line 200 of file common.c.
int im_fft |
( |
float * |
img, |
|
|
fftwl_complex * |
fft_im, |
|
|
int |
h, |
|
|
int |
w |
|
) |
| |
This method computes the 2-D FFT of an input image
- Author
- Lara Raad
- Parameters
-
img | Input image to apply the 2-D FFT |
fft_im | 2-D FFT of the input image img |
h,w | Dimensions of img (height and width) |
- Date
- 26/02/2014
Definition at line 306 of file common.c.
Image initialize |
( |
Image |
src_img, |
|
|
int |
wp, |
|
|
int |
wo, |
|
|
int |
p_row, |
|
|
int |
p_col, |
|
|
Corner * |
patch_src |
|
) |
| |
This method initializes the output image taking a random patch from the input texture and placing it on the left-top corner of the output image.
- Author
- Lara Raad
- Parameters
-
src_img | The input texture sample |
wp | The size of the patches |
wo | The size of the overlap area betwenn patches |
p_row | Number of patches per row in the output image |
p_col | Number of patches per column in the output image |
patch_src | Top left corner position of the patch from the source |
- Date
- 24/05/2012
Definition at line 42 of file common.c.
void initialize_image |
( |
Image * |
im, |
|
|
int |
rows, |
|
|
int |
cols, |
|
|
int |
channels |
|
) |
| |
This method initializes images of type float. It sets the numeber of rows, columns and channels and sets the pixels values to zero.
- Author
- Lara Raad
- Parameters
-
im | The image to initialize |
rows | Number of rows of the image |
cols | Number of columns of the image |
channels | Number of channels of the image |
- Date
- 24/05/2012
Definition at line 96 of file common.c.
void initialize_image_D |
( |
Image_D * |
im, |
|
|
int |
rows, |
|
|
int |
cols, |
|
|
int |
channels |
|
) |
| |
This method initializes images of type double. It sets the number of rows, columns and channels and sets the pixels values to zero.
- Author
- Lara Raad
- Parameters
-
im | The image to initialize |
rows | Number of rows of the image |
cols | Number of columns of the image |
channels | Number of channels of the image |
- Date
- 24/05/2012
Definition at line 116 of file common.c.
void initialize_image_LD |
( |
Image_LD * |
im, |
|
|
int |
rows, |
|
|
int |
cols, |
|
|
int |
channels |
|
) |
| |
This method initializes images of type long double. It sets the number of rows, columns and channels and sets the pixels values to zero.
- Author
- Lara Raad
- Parameters
-
im | The image to initialize |
rows | Number of rows of the image |
cols | Number of columns of the image |
channels | Number of channels of the image |
- Date
- 24/05/2012
Definition at line 136 of file common.c.
void initialize_image_UI |
( |
Image_UI * |
im, |
|
|
int |
rows, |
|
|
int |
cols, |
|
|
int |
channels |
|
) |
| |
This method initializes images of type unsigned long. It sets the number of rows, columns and channels and sets the pixels values to zero.
- Author
- Lara Raad
- Parameters
-
im | The image to initialize |
rows | Number of rows of the image |
cols | Number of columns of the image |
channels | Number of channels of the image |
- Date
- 24/05/2012
Definition at line 156 of file common.c.
char* remove_ext_filename |
( |
char * |
filename | ) |
|
This method removes the extension of a filename
- Author
- Lara Raad
- Parameters
-
filename | File name to which the extension is removed |
- Date
- 25/08/2014
Definition at line 278 of file common.c.
This method updates the synthesis map for each patch added in the synthesized image
- Author
- Lara Raad
- Parameters
-
synth_map | Synthesis map |
pos_map | Color map of the texture sample |
leftTop_src | Position of the patch to add taken in the src image |
leftTop_output | Position in the ouput image where we add a block |
pathc_sz | Patch size |
binIm | Binary image used to indicate which pixels are form the old patch and wich pixels are from the new patch |
- Date
- 26/02/2014
Definition at line 236 of file common.c.