IDS peak IPL  v1.7.0
peak::ipl::HotpixelCorrection Class Referencefinal

Algorithm for (adaptive) hotpixel detection and correction. More...

#include <peak_ipl/algorithm/peak_ipl_hotpixel_correction.hpp>

Public Types

enum  SensitivityLevel {
  SensitivityLevel::Invalid,
  SensitivityLevel::SensitivityLevel1,
  SensitivityLevel::SensitivityLevel2,
  SensitivityLevel::SensitivityLevel3,
  SensitivityLevel::SensitivityLevel4,
  SensitivityLevel::SensitivityLevel5
}
 SensitivityLevel parameter for the HotpixelCorrection algorithm. More...
 

Public Member Functions

 HotpixelCorrection ()
 
 ~HotpixelCorrection ()
 
 HotpixelCorrection (const HotpixelCorrection &other)=delete
 
HotpixelCorrection & operator= (const HotpixelCorrection &other)=delete
 
 HotpixelCorrection (HotpixelCorrection &&other) noexcept
 
HotpixelCorrection & operator= (HotpixelCorrection &&other) noexcept
 
void SetSensitivity (SensitivityLevel sensitivityLevel=SensitivityLevel::SensitivityLevel3)
 Sets the sensitivity of the hotpixel detection. More...
 
SensitivityLevel Sensitivity () const
 Returns the current sensitivity. More...
 
void SetGainFactorPercent (uint32_t gainFactorPercent=100)
 Sets the gain factor in percent. More...
 
uint32_t GainFactorPercent () const
 Returns the current gain factor in percent. More...
 
std::vector< Point2D > Detect (const Image &inputImage) const
 Detects hotpixels in the given image. More...
 
Image Correct (const Image &inputImage, const std::vector< Point2D > &hotpixels) const
 Corrects the given hotpixels in the given image. More...
 
Image & CorrectInPlace (Image &inputImage, const std::vector< Point2D > &hotpixels) const
 Corrects the given hotpixels inplace in the given image. More...
 
Image CorrectAdaptive (const Image &inputImage)
 Corrects the given image adaptively. More...
 
Image & CorrectAdaptiveInPlace (Image &inputImage)
 Corrects the given image inplace adaptively. More...
 

Detailed Description

Algorithm for (adaptive) hotpixel detection and correction.

This algorithm corrects hotpixels either manually by correcting a predefined list of pixels or adaptively by automatically updating the list of pixels to correct. In manual mode, pass a list of hotpixels to Correct(). The hotpixels can obtained using Detect(), or from a different source, e.g. retrieved directly from the camera from an initial hotpixel calibration. In adaptive mode, just keep passing new images to CorrectAdaptive(). Hotpixels are then detected and corrected automatically.

Member Enumeration Documentation

◆ SensitivityLevel

SensitivityLevel parameter for the HotpixelCorrection algorithm.

Higher sensitivity levels mean more hotpixels will be detected and corrected, but can also lead to more false-positives.

Enumerator
Invalid 
SensitivityLevel1 
SensitivityLevel2 
SensitivityLevel3 
SensitivityLevel4 
SensitivityLevel5 

Constructor & Destructor Documentation

◆ HotpixelCorrection() [1/3]

peak::ipl::HotpixelCorrection::HotpixelCorrection ( )
inline

◆ ~HotpixelCorrection()

peak::ipl::HotpixelCorrection::~HotpixelCorrection ( )
inline

◆ HotpixelCorrection() [2/3]

peak::ipl::HotpixelCorrection::HotpixelCorrection ( const HotpixelCorrection &  other)
delete

◆ HotpixelCorrection() [3/3]

peak::ipl::HotpixelCorrection::HotpixelCorrection ( HotpixelCorrection &&  other)
inlinenoexcept

Member Function Documentation

◆ Correct()

Image peak::ipl::HotpixelCorrection::Correct ( const Image &  inputImage,
const std::vector< Point2D > &  hotpixels 
) const
inline

Corrects the given hotpixels in the given image.

Pass a list of hotpixels, either returned by Detect(), or from a different source (e.g. retrieved directly from the camera from an initial hotpixel calibration).

Parameters
[in]inputImageThe input image.
[in]hotpixelsThe list of hotpixels to be corrected.
Returns
Corrected image
Exceptions
ImageFormatNotSupportedExceptioninputImage has packed pixel format
OutOfRangeExceptioninputImage is too small to process correctly
ExceptionAn internal error has occurred.
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if inputImage has packed pixel format
1.6 Will throw OutOfRangeException if inputImage is too small to be processed correctly

◆ CorrectAdaptive()

Image peak::ipl::HotpixelCorrection::CorrectAdaptive ( const Image &  inputImage)
inline

Corrects the given image adaptively.

For each new passed to this method, first the list of hotpixels is adapted, then all pixels in the adapted hotpixel list are corrected.

Parameters
[in]inputImageThe input image.
Returns
Corrected image
Exceptions
ImageFormatNotSupportedExceptioninputImage has packed pixel format
OutOfRangeExceptioninputImage is too small to process correctly
ExceptionAn internal error has occurred.
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if inputImage has packed pixel format
1.6 Will throw OutOfRangeException if inputImage is too small to be processed correctly

◆ CorrectAdaptiveInPlace()

Image & peak::ipl::HotpixelCorrection::CorrectAdaptiveInPlace ( Image &  inputImage)
inline

Corrects the given image inplace adaptively.

For each new passed to this method, first the list of hotpixels is adapted, then all pixels in the adapted hotpixel list are corrected. The image will not be copied.

Parameters
[in]inputImageThe input image.
Returns
Corrected image
Exceptions
ImageFormatNotSupportedExceptioninputImage has packed pixel format
OutOfRangeExceptioninputImage is too small to process correctly
ExceptionAn internal error has occurred.
Since
1.7

◆ CorrectInPlace()

Image & peak::ipl::HotpixelCorrection::CorrectInPlace ( Image &  inputImage,
const std::vector< Point2D > &  hotpixels 
) const
inline

Corrects the given hotpixels inplace in the given image.

Pass a list of hotpixels, either returned by Detect(), or from a different source (e.g. retrieved directly from the camera from an initial hotpixel calibration). The image will not be copied and the hotpixel will be corrected within the given image.

Parameters
[in]inputImageThe input image.
[in]hotpixelsThe list of hotpixels to be corrected.
Returns
Corrected image
Exceptions
ImageFormatNotSupportedExceptioninputImage has packed pixel format
OutOfRangeExceptioninputImage is too small to process correctly
ExceptionAn internal error has occurred.
Since
1.7

◆ Detect()

std::vector< Point2D > peak::ipl::HotpixelCorrection::Detect ( const Image &  inputImage) const
inline

Detects hotpixels in the given image.

Parameters
[in]inputImageThe input image.
Returns
List of detected hotpixels
Exceptions
ImageFormatNotSupportedExceptioninputImage has packed pixel format
OutOfRangeExceptioninputImage is too small to process correctly
ExceptionAn internal error has occurred.
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if inputImage has packed pixel format
1.6 Will throw OutOfRangeException if inputImage is too small to be processed correctly

◆ GainFactorPercent()

uint32_t peak::ipl::HotpixelCorrection::GainFactorPercent ( ) const
inline

Returns the current gain factor in percent.

Returns
Gain factor in percent
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ operator=() [1/2]

HotpixelCorrection& peak::ipl::HotpixelCorrection::operator= ( const HotpixelCorrection &  other)
delete

◆ operator=() [2/2]

HotpixelCorrection & peak::ipl::HotpixelCorrection::operator= ( HotpixelCorrection &&  other)
inlinenoexcept

◆ Sensitivity()

HotpixelCorrection::SensitivityLevel peak::ipl::HotpixelCorrection::Sensitivity ( ) const
inline

Returns the current sensitivity.

Returns
SensitivityLevel
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ SetGainFactorPercent()

void peak::ipl::HotpixelCorrection::SetGainFactorPercent ( uint32_t  gainFactorPercent = 100)
inline

Sets the gain factor in percent.

Parameters
[in]gainFactorPercentThe gain factor in percent to set.
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ SetSensitivity()

void peak::ipl::HotpixelCorrection::SetSensitivity ( SensitivityLevel  sensitivityLevel = SensitivityLevel::SensitivityLevel3)
inline

Sets the sensitivity of the hotpixel detection.

Parameters
[in]sensitivityLevelThe sensitivity level to set.
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

The documentation for this class was generated from the following file: