IDS peak IPL v1.12.1
Loading...
Searching...
No Matches
peak::ipl::Sharpness Class Referencefinal

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

#include <peak_ipl/algorithm/peak_ipl_sharpness.hpp>

Data Structures

struct  SharpnessROI
 

Public Types

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

Public Member Functions

 Sharpness ()
 Constructor for a new Sharpness instance.
 
 ~Sharpness ()
 Destructor for the Sharpness instance.
 
 Sharpness (const Sharpness &other)
 Copy Constructor for a new Sharpness instance.
 
Sharpness & operator= (const Sharpness &other)
 Copy assigment for Sharpness instance.
 
 Sharpness (Sharpness &&other) noexcept
 Move constructor for Sharpness instance.
 
Sharpness & operator= (Sharpness &&other) noexcept
 Move assignment for Sharpness instance.
 
double Measure (const Image &image)
 Measures the sharpness of the given image. The higher the value, the better the sharpness.
 
bool IsPixelFormatSupported (PixelFormatName pixelFormatName) const
 Checks if the given pixel format can be used for sharpness measurement.
 
std::vector< PixelFormatName > SupportedPixelFormats () const
 Returns a list of supported pixel formats which can be used for sharpness measurement.
 
void SetAlgorithm (SharpnessAlgorithm algorithm)
 Sets the algorithm used for measurement calculation.
 
SharpnessAlgorithm Algorithm () const
 Returns the used algorithm for the sharpness measurement.
 
Size2D ROIMinSize () const
 Gets the minimum size of a ROI, in which the sharpness is measured.
 
void SetROIs (const SharpnessROIList &rois)
 Sets the region of interests in which the sharpness is measured.
 
void SetROI (const SharpnessROI &roi)
 Set ROI in which the sharpness is measured.
 
void SetROI (const Rect2D &roi)
 Set ROI in which the sharpness is measured.
 
SharpnessROIList ROIs () const
 Gets ROIs in which the sharpness is measured.
 

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

enum class peak::ipl::Sharpness::SharpnessAlgorithm : uint16_t
strong

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

enum class peak::ipl::Sharpness::SharpnessROIWeight : uint16_t
strong

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

◆ Algorithm()

Sharpness::SharpnessAlgorithm peak::ipl::Sharpness::Algorithm ( ) const
inline

Returns the used algorithm for the sharpness measurement.

Returns
Current algorithm
Since
1.6

◆ IsPixelFormatSupported()

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

Checks if the given pixel format can be used for sharpness measurement.

Returns
Flag whether the given pixel format is supported.
Parameters
[in]pixelFormatNameThe pixelFormat of the input image.
Since
1.6

◆ 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.
Note
Will not work with packed pixel formats. See Packed pixel format handling for the correct handling of this.
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

◆ ROIMinSize()

Size2D peak::ipl::Sharpness::ROIMinSize ( ) const
inline

Gets the minimum size of a ROI, in which the sharpness is measured.

Returns
Required minimum size of a roi
Since
1.6

◆ ROIs()

Sharpness::SharpnessROIList peak::ipl::Sharpness::ROIs ( ) const
inline

Gets ROIs in which the sharpness is measured.

Returns
Active measurement rois
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 Rect2D &  roi)
inline

Set ROI in which the sharpness is measured.

Parameters
[in]roiRect2D to set.
Since
1.6

◆ SetROI() [2/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

◆ 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

◆ SupportedPixelFormats()

std::vector< PixelFormatName > peak::ipl::Sharpness::SupportedPixelFormats ( ) const
inline

Returns a list of supported pixel formats which can be used for sharpness measurement.

Returns
List of supported pixel formats.
Since
1.6

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