ifw-odp 5.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ifw::odp::Recipe Class Reference

This class is C++ wrapper for a CPL and CLIPM recipes. It provides a simplified interface that allows to call CPL routines from INS applications. More...

#include <recipe.hpp>

Inheritance diagram for ifw::odp::Recipe:
ifw::odp::Error

Public Member Functions

 Recipe ()
 Class constructor.
 
 ~Recipe ()
 Class destructor.
 
void GetCenterGauss (const odp::Image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, CenterGauss *cen_gauss, const int robustness=0)
 Compute the center gauss of an image subwindow.
 
void GetCenterMoment (const odp::Image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, bool wdw_enlarge, double gain, CenterGauss *cenMoment)
 Compute the center moment of an image subwindow.
 
void GetMultiCenterGauss (const odp::Image *image, const odp::Matrix *ref, unsigned int areasize, odp::Matrix *center, odp::Matrix *center_err, odp::Matrix *sigma, odp::Matrix *sigma_err, odp::Matrix *fwhm, odp::Matrix *fwhm_err, odp::Matrix *intensities, odp::Array *err_codes, const int robustness)
 Compute multiple center gauss of an image.
 
void GetIqe (const odp::Image *image, const cpl_size startX, const cpl_size startY, const cpl_size endX, const cpl_size endY, Iqe *iqe)
 Compute image quality estimator over an image subwindow.
 
void GetSlitPos (const odp::Image *image, const int max_width, SlitPos *slit)
 Computes the slit data.
 
void AlignPoints (const odp::Matrix *matrix1, const odp::Matrix *matrix2, unsigned int mode, odp::Matrix *trans, odp::Matrix *shift, odp::Matrix *rot)
 Linear transformation between two set of points.
 
void AlignCorrelate (const odp::Image *img1, const odp::Image *img2, const odp::Matrix *ref, unsigned int wsize, double maxd, unsigned int mode, odp::Matrix *trans, odp::Matrix *shift, odp::Matrix *pixels, odp::Matrix *locs, odp::Matrix *uncer, odp::Array *err_codes)
 Crosscorrelation of two images.
 
std::vector< double > GetRngPoisson2d (int llx, int lly, int urx, int ury, int homogenity, int npairs)
 Generates a set of random numbers within a box.
 
void GetRngPoisson2d (double llx, double lly, double urx, double ury, int homogenity, int npairs, void **buffer_ptr, cpl_type cpltype=CPL_TYPE_DOUBLE)
 Generates a set of random numbers within a box.
 
void GetRectangularAperture (const odp::Image *image, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury, RectAperture *aperture, odp::Matrix *stat)
 Wrapper to the CLIPM rectangular characterization.
 
void GetCircularAperture (const odp::Image *image, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury, CircularAperture *aperture, odp::Matrix *stat)
 Wrapper to the CLIPM circular characterization.
 
void EstimateBackground (const odp::Image *img, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury, double *sigma, cpl_size *nused, double *background)
 Estimate the background in an image region.
 
void EstimateFwhm (const odp::Image *img, double peak_pos1, double peak_pos2, double bckg_level, double *fwhm)
 Estimate the FWHM of a round object.
 
void GetBarycentre (const odp::Image *img, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury, double bckg_level, double cut_level, double centre[2], double *weight, cpl_size *nused)
 Compute the barycentre of an object.
 
void DetectCircularApertures (const odp::Image *img, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury, odp::Matrix *stat)
 Wrapper to the CLIPM detect circular aperture.
 
- Public Member Functions inherited from ifw::odp::Error
 Error ()
 Class constructor.
 
virtual ~Error ()
 Class destructor.
 
void ResetCplError ()
 Reset CPL error and internal error flag.
 
bool CheckCplError () const
 Check if there is an error in CPL.
 

Additional Inherited Members

- Protected Member Functions inherited from ifw::odp::Error
std::string GetErrorMsg () const
 Get CPL error message.
 

Detailed Description

This class is C++ wrapper for a CPL and CLIPM recipes. It provides a simplified interface that allows to call CPL routines from INS applications.

Recipe - CPL and CLIPM recipe wrapper class

See also
CPL Reference: http://www.eso.org/observing/cpl/reference_3.0/ or above CLIPM library

Constructor & Destructor Documentation

◆ Recipe()

ifw::odp::Recipe::Recipe ( )

Class constructor.

Returns
none

◆ ~Recipe()

ifw::odp::Recipe::~Recipe ( )

Class destructor.

Returns
none

Member Function Documentation

◆ AlignCorrelate()

void ifw::odp::Recipe::AlignCorrelate ( const odp::Image * img1,
const odp::Image * img2,
const odp::Matrix * ref,
unsigned int wsize,
double maxd,
unsigned int mode,
odp::Matrix * trans,
odp::Matrix * shift,
odp::Matrix * pixels,
odp::Matrix * locs,
odp::Matrix * uncer,
odp::Array * err_codes )

Crosscorrelation of two images.

Parameters
[in]img1First image to cross-correlate.
[in]img2Second image to cross-correlate.
[in]refReference points.
[in]wsizeWindow size for each of the reference subwindows.
[in]maxdMaximum search distance.
[in]modeAlignment mode.
[out]transTransformation matrix.
[out]shiftShift matrix.
[out]pixelsTransformation shifting matrix.
[out]locsShift location matrix.
[out]uncerUncertainties matrix for each cetroid.
[out]err_codesList of error codes for correlation and centroding.

Interface to a clipm recipe function. It does the cross correlation between two images by correlation of a set of subwindows.

Please note that output matrix objects will be deleted before to point to the new allocated matrices. If output matrix objects are null, they are not going to be created.

See also
CLIPM function: clipm_align_correlate

◆ AlignPoints()

void ifw::odp::Recipe::AlignPoints ( const odp::Matrix * matrix1,
const odp::Matrix * matrix2,
unsigned int mode,
odp::Matrix * trans,
odp::Matrix * shift,
odp::Matrix * rot )

Linear transformation between two set of points.

Parameters
[in]matrix1First set of points (CPL matrix).
[in]matrix2Second set of points (CPL matrix).
[in]modeAligning mode.
[out]transOutput transformation (CPL matrix).
[out]shiftOutput shift (CPL matrix).
[out]rotOutput residuals (CPL matrix).

Interface to a clipm recipe function. It does the linear transformation between two set of points.

Please note that output matrix objects will be deleted before to point to the new allocated matrices. If output matrix objects are null, they are not going to be created.

See also
CLIPM function: clipm_align_points

◆ DetectCircularApertures()

void ifw::odp::Recipe::DetectCircularApertures ( const odp::Image * img,
const cpl_size llx,
const cpl_size lly,
const cpl_size urx,
const cpl_size ury,
odp::Matrix * stat )

Wrapper to the CLIPM detect circular aperture.

Parameters
[in]imgImage to analyze.
[in]llxLower left X coordinate of the box
[in]llyLower left Y coordinate of the box
[in]urxUpper right X coordinate of the box
[in]uryUpper right Y coordinate of the box
[out]statMatrix with the list of circular apertures detected

Interface to a clipm recipe function. This method is a wrapper for the function detecting circular apertures.

See also
CLIPM function: clipm_aperture_detect_circles

◆ EstimateBackground()

void ifw::odp::Recipe::EstimateBackground ( const odp::Image * img,
const cpl_size llx,
const cpl_size lly,
const cpl_size urx,
const cpl_size ury,
double * sigma,
cpl_size * nused,
double * background )

Estimate the background in an image region.

Parameters
[in]imgInput image
[in]llxLower left X coordinate of the box
[in]llyLower left Y coordinate of the box
[in]urxUpper right X coordinate of the box
[in]uryUpper right Y coordinate of the box
[out]sigma(Optional output) background sigma, can be nullptr, returns -1.0 in the case of error
[out]nused(Optional output) number of found background pixels, can be nullptr, returns 0 in the case of error
[out]backgroundEstimated background value.
See also
CLIPM function: clipm_image_signal_estimate_bg_in_region

◆ EstimateFwhm()

void ifw::odp::Recipe::EstimateFwhm ( const odp::Image * img,
double peak_pos1,
double peak_pos2,
double bckg_level,
double * fwhm )

Estimate the FWHM of a round object.

Parameters
[in]imgInput image
[in]peak_pos1Peak position1
[in]peak_pos2Peak position2
[in]bckg_levelInput background level to subtract
[out]fwhmFull with half maximum
See also
CLIPM function: clipm_priv_image_estimate_fwhm_round

◆ GetBarycentre()

void ifw::odp::Recipe::GetBarycentre ( const odp::Image * img,
const cpl_size llx,
const cpl_size lly,
const cpl_size urx,
const cpl_size ury,
double bckg_level,
double cut_level,
double centre[2],
double * weight,
cpl_size * nused )

Compute the barycentre of an object.

Parameters
[in]imgInput image
[in]llxLower left X coordinate of the box
[in]llyLower left Y coordinate of the box
[in]urxUpper right X coordinate of the box
[in]uryUpper right Y coordinate of the box
[in]bckg_levelInput background level to subtract
[in]cut_levelLower limit of values to use (separately from bckg_level) (values can be equal to or greater)
[out]centreMandatory (double) buffer of size 2 to contain the barycentre position after true
[out]weight(Optional) output weight of the peak, can be nullptr
[out]nused(Optional output) number of found background pixels, can be nullptr, returns 0 in the case of error
See also
CLIPM function: clipm_priv_image_get_barycentre

◆ GetCenterGauss()

void ifw::odp::Recipe::GetCenterGauss ( const odp::Image * image,
cpl_size llx,
cpl_size lly,
cpl_size urx,
cpl_size ury,
CenterGauss * cen_gauss,
const int robustness = 0 )

Compute the center gauss of an image subwindow.

Parameters
[in]imageImage object to compute the center gauss.
[in]llxLower left X coordinate
[in]llyLower left Y coordinate
[in]urxUpper right X coordinate
[in]uryUpper right Y coordinate
[out]cen_gaussCenter gauss information.
[in]robustnessAlgorithm robustness.

Interface to a clipm recipe function. It obtains the center gauss of an image subwindow.

See also
CLIPM function: clipm_centroiding_gauss

◆ GetCenterMoment()

void ifw::odp::Recipe::GetCenterMoment ( const odp::Image * image,
cpl_size llx,
cpl_size lly,
cpl_size urx,
cpl_size ury,
bool wdw_enlarge,
double gain,
CenterGauss * cenMoment )

Compute the center moment of an image subwindow.

Parameters
[in]imageImage object to compute the center moment.
[in]llxLower left X coordinate
[in]llyLower left Y coordinate
[in]urxUpper right X coordinate
[in]uryUpper right Y coordinate
[in]wdw_enlargeFlag to allow the function to increase the window size when it detects that the window cuts the wings of the centered object, default should be 0.
[in]gain(Optional) detector gain input in unit [1/electrons], required for computation of center error.
[out]cenMomentCenter moment information.
See also
clipm_centroiding_moment

Interface to a clipm recipe function. It obtains the center moment of an image subwindow.

Warning
{Values fwhm_err and sigma_err of CenterGauss output are not filled by this function so they will be undetermined.}
See also
CLIPM function: clipm_centroiding_moment

◆ GetCircularAperture()

void ifw::odp::Recipe::GetCircularAperture ( const odp::Image * image,
const cpl_size llx,
const cpl_size lly,
const cpl_size urx,
const cpl_size ury,
CircularAperture * aperture,
odp::Matrix * stat )

Wrapper to the CLIPM circular characterization.

Parameters
[in]imageImage to analyze.
[in]llxLower left X coordinate of the box
[in]llyLower left Y coordinate of the box
[in]urxUpper right X coordinate of the box
[in]uryUpper right Y coordinate of the box
[out]apertureCircular aperture data
[out]statStatistical information

Interface to a clipm recipe function. This method is a wrapper for the circular aperture.

See also
CLIPM function: clipm_aperture_characterise_circular

◆ GetIqe()

void ifw::odp::Recipe::GetIqe ( const odp::Image * image,
const cpl_size startX,
const cpl_size startY,
const cpl_size endX,
const cpl_size endY,
Iqe * iqe )

Compute image quality estimator over an image subwindow.

Parameters
[in]imageImage to compute the IQE
[in]startXLower left X coordinate
[in]startYLower left Y coordinate
[in]endXUpper right X coordinate
[in]endYUpper right Y coordinate
[out]iqeInformation about the IQE

Get the image quality estimator using a CPL function.

See also
CPL function: cpl_image_iqe

◆ GetMultiCenterGauss()

void ifw::odp::Recipe::GetMultiCenterGauss ( const odp::Image * image,
const odp::Matrix * ref,
unsigned int areasize,
odp::Matrix * center,
odp::Matrix * center_err,
odp::Matrix * sigma,
odp::Matrix * sigma_err,
odp::Matrix * fwhm,
odp::Matrix * fwhm_err,
odp::Matrix * intensities,
odp::Array * err_codes,
const int robustness )

Compute multiple center gauss of an image.

Parameters
[in]imageImage to compute the multiple center gauss.
[in]refMatrix containing the reference points.
[in]areasizeSize of area to compute the center gauss.
[out]centerOutput matrix containing the computed center.
[out]center_errOutput matrix containing the error of the computed center.
[out]sigmaOutput matrix containing the computed sigma.
[out]sigma_errOutput matrix containing the error of the computed sigma.
[out]fwhmOutput matrix containing the computed FWHM.
[out]fwhm_errOutput matrix containing the error of the computed FWHM.
[out]intensitiesOutput matrix containing the computed intesities.
[out]err_codesOutput array containing the error codes.
[in]robustnessAlgorithm robustness.

Interface to a clipm recipe function. It obtains the center gauss of an image subwindow.

Apply a gaussian fit over a set of image subwindows. CPL matrices are used for input and output data.

Please note that output matrix objects will be deleted before to point to the new allocated matrices. If output matrix objects are null, they are not going to be created.

See also
CLIPM function: clipm_centroiding_multi_gauss

◆ GetRectangularAperture()

void ifw::odp::Recipe::GetRectangularAperture ( const odp::Image * image,
const cpl_size llx,
const cpl_size lly,
const cpl_size urx,
const cpl_size ury,
RectAperture * aperture,
odp::Matrix * stat )

Wrapper to the CLIPM rectangular characterization.

Parameters
[in]imageImage to analyze.
[in]llxLower left X coordinate of the box
[in]llyLower left Y coordinate of the box
[in]urxUpper right X coordinate of the box
[in]uryUpper right Y coordinate of the box
[out]apertureRectangular aperture data
[out]statStatistical information

Interface to a clipm recipe function. This method is a wrapper for the rectangular aperture.

See also
CLIPM function: clipm_aperture_characterise_rectangular

◆ GetRngPoisson2d() [1/2]

void ifw::odp::Recipe::GetRngPoisson2d ( double llx,
double lly,
double urx,
double ury,
int homogenity,
int npairs,
void ** buffer_ptr,
cpl_type cpltype = CPL_TYPE_DOUBLE )

Generates a set of random numbers within a box.

Parameters
[in]llxLower left X coordinate of the box
[in]llyLower left Y coordinate of the box
[in]urxUpper right X coordinate of the box
[in]uryUpper right Y coordinate of the box
[in]homogenityHomogenity factor
[in]npairsNumber of pairs.
[out]buffer_ptrOutput buffer with the random values.
[in]cpltypeCPL type.

Interface to a clipm recipe function. This is a method that generates a set of random offsets within a box following the Poisson law.

See also
CLIPM function: clipm_math_rng_poisson_pointpattern_2d

◆ GetRngPoisson2d() [2/2]

std::vector< double > ifw::odp::Recipe::GetRngPoisson2d ( int llx,
int lly,
int urx,
int ury,
int homogenity,
int npairs )

Generates a set of random numbers within a box.

Parameters
[in]llxLower left X coordinate of the box
[in]llyLower left Y coordinate of the box
[in]urxUpper right X coordinate of the box
[in]uryUpper right Y coordinate of the box
[in]homogenityHomogenity factor
[in]npairsNumber of pairs.
Returns
STL vector with the generated data.

Interface to a clipm recipe function. This is a method that generates a set of random offsets within a box following the Poisson law.

See also
CLIPM function: clipm_math_rng_poisson_pointpattern_2d

◆ GetSlitPos()

void ifw::odp::Recipe::GetSlitPos ( const odp::Image * image,
const int max_width,
SlitPos * slit )

Computes the slit data.

Parameters
[in]imageImage to compute the slit position.
[in]max_widthMaximum slit width.
[out]slitstructure with the slit information

Interface to clipm recipe function. It obtain the center position and tilt angle of the slit.

See also
CLIPM function: clipm_aperture_slitpos

The documentation for this class was generated from the following files: