DGtal  1.5.beta
DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue > Struct Template Reference

#include <DGtal/images/bijectiveRotations/ErrorBijectiveRotation.h>

Public Types

typedef functors::ForwardRigidTransformation2D< TSpace, TInputValue, typename TSpace::RealPoint, functors::IdentityRealRotation
 
typedef std::vector< std::vector< typename TSpace::RealPoint > > VectorField
 
typedef functors::ForwardRigidTransformation2D< TSpace, TInputValue, typename TSpace::RealPoint, functors::IdentityRealRotation
 
typedef std::vector< std::vector< typename TSpace::RealPoint > > VectorField
 

Public Member Functions

 ErrorVectorField (const TBijectiveReflections &reflections, const double theta, const typename TSpace::Point center)
 
VectorField getOutputVectorFieldFromContour (const TDomain &set2dContour, bool continuityVecField=false)
 
 ErrorVectorField (const TBijectiveReflections &reflections, const double theta, const typename TSpace::Point center)
 
VectorField getOutputVectorFieldFromContour (const TDomain &set2dContour, bool continuityVecField=false)
 

Protected Attributes

TBijectiveReflections normalVectors
 
TSpace::Point my_center
 
RealRotation targetRotation
 
RealRotation originCenteredRotation
 

Detailed Description

template<typename TSpace, typename TDomain, typename TBijectiveReflections, typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
struct DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >

Definition at line 44 of file ErrorBijectiveRotation.h.

Member Typedef Documentation

◆ RealRotation [1/2]

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
typedef functors::ForwardRigidTransformation2D<TSpace,TInputValue,typename TSpace::RealPoint,functors::Identity> DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::RealRotation

Definition at line 46 of file ErrorBijectiveRotation.h.

◆ RealRotation [2/2]

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
typedef functors::ForwardRigidTransformation2D<TSpace,TInputValue,typename TSpace::RealPoint,functors::Identity> DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::RealRotation

Definition at line 46 of file ErrorVectorField.h.

◆ VectorField [1/2]

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
typedef std::vector<std::vector<typename TSpace::RealPoint> > DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::VectorField

Definition at line 47 of file ErrorBijectiveRotation.h.

◆ VectorField [2/2]

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
typedef std::vector<std::vector<typename TSpace::RealPoint> > DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::VectorField

Definition at line 47 of file ErrorVectorField.h.

Constructor & Destructor Documentation

◆ ErrorVectorField() [1/2]

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::ErrorVectorField ( const TBijectiveReflections &  reflections,
const double  theta,
const typename TSpace::Point  center 
)
inline

Definition at line 56 of file ErrorBijectiveRotation.h.

56  :normalVectors(reflections),targetRotation(center,theta,{0,0}),my_center(center),originCenteredRotation({0,0},theta,{0,0})
57  {}
TBijectiveReflections normalVectors

◆ ErrorVectorField() [2/2]

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::ErrorVectorField ( const TBijectiveReflections &  reflections,
const double  theta,
const typename TSpace::Point  center 
)
inline

Definition at line 56 of file ErrorVectorField.h.

56  :normalVectors(reflections),targetRotation(center,theta,{0,0}),my_center(center),originCenteredRotation({0,0},theta,{0,0})
57  {}

Member Function Documentation

◆ getOutputVectorFieldFromContour() [1/2]

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
VectorField DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::getOutputVectorFieldFromContour ( const TDomain &  set2dContour,
bool  continuityVecField = false 
)
inline

compute vector of errors for each pixel between either

  • each digitized reflections and the real reflection
  • or the the composition of digitized reflections and the final rotation

Definition at line 62 of file ErrorBijectiveRotation.h.

62  {
63  VectorField outVecField;
64 
65  for (typename TDomain::ConstIterator it = set2dContour.begin(); it != set2dContour.end(); ++it ) {
66  std::vector<typename TSpace::RealPoint> pixelError;
67  typename TSpace::Point p = *it;
68 
69  typename TSpace::Point preflections = normalVectors(p-my_center)+my_center;
70  typename TSpace::RealPoint protation = targetRotation(p);
71 
72  // compute the error field
73  typename TSpace::RealPoint error = protation - preflections ;
74  pixelError.push_back(error);
75 
76  // compute the eucliean rotation of the neighbors of p
77  if(continuityVecField) {
78  // for the 8-Neighbor, compute the rotation
79  for(int veci = -1 ; veci <2 ; ++veci) {
80  for(int vecj = -1 ; vecj<2 ; ++vecj) {
81  if(veci!=0 || vecj!=0){
82  typename TSpace::RealPoint vecij_rot = originCenteredRotation({static_cast<double>(veci),static_cast<double>(vecj)});
83  typename TSpace::RealPoint neigh_rot = protation+vecij_rot;
84  pixelError.push_back(neigh_rot-preflections);
85  }
86 
87  }
88  }
89 
90  }
91 
92 
93  outVecField.push_back(pixelError);
94  }
95  return outVecField;
96  }
MyDigitalSurface::ConstIterator ConstIterator
MessageStream error
std::vector< std::vector< typename TSpace::RealPoint > > VectorField
MyPointD Point
Definition: testClone2.cpp:383
PointVector< 3, double > RealPoint

References DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::my_center, DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::normalVectors, DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::originCenteredRotation, and DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::targetRotation.

Referenced by DGtal::LinfPolicy< TSpace, TDomain, TBijectiveRotation >::evaluate(), DGtal::L2< TSpace, TDomain, TBijectiveRotation >::evaluate(), and DGtal::LcontinuityPolicy< TSpace, TDomain, TBijectiveRotation >::evaluate().

◆ getOutputVectorFieldFromContour() [2/2]

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
VectorField DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::getOutputVectorFieldFromContour ( const TDomain &  set2dContour,
bool  continuityVecField = false 
)
inline

compute vector of errors for each pixel between either

  • each digitized reflections and the real reflection
  • or the the composition of digitized reflections and the final rotation

Definition at line 62 of file ErrorVectorField.h.

62  {
63  VectorField outVecField;
64  // std::cout << "DSL output vector error : normalVectors "<<normalVectors.my_startingAngle<<std::endl;
65  // std::cout << "DSL output vector error : rotation angle "<<normalVectors.my_angle<<std::endl;
66  // std::cout << "input test point = "<<*(set2dContour.begin()+30)<<std::endl;
67  // std::cout << "output double reflections = "<<normalVectors(*(set2dContour.begin()+30)-my_center)+my_center<<std::endl;
68  // std::cout << "output rotation = "<<targetRotation(*(set2dContour.begin()+30))<<std::endl;
69 
70  for (typename TDomain::ConstIterator it = set2dContour.begin(); it != set2dContour.end(); ++it ) {
71  std::vector<typename TSpace::RealPoint> pixelError;
72  typename TSpace::Point p = *it;
73 
74  typename TSpace::Point preflections = normalVectors(p-my_center)+my_center;
75  typename TSpace::RealPoint protation = targetRotation(p);
76 
77  // compute the error field
78  typename TSpace::RealPoint error = protation - preflections ;
79  pixelError.push_back(error);
80 
81  // compute the eucliean rotation of the neighbors of p
82  if(continuityVecField) {
83  // for the 8-Neighbor, compute the rotation
84  for(int veci = -1 ; veci <2 ; ++veci) {
85  for(int vecj = -1 ; vecj<2 ; ++vecj) {
86  if(veci!=0 || vecj!=0){
87  typename TSpace::RealPoint vecij_rot = originCenteredRotation({static_cast<double>(veci),static_cast<double>(vecj)});
88  typename TSpace::RealPoint neigh_rot = protation+vecij_rot;
89  pixelError.push_back(neigh_rot-preflections);
90  }
91 
92  }
93  }
94 
95  }
96 
97 
98  outVecField.push_back(pixelError);
99  }
100 
101  return outVecField;
102  }

References DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::my_center, DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::normalVectors, DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::originCenteredRotation, and DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::targetRotation.

Field Documentation

◆ my_center

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
TSpace::Point DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::my_center
protected

◆ normalVectors

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
TBijectiveReflections DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::normalVectors
protected

◆ originCenteredRotation

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
RealRotation DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::originCenteredRotation
protected

◆ targetRotation

template<typename TSpace , typename TDomain , typename TBijectiveReflections , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
RealRotation DGtal::ErrorVectorField< TSpace, TDomain, TBijectiveReflections, TInputValue, TOutputValue >::targetRotation
protected

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