homog2d library
Functions
tryme2.cpp File Reference
#include "homog2d.hpp"
Include dependency graph for tryme2.cpp:

Functions

template<typename T1 , typename T2 >
void drawPts (Image< SvgImage > &im, const T1 &shape1, const T2 &shape2)
 
int main ()
 

Function Documentation

◆ drawPts()

template<typename T1 , typename T2 >
void drawPts ( Image< SvgImage > &  im,
const T1 &  shape1,
const T2 &  shape2 
)
25 {
26  auto x = shape1.intersects(shape2);
27  if( x() )
28  draw( im, x.get() );
29 }
void draw(Data &data)
Definition: precision_test_opencv.cpp:184
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( )
32 {
33  Image<SvgImage> im(300,250);
34 
35  Line2d li( Point2d(30,50), Point2d(100,80) );
36  li.draw( im, DrawParams().setColor(0,0,250) );
37 
38  FRect r( 40,30,200,180 );
39  auto r2 = Homogr(-5.*M_PI/180.) * r;
40  r2.draw( im, DrawParams().setColor(200,0,0) );
41 
42  Circle cir( 162, 141, 65 );
43  cir.draw( im, DrawParams().setColor(0,250,0) );
44 
45  drawPts( im, li, cir );
46  drawPts( im, li, r2 );
47  drawPts( im, r2, cir );
48 
49  std::cout << im;
50 }
A circle.
Definition: homog2d.hpp:378
Homogr_< HOMOG2D_INUMTYPE > Homogr
Default homography (3x3 matrix) type, uses double as numerical type.
Definition: homog2d.hpp:12382
#define M_PI
Definition: homog2d.hpp:235
void draw(img::Image< img::SvgImage > &im, img::DrawParams dp=img::DrawParams()) const
SVG draw function.
Definition: homog2d.hpp:4414
Draw parameters, independent of back-end library.
Definition: homog2d.hpp:514
void draw(img::Image< cv::Mat > &, img::DrawParams=img::DrawParams()) const
Draw Circle (Opencv implementation)
Definition: homog2d.hpp:11907
Line2d li
Definition: homog2d_test.cpp:4035
Point2d_< HOMOG2D_INUMTYPE > Point2d
Default point type, uses double as numerical type.
Definition: homog2d.hpp:12379
void drawPts(Image< SvgImage > &im, const T1 &shape1, const T2 &shape2)
Definition: tryme2.cpp:24
img::Image< img::SvgImage > im(300, 400)
A Flat Rectangle, modeled by its two opposite points.
Definition: homog2d.hpp:379
Opaque data structure, will hold the image type, depending on back-end library. This type is the one ...
Definition: homog2d.hpp:712
Circle cir
Definition: homog2d_test.cpp:4036
Base class, will be instanciated as Point2d_ or Line2d_.
Definition: homog2d.hpp:365
Here is the call graph for this function: