PSFEstimationwithCPSO
PsfEstimator Class Reference

This class is a pool manager for the PSF Estimation methods. More...

#include <psf_estimator.hpp>

List of all members.

Static Public Member Functions

static void startup (int _cpso_pool_size, double *_zernikes, int *_phase_mask, int *_diffraction_mask, int _phase_size, int _image_size, int _n_zernikes, int _psf_range, WORD _w, WORD _c1, WORD _c2, WORD _reset_at, int _n_particles, int _n_swarms, vector< int > *_devices)
 Startup the PSF estimation by making all the necessary initializations.
static void resetPool (WORD _w, WORD _c1, WORD _c2, WORD _reset_at, int _n_particles, int _n_swarms)
 Reset the pool of CPSO Objects.
static void shutdown ()
 Shutdown the OpenCl and the search methods.
static CPSOgetCPSO (double *object, double *image)
 Get a CPSO instance from the pool.
static CPSOgetCPSO (double *object, double *image, WORD *startp_coefs)
 Get a CPSO instance from the pool.

Detailed Description

This class is a pool manager for the PSF Estimation methods.

Currently, only the search method CPSO (Cooperative Particle Swarm Optimization) is implemented into this class.


Member Function Documentation

CPSO * PsfEstimator::getCPSO ( double *  object,
double *  image 
) [static]

Get a CPSO instance from the pool.

Parameters:
objectThe object data.
imageThe image data.
Returns:
The CPSO instance obtained.
CPSO * PsfEstimator::getCPSO ( double *  object,
double *  image,
WORD *  startp_coefs 
) [static]

Get a CPSO instance from the pool.

Parameters:
objectThe object data.
imageThe image data.
startp_coefsThe Zernike coefficients for the startup (not required). If provided, it will be used for initializing the search. If not provided, random coefficients will be created.
Returns:
The CPSO instance obtained.
void PsfEstimator::resetPool ( WORD  _w,
WORD  _c1,
WORD  _c2,
WORD  _reset_at,
int  _n_particles,
int  _n_swarms 
) [static]

Reset the pool of CPSO Objects.

The reset consists of finalizing all instances already created. If any instance is in use, wait for its release.

Parameters:
_wThe new parameter w for the CPSO search.
_c1The new parameter c1 for the CPSO search.
_c2The new parameter c2 for the CPSO search.
_reset_atThe new particle reset parameter for the CPSO search.
_n_particlesThe new number of particles for the CPSO search.
_n_swarmsThe new number of swarms for the CPSO search.
void PsfEstimator::shutdown ( ) [static]

Shutdown the OpenCl and the search methods.

This method release all the remaining OpenCl data and frees up the data allocated by the search methods.

void PsfEstimator::startup ( int  _cpso_pool_size,
double *  _zernikes,
int *  _phase_mask,
int *  _diffraction_mask,
int  _phase_size,
int  _image_size,
int  _n_zernikes,
int  _psf_range,
WORD  _w,
WORD  _c1,
WORD  _c2,
WORD  _reset_at,
int  _n_particles,
int  _n_swarms,
vector< int > *  _devices 
) [static]

Startup the PSF estimation by making all the necessary initializations.

This method must always be called only once before requesting any search instance. The OpenCl environment and the search methods are started up by here.

Parameters:
_cpso_pool_sizeThe pool size for the CPSO search method. This is lazy load.
_zernikesThe complete Zernike matrix.
_phase_maskThe phase mask.
_diffraction_maskThe diffraction mask.
_phase_sizeThe phase width.
_image_sizeThe image width.
_n_zernikesThe number of Zernike terms used for the calculations.
_psf_rangeThe range for the Zernike coefficients.
_wThe parameter w for the CPSO search.
_c1The parameter c1 for the CPSO search.
_c2The parameter c2 for the CPSO search.
_reset_atThe particle reset parameter for the CPSO search.
_n_particlesThe number of particles for the CPSO search.
_n_swarmsThe number of swarms for the CPSO search.
_devicesThe list of devices to be used. If Null, all available devices will be used.

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