iVS3D v2.0.0
Loading...
Searching...
No Matches
cropexport.h
1#ifndef CROPEXPORT_H
2#define CROPEXPORT_H
3
4
5#include "opencv2/core.hpp"
6#include "opencv2/imgproc.hpp"
7#include "ui_cropexport.h"
8#include "view/roiselect.h"
9#include <QGraphicsProxyWidget>
10#include <QDialog>
11#include <QGraphicsScene>
12#include <QGraphicsSceneMouseEvent>
13#include <QGraphicsItem>
14
15
27namespace Ui {
28class CropExport;
29}
30
31class CropExport : public QDialog
32{
33 Q_OBJECT
34
35public:
36 explicit CropExport(QWidget *parent = nullptr);
43 CropExport(QWidget *parent, const cv::Mat* img, QRect roi);
48 void triggerResize();
53 QRect getROI();
54
55protected:
56 void resizeEvent(QResizeEvent *);
57
58
59public slots:
60 void slot_mousePress(QGraphicsSceneMouseEvent *mouseEvent);
61 void slot_mouseMove(QGraphicsSceneMouseEvent *mouseEvent);
62
63private slots:
64 void on_pushButton_abort_clicked();
65 void on_pushButton_crop_clicked();
66
67private:
68 Ui::CropExport *ui;
69 void setSavedROI(QRect roi);
70 QImage qImageFromCvMat(const cv::Mat *input, bool bgr);
71 QPointF start;
72 QPointF end;
73 int clickCounter = 0;
74 roiSelect* m_scene;
75 QGraphicsRectItem* m_rect = nullptr;
76 QRect image;
77 QPoint imageSize;
78 QRect m_oldROI;
79};
80
81#endif // CROPEXPORT_H
The CropExport class is which will open a QDialog on which an roi can be selected.
Definition cropexport.h:32
QRect getROI()
Cuts the drawn QRect to the image borders and returns the modified QRect.
Definition cropexport.cpp:61
void triggerResize()
triggerResize triggers the Resize slot
Definition cropexport.cpp:52
The roiSelect class provides the visual interface for the user to select a ROI and signals this inter...
Definition roiselect.h:18