IDS peak IPL  v1.6.0
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
}
 
enum  SharpnessROIWeight : uint16_t {
  SharpnessROIWeight::Weak = 0x0021,
  SharpnessROIWeight::Medium = 0x0042,
  SharpnessROIWeight::Strong = 0x0063
}
 
using SharpnessROIList = std::vector< SharpnessROI >
 

Public Member Functions

 Sharpness ()
 
 ~Sharpness ()
 
 Sharpness (const Sharpness &)=delete
 
Sharpness & operator= (const Sharpness &)=delete
 
 Sharpness (Sharpness &&) noexcept
 
Sharpness & operator= (Sharpness &&) noexcept
 
double Measure (const Image &image)
 Measures the sharpness of the given image. The higher the value, the better the sharpness. More...
 
bool IsPixelFormatSupported (PixelFormatName pixelFormatName) const
 Checks if the given pixel format can be used for sharpness measurement. More...
 
std::vector< PixelFormatName > SupportedPixelFormats () const
 Returns a list of supported pixel formats which can be used for shaprness measurement. More...
 
void SetAlgorithm (SharpnessAlgorithm algorithm)
 Sets the algorithm to use for measurement calculation. More...
 
SharpnessAlgorithm Algorithm () const
 Returns the used algorithm for the sharpness measurement. More...
 
Size2D ROIMinSize () const
 Gets the minimum size of a ROI, in which the sharpness is measured. More...
 
void SetROIs (const SharpnessROIList &rois)
 Sets 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...
 
SharpnessROIList ROIs () const
 Gets ROIs in which the sharpness is measured. More...
 

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 less edges will not reach the sharpness value of an image with a lot of edges.

Member Typedef Documentation

◆ SharpnessROIList

Member Enumeration Documentation

◆ SharpnessAlgorithm

Enumerator
Tenengrad 
MeanScore 
HistogramVariance 
Sobel 

◆ SharpnessROIWeight

Enumerator
Weak 
Medium 
Strong 

Constructor & Destructor Documentation

◆ Sharpness() [1/3]

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

◆ ~Sharpness()

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

◆ Sharpness() [2/3]

peak::ipl::Sharpness::Sharpness ( const Sharpness &  )
delete

◆ Sharpness() [3/3]

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

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.
Returns
Relative sharpness value
Exceptions
InvalidPixelFormatpixel format is not supported.
Since
1.6

◆ operator=() [1/2]

Sharpness& peak::ipl::Sharpness::operator= ( const Sharpness &  )
delete

◆ operator=() [2/2]

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

◆ 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 to use 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 &  rect)
inline

Set ROI in which the sharpness is measured.

Parameters
[in]rectRect2D to set.
Since
1.6

◆ SetROIs()

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

Sets 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 shaprness measurement.

Returns
List of supported pixel formats.
Since
1.6

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