DGtal  0.9.3
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 716 of file SegmentComputerEstimators.h.

Member Typedef Documentation

◆ RealVector

Definition at line 719 of file SegmentComputerEstimators.h.

◆ Value

Definition at line 720 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 735 of file SegmentComputerEstimators.h.

References DGtal::NumberTraits< T >::castToDouble().

736  {
738  ::castToDouble( aDSS.b() );
740  ::castToDouble( aDSS.a() );
741  RealVector v(x,y);
742  double norm = v.norm(RealVector::L_2);
743  v /= norm;
744  return v;
745  }
static double castToDouble(const T &aT)
Definition: NumberTraits.h:154

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