PSFEstimationwithCPSO
|
This class is a pool manager for the PSF Estimation methods. More...
#include <psf_estimator.hpp>
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 CPSO * | getCPSO (double *object, double *image) |
Get a CPSO instance from the pool. | |
static CPSO * | getCPSO (double *object, double *image, WORD *startp_coefs) |
Get a CPSO instance from the pool. |
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.
CPSO * PsfEstimator::getCPSO | ( | double * | object, |
double * | image | ||
) | [static] |
CPSO * PsfEstimator::getCPSO | ( | double * | object, |
double * | image, | ||
WORD * | startp_coefs | ||
) | [static] |
Get a CPSO instance from the pool.
object | The object data. |
image | The image data. |
startp_coefs | The 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. |
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.
_w | The new parameter w for the CPSO search. |
_c1 | The new parameter c1 for the CPSO search. |
_c2 | The new parameter c2 for the CPSO search. |
_reset_at | The new particle reset parameter for the CPSO search. |
_n_particles | The new number of particles for the CPSO search. |
_n_swarms | The 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.
_cpso_pool_size | The pool size for the CPSO search method. This is lazy load. |
_zernikes | The complete Zernike matrix. |
_phase_mask | The phase mask. |
_diffraction_mask | The diffraction mask. |
_phase_size | The phase width. |
_image_size | The image width. |
_n_zernikes | The number of Zernike terms used for the calculations. |
_psf_range | The range for the Zernike coefficients. |
_w | The parameter w for the CPSO search. |
_c1 | The parameter c1 for the CPSO search. |
_c2 | The parameter c2 for the CPSO search. |
_reset_at | The particle reset parameter for the CPSO search. |
_n_particles | The number of particles for the CPSO search. |
_n_swarms | The number of swarms for the CPSO search. |
_devices | The list of devices to be used. If Null, all available devices will be used. |