Wrapper for PI driver and image processing library. More...
#include <IRImager.h>
Public Types | |
enum class | RadialDistortionCorrectionMode { Off , Normal , Wide } |
Public Member Functions | |
IRImager () | |
Standard constructor. | |
~IRImager () | |
Destructor. | |
bool | init (IRDeviceParams *params, unsigned int frequency, unsigned int width, unsigned int height, bool useHID, unsigned short hwRev=0, unsigned short fwRev=0) |
Initializing routine, to be called after instantiation. More... | |
void | initRawdataHeader (RawdataHeader &header) const |
Initialize Rawdata header with camera specific parameters. More... | |
bool | reconnect (IRDeviceParams *params, unsigned int frequency, unsigned int width, unsigned int height, bool useHID, unsigned short hwRev=0, unsigned short fwRev=0) |
Reconnect resets internal variables and calls init method again. | |
Tchar * | checkCalibration () |
Check existence of calibration file set. More... | |
void | setAutoFlag (bool autoFlag) |
Set flag automatic. More... | |
bool | getAutoFlag () const |
Get flag automatic. More... | |
void | setFlagMinInterval (float seconds) |
Set flag min interval. More... | |
float | getFlagMinInterval () const |
Get flag min interval. More... | |
void | setFlagMaxInterval (float seconds) |
Set flag max interval. More... | |
float | getFlagMaxInterval () const |
Get flag max interval. More... | |
bool | setTempRange (int tMin, int tMax) |
Set temperature range. More... | |
unsigned int | getHWRevision () const |
Get hardware revision. More... | |
unsigned int | getFWRevision () const |
Get firmware revision. More... | |
unsigned int | getWidth () const |
Get image width of thermal channel. More... | |
unsigned int | getHeight () const |
Get image height of thermal channel. More... | |
unsigned int | getVisibleWidth () const |
Get image width of visible channel (if available) More... | |
unsigned int | getVisibleHeight () const |
Get image height of visible channel (if available) More... | |
unsigned int | getWidthIn () const |
Get width of raw format (from UVC stream) More... | |
unsigned int | getHeightIn () const |
Get height of raw format (from UVC stream) More... | |
unsigned short | getBitCount () const |
Get # of bits used for temperature coding. More... | |
long long | getAvgTimePerFrame () const |
Get average time per frame. More... | |
float | getMaxFramerate () const |
Get maximum frame rate of device return frame rate (in frames/second) | |
float | getHWInterval () const |
Get time interval between hardware frames (camera timestamp) More... | |
bool | hasBispectralTechnology () const |
Check if bispectral technology is available. More... | |
int | getEnergyBuffer (unsigned short *buffer) const |
Get energy buffer of previously acquired frame. More... | |
int | getMetaData (unsigned char *buffer, int size) const |
Get meta data container of previously acquired frame. More... | |
bool | getTemperatureTableParameters (double *t1, double *t3, double *tJunct, short *e1, short *e3, short *eJunct, double *lambda, double *lambda2) const |
Get temperature table parameters @params[out] t1 Temperature for 1st operating point @params[out] t3 Temperature for 2nd operating point @params[out] tJunct Crossover temperature of junction point between both ranges @params[out] e1 Energy of 1st operating point @params[out] e3 Energy of 2nd operating point @params[out] eJunct Energy of tJunct @params[out] lambda Central wave length of the Planck function (standard range for all imagers) @params[out] lambda2 Central wave length of the second range after tJunct (e.g. More... | |
void | setThermalFrameCallback (fptrIRThermalFrame callback) |
Set callback function to be called for new frames. More... | |
void | setVisibleFrameCallback (fptrIRVisibleFrame callback) |
Set callback function to be called for new frames. More... | |
void | setFlagStateCallback (fptrIRFlagState callback) |
Set callback function to be called for changing flag states. More... | |
void | setThermalFrameEventCallback (fptrIRThermalSnapshot callback) |
Set callback function to be called for PIF or software trigger events. More... | |
void | setVisibleFrameEventCallback (fptrIRVisibleSnapshot callback) |
Set callback function to be called for PIF or software trigger events. More... | |
void | setProcessExitCallback (fptrIRProcessEvent callback) |
Set callback function to be called when the process method has finalized its work. More... | |
void | setClient (IRImagerClient *client) |
Set client as callback receiver. More... | |
ImageProcessing * | getImageProcessingChain () |
Get pointer to image processing chain. More... | |
void | process (unsigned char *buffer, void *arg=NULL) |
Process raw data. More... | |
void | forceFlagEvent (float time=0.f) |
Force shutter flag event manually (close/open cycle) More... | |
void | raiseSnapshotEvent () |
Raise a software triggered snapshot event (comparable with PIF event) | |
bool | isFlagOpen () const |
Check if shutter flag is open. More... | |
float | getTempFlag () const |
Get temperature of shutter flag. More... | |
float | getTempBox () const |
Get temperature of housing. More... | |
float | getTempChip () const |
Get temperature of chip. More... | |
void | enableChipHeating (bool enable) |
Enable heating of bolometers. More... | |
bool | isChipHeatingEnabled () const |
Get state of bolometers heating. More... | |
void | setTempChipReference (float t) |
Set reference input of bolometer heating (limited to +20° - 55°). More... | |
float | getTempChipReference () const |
Get reference input of bolometer heating. More... | |
void | setRadiationParameters (float emissivity, float transmissivity, float tAmbient=-999.f) |
Set radiation properties, i.e. More... | |
void | setUseMultiThreading (bool useMultiThreading) |
Experimental feature: Use multi-threading to accelerate process call. More... | |
bool | setFocusmotorPos (float pos) |
Set the position of the focusmotor. More... | |
float | getFocusmotorPos () const |
Get the position of the focusmotor. More... | |
void | onFlagState (unsigned int flagstate) |
Internal method not to be used by any application. | |
void | onThermalFrameInit (unsigned int width, unsigned int height, unsigned short bitCount, long long avgTimePerFrame) |
Internal method not to be used by any application! | |
void | onThermalFrame (unsigned short *buffer, IRFrameMetadata meta) |
Internal method not to be used by any application! | |
void | onVisibleFrameInit (unsigned int width, unsigned int height) |
Internal method not to be used by any application! | |
void | onVisibleFrame (unsigned char *buffer, IRFrameMetadata meta) |
Internal method not to be used by any application! | |
void | onSnapshotEvent (unsigned short *thermal, unsigned short *energy, unsigned char *rgb, IRFrameMetadata meta, const IRArray< IREventData > &events) |
Internal method not to be used by any application! | |
void | onProcessExit () |
Internal method not to be used by any application! | |
void | activateTrace (bool activate) |
Serialize image. More... | |
void | printTrace (const unsigned int pixelID) |
Print trace record (needs to be activated before) More... | |
void | setClippedFormatPosition (Point p) |
Set the clipped format position. More... | |
Point | getClippedFormatPosition () const |
Get the clipped format position. More... | |
void | setFlagForecast (bool value) |
Enable/Disable the flag forecast. More... | |
bool | getFlagForecast () const |
Returns if flag forecast is enabled/disabled. More... | |
double | getRadialDistortionCorrFact1 () const |
Get the first radial distortion correction factor (r^2). More... | |
void | setRadialDistortionCorrFact1 (double value) |
Set the first (r^2) radial distortion correction factor (Brown's distortion model). More... | |
double | getRadialDistortionCorrFact2 () const |
Get the second radial distortion correction factor (r^4). More... | |
void | setRadialDistortionCorrFact2 (double value) |
Set the second (r^4) radial distortion correction factor (Brown's distortion model). More... | |
void | setRadialDistortionCorr (RadialDistortionCorrectionMode value) |
Set the radial distortion correction mode. More... | |
RadialDistortionCorrectionMode | getRadialDistortionCorr () |
Get the radial distortion correction mode. More... | |
unsigned short | getPifDICount () const |
Get the Pif count of digital input's. More... | |
unsigned short | getPifAICount () const |
Get the Pif count of analog input's. More... | |
unsigned short | getPifDOCount () const |
Get the Pif count of digital output's. More... | |
unsigned short | getPifAOCount () const |
Get the Pif count of analog output's. More... | |
unsigned char | getPifDeviceCount (bool actual) const |
Get the Pif Device Count. More... | |
void | setPifAO (unsigned char channel, float value) |
Set the Pif Analog Output. More... | |
void | setPifDO (unsigned char channel, bool value) |
Set the Pif Digital Output. More... | |
const IRFrameMetadata & | getLastMetadata () |
Returns the last meta data. More... | |
IRPifConfig | getPifConfig () const |
Get the Pif Config object. More... | |
void | setPifConfig (IRPifConfig config) |
Set the Pif Config. More... | |
IRPifConfig | setPifType (IRPifType::Value pifType, unsigned char pifDeviceCount) |
Currently only for Xi80. More... | |
IRPifType::Value | getPifType () const |
Returns the current pif type. More... | |
short | getTemprangeDecimal () const |
Returns the number of decimal places in thermal data. More... | |
void | setReferenceTemperature (float referenceTemperature, float measuredTemperature, float tAmbient=-999.f) |
Set a reference temperature to a known reference source inside the view of the camera to improve camera accuracy. More... | |
Static Public Member Functions | |
static const char *const | getVersion () |
Get libirimager version. | |
Wrapper for PI driver and image processing library.
|
strong |
void evo::IRImager::activateTrace | ( | bool | activate | ) |
Serialize image.
[in] | filename | file name |
[in] | preview | destination buffer for preview data |
[in] | sizePreview | size of destination buffer Activate trace module. If the processing chain needs to be debugged, this trace functionality might help. But be careful: Tracing is not thread safe! Do not use it in applications having more than one camera connected. |
[in] | activate | activation state |
Tchar * evo::IRImager::checkCalibration | ( | ) |
Check existence of calibration file set.
Class instance must be initialized before.
void evo::IRImager::enableChipHeating | ( | bool | enable | ) |
Enable heating of bolometers.
[in] | enable | enable flag |
void evo::IRImager::forceFlagEvent | ( | float | time = 0.f | ) |
Force shutter flag event manually (close/open cycle)
[in] | time | point of time in future in [ms], when flag should be closed |
bool evo::IRImager::getAutoFlag | ( | ) | const |
Get flag automatic.
long long evo::IRImager::getAvgTimePerFrame | ( | ) | const |
Get average time per frame.
unsigned short evo::IRImager::getBitCount | ( | ) | const |
Get # of bits used for temperature coding.
Point evo::IRImager::getClippedFormatPosition | ( | ) | const |
Get the clipped format position.
Returns uint max if not set previously.
[out] | Current | clipped format position |
int evo::IRImager::getEnergyBuffer | ( | unsigned short * | buffer | ) | const |
Get energy buffer of previously acquired frame.
[out] | Output | buffer (needs to be allocated outside having the size of getWidth()*getHeight()) |
bool evo::IRImager::getFlagForecast | ( | ) | const |
Returns if flag forecast is enabled/disabled.
float evo::IRImager::getFlagMaxInterval | ( | ) | const |
Get flag max interval.
float evo::IRImager::getFlagMinInterval | ( | ) | const |
Get flag min interval.
float evo::IRImager::getFocusmotorPos | ( | ) | const |
Get the position of the focusmotor.
[out] | fucos | motor position in % (< 0 if no focusmotor available) |
unsigned int evo::IRImager::getFWRevision | ( | ) | const |
Get firmware revision.
unsigned int evo::IRImager::getHeight | ( | ) | const |
Get image height of thermal channel.
unsigned int evo::IRImager::getHeightIn | ( | ) | const |
Get height of raw format (from UVC stream)
float evo::IRImager::getHWInterval | ( | ) | const |
Get time interval between hardware frames (camera timestamp)
unsigned int evo::IRImager::getHWRevision | ( | ) | const |
Get hardware revision.
ImageProcessing * evo::IRImager::getImageProcessingChain | ( | ) |
Get pointer to image processing chain.
const IRFrameMetadata & evo::IRImager::getLastMetadata | ( | ) |
Returns the last meta data.
Can be used for polling the PIF-Inputs
int evo::IRImager::getMetaData | ( | unsigned char * | buffer, |
int | size | ||
) | const |
Get meta data container of previously acquired frame.
[out] | Output | buffer |
[in] | size | Size of buffer in bytes |
unsigned short evo::IRImager::getPifAICount | ( | ) | const |
Get the Pif count of analog input's.
unsigned short evo::IRImager::getPifAOCount | ( | ) | const |
Get the Pif count of analog output's.
IRPifConfig evo::IRImager::getPifConfig | ( | ) | const |
Get the Pif Config object.
unsigned char evo::IRImager::getPifDeviceCount | ( | bool | actual | ) | const |
Get the Pif Device Count.
unsigned short evo::IRImager::getPifDICount | ( | ) | const |
Get the Pif count of digital input's.
unsigned short evo::IRImager::getPifDOCount | ( | ) | const |
Get the Pif count of digital output's.
IRPifType::Value evo::IRImager::getPifType | ( | ) | const |
Returns the current pif type.
RadialDistortionCorrectionMode evo::IRImager::getRadialDistortionCorr | ( | ) |
Get the radial distortion correction mode.
[out] | Current | distortion correction mode |
double evo::IRImager::getRadialDistortionCorrFact1 | ( | ) | const |
Get the first radial distortion correction factor (r^2).
[out] | Current | first radial distortion correction factor (r^2) |
double evo::IRImager::getRadialDistortionCorrFact2 | ( | ) | const |
Get the second radial distortion correction factor (r^4).
[out] | Current | second radial distortion correction factor (r^4) |
float evo::IRImager::getTempBox | ( | ) | const |
Get temperature of housing.
float evo::IRImager::getTempChip | ( | ) | const |
Get temperature of chip.
float evo::IRImager::getTempChipReference | ( | ) | const |
Get reference input of bolometer heating.
bool evo::IRImager::getTemperatureTableParameters | ( | double * | t1, |
double * | t3, | ||
double * | tJunct, | ||
short * | e1, | ||
short * | e3, | ||
short * | eJunct, | ||
double * | lambda, | ||
double * | lambda2 | ||
) | const |
Get temperature table parameters @params[out] t1 Temperature for 1st operating point @params[out] t3 Temperature for 2nd operating point @params[out] tJunct Crossover temperature of junction point between both ranges @params[out] e1 Energy of 1st operating point @params[out] e3 Energy of 2nd operating point @params[out] eJunct Energy of tJunct @params[out] lambda Central wave length of the Planck function (standard range for all imagers) @params[out] lambda2 Central wave length of the second range after tJunct (e.g.
for PI1M)
float evo::IRImager::getTempFlag | ( | ) | const |
Get temperature of shutter flag.
short evo::IRImager::getTemprangeDecimal | ( | ) | const |
Returns the number of decimal places in thermal data.
unsigned int evo::IRImager::getVisibleHeight | ( | ) | const |
Get image height of visible channel (if available)
unsigned int evo::IRImager::getVisibleWidth | ( | ) | const |
Get image width of visible channel (if available)
unsigned int evo::IRImager::getWidth | ( | ) | const |
Get image width of thermal channel.
unsigned int evo::IRImager::getWidthIn | ( | ) | const |
Get width of raw format (from UVC stream)
bool evo::IRImager::hasBispectralTechnology | ( | ) | const |
Check if bispectral technology is available.
bool evo::IRImager::init | ( | IRDeviceParams * | params, |
unsigned int | frequency, | ||
unsigned int | width, | ||
unsigned int | height, | ||
bool | useHID, | ||
unsigned short | hwRev = 0 , |
||
unsigned short | fwRev = 0 |
||
) |
Initializing routine, to be called after instantiation.
[in] | params | Device parameters |
[in] | frequency | Frame rate |
[in] | width | Raw image width (differs from thermal image) |
[in] | height | Raw image height (differs from thermal image) |
[in] | useHID | Use HID to control camera. If not, a dummy delegate is being used |
[in] | hwRev | Hardware revision |
[in] | fwRev | Firmware revision |
void evo::IRImager::initRawdataHeader | ( | RawdataHeader & | header | ) | const |
Initialize Rawdata header with camera specific parameters.
[out] | header | Rawdata header |
bool evo::IRImager::isChipHeatingEnabled | ( | ) | const |
Get state of bolometers heating.
bool evo::IRImager::isFlagOpen | ( | ) | const |
void evo::IRImager::printTrace | ( | const unsigned int | pixelID | ) |
Print trace record (needs to be activated before)
[in] | pixelID | ID of pixel, which should be investigated |
void evo::IRImager::process | ( | unsigned char * | buffer, |
void * | arg = NULL |
||
) |
Process raw data.
[in] | buffer | Raw data acquired with getFrame() |
[in] | arg | User-defined data (will be returned with callback methods) |
void evo::IRImager::setAutoFlag | ( | bool | autoFlag | ) |
Set flag automatic.
[in] | autoFlag | true=enable automatic, false=disable automatic |
void evo::IRImager::setClient | ( | IRImagerClient * | client | ) |
Set client as callback receiver.
[in] | client | callback client |
void evo::IRImager::setClippedFormatPosition | ( | Point | p | ) |
Set the clipped format position.
For PI1M only position with x=0 are valid.
[in] | p | Upper left x and y position for clipped area |
void evo::IRImager::setFlagForecast | ( | bool | value | ) |
Enable/Disable the flag forecast.
true,if | flag forecast should be enabled |
void evo::IRImager::setFlagMaxInterval | ( | float | seconds | ) |
Set flag max interval.
[in] | float | maximal interval in seconds |
void evo::IRImager::setFlagMinInterval | ( | float | seconds | ) |
Set flag min interval.
[in] | float | minimal interval in seconds |
void evo::IRImager::setFlagStateCallback | ( | fptrIRFlagState | callback | ) |
Set callback function to be called for changing flag states.
[in] | callback | Pointer to callback function for flag state events |
bool evo::IRImager::setFocusmotorPos | ( | float | pos | ) |
Set the position of the focusmotor.
[in] | pos | fucos motor position in % |
[out] | error | return value; false if no focusmotor is available |
void evo::IRImager::setPifAO | ( | unsigned char | channel, |
float | value | ||
) |
Set the Pif Analog Output.
channel | AO-Channel number starting with 0 |
value | Value to be set. Value is Ampere or Voltage, depends on set AnalogMode of IRPifConfig. |
void evo::IRImager::setPifConfig | ( | IRPifConfig | config | ) |
Set the Pif Config.
config | Config with new pif configuration |
void evo::IRImager::setPifDO | ( | unsigned char | channel, |
bool | value | ||
) |
Set the Pif Digital Output.
channel | DO-Channel number starting with 0 |
value | Value to be set. |
IRPifConfig evo::IRImager::setPifType | ( | IRPifType::Value | pifType, |
unsigned char | pifDeviceCount | ||
) |
Currently only for Xi80.
Set pif type to extern stackable pif or intern
pifType | Type of pif |
pifDeviceCount | Count of pif devices |
void evo::IRImager::setProcessExitCallback | ( | fptrIRProcessEvent | callback | ) |
Set callback function to be called when the process method has finalized its work.
[in] | callback | Pointer to callback function for exit event of process method |
void evo::IRImager::setRadialDistortionCorr | ( | RadialDistortionCorrectionMode | value | ) |
Set the radial distortion correction mode.
[in] | Distortion | correction mode |
void evo::IRImager::setRadialDistortionCorrFact1 | ( | double | value | ) |
Set the first (r^2) radial distortion correction factor (Brown's distortion model).
[in] | First | radial distortion correction factor (r^2) |
void evo::IRImager::setRadialDistortionCorrFact2 | ( | double | value | ) |
Set the second (r^4) radial distortion correction factor (Brown's distortion model).
First factor also needs to be non-zero to enable radial distortion correction.
[in] | Second | radial distortion correction factor (r^4) |
void evo::IRImager::setRadiationParameters | ( | float | emissivity, |
float | transmissivity, | ||
float | tAmbient = -999.f |
||
) |
Set radiation properties, i.e.
emissivity and transmissivity parameters
[in] | emissivity | emissivity of observed object [0;1] |
[in] | transmissivity | transmissivity of observed object [0;1] |
[in] | tAmbient | ambient temperature, setting invalid values (below -273,15 degrees) forces the library to take its own measurement values. |
void evo::IRImager::setReferenceTemperature | ( | float | referenceTemperature, |
float | measuredTemperature, | ||
float | tAmbient = -999.f |
||
) |
Set a reference temperature to a known reference source inside the view of the camera to improve camera accuracy.
[in] | referenceTemperature | Real temperature of reference source |
[in] | measuredTemperature | Measured temperature from camera of reference source |
[in] | tAmbient | Ambient temperature, setting invalid values (below -273,15 degrees) forces the library to take its own measurement values. |
void evo::IRImager::setTempChipReference | ( | float | t | ) |
Set reference input of bolometer heating (limited to +20° - 55°).
The chip temperature can be monitored with getTempChip().
[in] | t | temperature in °C |
bool evo::IRImager::setTempRange | ( | int | tMin, |
int | tMax | ||
) |
Set temperature range.
[in] | tMin | Minimal temperature, e.g. -20, 0, 150 |
[in] | tMax | Maximum temperature, e.g. 100, 250, 900 |
void evo::IRImager::setThermalFrameCallback | ( | fptrIRThermalFrame | callback | ) |
Set callback function to be called for new frames.
[in] | callback | Pointer to callback function for thermal channel |
void evo::IRImager::setThermalFrameEventCallback | ( | fptrIRThermalSnapshot | callback | ) |
Set callback function to be called for PIF or software trigger events.
[in] | callback | Pointer to callback function for events |
void evo::IRImager::setUseMultiThreading | ( | bool | useMultiThreading | ) |
Experimental feature: Use multi-threading to accelerate process call.
[in] | useMultiThreading | Activate/Deactivate multi-threading |
void evo::IRImager::setVisibleFrameCallback | ( | fptrIRVisibleFrame | callback | ) |
Set callback function to be called for new frames.
[in] | callback | Pointer to callback function for visible channel |
void evo::IRImager::setVisibleFrameEventCallback | ( | fptrIRVisibleSnapshot | callback | ) |
Set callback function to be called for PIF or software trigger events.
[in] | callback | Pointer to callback function for events |