Increases the contrast of displayed images and exported H.264 video by constraining the image to a minimum and maximum range of pixel values. Provides a histogram to analyze the dynamic range. More...
Public Member Functions | |
PvRangeFilter () | |
Constructor. | |
~PvRangeFilter () | |
Destructor. | |
PvBuffer * | Process (PvBuffer *aBuffer) |
Applies the range filter to an image in a buffer. More... | |
PvResult | GetHistogram (uint32_t *aHistogramPtr, uint32_t aHistogramSize, uint32_t &aMaxValue) |
Retrieves histogram information for the last processed image. More... | |
void | Reset () |
Resets the filter. More... | |
void | AutoConfigure () |
Automatically configures the minimum and maximum thresholds to the lightest and darkest pixel values in the image using the latest histogram information available. | |
bool | IsEnabled () const |
Returns whether the filter is enabled. More... | |
uint8_t | GetDark () const |
Returns the dark threshold for the filter. More... | |
uint8_t | GetLight () const |
Returns the light threshold for the filter. More... | |
void | SetDark (uint8_t aValue) |
Sets the dark threshold for the filter. More... | |
void | SetLight (uint8_t aValue) |
Sets the light threshold for the filter. More... | |
void | SetEnabled (bool aEnabled) |
Sets whether the filter is enabled. More... | |
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... | |
PvBufferConverter & | GetConverter () |
Returns a reference to the internal buffer converter. More... | |
Increases the contrast of displayed images and exported H.264 video by constraining the image to a minimum and maximum range of pixel values. Provides a histogram to analyze the dynamic range.
PvBufferConverter & PvRangeFilter::GetConverter | ( | ) |
Returns a reference to the internal buffer converter.
Before performing range analysis or filtering the input buffer may be converted to a different pixel format. The converter used for this operation can be configured using this method. As an example, a RGB filter could be set or the Bayer interpolation method could be selected.
uint8_t PvRangeFilter::GetDark | ( | ) | const |
Returns the dark threshold for the filter.
PvResult PvRangeFilter::GetHistogram | ( | uint32_t * | aHistogram, |
uint32_t | aHistogramSize, | ||
uint32_t & | aMaxValue | ||
) |
Retrieves histogram information for the last processed image.
Copies the histogram data into an array. The array must be large enough to hold at least 256 elements. Note: If the array is capable of holding more than 256 elements, the eBUS SDK will only fill the first 256 elements of the array.
[out] | aHistogram | Pointer to the array to copy the histogram data to. |
[in] | aHistogramSize | The number of elements in the array. |
[out] | aMaxValue | The highest value stored in the array. |
uint8_t PvRangeFilter::GetLight | ( | ) | const |
Returns the light threshold for the filter.
bool PvRangeFilter::IsEnabled | ( | ) | const |
Returns whether the filter is enabled.
PvResult PvRangeFilter::Load | ( | PvConfigurationReader * | aReader | ) |
Loads the filter configuration from a configuration file.
[in] | aReader | Configuration reader from which to load the filter configuration. |
Applies the range filter to an image in a buffer.
If the filter is disabled, the input buffer is returned. If the filter is enabled, the range filter is applied and a pointer to the buffer containing the processed data is returned.
[in] | aBuffer | Input image buffer. |
void PvRangeFilter::Reset | ( | ) |
Resets the filter.
Disables the filter and resets the minimum and maximum thresholds to 0 and 255.
PvResult PvRangeFilter::Save | ( | PvConfigurationWriter * | aWriter | ) |
Saves the filter configuration to a configuration file.
[in] | aWriter | Configuration writer to which filter configuration is saved. |
void PvRangeFilter::SetDark | ( | uint8_t | aValue | ) |
Sets the dark threshold for the filter.
Must be between 0 and 254 and smaller than the light threshold.
[in] | aValue | New dark threshold. |
void PvRangeFilter::SetEnabled | ( | bool | aEnabled | ) |
Sets whether the filter is enabled.
[in] | aEnabled | Filter enabled. |
void PvRangeFilter::SetLight | ( | uint8_t | aValue | ) |
Sets the light threshold for the filter.
Must be between 1 and 255 and greater than the dark threshold.
[in] | aValue | New light threshold. |
Copyright (c) 2002-2018 Pleora Technologies Inc.
www.pleora.com