05Robot 3.0

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

Processor_PlaneCalibration.h
Go to the documentation of this file.
1
7 #ifndef PROCESSOR_PLANECALIBRATION_H
8 #define PROCESSOR_PLANECALIBRATION_H
9
10 #include "Processor.h"
11
12 #include <opencv2/opencv.hpp>
13 #include <opencv2/highgui/highgui.hpp>
14 #include <opencv2/imgproc/imgproc.hpp>
15 #include <opencv2/calib3d/calib3d.hpp>
16
17 #include <QDebug>
26 class Processor_PlaneCalibration: public Processor
27 {
28 Q_OBJECT
32 ADD_PROPERTY(checkerboard_columns, int)
36 ADD_PROPERTY(checkerboard_rows, int)
40 ADD_PROPERTY(checkerboard_raster, double)
44 ADD_PROPERTY(workspace_x_offset, double)
48 ADD_PROPERTY(workspace_y_offset, double)
52 ADD_PROPERTY(workspace_x_size, double)
56 ADD_PROPERTY(workspace_y_size, double)
60 ADD_PROPERTY(picture_width, int)
64 ADD_PROPERTY(picture_height, int)
65
66 public:
70 Processor_PlaneCalibration() {
71 Processor();
72 inputType = InputTypeMat;
73
74 mode_ = Processor_PlaneCalibration_Mode_Waiting;
75
76 m_checkerboard_columns = 9;
77 m_checkerboard_rows = 6;
78 m_checkerboard_raster = 0.038;
79
80 m_workspace_x_offset = 0.058;
81 m_workspace_y_offset = 0.0535;
82
83 m_workspace_x_size = 0.420;
84 m_workspace_y_size = 0.297;
85
86 m_picture_width = 640;
87 m_picture_height = 480;
88 }
89
90 private:
91 enum Processor_PlaneCalibration_Mode {Processor_PlaneCalibration_Mode_Waiting, Processor_PlaneCalibration_Mode_Acquire, Processor_PlaneCalibration_Mode_Calibrated};
92 Processor_PlaneCalibration_Mode mode_;
93
94 cv::Mat perspective_mat_;
95
96 public:
102 int start();
110 int process(int t1, int t2);
121 int processSpecial(string s);
127 int stop();
128
134 virtual void writeXml(QXmlStreamWriter& stream);
140 virtual void readXml(QXmlStreamReader& stream);
141 };
143 #endif
ADD_PROPERTY
#define ADD_PROPERTY(member, _type)
Definition: common.h:14
Processor_PlaneCalibration::process
int process(int t1, int t2)
Processes frames in input buffer.
Processor
Image processor base class.
Definition: Processor.h:28
Processor_PlaneCalibration::picture_width
int picture_width() const
Gets picture_width property value.
Processor_PlaneCalibration::processSpecial
int processSpecial(string s)
Processes special command.
Processor_PlaneCalibration::workspace_x_size
double workspace_x_size() const
Gets workspace_x_size property value.
Processor_PlaneCalibration::checkerboard_rows
int checkerboard_rows() const
Gets checkerboard_rows property value.
Processor_PlaneCalibration::checkerboard_columns
int checkerboard_columns() const
Gets checkerboard_columns property value.
Processor_PlaneCalibration::workspace_y_offset
double workspace_y_offset() const
Gets workspace_y_offset property value.
Processor_PlaneCalibration::checkerboard_raster
double checkerboard_raster() const
Gets checkerboard_raster property value.
Processor.h
Processor_PlaneCalibration
Perspective correction image processor.
Definition: Processor_PlaneCalibration.h:26
Processor::Processor
Processor()
Starts internal clock.
Definition: Processor.h:36
Processor_PlaneCalibration::readXml
virtual void readXml(QXmlStreamReader &stream)
Reads properties and calibration matrix from XML stream.
Processor_PlaneCalibration::workspace_y_size
double workspace_y_size() const
Gets workspace_y_size property value.
Processor_PlaneCalibration::workspace_x_offset
double workspace_x_offset() const
Gets workspace_x_offset property value.
Processor_PlaneCalibration::stop
int stop()
Stops image processing.
Processor::InputTypeMat
Definition: Processor.h:46
Processor_PlaneCalibration::writeXml
virtual void writeXml(QXmlStreamWriter &stream)
Writes properties and current calibration matrix to XML stream.
Processor_PlaneCalibration::start
int start()
Starts image processing.
Processor_PlaneCalibration::picture_height
int picture_height() const
Gets picture_height property value.
Processor::inputType
InputType inputType
Processor input data type.
Definition: Processor.h:53