Main Page | Modules | Alphabetical List | Class List | Directories | Class Members

High level functions to handle apertures


Functions

cpl_apertures * cpl_apertures_new (int naperts)
 Constructor for cpl_apertures.
void cpl_apertures_delete (cpl_apertures *apert)
 Destructor for cpl_apertures.
void cpl_apertures_dump (const cpl_apertures *aperts, FILE *fp)
 Dump a cpl_apertures to an opened file pointer.
cpl_apertures * cpl_apertures_new_from_image (const cpl_image *in, const cpl_image *lab)
 Compute statistics on selected apertures.
int cpl_apertures_get_size (const cpl_apertures *in)
 Accessor to get the number of apertures.
double cpl_apertures_get_max_x (const cpl_apertures *in, int ind)
 Accessor to get the x position of an aperture.
double cpl_apertures_get_max_y (const cpl_apertures *in, int ind)
 Accessor to get the y position of an aperture.
double cpl_apertures_get_centroid_x (const cpl_apertures *in, int ind)
 Accessor to get the x centroid of an aperture.
double cpl_apertures_get_centroid_y (const cpl_apertures *in, int ind)
 Accessor to get the y centroid of an aperture.
int cpl_apertures_get_npix (const cpl_apertures *in, int ind)
 Accessor to get the number of pixels of an aperture.
int cpl_apertures_get_left (const cpl_apertures *in, int ind)
 Accessor to get the left x position of an aperture.
int cpl_apertures_get_left_y (const cpl_apertures *in, int ind)
 Accessor to get the left y position of an aperture.
int cpl_apertures_get_right (const cpl_apertures *in, int ind)
 Accessor to get the right x position of an aperture.
int cpl_apertures_get_right_y (const cpl_apertures *in, int ind)
 Accessor to get the right y position of an aperture.
int cpl_apertures_get_bottom_x (const cpl_apertures *in, int ind)
 Accessor to get the bottom x position of an aperture.
int cpl_apertures_get_bottom (const cpl_apertures *in, int ind)
 Accessor to get the bottom y position of an aperture.
int cpl_apertures_get_top_x (const cpl_apertures *in, int ind)
 Accessor to get the top x position of an aperture.
int cpl_apertures_get_top (const cpl_apertures *in, int ind)
 Accessor to get the top y position of an aperture.
double cpl_apertures_get_max (const cpl_apertures *in, int ind)
 Accessor to get the maximum value of an aperture.
double cpl_apertures_get_min (const cpl_apertures *in, int ind)
 Accessor to get the minimum value of an aperture.
double cpl_apertures_get_mean (const cpl_apertures *in, int ind)
 Accessor to get the mean value of an aperture.
double cpl_apertures_get_median (const cpl_apertures *in, int ind)
 Accessor to get the median value of an aperture.
double cpl_apertures_get_stdev (const cpl_apertures *in, int ind)
 Accessor to get the std dev. value of an aperture.
double cpl_apertures_get_flux (const cpl_apertures *in, int ind)
 Accessor to get the flux of an aperture.
cpl_error_code cpl_apertures_sort_by_npix (cpl_apertures *in)
 Sort by decreasing aperture size.
cpl_error_code cpl_apertures_sort_by_max (cpl_apertures *in)
 Sort by decreasing aperture peak value.
cpl_error_code cpl_apertures_sort_by_flux (cpl_apertures *in)
 Sort by decreasing aperture flux.
cpl_apertures * cpl_apertures_extract (const cpl_image *in, const cpl_vector *sigmas, int *pisigma)
 Simple detection of apertures in an image.
cpl_apertures * cpl_apertures_extract_window (const cpl_image *in, const cpl_vector *sigmas, int llx, int lly, int urx, int ury, int *pisigma)
 Simple detection of apertures in an image window.
cpl_apertures * cpl_apertures_extract_sigma (const cpl_image *in, double sigma)
 Simple apertures detection in an image using a provided sigma.

Detailed Description

The aperture object contains a list of zones in an image. It is typically used to contain the results of an objects detection, or if one wants to work on a very specific zone in an image.

This module provides functions to handle cpl_apertures.


Function Documentation

void cpl_apertures_delete cpl_apertures *  apert  ) 
 

Destructor for cpl_apertures.

Parameters:
apert Object to delete.
Returns:
void
This function deallocates all possibly allocated arrays inside the given object, then deallocates the main pointer.

void cpl_apertures_dump const cpl_apertures *  aperts,
FILE *  fp
 

Dump a cpl_apertures to an opened file pointer.

Parameters:
aperts cpl_apertures to dump
fp Opened file pointer, ready to receive data
Returns:
void
This function dumps all informations contained into a cpl_apertures to the passed (opened) file pointer. It is Ok to pass stdout or stderr. If the object is unallocated or contains nothing, this function does nothing.

cpl_apertures* cpl_apertures_extract const cpl_image *  in,
const cpl_vector *  sigmas,
int *  pisigma
 

Simple detection of apertures in an image.

Parameters:
in Input image
sigmas Positive, decreasing sigmas to apply
pisigma Index of the sigma that was used or undefined on error
Returns:
The detected apertures or NULL on error
See also:
cpl_apertures_extract_sigma()
pisigma may be NULL.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if in or sigmas is NULL
  • CPL_ERROR_DATA_NOT_FOUND if the apertures cannot be detected

cpl_apertures* cpl_apertures_extract_sigma const cpl_image *  in,
double  sigma
 

Simple apertures detection in an image using a provided sigma.

Parameters:
in Input image
sigma detection level
Returns:
The list of detected apertures or NULL if nothing detected or in error case.
The threshold used for the detection is the median plus the average distance to the median times sigma.

The input image type can be CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT or CPL_TYPE_INT.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if sigma is negative or 0.0
  • CPL_ERROR_ILLEGAL_OUTPUT if the image cannot be binarised or labelised

cpl_apertures* cpl_apertures_extract_window const cpl_image *  in,
const cpl_vector *  sigmas,
int  llx,
int  lly,
int  urx,
int  ury,
int *  pisigma
 

Simple detection of apertures in an image window.

Parameters:
in Input image
sigmas Positive, decreasing sigmas to apply
llx Lower left x position (FITS convention)
lly Lower left y position (FITS convention)
urx Upper right x position (FITS convention)
ury Upper right y position (FITS convention)
pisigma Index of the sigma that was used or undefined on error
Returns:
The list of detected apertures or NULL on error
See also:
cpl_apertures_extract()

cpl_image_extract()

int cpl_apertures_get_bottom const cpl_apertures *  in,
int  ind
 

Accessor to get the bottom y position of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the bottom y position of the aperture or -1 in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

int cpl_apertures_get_bottom_x const cpl_apertures *  in,
int  ind
 

Accessor to get the bottom x position of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the bottom x position of the aperture or -1 in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

double cpl_apertures_get_centroid_x const cpl_apertures *  in,
int  ind
 

Accessor to get the x centroid of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the x centroid position of the aperture
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

double cpl_apertures_get_centroid_y const cpl_apertures *  in,
int  ind
 

Accessor to get the y centroid of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the y centroid position of the aperture
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

double cpl_apertures_get_flux const cpl_apertures *  in,
int  ind
 

Accessor to get the flux of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the flux of the aperture
See also:
cpl_apertures_get_mean()

int cpl_apertures_get_left const cpl_apertures *  in,
int  ind
 

Accessor to get the left x position of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the left x position of the aperture or -1 in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

int cpl_apertures_get_left_y const cpl_apertures *  in,
int  ind
 

Accessor to get the left y position of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the left y position of the aperture or -1 in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

double cpl_apertures_get_max const cpl_apertures *  in,
int  ind
 

Accessor to get the maximum value of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the maximum value of the aperture
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

double cpl_apertures_get_max_x const cpl_apertures *  in,
int  ind
 

Accessor to get the x position of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the x position of the aperture
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

double cpl_apertures_get_max_y const cpl_apertures *  in,
int  ind
 

Accessor to get the y position of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the y position of the aperture
See also:
cpl_apertures_get_max_x()

double cpl_apertures_get_mean const cpl_apertures *  in,
int  ind
 

Accessor to get the mean value of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the mean value of the aperture
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

double cpl_apertures_get_median const cpl_apertures *  in,
int  ind
 

Accessor to get the median value of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the median value of the aperture
See also:
cpl_apertures_get_mean()

double cpl_apertures_get_min const cpl_apertures *  in,
int  ind
 

Accessor to get the minimum value of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the minimum value of the aperture
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

int cpl_apertures_get_npix const cpl_apertures *  in,
int  ind
 

Accessor to get the number of pixels of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the number of pixels of the aperture or -1 in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

int cpl_apertures_get_right const cpl_apertures *  in,
int  ind
 

Accessor to get the right x position of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the right x position of the aperture or -1 in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

int cpl_apertures_get_right_y const cpl_apertures *  in,
int  ind
 

Accessor to get the right y position of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the right y position of the aperture or -1 in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

int cpl_apertures_get_size const cpl_apertures *  in  ) 
 

Accessor to get the number of apertures.

Parameters:
in a cpl_apertures object
Returns:
the number of apertures or -1 in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL

double cpl_apertures_get_stdev const cpl_apertures *  in,
int  ind
 

Accessor to get the std dev. value of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the standard deviation of the aperture
See also:
cpl_apertures_get_mean()

int cpl_apertures_get_top const cpl_apertures *  in,
int  ind
 

Accessor to get the top y position of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the top y position of the aperture or -1 in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

int cpl_apertures_get_top_x const cpl_apertures *  in,
int  ind
 

Accessor to get the top x position of an aperture.

Parameters:
in a cpl_apertures object
ind the aperture index (1 for the first one)
Returns:
the top x position of the aperture or -1 in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is out of the bounds of in

cpl_apertures* cpl_apertures_new int  naperts  ) 
 

Constructor for cpl_apertures.

Parameters:
naperts Number of apertures in the structure
Returns:
1 newly allocated cpl_apertures or NULL in error case
The returned object must be deleted using cpl_apertures_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_ILLEGAL_INPUT if naperts is not strictly positive

cpl_apertures* cpl_apertures_new_from_image const cpl_image *  in,
const cpl_image *  lab
 

Compute statistics on selected apertures.

Parameters:
in Reference image.
lab labelized image (type CPL_TYPE_INT)
Returns:
An apertures statistics holder or NULL in error case
The returned object must be deleted using cpl_apertures_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if lab is not of type CPL_TYPE_INT or if lab and in have different sizes or if lab maximum value is lower or equal to 0

cpl_error_code cpl_apertures_sort_by_flux cpl_apertures *  in  ) 
 

Sort by decreasing aperture flux.

Parameters:
in Apertures to sort (MODIFIED)
Returns:
the _cpl_error_code_ or CPL_ERROR_NONE
See also:
cpl_apertures_sort_by_npix()

cpl_error_code cpl_apertures_sort_by_max cpl_apertures *  in  ) 
 

Sort by decreasing aperture peak value.

Parameters:
in Apertures to sort (MODIFIED)
Returns:
the _cpl_error_code_ or CPL_ERROR_NONE
See also:
cpl_apertures_sort_by_npix()

cpl_error_code cpl_apertures_sort_by_npix cpl_apertures *  in  ) 
 

Sort by decreasing aperture size.

Parameters:
in Apertures to sort (MODIFIED)
Returns:
CPL_ERROR_NONE or the relevant _cpl_error_code_
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL


Generated on Mon Sep 26 14:38:18 2005 for Common Pipeline Library Reference Manual by  doxygen 1.4.1