27 std::cout <<
"depth=" << depth <<
" nb pl input=" << v_pl.
size() <<
'\n';
28 if( depth == max_depth )
30 std::vector<CPolyline> v_pl_new;
34 for(
const auto& pl: v_pl ) {
35 auto v_segs = pl.getSegs();
37 auto v_pts = pl.getPts();
38 auto pl1 =
CPolyline( std::vector<Point2d>{ v_pts[0], v_mid[0], v_mid[2] } );
39 auto pl2 =
CPolyline( std::vector<Point2d>{ v_pts[1], v_mid[1], v_mid[0] } );
40 auto pl3 =
CPolyline( std::vector<Point2d>{ v_pts[2], v_mid[2], v_mid[1] } );
43 v_all.push_back( std::make_pair(pld,
img::Color(r,g,b) ) );
45 v_pl_new.push_back(pl1);
46 v_pl_new.push_back(pl2);
47 v_pl_new.push_back(pl3);
50 for(
const auto& e: v_all )
56 std::ostringstream oss;
57 oss <<
"showcase10_" << std::setfill(
'0') << std::setw(2) << depth <<
".svg";
58 im.
write( oss.str() );
void draw(Data &data)
Definition: precision_test_opencv.cpp:184
auto getCenters(const T &vsegs)
Free function, returns middle points of set of segments/circles.
Definition: homog2d.hpp:10743
#define M_PI
Definition: homog2d.hpp:235
auto max_color
Definition: showcase10.cpp:12
Draw parameters, independent of back-end library.
Definition: homog2d.hpp:514
void write(std::string) const
Definition: homog2d.hpp:752
Color type , see DrawParams.
Definition: homog2d.hpp:432
Hmatrix_ & addScale(T k)
Adds the same scale factor to the matrix.
Definition: homog2d.hpp:1878
CPolyline_< HOMOG2D_INUMTYPE > CPolyline
Default polyline type.
Definition: homog2d.hpp:12398
Hmatrix_ & addTranslation(T tx, T ty)
Adds a translation tx,ty to the matrix.
Definition: homog2d.hpp:1830
void clear(Color c=Color(255, 255, 255))
Definition: homog2d.hpp:759
Hmatrix_ & addRotation(T theta)
Adds a rotation with an angle theta (radians) to the matrix.
Definition: homog2d.hpp:1854
void recurseTriangles(std::vector< CPolyline > &v_pl, std::vector< DrawType > &v_all, int max_depth, Homogr &H, img::Image< IM > &im)
Each polyline in the input vector v_pl will be replaced by 3.
Definition: showcase10.cpp:16
size_t size() const
Definition: homog2d.hpp:1375