IDS peak IPL  v1.9.3
peak::ipl::Sharpness Class Referencefinal

Configure and measure the sharpness of a given image. More...

#include <peak_ipl/algorithm/peak_ipl_sharpness.hpp>

Classes

struct  SharpnessROI
 

Public Types

enum  SharpnessAlgorithm : uint16_t {
  SharpnessAlgorithm::Tenengrad,
  SharpnessAlgorithm::MeanScore,
  SharpnessAlgorithm::HistogramVariance,
  SharpnessAlgorithm::Sobel
}
 Measure Algorithms. More...
 
enum  SharpnessROIWeight : uint16_t {
  SharpnessROIWeight::Weak = 0x0021,
  SharpnessROIWeight::Medium = 0x0042,
  SharpnessROIWeight::Strong = 0x0063
}
 
using SharpnessROIList = std::vector< SharpnessROI >
 

Public Member Functions

 Sharpness ()
 Constructor for a new Sharpness instance. More...
 
 ~Sharpness ()
 Destructor for the Sharpness instance. More...
 
 Sharpness (const Sharpness &other)
 Copy Constructor for a new Sharpness instance. More...
 
Sharpness & operator= (const Sharpness &other)
 Copy assigment for Sharpness instance. More...
 
 Sharpness (Sharpness &&other) noexcept
 Move constructor for Sharpness instance. More...
 
Sharpness & operator= (Sharpness &&other) noexcept
 Move assignment for Sharpness instance. More...
 
double Measure (const Image &image)
 Measures the sharpness of the given image. The higher the value, the better the sharpness. More...
 
void SetAlgorithm (SharpnessAlgorithm algorithm)
 Sets the algorithm used for measurement calculation. More...
 
void SetROIs (const SharpnessROIList &rois)
 Sets the region of interests in which the sharpness is measured. More...
 
void SetROI (const SharpnessROI &roi)
 Set ROI in which the sharpness is measured. More...
 
void SetROI (const Rect2D &roi)
 Set ROI in which the sharpness is measured. More...
 

Public Attributes

 PEAK_IPL_MAYBE_UNUSED = inline bool IsPixelFormatSupported(PixelFormatName pixelFormatName) const
 

Detailed Description

Configure and measure the sharpness of a given image.

The class allows the measurement of the sharpness in a defined ROI of the given image. To get a sharpness value, the edges in the image are evaluated. The sharpness can only be indicated as a relative value, as it depends on the edges in the current image. An image with fewer edges won't reach the sharpness value of an image with a lot of edges.

Member Typedef Documentation

◆ SharpnessROIList

Member Enumeration Documentation

◆ SharpnessAlgorithm

Measure Algorithms.

Enumerator
Tenengrad 

contrast-based sharpness algorithm (convolution)

MeanScore 

contrast-based sharpness algorithm (mean value)

HistogramVariance 

statistics-based sharpness algorithm

Sobel 

contrast-based sharpness algorithm (convolution)

◆ SharpnessROIWeight

Weight for a sharpness roi. The weight influences the sum of the measure. Strong roi have more weight than medium and medium more weight than weak.

Enumerator
Weak 

Weak use of roi for the measurement.

Medium 

Normal use of roi for the measurement.

Strong 

Strong use of roi for the measurement.

Constructor & Destructor Documentation

◆ Sharpness() [1/3]

peak::ipl::Sharpness::Sharpness ( )
inline

Constructor for a new Sharpness instance.

Creates a new Sharpness instance.

Since
1.6

◆ ~Sharpness()

peak::ipl::Sharpness::~Sharpness ( )
inline

Destructor for the Sharpness instance.

Destroys a Sharpness instance.

Since
1.6

◆ Sharpness() [2/3]

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

Copy Constructor for a new Sharpness instance.

Creates a new Sharpness 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.6 Deleted
1.8 Implemented as shallow copy

◆ Sharpness() [3/3]

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

Move constructor for Sharpness instance.

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

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

Member Function Documentation

◆ Measure()

double peak::ipl::Sharpness::Measure ( const Image &  image)
inline

Measures the sharpness of the given image. The higher the value, the better the sharpness.

Parameters
[in]imageThe image to measure the relative sharpness.
Returns
Relative sharpness value
Exceptions
InvalidPixelFormatpixel format isn't supported.
Since
1.6

◆ operator=() [1/2]

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

Copy assigment for Sharpness 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.6 Deleted
1.8 Implemented as shallow copy

◆ operator=() [2/2]

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

Move assignment for Sharpness instance.

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

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

◆ SetAlgorithm()

void peak::ipl::Sharpness::SetAlgorithm ( SharpnessAlgorithm  algorithm)
inline

Sets the algorithm used for measurement calculation.

Since
1.6

◆ SetROI() [1/2]

void peak::ipl::Sharpness::SetROI ( const SharpnessROI &  roi)
inline

Set ROI in which the sharpness is measured.

Parameters
[in]roiSharpnessROI to set.
Since
1.6

◆ SetROI() [2/2]

void peak::ipl::Sharpness::SetROI ( const Rect2D &  roi)
inline

Set ROI in which the sharpness is measured.

Parameters
[in]roiRect2D to set.
Since
1.6

◆ SetROIs()

void peak::ipl::Sharpness::SetROIs ( const SharpnessROIList &  rois)
inline

Sets the region of interests in which the sharpness is measured.

Parameters
[in]roisSharpnessROIList to set.
Since
1.6

Member Data Documentation

◆ PEAK_IPL_MAYBE_UNUSED

peak::ipl::Sharpness::PEAK_IPL_MAYBE_UNUSED = inline bool IsPixelFormatSupported(PixelFormatName pixelFormatName) const

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