-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQtOpencvCore.hpp
48 lines (37 loc) · 1.18 KB
/
QtOpencvCore.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef QTOPENCVCORE_HPP
#define QTOPENCVCORE_HPP
#include <string>
#include <QImage>
#include <QPixmap>
#include <QString>
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
namespace QtOpencvCore
{
/**
* @brief This function takes a cv::Mat image and converts it to a QImage
* @param img is a cv::Mat image which will be converted to a QImage
* @return QImage of the cv::Mat image img
*/
QImage img2qimg(cv::Mat& img);
QPixmap img2qpix(cv::Mat& img);
/**
* @brief This function takes a QImage image and converts it to a cv::Mat
* @param qimg is a QImage image which will be converted to a cv::Mat
* @return cv::Mat of the QImage img
*/
cv::Mat qimg2img(QImage const &qimg);
/**
* @brief Converts a QString to a std string
* @param QString to be converted
* @return Std string created from the QString
*/
std::string qstr2str(QString const& qstr);
/**
* @brief Converts a std string to a QString
* @param Std string to be converted
* @return QString created from the std string
*/
QString str2qstr(std::string const& str);
}
#endif // QTOPENCVCORE_HPP