High level functions for geometric transformations


Functions

cpl_image ** cpl_geom_img_offset_combine (cpl_imagelist *ilist, const cpl_bivector *offs, int refine, const cpl_bivector *aperts, const cpl_vector *sigmas, int *pisigma, int s_hx, int s_hy, int m_hx, int m_hy, int min_rej, int max_rej, cpl_geom_combine union_flag)
 Images list recombination.
cpl_bivector * cpl_geom_img_offset_fine (const cpl_imagelist *ilist, const cpl_bivector *estimates, const cpl_bivector *anchors, int s_hx, int s_hy, int m_hx, int m_hy, cpl_vector *correl)
 Get the offsets by correlating the images.
cpl_image ** cpl_geom_img_offset_saa (const cpl_imagelist *ilist, const cpl_bivector *offs, cpl_kernel kernel, int rejmin, int rejmax, cpl_geom_combine union_flag, double *ppos_x, double *ppos_y)
 Shift and add an images list to a single image.

Detailed Description

This module contains functions to compute the shift-and-add operation on an image list.

Synopsis:
   #include "cpl_geom_img.h"

Function Documentation

cpl_image** cpl_geom_img_offset_combine ( cpl_imagelist *  ilist,
const cpl_bivector *  offs,
int  refine,
const cpl_bivector *  aperts,
const cpl_vector *  sigmas,
int *  pisigma,
int  s_hx,
int  s_hy,
int  m_hx,
int  m_hy,
int  min_rej,
int  max_rej,
cpl_geom_combine  union_flag 
)

Images list recombination.

Parameters:
ilist Input imagelist - may be empty on return
offs List of offsets estimates in x and y or NULL if unknown
refine Flag to refine the estimated offsets or not
aperts List of correlation apertures or NULL if unknown
sigmas Positive, decreasing sigmas to apply
pisigma Index of the sigma that was used or undefined on error
s_hx Search area half-width.
s_hy Search area half-height.
m_hx Measurement area half-width.
m_hy Measurement area half-height.
min_rej number of low values to reject in stacking
max_rej number of high values to reject in stacking
union_flag Combination mode (CPL_GEOM_UNION or CPL_GEOM_INTERSECT)
Returns:
Pointer to newly allocated images array, or NULL on error.
See also:
cpl_apertures_extract()

cpl_geom_img_offset_fine()

This function detects cross correlation points in the first image (if not provided by the user), use them to refine the provided offsets with a cross correlation method, and then apply the shift and add to recombine the images together. If offs is NULL, the function tries to find offsets estimates itself by subsampling the images and correlate them together with the first one.

The input image list is purged from bad correlating frames.

The supported types are CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT.

The number of provided offsets shall be equal to the number of inputs images. The ith offset (offs_x, offs_y) is the offset that has to be used to shift the ith image to align it on the first one.

The bad pixel map of the input images list is ignored, and the bad pixel map of the output image is empty.

The returned image array contains 2 images:

If not NULL, the returned cpl_image array arr must be deallocated like:

  if (arr[0] != NULL) cpl_image_delete(arr[0]);
  if (arr[1] != NULL) cpl_image_delete(arr[1]);
  cpl_free(arr);

Possible _cpl_error_code_ set in this function:

cpl_bivector* cpl_geom_img_offset_fine ( const cpl_imagelist *  ilist,
const cpl_bivector *  estimates,
const cpl_bivector *  anchors,
int  s_hx,
int  s_hy,
int  m_hx,
int  m_hy,
cpl_vector *  correl 
)

Get the offsets by correlating the images.

Parameters:
ilist Input image list
estimates First-guess estimation of the offsets
anchors List of anchor points
s_hx Half-width of search area
s_hy Half-height of search area
m_hx Half-width of measurement area
m_hy Half-height of measurement area
correl List of cross-correlation quality factors
Returns:
List of offsets or NULL in error case
The matching is performed using a 2d cross-correlation, using a minimal squared differences criterion. One measurement is performed per input anchor point, and the median offset is returned together with a measure of similarity for each plane.

The images in the input list must only differ from a shift. In order from the correlation to work, they must have the same level (check the average values of your input images if the correlation does not work).

The supported types are CPL_TYPE_DOUBLE and CPL_TYPE_FLOAT. The bad pixel maps are ignored by this function.

The ith offset (offsx, offsy) in the returned offsets is the one that have to be used to shift the ith image to align it on the reference image (the first one).

If not NULL, the returned cpl_bivector must be deallocated with cpl_bivector_delete().

Possible _cpl_error_code_ set in this function:

cpl_image** cpl_geom_img_offset_saa ( const cpl_imagelist *  ilist,
const cpl_bivector *  offs,
cpl_kernel  kernel,
int  rejmin,
int  rejmax,
cpl_geom_combine  union_flag,
double *  ppos_x,
double *  ppos_y 
)

Shift and add an images list to a single image.

Parameters:
ilist Input image list
offs List of offsets in x and y
kernel Interpolation kernel to use for resampling
rejmin Number of minimum value pixels to reject in stacking
rejmax Number of maximum value pixels to reject in stacking
union_flag Combination mode (CPL_GEOM_UNION or CPL_GEOM_INTERSECT)
ppos_x If non-NULL, *ppos_x is the X-position of the first image in the combined image
ppos_y If non-NULL, *ppos_y is the Y- position of the first image in the combined image
Returns:
Pointer to newly allocated images array, or NULL on error.
The supported types are CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT.

The number of provided offsets shall be equal to the number of inputs images. The ith offset (offs_x, offs_y) is the offset that has to be used to shift the ith image to align it on the first one.

Provide the name of the kernel you want to generate. Supported kernel types are:

If the number of input images is lower or equal to 3, the rejection parameters are ignored. If the number of input images is lower or equal to 2*(rejmin+rejmax), the rejection parameters are ignored.

The bad pixel map of the input images list is ignored, and the bad pixel map of the output image is empty.

If not NULL, the returned cpl_image array arr must be deallocated like:

  if (arr[0] != NULL) cpl_image_delete(arr[0]);
  if (arr[1] != NULL) cpl_image_delete(arr[1]);
  cpl_free(arr);

Possible _cpl_error_code_ set in this function:


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