iCub-main
SphericalCalibTool.h
Go to the documentation of this file.
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 /*
4  * Copyright (C) 2007 Jonas Ruesch
5  * CopyPolicy: Released under the terms of the GNU GPL v2.0.
6  *
7  */
8 
9 #ifndef __SPHERICALCALIBTOOL__
10 #define __SPHERICALCALIBTOOL__
11 
12 // yarp
13 //#include <yarp/sig/Image.h>
14 #include <yarp/sig/all.h>
15 #include <yarp/os/Value.h>
16 
17 // opencv
18 #include <opencv2/core/core_c.h>
19 
20 // iCub
21 #include <iCub/ICalibTool.h>
22 #include <iCub/spherical_projection.h>
23 
24 
28 class SphericalCalibTool : public ICalibTool
29 {
30 private:
31 
32  IplImage *_mapX;
33  IplImage *_mapY;
34 
35  double _fx, _fx_scaled;
36  double _fy, _fy_scaled;
37  double _cx, _cx_scaled;
38  double _cy, _cy_scaled;
39  double _p1;
40  double _p2;
41  double _k1;
42  double _k2;
43 
44  bool _needInit;
45 
46  CvSize _calibImgSize;
47  CvSize _oldImgSize;
48 
49  bool _drawCenterCross;
50 
51  bool init(CvSize currImgSize, CvSize calibImgSize);
52 
53 public:
54 
57 
58  virtual bool open (yarp::os::Searchable &config);
59  virtual bool close();
60  virtual bool configure (yarp::os::Searchable &config);
62  void stopConfig( std::string val );
63 
64  // ICalibTool
65  void apply(const yarp::sig::ImageOf<yarp::sig::PixelRgb> & in,
66  yarp::sig::ImageOf<yarp::sig::PixelRgb> & out);
67 };
68 
69 
70 #endif
71 
72 
73 
74 
Interface to calibrate and project input image based on camera's internal parameters and projection m...
Definition: ICalibTool.h:19
Interface to calibrate and spherically project input image .
void apply(const yarp::sig::ImageOf< yarp::sig::PixelRgb > &in, yarp::sig::ImageOf< yarp::sig::PixelRgb > &out)
virtual bool open(yarp::os::Searchable &config)
virtual ~SphericalCalibTool()
void stopConfig(std::string val)
Stop module if there is an unread value.
virtual bool configure(yarp::os::Searchable &config)
virtual bool close()
out
Definition: sine.m:8