ifw-odp  2.0.0-alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
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 odp::Recipe:
odp::Error

Public Member Functions

 Recipe ()
 Class constructor. More...
 
 ~Recipe ()
 Class destructor. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void GetSlitPos (const odp::Image *image, const int max_width, SlitPos *slit)
 Computes the slit data. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void EstimateFwhm (const odp::Image *img, double peak_pos1, double peak_pos2, double bckg_level, double *fwhm)
 Estimate the FWHM of a round object. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from odp::Error
 Error ()
 Class constructor. More...
 
virtual ~Error ()
 Class destructor. More...
 
void ResetCplError ()
 Reset CPL error and internal error flag. More...
 
bool CheckCplError () const
 Check if there is an error in CPL. More...
 

Additional Inherited Members

- Protected Member Functions inherited from odp::Error
void AddCplError () const
 Add CPL error to the error stack. More...
 
std::string GetErrorMsg () const
 Get CPL error message. More...
 
- Static Protected Member Functions inherited from odp::Error
static void DumpError (unsigned self, unsigned first, unsigned last)
 Dump current CPL error. More...
 

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

odp::Recipe::Recipe ( )

Class constructor.

Returns
none
odp::Recipe::~Recipe ( )

Class destructor.

Returns
none

Member Function Documentation

void 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
void 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
void 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
void 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
void 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
void 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
void 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
void 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
void 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
void 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
void 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
void 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
std::vector< double > 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
void 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
void 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: