CVB++ 14.1
Cvb::Foundation::Edge Namespace Reference

Collection of functions for edge detection. More...

Classes

class  EdgeResult
 Edge search result More...
 
class  EdgeResultPair
 A pair of found edges. More...
 
class  Projection
 Projection that the Edge analysis of Common Vision Blox is using. More...
 
class  ProjectionValue
 Single projection value. More...
 

Typedefs

typedef std::shared_ptr< ProjectionProjectionPtr
 Convenience shared pointer for Projection.
 

Enumerations

enum class  EdgeSearchMode {
  Intensity , IntensitySubPixel , Contrast , ContrastSubPixel ,
  SecondDerivativeSubPixel
}
 Determines the algorithm for finding an edge. More...
 
enum class  EdgeType { Ignore = CExports::POLARITY_DONT_CARE , Positive = CExports::POLARITY_POSITIVE , Negative = CExports::POLARITY_NEGATIVE }
 Type of the edges to be searched. More...
 
enum class  ProjectionMode { Average , Sum }
 Options affecting the result of the projection. More...
 

Functions

bool operator!= (const EdgeResult &lhs, const EdgeResult &rhs) noexcept
 Comparison operator for EdgeResult objects. More...
 
bool operator== (const EdgeResult &lhs, const EdgeResult &rhs) noexcept
 Comparison operator for EdgeResult objects. More...
 
EdgeResult FindFirstEdge (const ImagePlane &plane, EdgeSearchMode mode, EdgeType type, double threshold, Area2D aoi, double density=1.0)
 Find the first edge (as specified) in the aoi. More...
 
EdgeResult FindFirstEdge (const ImagePlane &plane, EdgeSearchMode mode, EdgeType type, double threshold, double density=1.0)
 Find the first edge (as specified) in the whole plane. More...
 
EdgeResultPair FindEdgePair (const ImagePlane &plane, EdgeSearchMode mode, EdgeType type1, double threshold1, EdgeType type2, double threshold2, Area2D aoi, double density=1.0)
 Find an edge pair (as specified) in the aoi. More...
 
EdgeResultPair FindEdgePair (const ImagePlane &plane, EdgeSearchMode mode, EdgeType type1, double threshold1, EdgeType type2, double threshold2, double density=1.0)
 Find an edge pair (as specified) in the whole plane. More...
 
EdgeResultPair FindEdgePair (const ImagePlane &plane, EdgeSearchMode mode, EdgeType type1, EdgeType type2, double threshold, Area2D aoi, double density=1.0)
 Find an edge pair (as specified) in the aoi. More...
 
EdgeResultPair FindEdgePair (const ImagePlane &plane, EdgeSearchMode mode, EdgeType type1, EdgeType type2, double threshold, double density=1.0)
 Find an edge pair (as specified) in the whole plane. More...
 
std::vector< EdgeResultFindAllEdges (const ImagePlane &plane, EdgeSearchMode mode, EdgeType type, double threshold, Area2D aoi, double density=1.0)
 Find all edges inside the aoi. More...
 
std::vector< EdgeResultFindAllEdges (const ImagePlane &plane, EdgeSearchMode mode, EdgeType type, double threshold, double density=1.0)
 Find all edges inside the whole plane. More...
 
EdgeResult FindBestEdge (const ImagePlane &plane, EdgeType type, Area2D aoi, double density=1.0)
 Use the 2nd derivative method to find the edge with the highest intensity in the area of interest. More...
 
EdgeResult FindBestEdge (const ImagePlane &plane, EdgeType type, double density=1.0)
 Use the 2nd derivative method to find the edge with the highest intensity in the whole plane. More...
 
void WriteProjection (const ImagePlane &plane, Area2D aoi, double density=1.0)
 Write the projection that Edge is using internally as the basis for its calculations into an image plane (might be useful for debugging). More...
 

Detailed Description

Collection of functions for edge detection.

Remarks
CMake users: Link to imported target CVB::CvbFoundationEdge

Enumeration Type Documentation

◆ EdgeSearchMode

enum class EdgeSearchMode
strong

Determines the algorithm for finding an edge.

Enumerator
Intensity 

Find edges based on absolute intensities in the image.

In this mode, the edge quality directly corresponds to the difference in intensity across the edge.

IntensitySubPixel 

Like Intensity, but with sub pixel accuracy.

Contrast 

Find edges based on the contrasts in the image (1st derivative of the gray values).

ContrastSubPixel 

Like Contrast, but with sub pixel accuracy.

SecondDerivativeSubPixel 

Find edges based on the 2nd derivative of the intensities with sub pixel accuracy.

Note that in this mode edge qualities are usually much lower than 10.

◆ EdgeType

enum class EdgeType
strong

Type of the edges to be searched.

Enumerator
Ignore 

Used for EdgeResult::Nothing and with the 2nd derivative edge detection functions.

Positive 

Intensities increase along the scan direction.

Negative 

Intensities decrease along the scan direction.

◆ ProjectionMode

enum class ProjectionMode
strong

Options affecting the result of the projection.

Enumerator
Average 

Projection value is the average value per projection line.

Sum 

Projection value is the sum of all gray values per projection line.

Function Documentation

◆ FindAllEdges() [1/2]

std::vector< EdgeResult > FindAllEdges ( const ImagePlane plane,
EdgeSearchMode  mode,
EdgeType  type,
double  threshold,
Area2D  aoi,
double  density = 1.0 
)
inline

Find all edges inside the aoi.

Parameters
[in]planePlane in which to search.
[in]modeSearch mode to use.
[in]typeType of edge to be searched for.
[in]thresholdThreshold to apply.
[in]aoiArea to scan.
[in]densitySearch density to use where 1.0 means scanning all pixels.
Returns
Found edges.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FindAllEdges() [2/2]

std::vector< EdgeResult > FindAllEdges ( const ImagePlane plane,
EdgeSearchMode  mode,
EdgeType  type,
double  threshold,
double  density = 1.0 
)
inline

Find all edges inside the whole plane.

Parameters
[in]planePlane in which to search.
[in]modeSearch mode to use.
[in]typeType of edge to be searched for.
[in]thresholdThreshold to apply.
[in]densitySearch density to use where 1.0 means scanning all pixels.
Returns
Found edges.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FindBestEdge() [1/2]

EdgeResult FindBestEdge ( const ImagePlane plane,
EdgeType  type,
Area2D  aoi,
double  density = 1.0 
)
inline

Use the 2nd derivative method to find the edge with the highest intensity in the area of interest.

Parameters
[in]planePlane to scan.
[in]typeType of edge to be searched for.
[in]aoiArea to scan.
[in]densityDensity at which to scan the aoi where 1.0 means scanning all pixels.
Returns
The best result (or EdgeResult::Nothing() if nothing was found e.g. because the area is outside the image).
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FindBestEdge() [2/2]

EdgeResult FindBestEdge ( const ImagePlane plane,
EdgeType  type,
double  density = 1.0 
)
inline

Use the 2nd derivative method to find the edge with the highest intensity in the whole plane.

Parameters
[in]planePlane to scan.
[in]typeType of edge to be searched for.
[in]densityDensity at which to scan the plane where 1.0 means scanning all pixels.
Returns
The best result (or EdgeResult::Nothing() if nothing was found e.g. because the area is outside the image).
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FindEdgePair() [1/4]

EdgeResultPair FindEdgePair ( const ImagePlane plane,
EdgeSearchMode  mode,
EdgeType  type1,
double  threshold1,
EdgeType  type2,
double  threshold2,
Area2D  aoi,
double  density = 1.0 
)
inline

Find an edge pair (as specified) in the aoi.

Parameters
[in]planePlane to search in.
[in]modeSearch mode.
[in]type1Type of edge to be searched for.
[in]threshold1Threshold to apply when looking for the first edge (left to right in the aoi).
[in]type2Type of edge to be searched for.
[in]threshold2Threshold to apply when looking for the second edge (right to left in the aoi).
[in]aoiArea to scan.
[in]densityDensity at which to scan the aoi where 1.0 means scanning all pixels.
Returns
Search results (containing EdgeResult::Nothing() if not found).
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FindEdgePair() [2/4]

EdgeResultPair FindEdgePair ( const ImagePlane plane,
EdgeSearchMode  mode,
EdgeType  type1,
double  threshold1,
EdgeType  type2,
double  threshold2,
double  density = 1.0 
)
inline

Find an edge pair (as specified) in the whole plane.

Parameters
[in]planePlane to search in.
[in]modeSearch mode.
[in]type1Type of edge to be searched for.
[in]threshold1Threshold to apply when looking for the first edge (left to right in the plane).
[in]type2Type of edge to be searched for.
[in]threshold2Threshold to apply when looking for the second edge (right to left in the plane).
[in]densityDensity at which to scan the plane where 1.0 means scanning all pixels.
Returns
Search results (containing EdgeResult::Nothing() if not found).
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FindEdgePair() [3/4]

EdgeResultPair FindEdgePair ( const ImagePlane plane,
EdgeSearchMode  mode,
EdgeType  type1,
EdgeType  type2,
double  threshold,
Area2D  aoi,
double  density = 1.0 
)
inline

Find an edge pair (as specified) in the aoi.

Parameters
[in]planePlane to search in.
[in]modeSearch mode.
[in]type1Type of edge to be searched for.
[in]type2Type of edge to be searched for.
[in]thresholdThreshold to apply when looking for for both edges.
[in]aoiArea to scan.
[in]densityDensity at which to scan the aoi where 1.0 means scanning all pixels.
Returns
Search results (containing EdgeResult::Nothing() if not found).
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FindEdgePair() [4/4]

EdgeResultPair FindEdgePair ( const ImagePlane plane,
EdgeSearchMode  mode,
EdgeType  type1,
EdgeType  type2,
double  threshold,
double  density = 1.0 
)
inline

Find an edge pair (as specified) in the whole plane.

Parameters
[in]planePlane to search in.
[in]modeSearch mode.
[in]type1Type of edge to be searched for.
[in]type2Type of edge to be searched for.
[in]thresholdThreshold to apply when looking for for both edges.
[in]densityDensity at which to scan the aoi where 1.0 means scanning all pixels.
Returns
Search results (containing EdgeResult::Nothing() if not found).
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FindFirstEdge() [1/2]

EdgeResult FindFirstEdge ( const ImagePlane plane,
EdgeSearchMode  mode,
EdgeType  type,
double  threshold,
Area2D  aoi,
double  density = 1.0 
)
inline

Find the first edge (as specified) in the aoi.

Parameters
[in]planePlane to search in.
[in]modeSearch mode.
[in]typeType of edge to be searched for.
[in]thresholdEdge threshold to apply.
[in]aoiArea to scan.
[in]densityDensity at which to scan the aoi where 1.0 means scanning all pixels.
Returns
Found edge (or EdgeResult::Nothing() if no edge was found).
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FindFirstEdge() [2/2]

EdgeResult FindFirstEdge ( const ImagePlane plane,
EdgeSearchMode  mode,
EdgeType  type,
double  threshold,
double  density = 1.0 
)
inline

Find the first edge (as specified) in the whole plane.

Parameters
[in]planePlane to search in.
[in]modeSearch mode.
[in]typeType of edge to be searched for.
[in]thresholdEdge threshold to apply.
[in]densityDensity at which to scan the plane where 1.0 means scanning all pixels.
Returns
Found edge (or EdgeResult::Nothing() if no edge was found).
Exceptions
Anyexception derived from std::exception including CvbException.

◆ operator!=()

bool operator!= ( const EdgeResult lhs,
const EdgeResult rhs 
)
inlinenoexcept

Comparison operator for EdgeResult objects.

Parameters
[in]lhsLeft hand side operand.
[in]rhsRight hand side operand.
Returns
True if lhs != rhs, false otherwise.
Exceptions
Doesnot throw any exception.

◆ operator==()

bool operator== ( const EdgeResult lhs,
const EdgeResult rhs 
)
inlinenoexcept

Comparison operator for EdgeResult objects.

Parameters
[in]lhsLeft hand side operand.
[in]rhsRight hand side operand.
Returns
True if lhs == rhs, false otherwise.
Exceptions
Doesnot throw any exception.

◆ WriteProjection()

void WriteProjection ( const ImagePlane plane,
Area2D  aoi,
double  density = 1.0 
)
inline

Write the projection that Edge is using internally as the basis for its calculations into an image plane (might be useful for debugging).

Parameters
[in]planePlane to write the projection to.
[in]aoiArea of interest to project.
[in]densityDensity at which to scan where 1.0 means scanning all pixels.
Exceptions
Anyexception derived from std::exception including CvbException.