Functions | |
cpl_error_code | cpl_image_fill_gaussian (cpl_image *ima, double xcen, double ycen, double norm, double sig_x, double sig_y) |
Generate an image from a 2d gaussian function. | |
cpl_error_code | cpl_image_fill_noise_uniform (cpl_image *ima, double min_pix, double max_pix) |
Generate an image with uniform random noise distribution. | |
cpl_error_code | cpl_image_fill_polynomial (cpl_image *ima, const cpl_polynomial *poly, double startx, double stepx, double starty, double stepy) |
Generate an image from a 2d polynomial function. | |
cpl_image * | cpl_image_fill_test_create (int nx, int ny) |
Generate a test image with pixel type CPL_TYPE_DOUBLE. |
These functions are mostly used to test the software. Gaussian images, or uniform noise images can be generated.
#include "cpl_image_gen.h"
cpl_error_code cpl_image_fill_gaussian | ( | cpl_image * | ima, | |
double | xcen, | |||
double | ycen, | |||
double | norm, | |||
double | sig_x, | |||
double | sig_y | |||
) |
Generate an image from a 2d gaussian function.
ima | the gaussian image to generate | |
xcen | x position of the center (1 for the first pixel) | |
ycen | y position of the center (1 for the first pixel) | |
norm | norm of the gaussian. | |
sig_x | Sigma in x for the gaussian distribution. | |
sig_y | Sigma in y for the gaussian distribution. |
f(x, y) = (norm/(2*pi*sig_x*sig_y)) * exp(-(x-xcen)^2/(2*sig_x^2)) * exp(-(y-ycen)^2/(2*sig_y^2))
The input image type can be CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
cpl_error_code cpl_image_fill_noise_uniform | ( | cpl_image * | ima, | |
double | min_pix, | |||
double | max_pix | |||
) |
Generate an image with uniform random noise distribution.
ima | the image to generate | |
min_pix | Minimum output pixel value. | |
max_pix | Maximum output pixel value. |
Possible _cpl_error_code_ set in this function:
cpl_error_code cpl_image_fill_polynomial | ( | cpl_image * | ima, | |
const cpl_polynomial * | poly, | |||
double | startx, | |||
double | stepx, | |||
double | starty, | |||
double | stepy | |||
) |
Generate an image from a 2d polynomial function.
ima | the polynomial image to generate | |
poly | the 2d polynomial | |
startx | the x value associated with the left pixels column | |
stepx | the x step | |
starty | the y value associated with the bottom pixels row | |
stepy | the y step |
The input image type can be CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
If you want to generate an image whose pixel values are the values of the polynomial applied to the pixel positions, just call cpl_image_fill_polynomial(ima, poly, 1.0, 1.0, 1.0, 1.0);
Possible _cpl_error_code_ set in this function:
cpl_image* cpl_image_fill_test_create | ( | int | nx, | |
int | ny | |||
) |
Generate a test image with pixel type CPL_TYPE_DOUBLE.
nx | x size | |
ny | y size |
Possible _cpl_error_code_ set in this function: