|
cpl_error_code | clipm_image_sim_noise_gaussian (cpl_image *img_modified, const cpl_size window_xxyy[4], double sigma) |
| Add white gaussian noise to an image. More...
|
|
cpl_error_code | clipm_image_sim_circle (cpl_image *img_modified, double centre_x, double centre_y, double radius, double brightness) |
| Add a circle to an existing image (additively, on top). More...
|
|
cpl_error_code | clipm_image_sim_rectangle (cpl_image *img_modified, double centre_x, double centre_y, double angle, double length, double width, double brightness) |
| Add a circle to an existing image (additively, on top). More...
|
|
This module provides tool functions for the simulation of image content. They are intended to create test images.
- Synopsis:
-
cpl_error_code clipm_image_sim_circle |
( |
cpl_image * |
img_modified, |
|
|
double |
centre_x, |
|
|
double |
centre_y, |
|
|
double |
radius, |
|
|
double |
brightness |
|
) |
| |
Add a circle to an existing image (additively, on top).
- Parameters
-
img_modified | Input image to modify (FITS convention) |
centre_x | X centre |
centre_y | Y centre |
radius | Radius, if = 0, nothing is done |
brightness | Filling brightness |
- Returns
- CPL error code
- Principle:
- A filled circle is added on top of the existing image content.
- radius can be negative, in this case nothing is done.
- The centre may lie outside the image.
- Bad Pixel Handling:
- Since the circle is added to the existing image content, only good pixels will be modified.
- Error Handling:
- The following errors can be set and returned:
- CPL_ERROR_NULL_INPUT: img_modified is NULL
- CPL_ERROR_INVALID_TYPE: img_modified is not of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE
- Todo:
-
cpl_error_code clipm_image_sim_noise_gaussian |
( |
cpl_image * |
img_modified, |
|
|
const cpl_size |
window_xxyy[4], |
|
|
double |
sigma |
|
) |
| |
Add white gaussian noise to an image.
- Parameters
-
img_modified | Image |
window_xxyy | (Optional) Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
sigma | Noise sigma, must be > 0 |
- Returns
- CPL error code
- Principle:
- An existing image must be passed.
- Gaussian noise is added to the pixels with the corresponding sigma value.
- The added absolute noise values are limited to 4*sigma to produce a reliable value range for testing.
- Bad Pixel Handling:
- Bad pixels are ignored (the data buffer is not modified at these locations).
- Error Handling:
- The following errors can be set and returned:
- CPL_ERROR_NULL_INPUT: image is NULL
- CPL_ERROR_ILLEGAL_INPUT: sigma <= 0
- CPL_ERROR_INVALID_TYPE: image is not of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE
- CPL_ERROR_ACCESS_OUT_OF_RANGE: window_xxyy specifies coordinates outside the image plane
- Todo:
-
cpl_error_code clipm_image_sim_rectangle |
( |
cpl_image * |
img_modified, |
|
|
double |
centre_x, |
|
|
double |
centre_y, |
|
|
double |
angle, |
|
|
double |
length, |
|
|
double |
width, |
|
|
double |
brightness |
|
) |
| |
Add a circle to an existing image (additively, on top).
- Parameters
-
img_modified | Input image to modify (FITS convention) |
centre_x | X centre |
centre_y | Y centre |
angle | Orientation (mathematically positive, i.e. counterclockwise) |
length | Length, will point into the direction of angle |
width | Width |
brightness | Filling brightness |
- Returns
- CPL error code
- Principle:
- A filled rectangle is added on top of the existing image content.
- The centre may lie outside the image.
- Bad Pixel Handling:
- Since the rectangle is added to the existing image content, only good pixels will be modified.
- Error Handling:
- The following errors can be set and returned:
- CPL_ERROR_NULL_INPUT: img_modified is NULL
- CPL_ERROR_INVALID_TYPE: img_modified is not of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE
- Todo:
-