Implement Qt OpenCV image processing app
Some checks failed
Build Windows Release / Build Windows x64 Release on Linux (MinGW + Qt + OpenCV) (push) Failing after 2m15s
Some checks failed
Build Windows Release / Build Windows x64 Release on Linux (MinGW + Qt + OpenCV) (push) Failing after 2m15s
This commit is contained in:
16
MainWindow.h
16
MainWindow.h
@@ -7,6 +7,7 @@
|
||||
#include <QPixmap>
|
||||
#include <QScrollArea>
|
||||
#include <QString>
|
||||
#include <functional>
|
||||
|
||||
class QAction;
|
||||
class QMenu;
|
||||
@@ -48,6 +49,8 @@ private Q_SLOTS:
|
||||
void flipVertical();
|
||||
void grayscale();
|
||||
void invertColors();
|
||||
void extractObjects();
|
||||
void classifyImage();
|
||||
void updateZoomFromSlider(int value);
|
||||
|
||||
private:
|
||||
@@ -57,16 +60,21 @@ private:
|
||||
void createCentralWidget();
|
||||
void setImage(const QImage &image, const QString &path = QString());
|
||||
void updateImageView();
|
||||
void updateSingleView(ImageLabel *label, const QImage &image);
|
||||
void setZoomFactor(double factor);
|
||||
void applyTransformedImage(const QImage &image);
|
||||
void applyTransformedImage(const QImage &image, const QString &message = QString());
|
||||
void processImageInThread(const QString &actionName, const QString &doneMessage, const std::function<QImage(QImage)> &processor);
|
||||
void updateActions();
|
||||
bool ensureImageLoaded(const QString &actionName) const;
|
||||
bool writeImageToPath(const QString &path);
|
||||
|
||||
ImageLabel *imageLabel_ = nullptr;
|
||||
QScrollArea *scrollArea_ = nullptr;
|
||||
ImageLabel *originalLabel_ = nullptr;
|
||||
ImageLabel *processedLabel_ = nullptr;
|
||||
QScrollArea *originalScrollArea_ = nullptr;
|
||||
QScrollArea *processedScrollArea_ = nullptr;
|
||||
QSlider *zoomSlider_ = nullptr;
|
||||
|
||||
QImage originalImage_;
|
||||
QImage currentImage_;
|
||||
QString currentPath_;
|
||||
double zoomFactor_ = 1.0;
|
||||
@@ -85,6 +93,8 @@ private:
|
||||
QAction *flipVerticalAction_ = nullptr;
|
||||
QAction *grayscaleAction_ = nullptr;
|
||||
QAction *invertAction_ = nullptr;
|
||||
QAction *extractAction_ = nullptr;
|
||||
QAction *classifyAction_ = nullptr;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
Reference in New Issue
Block a user