-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwindow.h
82 lines (60 loc) · 1.79 KB
/
mainwindow.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <ros/ros.h>
#include <sensor_msgs/Image.h>
#include <geometry_msgs/Pose2D.h>
#include "./imagecropper/imagecropper.h"
#include <opencv2/opencv.hpp>
#include <QThread>
#include "worker.h"
#include "rapidjson/document.h"
#include "rapidjson/istreamwrapper.h"
#include "rapidjson/ostreamwrapper.h"
#include "rapidjson/writer.h"
using namespace rapidjson;
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
void mousePressEvent(QMouseEvent *event); // add
bool have_crop_img_;
std::string file_path_, config_path_;
void set_template_image(cv::Mat mat, int canny_low=50, int canny_high=100);
Document doc_;
void saveParam();
private slots:
void on_pushButton_clicked();
void on_cropButton_clicked();
void on_horizontalSlider_valueChanged(int value);
void on_horizontalSlider_2_valueChanged(int value);
void on_horizontalSlider_3_valueChanged(int value);
void on_horizontalSlider_4_valueChanged(int value);
void on_doubleSpinBox_valueChanged(double arg1);
private:
Ui::MainWindow *ui;
ros::NodeHandle nh_;
ros::Subscriber string_sub_;
ros::Publisher result_pub_;
void callbackImage(const sensor_msgs::Image::ConstPtr& msg);
ImageCropper *w;
QPixmap pixmap;
cv::Mat template_img_, crop_image_;
cv::Point2f *temp_dots_from_center_;
int temp_dot_num_;
int temp_canny_low_;
int temp_canny_high_;
int search_canny_low_;
int search_canny_high_;
double temp_dot_center_x_;
double temp_dot_center_y_;
double match_ratio_th_;
QThread *thread;
Worker *worker;
};
#endif // MAINWINDOW_H