CVB++ 14.1
Projection Class Reference

Projection that the Edge analysis of Common Vision Blox is using. More...

#include <cvb/foundation/edge.hpp>

Public Member Functions

 Projection (const ImagePlane &plane, Area2D aoi, ProjectionMode mode=ProjectionMode::Sum, double density=1.0)
 Create a projection object. More...
 
std::vector< ProjectionValueValues () const
 Retrieve the values of the projection. More...
 
void * Handle () const noexcept
 Classic API PROJECTIONEX handle. More...
 
std::vector< EdgeResultCalculateZeroCrossings ()
 Get all the zero crossings, that are in the projection. More...
 
std::unique_ptr< ProjectionDerive ()
 Create derivative of this projection. More...
 
template<class RANGE >
TypedRange< std::unique_ptr< Projection >, int, RANGE >::type Filter (const RANGE &kernel)
 Filter this projection using a 1D filter kernel. More...
 
std::unique_ptr< ProjectionToAverageProjection ()
 Create a new averaged projection from this one. More...
 
ProjectionMode Mode () const noexcept
 Gets the mode of the projection. More...
 

Static Public Member Functions

static std::unique_ptr< ProjectionCreate (const ImagePlane &plane, Area2D aoi, ProjectionMode mode=ProjectionMode::Sum, double density=1.0)
 Create a projection object. More...
 
static std::unique_ptr< ProjectionFromHandle (HandleGuard< Projection > &&guard, ProjectionMode mode)
 Creates projection from a classic API handle. More...
 

Detailed Description

Projection that the Edge analysis of Common Vision Blox is using.

The projections are what is being used internally inside the Edge finding algorithms and the Projection object may in fact be used to build a customized edge detection.

Constructor & Destructor Documentation

◆ Projection()

Projection ( const ImagePlane plane,
Area2D  aoi,
ProjectionMode  mode = ProjectionMode::Sum,
double  density = 1.0 
)
inline

Create a projection object.

Parameters
[in]planeImage plane to create the projection from.
[in]aoiArea of interest to scan.
[in]modeMode to use.
[in]densityDensity at which to scan. This is a percentage value how many pixels to process: 0.0 means 0% and 1.0 means 100%.
Exceptions
Anyexception derived from std::exception including CvbException.

Member Function Documentation

◆ CalculateZeroCrossings()

std::vector< EdgeResult > CalculateZeroCrossings ( )
inline

Get all the zero crossings, that are in the projection.

Returns
Array containing the zero crossings as vector of EdgeResult.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Create()

static std::unique_ptr< Projection > Create ( const ImagePlane plane,
Area2D  aoi,
ProjectionMode  mode = ProjectionMode::Sum,
double  density = 1.0 
)
inlinestatic

Create a projection object.

Parameters
[in]planeImage plane to create the projection from.
[in]aoiArea of interest to scan.
[in]modeMode to use.
[in]densityDensity at which to scan. This is a percentage value how many pixels to process: 0.0 means 0% and 1.0 means 100%.
Returns
Pointer to the projection object.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Derive()

std::unique_ptr< Projection > Derive ( )
inline

Create derivative of this projection.

Returns
New projection containing the derivative of this projection.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Filter()

TypedRange< std::unique_ptr< Projection >, int, RANGE >::type Filter ( const RANGE &  kernel)
inline

Filter this projection using a 1D filter kernel.

Parameters
[in]kernelFilter kernel to use.
Returns
New projection containing the filtered projection.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FromHandle()

static std::unique_ptr< Projection > FromHandle ( HandleGuard< Projection > &&  guard,
ProjectionMode  mode 
)
inlinestatic

Creates projection from a classic API handle.

Parameters
[in]guardLife time guard for C-API handle.
[in]modeMode to use.
Returns
The projection created from the classic API handle.
Exceptions
Anyexception derived from std::exception including CvbException.

The projection takes ownership of the handle, so you must share it before using this function.

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Classic API PROJECTIONEX handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

◆ Mode()

ProjectionMode Mode ( ) const
inlinenoexcept

Gets the mode of the projection.

Returns
The projection mode.
Exceptions
Doesnot throw any exception.

◆ ToAverageProjection()

std::unique_ptr< Projection > ToAverageProjection ( )
inline

Create a new averaged projection from this one.

Returns
The averaged projection object.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Values()

std::vector< ProjectionValue > Values ( ) const
inline

Retrieve the values of the projection.

Returns
Vector with the projection values.
Exceptions
Anyexception derived from std::exception including CvbException.