DGtal 1.3.0
No Matches
Public Types | Public Member Functions
DGtal::detail::NormalizedTangentVectorFromDSS Struct Reference

#include <DGtal/geometry/curves/estimation/SegmentComputerEstimators.h>

Public Types

typedef DGtal::PointVector< 2, double > RealVector
typedef RealVector Value

Public Member Functions

template<typename DSS >
Value operator() (const DSS &aDSS) const

Detailed Description

Description of class 'NormalizedTangentVectorFromDSS'

Aim: computes the unit vector of a DSS

Definition at line 715 of file SegmentComputerEstimators.h.

Member Typedef Documentation

◆ RealVector

Definition at line 718 of file SegmentComputerEstimators.h.

◆ Value

Definition at line 719 of file SegmentComputerEstimators.h.

Member Function Documentation

◆ operator()()

template<typename DSS >
Value DGtal::detail::NormalizedTangentVectorFromDSS::operator() ( const DSS &  aDSS) const


normalized tangent
aDSSan instance of segment computer devoted to the DSS recognition.
Template Parameters
DSSa model of segment computer, which must have methods a() and b() returning the y- and x-component of the tangent vector.

Definition at line 734 of file SegmentComputerEstimators.h.

735 {
736 double x = NumberTraits<typename DSS::Integer>
737 ::castToDouble( aDSS.b() );
738 double y = NumberTraits<typename DSS::Integer>
739 ::castToDouble( aDSS.a() );
740 RealVector v(x,y);
741 double norm = v.norm(RealVector::L_2);
742 v /= norm;
743 return v;
744 }

References DGtal::PointVector< 2, double >::L_2.

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