IDS peak IPL v1.16.0
Loading...
Searching...
No Matches
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 class  SensitivityLevel {
  Invalid ,
  SensitivityLevel1 ,
  SensitivityLevel2 ,
  SensitivityLevel3 ,
  SensitivityLevel4 ,
  SensitivityLevel5
}
 SensitivityLevel parameter for the HotpixelCorrection algorithm. More...
 

Public Member Functions

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

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 be 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 

default

SensitivityLevel4 
SensitivityLevel5 

Constructor & Destructor Documentation

◆ HotpixelCorrection() [1/3]

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

Constructor for a new HotpixelCorrection instance.

Creates a new HotpixelCorrection instance.

Since
1.0

◆ ~HotpixelCorrection()

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

Destructor for the HotpixelCorrection instance.

Destroys a HotpixelCorrection instance.

Since
1.0

◆ HotpixelCorrection() [2/3]

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

Copy Constructor for a new HotpixelCorrection instance.

Creates a new HotpixelCorrection instance.

Note
This only creates a shallow copy. See Shallow copy (since 1.8) for a detailed explanation.
Parameters
[in]otherThe other instance to acquire a reference for.
Since
1.0 Deleted
1.8 Implemented as shallow copy

◆ HotpixelCorrection() [3/3]

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

Move constructor for HotpixelCorrection instance.

Moves the instance from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move.
Since
1.0

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.
Note
Will not work with packed pixel formats. See Packed pixel format handling for the correct handling of this.
Returns
Corrected image
Exceptions
ImageFormatNotSupportedExceptioninputImage has a 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 a 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.
Note
Will not work with packed pixel formats. See Packed pixel format handling for the correct handling of this.
Returns
Corrected image
Exceptions
ImageFormatNotSupportedExceptioninputImage has a 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 a 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 won't be copied.

Parameters
[in]inputImageThe input image.
Note
Will not work with packed pixel formats. See Packed pixel format handling for the correct handling of this.
Returns
Corrected image
Exceptions
ImageFormatNotSupportedExceptioninputImage has a 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 won't 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.
Note
Will not work with packed pixel formats. See Packed pixel format handling for the correct handling of this.
Returns
Corrected image
Exceptions
ImageFormatNotSupportedExceptioninputImage has a 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 a 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 a 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
the Gain factor in percent
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ operator=() [1/2]

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

Copy assigment for HotpixelCorrection instance.

Acquires a reference from other to this instance. If this instance already has a reference, it will be destroyed.

Note
See Shallow copy (since 1.8) for a detailed explanation.
Parameters
[in]otherThe other instance to acquire a reference for.
Since
1.0 Deleted
1.8 Implemented as shallow copy

◆ operator=() [2/2]

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

Move assignment for HotpixelCorrection instance.

Moves the instance from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move.
Since
1.0

◆ 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: