05Robot 3.0

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

mat_utils.h
Go to the documentation of this file.
1 //
2 // mat_utils.h
3 // TestApp
4 //
5 // Created by Jakub Tomczyński on 01.09.2017.
6 //
7 //
8
9 #ifndef mat_utils_h
10 #define mat_utils_h
11
12 #include <opencv2/opencv.hpp>
13 #include <opencv2/highgui/highgui.hpp>
14 #include <opencv2/imgproc/imgproc.hpp>
15
16 #include <QVector>
17 #include <QImage>
18 #ifndef M_PI
19 #define M_PI 3.14159265358979323846
20 #endif
21 #ifndef M_PI_2
22 #define M_PI_2 3.14159265358979323846/2
23 #endif
24 //#define _USE_MATH_DEFINES
25 //QTextStream& operator<<( QTextStream& str, const cv::Mat &data);
26 //QTextStream& operator>>( QTextStream& str, cv::Mat &data);
27
33 QVector<QVector<double> > Mat_to_QVector2D(const cv::Mat &input);
39 cv::Mat QVector2D_to_Mat(const QVector<QVector<double> > &input, int type=CV_64F);
45 QImage Mat_to_QImage(const cv::Mat &input);
46
53 bool is_inside_rectangle(cv::RotatedRect rectangle, cv::Point2d point);
54
61 QStringList split_with_escape(QString input, char separator=',', char escape_char='\\');
62
63 #endif /* mat_utils_h */
QVector2D_to_Mat
cv::Mat QVector2D_to_Mat(const QVector< QVector< double > > &input, int type=CV_64F)
Converts row major QVector<QVector<double> > to cv::Mat.
is_inside_rectangle
bool is_inside_rectangle(cv::RotatedRect rectangle, cv::Point2d point)
Checks if point is inside a RotatedRect.
Mat_to_QImage
QImage Mat_to_QImage(const cv::Mat &input)
Converts cv::Mat to QImage.
split_with_escape
QStringList split_with_escape(QString input, char separator=',', char escape_char='\\')
Checks if point is inside a RotatedRect.
Mat_to_QVector2D
QVector< QVector< double > > Mat_to_QVector2D(const cv::Mat &input)
Converts cv::Mat to row major QVector<QVector<double> >