Efros-Leung
Exemplar-basedtexturesynthesis(Efros-Leung)
|
Image structures definitions. More...
Go to the source code of this file.
Classes | |
struct | cimage |
A color image of integers. More... | |
struct | imageF |
A gray-scale image of floats. More... | |
struct | pixel |
Some pixel's properties. More... | |
struct | cand_dist |
Store a patch and a distance. More... | |
Typedefs | |
typedef struct cimage * | Cimage |
typedef struct imageF * | ImageF |
typedef struct pixel * | Pixel |
typedef struct cand_dist * | Cand_dist |
Functions | |
void | error (char *msg) |
Fatal error function. | |
Cimage | new_Cimage (int nrow, int ncol) |
Create an empty color image. | |
ImageF | new_ImageF (int nrow, int ncol) |
Create an empty gray-scale image. | |
Cimage | load_png_image (char *filename) |
Load a color image from a PNG file. | |
void | write_png_image (Cimage v, char *filename) |
Save a color image as a PNG file. | |
void | delete_Cimage (Cimage v) |
Delete a color image. | |
void | delete_imageF (ImageF v) |
Delete a gray-scale image. | |
ImageF | CImage_to_ImageF (Cimage image) |
Extract the red channel of a color image. | |
Cimage | create_image_map (int nrow, int ncol) |
Create a color map. | |
void | print_algo_info (char *in_file_name, int nrows, int ncols, int nchannels, int t, float tolerance, char weights, int dims_pca, int out_sz) |
Print information about the parameters. | |
Cimage | crop_image (Cimage v, int out_img_sz) |
Crop a color image. | |
int | is_grayscale (Cimage image, long num_pixels) |
Check if an image is a real color image or a 3-channel gray image. | |
ImageF | add_border (ImageF v, int t) |
Add a border of zeros of width t to the input image. | |
ImageF | create_mask (int nrow, int ncol, int t) |
Create an image of size (nrow+t) times (ncol+t). |
Image structures definitions.
Definitions of common structures like images or coordinates.
ImageF add_border | ( | ImageF | v, |
int | t | ||
) |
Add a border of zeros of width t to the input image.
v | input image add the border. |
t | width of the border to be added. |
ImageF CImage_to_ImageF | ( | Cimage | image | ) |
Extract the red channel of a color image.
Convert the red channel of a color image into a gray-scale image.
image | a color image |
Cimage create_image_map | ( | int | nrow, |
int | ncol | ||
) |
Create a color map.
nrow | number of rows (dy) |
ncol | number of columns (dx) |
ImageF create_mask | ( | int | nrow, |
int | ncol, | ||
int | t | ||
) |
Create an image of size (nrow+t) times (ncol+t).
The image is filled with ones in the central region of size nrow x ncol and has a border of zeros of width t.
nrow | number of rows of the region filled with ones. |
ncol | number of columns of the region filled with ones. |
t | width of the border filled with zeros. |
Cimage crop_image | ( | Cimage | v, |
int | out_img_sz | ||
) |
Crop a color image.
v | color image to be cropped |
out_img_sz | size of the new image |
void delete_Cimage | ( | Cimage | v | ) |
Delete a color image.
Free the memory used by the image.
v | image to be deleted |
void delete_imageF | ( | ImageF | v | ) |
Delete a gray-scale image.
Free the memory used by the image.
v | image to be deleted |
void error | ( | char * | msg | ) |
Fatal error function.
Print a message to standard-error output and exit.
msg | String to be printed to standard-error output. |
int is_grayscale | ( | Cimage | image, |
long | num_pixels | ||
) |
Check if an image is a real color image or a 3-channel gray image.
image | input image to be tested. |
num_pixels | total number of pixels in the image (nrows * ncols) |
Cimage load_png_image | ( | char * | filename | ) |
Load a color image from a PNG file.
filename | name (path) of the image |
Cimage new_Cimage | ( | int | nrow, |
int | ncol | ||
) |
Create an empty color image.
Initialize the size of the image and allocate the memory.
nrow | number of rows (dy) |
ncol | number of columns (dx) |
ImageF new_ImageF | ( | int | nrow, |
int | ncol | ||
) |
Create an empty gray-scale image.
Initialize the size of the image and allocate the memory.
nrow | number of rows (dy) |
ncol | number of columns (dx) |
void print_algo_info | ( | char * | in_file_name, |
int | nrows, | ||
int | ncols, | ||
int | nchannels, | ||
int | t, | ||
float | tolerance, | ||
char | weights, | ||
int | dims_pca, | ||
int | out_sz | ||
) |
Print information about the parameters.
t | Half-size of the patches. |
out_sz | Size of the synthesized image. |
tolerance | Tolerance parameter ![]() |
dims_pca | Number of PCA components used to compute distances between (the known parts of) patches. |
weights | If 'G', use Gaussian-weighted ![]() ![]() |
in_file_name | Example image name. |
nrows | Number of rows (dy) in example image. |
ncols | Number of columns (dx) in example image. |
nchannels | Number of channels in example image. |
void write_png_image | ( | Cimage | image, |
char * | filename | ||
) |
Save a color image as a PNG file.
image | color image to be saves |
filename | name (path) of the file |