Main Page   Modules   Alphabetical List   Compound List   Compound Members  

Statistics on images


Functions

double cpl_image_stats_get_min (const cpl_image_stats *in)
 Get the minimum from a cpl_image_stats object. More...

double cpl_image_stats_get_max (const cpl_image_stats *in)
 Get the maximum from a cpl_image_stats object. More...

double cpl_image_stats_get_mean (const cpl_image_stats *in)
 Get the mean from a cpl_image_stats object. More...

double cpl_image_stats_get_median (const cpl_image_stats *in)
 Get the median from a cpl_image_stats object. More...

double cpl_image_stats_get_stdev (const cpl_image_stats *in)
 Get the std. dev. from a cpl_image_stats object. More...

double cpl_image_stats_get_flux (const cpl_image_stats *in)
 Get the flux from a cpl_image_stats object. More...

double cpl_image_stats_get_absflux (const cpl_image_stats *in)
 Get the absolute flux from a cpl_image_stats object. More...

int cpl_image_stats_get_min_x (const cpl_image_stats *in)
 Get the minimum x position from a cpl_image_stats object. More...

int cpl_image_stats_get_min_y (const cpl_image_stats *in)
 Get the minimum y position from a cpl_image_stats object. More...

int cpl_image_stats_get_max_x (const cpl_image_stats *in)
 Get the maximum x position from a cpl_image_stats object. More...

int cpl_image_stats_get_max_y (const cpl_image_stats *in)
 Get the maximum y position from a cpl_image_stats object. More...

int cpl_image_stats_get_npix (const cpl_image_stats *in)
 Get the number of pixels from a cpl_image_stats object. More...

cpl_image_stats * cpl_image_stat_subw (const cpl_image *in, const int bitmask, const int llx, const int lly, const int urx, const int ury)
 Compute various statistics of an image sub-window. More...

cpl_image_stats * cpl_image_stat (const cpl_image *image_in, const int bitmask)
 Compute various statistics of an image. More...

cpl_error_code cpl_image_stat_dump (const cpl_image_stats *stats, const int bitmask)
 Dump a cpl_image_stats object. More...

double cpl_image_min_subw (const cpl_image *image_in, const int llx, const int lly, const int urx, const int ury)
 computes minimum pixel value over an image sub-window. More...

double cpl_image_min (const cpl_image *image_in)
 computes minimum pixel value over an image. More...

double cpl_image_max_subw (const cpl_image *image_in, const int llx, const int lly, const int urx, const int ury)
 computes maximum pixel value over an image sub-window. More...

double cpl_image_max (const cpl_image *image_in)
 computes maximum pixel value over an image. More...

double cpl_image_mean_subw (const cpl_image *image_in, const int llx, const int lly, const int urx, const int ury)
 computes mean pixel value over an image sub-window. More...

double cpl_image_mean (const cpl_image *image_in)
 computes mean pixel value over an image. More...

double cpl_image_median_subw (const cpl_image *in, const int llx, const int lly, const int urx, const int ury)
 computes median pixel value over an image sub-window. More...

double cpl_image_median (const cpl_image *in)
 computes median pixel value over an image. More...

double cpl_image_stdev_subw (const cpl_image *image_in, const int llx, const int lly, const int urx, const int ury)
 computes pixel standard deviation over an image sub-window. More...

double cpl_image_stdev (const cpl_image *image_in)
 computes pixel standard deviation over an image. More...

double cpl_image_flux_subw (const cpl_image *image_in, const int llx, const int lly, const int urx, const int ury)
 Computes the sum of pixel values over an image sub-window. More...

double cpl_image_flux (const cpl_image *image_in)
 Computes the sum of pixel values over an image. More...

double cpl_image_absflux_subw (const cpl_image *image_in, const int llx, const int lly, const int urx, const int ury)
 Computes the sum of absolute values over an image sub-window. More...

double cpl_image_absflux (const cpl_image *image_in)
 Computes the sum of absolute values over an image. More...

cpl_error_code cpl_image_minpos_subw (const cpl_image *in, const int llx, const int lly, const int urx, const int ury, int *px, int *py)
 Computes minimum pixel value and position over an image sub window. More...

cpl_error_code cpl_image_minpos (const cpl_image *in, int *px, int *py)
 Computes minimum pixel value and position over an image. More...

cpl_error_code cpl_image_maxpos_subw (const cpl_image *in, const int llx, const int lly, const int urx, const int ury, int *px, int *py)
 Computes maximum pixel value and position over an image sub window. More...

cpl_error_code cpl_image_maxpos (const cpl_image *in, int *px, int *py)
 Computes maximum pixel value and position over an image. More...

double cpl_image_percentile (const cpl_image *in, const int k)
 Computes kth smallest pixel value over an image. More...

double cpl_image_median_stat (const cpl_image *in, double *sigma)
 Computes first and second order image statistics using median. More...


Detailed Description

This module provides functions to compute various statistics in images.

The bad pixel map stored in the image is taken into account for the statistics computations. These functions can compute the mean, median, maximum, minimum, flux, etc... of the good pixels of an image.

Synopsis:
   #include "cpl_image_stats.h"

Function Documentation

double cpl_image_absflux const cpl_image *    image_in
 

Computes the sum of absolute values over an image.

Parameters:
image_in  input image.
Returns:
the absolute flux (sum of |pixels|) value
See also:
cpl_image_min()

double cpl_image_absflux_subw const cpl_image *    image_in,
const int    llx,
const int    lly,
const int    urx,
const int    ury
 

Computes the sum of absolute values over an image sub-window.

Parameters:
image_in  input image.
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)
Returns:
the absolute flux (sum of |pixels|) value
See also:
cpl_image_min_subw()

double cpl_image_flux const cpl_image *    image_in
 

Computes the sum of pixel values over an image.

Parameters:
image_in  input image.
Returns:
the flux value
See also:
cpl_image_min()

double cpl_image_flux_subw const cpl_image *    image_in,
const int    llx,
const int    lly,
const int    urx,
const int    ury
 

Computes the sum of pixel values over an image sub-window.

Parameters:
image_in  input image.
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)
Returns:
the flux value
See also:
cpl_image_min_subw()

double cpl_image_max const cpl_image *    image_in
 

computes maximum pixel value over an image.

Parameters:
image_in  input image.
Returns:
the maximum value
See also:
cpl_image_min()

double cpl_image_max_subw const cpl_image *    image_in,
const int    llx,
const int    lly,
const int    urx,
const int    ury
 

computes maximum pixel value over an image sub-window.

Parameters:
image_in  input image.
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)
Returns:
the maximum value
See also:
cpl_image_min_subw()

cpl_error_code cpl_image_maxpos const cpl_image *    in,
int *    px,
int *    py
 

Computes maximum pixel value and position over an image.

Parameters:
in  Input image.
px  ptr to the x coordinate of the maximum position
py  ptr to the y coordinate of the maximum position
Returns:
the _cpl_error_code_ or CPL_ERROR_NONE
See also:
cpl_image_minpos()

cpl_error_code cpl_image_maxpos_subw const cpl_image *    in,
const int    llx,
const int    lly,
const int    urx,
const int    ury,
int *    px,
int *    py
 

Computes maximum pixel value and position over an image sub window.

Parameters:
in  Input image.
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)
px  ptr to the x coordinate of the maximum position
py  ptr to the y coordinate of the maximum position
Returns:
the _cpl_error_code_ or CPL_ERROR_NONE
See also:
cpl_image_minpos_subw()

double cpl_image_mean const cpl_image *    image_in
 

computes mean pixel value over an image.

Parameters:
image_in  input image.
Returns:
the mean value
See also:
cpl_image_min()

double cpl_image_mean_subw const cpl_image *    image_in,
const int    llx,
const int    lly,
const int    urx,
const int    ury
 

computes mean pixel value over an image sub-window.

Parameters:
image_in  input image.
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)
Returns:
the mean value
See also:
cpl_image_min_subw()

double cpl_image_median const cpl_image *    in
 

computes median pixel value over an image.

Parameters:
in  input image.
Returns:
the median value
See also:
cpl_tools_median_double()
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT

double cpl_image_median_stat const cpl_image *    in,
double *    sigma
 

Computes first and second order image statistics using median.

Parameters:
in  Input image.
sigma  Output computed sigma value.
Returns:
the median
See also:
cpl_tools_median_double()
This function takes an image in input. It tries to estimate the average and standard deviation of the image by approximating them by resp. the median and the average absolute distance to the median. The median is the returned double. The average absolute distance to the median is written into sigma. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE. 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
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_TYPE_MISMATCH
  • CPL_ERROR_DATA_NOT_FOUND

double cpl_image_median_subw const cpl_image *    in,
const int    llx,
const int    lly,
const int    urx,
const int    ury
 

computes median pixel value over an image sub-window.

Parameters:
in  input image.
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)
Returns:
the median value
See also:
cpl_tools_median_double()
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_TYPE_MISMATCH

double cpl_image_min const cpl_image *    image_in
 

computes minimum pixel value over an image.

Parameters:
image_in  input image.
Returns:
the minimum value
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT

double cpl_image_min_subw const cpl_image *    image_in,
const int    llx,
const int    lly,
const int    urx,
const int    ury
 

computes minimum pixel value over an image sub-window.

Parameters:
image_in  input image.
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)
Returns:
the minimum value
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT

cpl_error_code cpl_image_minpos const cpl_image *    in,
int *    px,
int *    py
 

Computes minimum pixel value and position over an image.

Parameters:
in  Input image.
px  ptr to the x coordinate of the minimum position
py  ptr to the y coordinate of the minimum position
Returns:
the _cpl_error_code_ or CPL_ERROR_NONE
Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT

cpl_error_code cpl_image_minpos_subw const cpl_image *    in,
const int    llx,
const int    lly,
const int    urx,
const int    ury,
int *    px,
int *    py
 

Computes minimum pixel value and position over an image sub window.

Parameters:
in  Input image.
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)
px  ptr to the x coordinate of the minimum position
py  ptr to the y coordinate of the minimum position
Returns:
the _cpl_error_code_ or CPL_ERROR_NONE
Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT

double cpl_image_percentile const cpl_image *    in,
const int    k
 

Computes kth smallest pixel value over an image.

Parameters:
in  Input image.
k  Rank of the value to find.
Returns:
the found value
Finds the kth smallest pixel value in the image. k=1 is the minimum, k=npix is the maximum, k=npix/2 is the median. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE. 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
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_TYPE_MISMATCH

cpl_image_stats* cpl_image_stat const cpl_image *    image_in,
const int    bitmask
 

Compute various statistics of an image.

Parameters:
image_in  Input image.
bitmask  Defines which parameters have to be computed
Returns:
1 newly allocated cpl_image_stats structure or NULL in error case
Compute various images statistics. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT

cpl_error_code cpl_image_stat_dump const cpl_image_stats *    stats,
const int    bitmask
 

Dump a cpl_image_stats object.

Parameters:
stats  cpl_image_stats object.
bitmask  Defines which parameters have to be dumped.
Returns:
the _cpl_error_code_ or CPL_ERROR_NONE
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT

cpl_image_stats* cpl_image_stat_subw const cpl_image *    in,
const int    bitmask,
const int    llx,
const int    lly,
const int    urx,
const int    ury
 

Compute various statistics of an image sub-window.

Parameters:
in  Input image.
bitmask  Defines which parameters have to be computed
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)
Returns:
1 newly allocated cpl_image_stats structure or NULL in error case
Compute various images statistics. The user specifies the statistics he wants to get with a bitmask. The bitmask would be CPL_STAT_MIN|CPL_STAT_MED in case the user wants to get the minimum and the median in the image. Possible requested values are: CPL_STAT_MIN, CPL_STAT_MAX, CPL_STAT_MEAN, CPL_STAT_MED, CPL_STAT_STDEV, CPL_STAT_FLUX, CPL_STAT_AFLUX, CPL_STAT_MINPOS, CPL_STAT_MAXPOS, CPL_STAT_ALL or any bitwise combination of these. In the case of CPL_STAT_MIN and CPL_STAT_MAX where more than one set of coordinates share the extremum it is undefined which of those coordinates will be returned. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_DATA_NOT_FOUND
  • CPL_ERROR_TYPE_MISMATCH

double cpl_image_stats_get_absflux const cpl_image_stats *    in
 

Get the absolute flux from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the absolute flux
See also:
cpl_image_stats_get_min()

double cpl_image_stats_get_flux const cpl_image_stats *    in
 

Get the flux from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the flux
See also:
cpl_image_stats_get_min()

double cpl_image_stats_get_max const cpl_image_stats *    in
 

Get the maximum from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the maximum value
See also:
cpl_image_stats_get_min()

int cpl_image_stats_get_max_x const cpl_image_stats *    in
 

Get the maximum x position from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the x position (1 for the first pixel), -1 in error case.
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT

int cpl_image_stats_get_max_y const cpl_image_stats *    in
 

Get the maximum y position from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the y position (1 for the first pixel), -1 in error case.
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT

double cpl_image_stats_get_mean const cpl_image_stats *    in
 

Get the mean from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the mean value
See also:
cpl_image_stats_get_min()

double cpl_image_stats_get_median const cpl_image_stats *    in
 

Get the median from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the median value
See also:
cpl_image_stats_get_min()

double cpl_image_stats_get_min const cpl_image_stats *    in
 

Get the minimum from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the minimum value
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

int cpl_image_stats_get_min_x const cpl_image_stats *    in
 

Get the minimum x position from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the x position (1 for the first pixel), -1 in error case.
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT

int cpl_image_stats_get_min_y const cpl_image_stats *    in
 

Get the minimum y position from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the y position (1 for the first pixel), -1 in error case.
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT

int cpl_image_stats_get_npix const cpl_image_stats *    in
 

Get the number of pixels from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the number of pixels, -1 in error case.
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT

double cpl_image_stats_get_stdev const cpl_image_stats *    in
 

Get the std. dev. from a cpl_image_stats object.

Parameters:
in  the cpl_image_stats object
Returns:
the standard deviation
See also:
cpl_image_stats_get_min()

double cpl_image_stdev const cpl_image *    image_in
 

computes pixel standard deviation over an image.

Parameters:
image_in  input image.
Returns:
the standard deviation value
See also:
cpl_image_min()

double cpl_image_stdev_subw const cpl_image *    image_in,
const int    llx,
const int    lly,
const int    urx,
const int    ury
 

computes pixel standard deviation over an image sub-window.

Parameters:
image_in  input image.
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)
Returns:
the standard deviation value
See also:
cpl_image_min_subw()


Generated on Mon May 24 14:58:05 2004 for Common Pipeline Library Reference Manual by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002