-
Notifications
You must be signed in to change notification settings - Fork 0
/
imageprocessor.hpp
46 lines (38 loc) · 1.15 KB
/
imageprocessor.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
#ifndef IMAGEPROCESSOR_HPP
#define IMAGEPROCESSOR_HPP
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <QObject>
#include <QtGui>
#include "utils.hpp"
/*!
* \brief The ImageProcessor class
*/
class ImageProcessor : public QObject
{
Q_OBJECT
typedef std::vector<cv::Point> Contour;
typedef std::vector<Contour> Contours;
public:
explicit ImageProcessor(QObject *parent = 0);
QPair<int, double> process(QImage _image);
QPair<int, double> process(cv::Mat &m);
void setLightThreshold(unsigned th);
void setBounds(const QRect& _bounds);
QSize getH_size() const;
void setH_size(const QSize &value);
void testProcessRealData();
void testProcessMarginal();
signals:
void frameChanged(QImage image, Contours contours);
void histogram(QImage hist, int w, double coef);
public slots:
private:
unsigned int lightThreshold;
QRect bounds;
QSize h_size;
double mean(cv::Mat image, Contour contour);
cv::Mat hist(cv::Mat im, const Contours &contours, const std::vector<cv::Vec4i>& h);
};
#endif // IMAGEPROCESSOR_HPP