Performs image analyse on an image. More...
Public Member Functions | |
PvImageAnalysisMono () | |
Constructor. | |
~PvImageAnalysisMono () | |
Destructor. | |
PvResult | Process (PvBuffer *aBuffer) |
Analyze a buffer. More... | |
PvResult | GetHistogram (uint32_t *aHistogram, int aBufferSize, int &aHistogramSize, uint32_t &aMaxValue) |
Retrieves histogram information about the last processed image. More... | |
double | GetAvg () const |
Average of the pixels in the ROI in the last analyzed image. More... | |
double | GetStdDev () const |
Standard deviation of the pixels in the ROI in the last analyzed image. More... | |
void | GetROI (int &aX, int &aY, int &aWidth, int &aHeight) |
Returns the ROI configured for image analysis. More... | |
void | SetROI (int aX, int aY, int aWidth, int aHeight) |
Sets the ROI used for image analysis. More... | |
void | Reset () |
Resets the configuration and results of the analysis object. | |
PvResult | Load (PvConfigurationReader *aReader) |
Loads the filter configuration from a configuration file. More... | |
PvResult | Save (PvConfigurationWriter *aWriter) |
Saves the filter configuration to a configuration file. More... | |
Performs image analyse on an image.
Call the Process method on a PvBuffer and the use accessors to retrieve information extracted from the image.
double PvImageAnalysisMono::GetAvg | ( | ) | const |
Average of the pixels in the ROI in the last analyzed image.
PvResult PvImageAnalysisMono::GetHistogram | ( | uint32_t * | aHistogram, |
int | aBufferSize, | ||
int & | aHistogramSize, | ||
uint32_t & | aMaxValue | ||
) |
Retrieves histogram information about the last processed image.
Copies the histogram data in a buffer. The buffer has to be 256 items or bigger.
[out] | aHistogram | Pointer to a buffer where to copy the histogram data. |
[in] | aBufferSize | The size of buffer (in uint32_t items count, not bytes) where the histogram data is to be copied. In doubt, use the maximum buffer size: 65536. |
[out] | aHistogramSize | The effective size of the histogram (in items). Dependent on bit-depth of PvBuffer used in Process. |
[out] | aMaxValue | The maximum value for one histogram bin. |
void PvImageAnalysisMono::GetROI | ( | int & | aX, |
int & | aY, | ||
int & | aWidth, | ||
int & | aHeight | ||
) |
Returns the ROI configured for image analysis.
[out] | aX | ROI upper-left corner X coordinate. |
[out] | aY | ROI upper-left corner Y coordinate. |
[out] | aWidth | ROI width in pixels. |
[out] | aHeight | ROI height in pixels. |
double PvImageAnalysisMono::GetStdDev | ( | ) | const |
Standard deviation of the pixels in the ROI in the last analyzed image.
PvResult PvImageAnalysisMono::Load | ( | PvConfigurationReader * | aReader | ) |
Loads the filter configuration from a configuration file.
[in] | aReader | Configuration reader from which to load the filter configuration. |
Analyze a buffer.
Computes the histogram, average, etc. on the input buffer. Use the class properties to retrieve the information about calling this method.
[in] | aBuffer | Input image buffer. |
PvResult PvImageAnalysisMono::Save | ( | PvConfigurationWriter * | aWriter | ) |
Saves the filter configuration to a configuration file.
[in] | aWriter | Configuration writer to which filter configuration is saved. |
void PvImageAnalysisMono::SetROI | ( | int | aX, |
int | aY, | ||
int | aWidth, | ||
int | aHeight | ||
) |
Sets the ROI used for image analysis.
The new ROI is only validated on the next Process call as the width and height of the buffer is unknown at this time.
[in] | aX | ROI upper-left corner X coordinate. |
[in] | aY | ROI upper-left corner Y coordinate. |
[in] | aWidth | ROI width in pixels. |
[in] | aHeight | ROI height in pixels. |
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com