Visual Servoing Platform  version 3.6.1 under development (2024-10-18)
VISP_NAMESPACE_NAME::vpDirection Class Reference

#include <visp3/imgproc/vpContours.h>

Public Member Functions

 vpDirection ()
 
vpDirection clockwise ()
 
vpDirection counterClockwise ()
 
VISP_NAMESPACE_ADDRESSING vpImagePoint active (const VISP_NAMESPACE_ADDRESSING vpImage< int > &I, const VISP_NAMESPACE_ADDRESSING vpImagePoint &point)
 

Public Attributes

vpDirectionType m_direction
 
int m_dirx [8]
 
int m_diry [8]
 

Detailed Description

Direction object.

Definition at line 99 of file vpContours.h.

Constructor & Destructor Documentation

◆ vpDirection()

VISP_NAMESPACE_NAME::vpDirection::vpDirection ( )
inline

Default constructor.

Definition at line 114 of file vpContours.h.

References m_direction, m_dirx, m_diry, and VISP_NAMESPACE_NAME::NORTH.

Member Function Documentation

◆ active()

VISP_NAMESPACE_ADDRESSING vpImagePoint VISP_NAMESPACE_NAME::vpDirection::active ( const VISP_NAMESPACE_ADDRESSING vpImage< int > &  I,
const VISP_NAMESPACE_ADDRESSING vpImagePoint point 
)
inline

Get the next point coordinate along the contour.

Parameters
IImage to process.
pointCurrent point coordinate.
Returns
Next point coordinate along the contour.

Definition at line 172 of file vpContours.h.

References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), m_direction, m_dirx, and m_diry.

Referenced by VISP_NAMESPACE_NAME::followBorder().

◆ clockwise()

vpDirection VISP_NAMESPACE_NAME::vpDirection::clockwise ( )
inline

Turn clockwise to find the next pixel along the contour.

Returns
Direction to take.

Definition at line 143 of file vpContours.h.

References VISP_NAMESPACE_NAME::LAST_DIRECTION, and m_direction.

Referenced by VISP_NAMESPACE_NAME::followBorder().

◆ counterClockwise()

vpDirection VISP_NAMESPACE_NAME::vpDirection::counterClockwise ( )
inline

Turn counter clockwise to find the next pixel along the contour.

Returns
Direction to take.

Definition at line 156 of file vpContours.h.

References VISP_NAMESPACE_NAME::LAST_DIRECTION, m_direction, and vpMath::modulo().

Referenced by VISP_NAMESPACE_NAME::followBorder().

Member Data Documentation

◆ m_direction

◆ m_dirx

int VISP_NAMESPACE_NAME::vpDirection::m_dirx[8]

Pixel increment along x to reach a given direction.

Definition at line 106 of file vpContours.h.

Referenced by active(), and vpDirection().

◆ m_diry

int VISP_NAMESPACE_NAME::vpDirection::m_diry[8]

Pixel increment along y to reach a given direction.

Definition at line 109 of file vpContours.h.

Referenced by active(), and vpDirection().