37 #include "DGtal/images/ImageSelector.h"
38 #include "DGtal/images/ImageContainerBySTLVector.h"
39 #include "DGtal/images/ConstImageAdapter.h"
40 #include "DGtal/helpers/StdDefs.h"
41 #include "DGtal/base/Common.h"
42 #include "DGtal/io/readers/PGMReader.h"
43 #include "DGtal/io/writers/GenericWriter.h"
45 #include "DGtal/images/RigidTransformation2D.h"
49 #include "DGtal/images/bijectiverotations/QSH.h"
50 #include "DGtal/images/bijectiverotations/CDLR.h"
51 #include "DGtal/images/bijectiverotations/RBC.h"
52 #include "DGtal/images/bijectiverotations/OTC.h"
53 #include "DGtal/images/bijectiverotations/CBDR.h"
54 #include "DGtal/images/bijectiverotations/Rotationtables.h"
58 using namespace DGtal;
59 using namespace functors;
63 "OTC",
"CBDR",
"CDLR",
"QSH" ,
"RBC"
67 template <
typename TBijectiveRotation>
74 typedef MyDomainTransformer::Bounds Bounds;
80 GrayImage imgGray( my_domain );
81 ColorImage imgColor( my_domain );
83 std::string structName = bijectiveRot.tostring();
87 trace.
info() << bijectiveRot.tostring() << std::endl;
89 auto rotatedImgGray = bijectiveRot.rotateImage(imgGray);
90 auto rotatedImgColor = bijectiveRot.rotateImage(imgColor);
106 typedef MyDomainTransformer::Bounds Bounds;
117 GrayImage imgGray( my_domain );
119 bool isSameTransformedDomain =
true;
120 for (
typename Domain::ConstIterator it = imgGray.domain().begin(); it != imgGray.domain().end(); ++it )
122 Point cdlrLinf = rotCDLRLinf(*it);
123 Point cdlrLinf_withMix = rotCDLRLinf_withMix(*it);
124 isSameTransformedDomain *= (cdlrLinf_withMix==cdlrLinf);
126 return isSameTransformedDomain;
136 typedef MyDomainTransformer::Bounds Bounds;
137 int kmax = 10;
int n = 2;
148 GrayImage imgGray( my_domain );
150 bool isSameTransformedDomain =
true;
151 for (
typename Domain::ConstIterator it = imgGray.domain().begin(); it != imgGray.domain().end(); ++it )
153 Point cbdrLinf = rotCBDRLinf(*it);
154 Point cbdrLinf_withMix = rotCBDRLinf_withMix(*it);
155 isSameTransformedDomain *= (cbdrLinf_withMix==cbdrLinf);
157 return isSameTransformedDomain;
166 typedef MyDomainTransformer::Bounds Bounds;
169 double angle = M_PI_4;
171 const int W=200;
const int H=200;
183 const int n = 3;
const int kmax=15;
194 std::vector< std::vector< int > > tableOTC = DGtal::functions::loadOTCTable<DGtal::SpaceND< 2, DGtal::int32_t >>(
"../tables/",rwidth);
198 bool res = testBijectiveRotations<OTC<DGtal::SpaceND< 2, DGtal::int32_t >>>(rot_OTC) &&
200 testBijectiveRotations<CBDR<DGtal::SpaceND< 2, DGtal::int32_t >>>(rot_CBDR) &&
202 testBijectiveRotations<QSH<DGtal::SpaceND< 2, DGtal::int32_t >>>(rot_QSH);
209 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
CDLR : Rotation with Discrete Line Reflections,.
Iterator for HyperRectDomain.
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
vec since the parameters are the vectors of digitized reflections
CBDR : Composition of Bijective Digitized Reflections,.
Aim: Automatically defines an adequate image type according to the hints given by the user.
OTC : Optimal Transport through Circle bijective rotation.
QSH : Quasi Shears represents a bijective rotation through shears.
RBC : Bijective Rotation through Circles.
TOutputValue center() const
RBC : Bijective Rotation through Circles.
std::vector< std::string > supportedBijectiveRotation
bool testCBDRPolicy(const Point &c, const double angle)
check that CBDR with a Linf error results in the same domain as RDSL with a mix of 1*Linf and 0*Lcont...
bool testBijectiveRotations(TBijectiveRotation &bijectiveRot)
bool testCDLRPolicy(const Point &c, const double angle)
check that RDSL with a Linf error results in the same domain as RDSL with a mix of 1*Linf and 0*Lcont...
double angle(const DGtal::Z2i::RealPoint &point)
ImageContainerBySTLVector< Domain, Value > Image