Skip to content

Commit

Permalink
Add face tracking and follow
Browse files Browse the repository at this point in the history
  • Loading branch information
mel-florance committed Jul 17, 2022
1 parent 7e6482b commit 1acf343
Show file tree
Hide file tree
Showing 6 changed files with 409 additions and 232 deletions.
2 changes: 1 addition & 1 deletion TelloController.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 7.0.2, 2022-07-16T15:54:48. -->
<!-- Written by QtCreator 7.0.2, 2022-07-17T11:29:05. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
2 changes: 2 additions & 0 deletions include/facedetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define FACEDETECTOR_H

#include <QObject>
#include <QVector3D>

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
Expand All @@ -22,6 +23,7 @@ class FaceDetector : public QObject

signals:
void faceframe(cv::Mat matrix);
void faceoffset(QVector3D& offset);

public slots:
void detect(cv::Mat src);
Expand Down
13 changes: 12 additions & 1 deletion include/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include <QProgressBar>
#include <QThread>
#include <QKeyEvent>
#include <QVector>
#include <QListWidgetItem>
#include <QLabel>

#include "../include/tellocontroller.h"
#include "../include/videoreader.h"
Expand Down Expand Up @@ -72,9 +75,14 @@ private slots:
void on_videoframe(cv::Mat matrix);
void on_record_timer();
void on_alert_timer();
void on_faceoffset(QVector3D& offset);

void on_button_start_recording_clicked();
void on_splitter_splitterMoved(int pos, int index);
void on_button_add_waypoint_clicked();

void on_button_remove_waypoint_clicked();
void on_waypoints_list_itemSelectionChanged();

protected:
void keyPressEvent(QKeyEvent *event) override;
Expand All @@ -90,11 +98,14 @@ private slots:
QThread* face_detector_thread;
EdgeDetector* edge_detector;
FaceDetector* face_detector;
std::unique_ptr<QProgressBar> progress_bar;
std::unique_ptr<QProgressBar> battery_progress_bar;
std::unique_ptr<QProgressBar> wifi_progress_bar;
std::unique_ptr<QProgressBar> temperature_progress_bar;
std::unique_ptr<TelloController> controller;
std::unique_ptr<QTimer> poll_infos_timer;
std::unique_ptr<QTimer> record_timer;
std::unique_ptr<QTimer> alert_timer;
QVector<QListWidgetItem*> waypoints;
bool is_connected;
bool is_video_started;
bool is_flying;
Expand Down
Loading

0 comments on commit 1acf343

Please sign in to comment.