Statistics on images


Functions

double cpl_image_get_absflux (const cpl_image *image)
 Computes the sum of absolute values over an image.
double cpl_image_get_absflux_window (const cpl_image *image, int llx, int lly, int urx, int ury)
 Computes the sum of absolute values over an image sub-window.
double cpl_image_get_centroid_x (const cpl_image *image)
 Computes the x centroid value over the whole image.
double cpl_image_get_centroid_x_window (const cpl_image *image, int llx, int lly, int urx, int ury)
 Computes the x centroid value over an image sub-window.
double cpl_image_get_centroid_y (const cpl_image *image)
 Computes the y centroid value over the whole image.
double cpl_image_get_centroid_y_window (const cpl_image *image, int llx, int lly, int urx, int ury)
 Computes the y centroid value over an image sub-window.
double cpl_image_get_flux (const cpl_image *image)
 Computes the sum of pixel values over an image.
double cpl_image_get_flux_window (const cpl_image *image, int llx, int lly, int urx, int ury)
 Computes the sum of pixel values over an image sub-window.
double cpl_image_get_max (const cpl_image *image)
 computes maximum pixel value over an image.
double cpl_image_get_max_window (const cpl_image *image, int llx, int lly, int urx, int ury)
 computes maximum pixel value over an image sub-window.
cpl_error_code cpl_image_get_maxpos (const cpl_image *image, int *px, int *py)
 Computes maximum pixel value and position over an image.
cpl_error_code cpl_image_get_maxpos_window (const cpl_image *image, int llx, int lly, int urx, int ury, int *px, int *py)
 Computes maximum pixel value and position over an image sub window.
double cpl_image_get_mean (const cpl_image *image)
 computes mean pixel value over an image.
double cpl_image_get_mean_window (const cpl_image *image, int llx, int lly, int urx, int ury)
 computes mean pixel value over an image sub-window.
double cpl_image_get_median (const cpl_image *image)
 computes median pixel value over an image.
double cpl_image_get_median_dev (const cpl_image *image, double *sigma)
 Computes first and second order image statistics using median.
double cpl_image_get_median_dev_window (const cpl_image *image, int llx, int lly, int urx, int ury, double *sigma)
 Computes first and second order image statistics using median.
double cpl_image_get_median_window (const cpl_image *image, int llx, int lly, int urx, int ury)
 computes median pixel value over an image sub-window.
double cpl_image_get_min (const cpl_image *image)
 computes minimum pixel value over an image.
double cpl_image_get_min_window (const cpl_image *image, int llx, int lly, int urx, int ury)
 computes minimum pixel value over an image sub-window.
cpl_error_code cpl_image_get_minpos (const cpl_image *image, int *px, int *py)
 Computes minimum pixel value and position over an image.
cpl_error_code cpl_image_get_minpos_window (const cpl_image *image, int llx, int lly, int urx, int ury, int *px, int *py)
 Computes minimum pixel value and position over an image sub window.
double cpl_image_get_sqflux (const cpl_image *image)
 Computes the sum of squared values over an image.
double cpl_image_get_sqflux_window (const cpl_image *image, int llx, int lly, int urx, int ury)
 Computes the sum of squared values over an image sub-window.
double cpl_image_get_stdev (const cpl_image *image)
 computes pixel standard deviation over an image.
double cpl_image_get_stdev_window (const cpl_image *image, int llx, int lly, int urx, int ury)
 computes pixel standard deviation over an image sub-window.

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_get_absflux ( const cpl_image *  image  ) 

Computes the sum of absolute values over an image.

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

double cpl_image_get_absflux_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury 
)

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

Parameters:
image 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_get_min_window()

double cpl_image_get_centroid_x ( const cpl_image *  image  ) 

Computes the x centroid value over the whole image.

Parameters:
image input image.
Returns:
the x centroid value
See also:
cpl_image_get_min_window()

double cpl_image_get_centroid_x_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury 
)

Computes the x centroid value over an image sub-window.

Parameters:
image 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 x centroid value
See also:
cpl_image_get_min_window()

double cpl_image_get_centroid_y ( const cpl_image *  image  ) 

Computes the y centroid value over the whole image.

Parameters:
image input image.
Returns:
the y centroid value
See also:
cpl_image_get_min_window()

double cpl_image_get_centroid_y_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury 
)

Computes the y centroid value over an image sub-window.

Parameters:
image 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 y centroid value
See also:
cpl_image_get_min_window()

double cpl_image_get_flux ( const cpl_image *  image  ) 

Computes the sum of pixel values over an image.

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

double cpl_image_get_flux_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury 
)

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

Parameters:
image 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_get_min_window()

double cpl_image_get_max ( const cpl_image *  image  ) 

computes maximum pixel value over an image.

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

double cpl_image_get_max_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury 
)

computes maximum pixel value over an image sub-window.

Parameters:
image 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_get_min_window()

cpl_error_code cpl_image_get_maxpos ( const cpl_image *  image,
int *  px,
int *  py 
)

Computes maximum pixel value and position over an image.

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

cpl_error_code cpl_image_get_maxpos_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury,
int *  px,
int *  py 
)

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

Parameters:
image 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:
CPL_ERROR_NONE or the _cpl_error_code_ on error
See also:
cpl_image_get_minpos_window()

double cpl_image_get_mean ( const cpl_image *  image  ) 

computes mean pixel value over an image.

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

double cpl_image_get_mean_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury 
)

computes mean pixel value over an image sub-window.

Parameters:
image 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_get_min_window()

double cpl_image_get_median ( const cpl_image *  image  ) 

computes median pixel value over an image.

Parameters:
image Input image.
Returns:
the median value
See also:
cpl_image_get_median_window()
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:

double cpl_image_get_median_dev ( const cpl_image *  image,
double *  sigma 
)

Computes first and second order image statistics using median.

Parameters:
image Input image.
sigma Output computed sigma value.
Returns:
the median
See also:
cpl_image_get_median_window()
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:

double cpl_image_get_median_dev_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury,
double *  sigma 
)

Computes first and second order image statistics using median.

Parameters:
image 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)
sigma Output computed sigma value.
Returns:
the median
See also:
cpl_image_get_median_window()
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:

double cpl_image_get_median_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury 
)

computes median pixel value over an image sub-window.

Parameters:
image 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, or undefined on error
The specified bounds are included in the specified region.

In case of error, the _cpl_error_code_ code is set, and the returned value is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

For a finite population or sample, the median is the middle value of an odd number of values (arranged in ascending order) or any value between the two middle values of an even number of values. In case of an even number of values in the input array, the median is chosen to be the lower of the two central values - this ensures that the computed median is always among the values of the input arrays.

Possible _cpl_error_code_ set in this function:

double cpl_image_get_min ( const cpl_image *  image  ) 

computes minimum pixel value over an image.

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

double cpl_image_get_min_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury 
)

computes minimum pixel value over an image sub-window.

Parameters:
image 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, or undefined on error
See also:
cpl_stats_new_from_window()
Note:
In case of error, the _cpl_error_code_ code is set.
The specified bounds are included in the specified region.

Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

cpl_error_code cpl_image_get_minpos ( const cpl_image *  image,
int *  px,
int *  py 
)

Computes minimum pixel value and position over an image.

Parameters:
image Input image.
px ptr to the x coordinate of the minimum position
py ptr to the y coordinate of the minimum position
Returns:
CPL_ERROR_NONE or the _cpl_error_code_ on error
See also:
cpl_image_get_minpos_window()
Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

cpl_error_code cpl_image_get_minpos_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury,
int *  px,
int *  py 
)

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

Parameters:
image 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:
CPL_ERROR_NONE or the _cpl_error_code_ on error
See also:
cpl_image_get_min_window()
The specified bounds are included in the specified region.

Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

double cpl_image_get_sqflux ( const cpl_image *  image  ) 

Computes the sum of squared values over an image.

Parameters:
image input image.
Returns:
the sqaure flux
See also:
cpl_image_get_min()

double cpl_image_get_sqflux_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury 
)

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

Parameters:
image 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 square flux
See also:
cpl_image_get_min_window()

double cpl_image_get_stdev ( const cpl_image *  image  ) 

computes pixel standard deviation over an image.

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

double cpl_image_get_stdev_window ( const cpl_image *  image,
int  llx,
int  lly,
int  urx,
int  ury 
)

computes pixel standard deviation over an image sub-window.

Parameters:
image 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_get_min_window()


Generated on Wed Mar 18 09:40:12 2009 for Common Pipeline Library Reference Manual by  doxygen 1.4.7