Resonon API
3.12 [Deprecated]
C++ API for controlling Resonon hyperspectral imagers
|
A class for imagers based on Allied Vimba Cameras. More...
#include "resonon_imager_allied.h"
Public Member Functions | |
PikaAllied () | |
PikaAllied is a class for Resonon Imagers that make use of Allied Vision Cameras via Allied's Vimba API. More... | |
virtual | ~PikaAllied () |
void | connect (const char *camera_serial_number=NULL) |
Connect to camera. More... | |
void | disconnect () |
Disconnect from a camera and free allocated resources. More... | |
void | start () |
Begin grabbing frames from the imager. More... | |
void | stop () |
Stop grabbing frames from the imager. More... | |
void | get_imager_type (char *buffer, int buffer_size) |
Get a string identifying the type of imager being controlled by this class. More... | |
void | get_serial_number (char *buffer, int buffer_size) |
Get a string identifying the serial number of the connected imager. More... | |
void | get_camera_serial_number (char *buffer, int buffer_size) |
Get a string identifying the serial number of the camera embedded in the imager. More... | |
void | generate_configuration_report (char *buffer, int buffer_size) |
Generates a report on the imager's internal settings. More... | |
float | get_coeff_a () |
Gets the first imager spectral calibration coefficient stored in camera memory. More... | |
float | get_coeff_b () |
Gets the second imager spectral calibration coefficient stored in camera memory. More... | |
float | get_coeff_c () |
Gets the third imager spectral calibration coefficient stored in camera memory. More... | |
double | get_wavelength_at_band (const int band) |
Get the wavelength of the imager at the requested band number. More... | |
int | get_frame_buffer_size_in_bytes () |
Get the size of the buffer required to get a single frame from the imager, in bytes, according to current windowing, binning, and bit depth settings. More... | |
unsigned short * | get_frame (unsigned short *buffer) |
Get a single frame from the imager and copy it to the provided buffer. More... | |
std::uint64_t | get_last_timestamp () |
Get the timestamp of the last image returned by PikaAllied::get_frame() in camera ticks (nanoseconds). More... | |
std::uint64_t | ticks_per_second () |
Get the number of camera ticks per second, for converting values returned by PikaAllied::get_last_timestamp() to seconds. More... | |
int | get_band_count () |
Get the number of bands (spectral dimension) provided by the imager. More... | |
int | get_sample_count () |
Get the number of samples (spatial dimension) provided by the imager. More... | |
void | set_framerate (const double frames_per_second) |
Set the imager framerate in frames per second. More... | |
double | get_framerate () |
Get the current requested framerate in frames per second. More... | |
double | get_min_framerate () |
Get the minimum value that the framerate can be set to. More... | |
double | get_max_framerate () |
Get the maximum value that the framerate can be set to. More... | |
double | get_min_integration_time () |
Get the minimum integration time supported by the camera. More... | |
double | get_max_integration_time () |
Get the maximum integration time supported by the camera. More... | |
void | set_integration_time (const double milliseconds) |
Set the integration time in milliseconds. More... | |
double | get_integration_time () |
Get the current integration time in milliseconds. More... | |
void | set_internal_trigger () |
Set the camera to internally triggered mode. More... | |
void | set_external_trigger (unsigned int signal_line, bool rising_edge=true) |
Set the camera to externally triggered mode. More... | |
bool | is_trigger_external () |
Return true if the camera is in external trigger mode, false if the camera is in internal trigger mode. More... | |
Public Member Functions inherited from Resonon::ResononImagerBase | |
ResononImagerBase () | |
virtual | ~ResononImagerBase () |
int | get_nearest_band_to_wavelength (const double wavelength) |
Return the band number that is closest to the requested wavelength from the current windowing settings. More... | |
virtual void | set_spectral_bin (int new_spectral_bin) |
Set the binning in the spectral dimension, if supported by the camera. More... | |
virtual int | get_spectral_bin () |
Get the current spectral binning setting. More... | |
virtual int | get_min_spectral_bin () |
Get the minimum spectral binning setting. More... | |
virtual int | get_max_spectral_bin () |
Get the maximum spectral binning setting. More... | |
virtual int | get_start_band () |
Get the start of the user-defined spectral window. More... | |
virtual void | set_start_band (int band) |
Set the first band in the user-defined spectral window. More... | |
virtual int | get_min_start_band () |
Get the minimum band number allowed for the start of the spectral window at current settings. More... | |
virtual int | get_max_start_band () |
Get the maximum band number allowed for the start of the spectral window at current settings. More... | |
virtual int | get_inc_start_band () |
Get the increment for valid value of the start of the spectral window at current settings. More... | |
virtual int | get_end_band () |
Get the end of the user-defined spectral window. More... | |
virtual void | set_end_band (int band) |
Set the end of the user-defined spectral window. More... | |
virtual int | get_min_end_band () |
Get the minimum band number allowed for the end of the user-defined spectral window at current settings. More... | |
virtual int | get_max_end_band () |
Get the maximum band number allowed for the end of the user-defined spectral window at current settings. More... | |
virtual int | get_inc_end_band () |
Get the increment for valid value of the end of the user-defined spectral window at current settings. More... | |
virtual int | get_start_sample () |
Get the start of the user-defined spatial window. More... | |
virtual void | set_start_sample (int sample) |
Set the first sample in the user-defined spatial window. More... | |
virtual int | get_min_start_sample () |
Get the minimum sample number allowed for the start of the spatial window at current settings. More... | |
virtual int | get_max_start_sample () |
Get the maximum sample number allowed for the start of the spatial window at current settings. More... | |
virtual int | get_inc_start_sample () |
Get the increment for valid value of the start of the spatial window at current settings. More... | |
virtual int | get_end_sample () |
Get the end of the user-defined spatial window. More... | |
virtual void | set_end_sample (int sample) |
Set the end of the user-defined spatial window. More... | |
virtual int | get_min_end_sample () |
Get the minimum sample number allowed for the end of the user-defined spatial window at current settings. More... | |
virtual int | get_max_end_sample () |
Get the maximum sample number allowed for the end of the user-defined spatial window at current settings. More... | |
virtual int | get_inc_end_sample () |
Get the increment for valid value of the end of the user-defined spatial window at current settings. More... | |
virtual void | set_gain (const double gain) |
Sets the camera gain. More... | |
virtual double | get_gain () |
Gets the camera gain setting. More... | |
virtual double | get_min_gain () |
Gets the camera minimum gain setting. More... | |
virtual double | get_max_gain () |
Gets the camera maximum gain setting. More... | |
A class for imagers based on Allied Vimba Cameras.
PikaAllied::PikaAllied | ( | ) |
PikaAllied is a class for Resonon Imagers that make use of Allied Vision Cameras via Allied's Vimba API.
Only one instance of this class is allowed.
|
virtual |
std::runtime_error | if there is an error while disconnecting from the camera. |
|
virtual |
Connect to camera.
This method will attempt to connect to the first camera found on the system.
[in] | camera_serial_number | The serial number of the camera to connect (this is not the imager serial number). If NULL connect to the first camera found. |
std::runtime_error | if camera cannot be initialized or an unexpected camera is found. Use std::runtime_error.what() for more details. |
Implements Resonon::ResononImagerBase.
|
virtual |
Disconnect from a camera and free allocated resources.
std::runtime_error | if there is an error while disconnecting from the camera |
Implements Resonon::ResononImagerBase.
|
virtual |
Generates a report on the imager's internal settings.
[in,out] | buffer | A character buffer to receive the report. Recommended size is 1,000 bytes. |
[in] | buffer_size | The size of the passed character buffer, to prevent overruns. |
std::runtime_error | if no imager is connected. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the number of bands (spectral dimension) provided by the imager.
std::runtime_error | if camera error occurs |
Implements Resonon::ResononImagerBase.
|
virtual |
Get a string identifying the serial number of the camera embedded in the imager.
[in,out] | buffer | A character buffer to receive the serial number cstring. |
[in] | buffer_size | The size of the passed character buffer, to prevent overruns. |
std::runtime_error | if no imager is connected. |
Implements Resonon::ResononImagerBase.
|
virtual |
Gets the first imager spectral calibration coefficient stored in camera memory.
std::runtime_error | if the imager is not connected. |
Implements Resonon::ResononImagerBase.
|
virtual |
Gets the second imager spectral calibration coefficient stored in camera memory.
std::runtime_error | if the imager is not connected. |
Implements Resonon::ResononImagerBase.
|
virtual |
Gets the third imager spectral calibration coefficient stored in camera memory.
std::runtime_error | if the imager is not connected. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get a single frame from the imager and copy it to the provided buffer.
Space for the data must be previously allocated. Use PikaAllied::get_frame_buffer_size_in_bytes() to get the required size of the buffer. Data type is unsigned short. This call retrieves the most recent frame received from the camera. If no frame has been received this call blocks until a frame becomes available. PikaAllied::start() must be called before retrieving frames.
[in,out] | buffer | A pointer to the buffer to which frame data should be copied. |
std::runtime_error | If camera has been improperly configured, frame capture has not been started, or a camera error occurs. Use std::runtime_error.what() to get details. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the size of the buffer required to get a single frame from the imager, in bytes, according to current windowing, binning, and bit depth settings.
std::runtime_error | if camera error occurs |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the current requested framerate in frames per second.
For PikaAllied cameras the exposure time is honored over the framerate. That is, if the exposure time is longer than 1/framerate, the achieved framerate will be less than the requested framerate. See Framerate and Integration Time for additional considerations.
std::runtime_error | if a camera error occurs. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get a string identifying the type of imager being controlled by this class.
For Pika NIR imagers based on the Allied Goldeye cameras, this string is "PikaNIR" for 320 pixel resolution imagers, or "PikaNIR640" for 640 pixel resolution imagers.
buffer | A character buffer to receive the imager type cstring. |
buffer_size | The size of the passed character buffer, to prevent overruns. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the current integration time in milliseconds.
std::runtime_error | if a camera error occurs. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the timestamp of the last image returned by PikaAllied::get_frame() in camera ticks (nanoseconds).
Implements Resonon::ResononImagerBase.
|
virtual |
Get the maximum value that the framerate can be set to.
See Framerate and Integration Time for additional considerations.
std::runtime_error | if a camera error occurs. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the maximum integration time supported by the camera.
std::runtime_error | if a camera error occurs. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the minimum value that the framerate can be set to.
See Framerate and Integration Time for additional considerations.
std::runtime_error | if a camera error occurs. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the minimum integration time supported by the camera.
std::runtime_error | if a camera error occurs. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the number of samples (spatial dimension) provided by the imager.
std::runtime_error | if camera error occurs |
Implements Resonon::ResononImagerBase.
|
virtual |
Get a string identifying the serial number of the connected imager.
[in,out] | buffer | A character buffer to receive the serial number cstring. |
[in] | buffer_size | The size of the passed character buffer, to prevent overruns. |
std::runtime_error | if no imager is connected. |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the wavelength of the imager at the requested band number.
Band numbers always start at 0 and end at the total number of bands available on the camera. To get all supplied wavelengths loop from 0 to PikaAllied::get_band_count() - 1.
band | The band number for which to calculate wavelength. |
std::domain_error | if band is invalid (band < 0 or band >= number of bands) |
Implements Resonon::ResononImagerBase.
|
virtual |
Return true if the camera is in external trigger mode, false if the camera is in internal trigger mode.
std::runtime_error | if camera error occurs |
Reimplemented from Resonon::ResononImagerBase.
|
virtual |
Set the camera to externally triggered mode.
signal_line | The signal trigger source. Valid values are 1 for line 1 and 2 for line 2. |
rising_edge | Set to true to trigger on the rising edge or false to trigger on the falling edge. |
std::runtime_error | if camera error occurs or an invalid signal_line is specified. |
Reimplemented from Resonon::ResononImagerBase.
|
virtual |
Set the imager framerate in frames per second.
For PikaAllied cameras, the exposure time is honored over the framerate. That is, if the exposure time is longer than 1/framerate, the achieved framerate will be less than the requested framerate. See Framerate and Integration Time for additional considerations.
frames_per_second | Requested framerate in frames per second. |
std::runtime_error | if a camera error occurs. |
Implements Resonon::ResononImagerBase.
|
virtual |
Set the integration time in milliseconds.
For PikaAllied cameras the integration time is honored over the framerate. That is, if the integration time is longer than 1/framerate, the achieved framerate will be less than the requested framerate. See Framerate and Integration Time for additional considerations.
milliseconds | Requested integration time in milliseconds. |
std::runtime_error | if a camera error occurs. |
Implements Resonon::ResononImagerBase.
|
virtual |
Set the camera to internally triggered mode.
std::runtime_error | if camera error occurs |
Reimplemented from Resonon::ResononImagerBase.
|
virtual |
Begin grabbing frames from the imager.
This method must be called before calling PikaAllied::get_frame().
std::runtime_error | if camera error occurs |
Implements Resonon::ResononImagerBase.
|
virtual |
Stop grabbing frames from the imager.
std::runtime_error | if camera error occurs |
Implements Resonon::ResononImagerBase.
|
virtual |
Get the number of camera ticks per second, for converting values returned by PikaAllied::get_last_timestamp() to seconds.
Implements Resonon::ResononImagerBase.