mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 23:56:29 +02:00
Merge remote-tracking branch 'upstream/master' into particles
This commit is contained in:
commit
28dd38c013
3 changed files with 8 additions and 3 deletions
|
@ -1788,6 +1788,7 @@ void Application::initMenu() {
|
||||||
_testPing->setChecked(true);
|
_testPing->setChecked(true);
|
||||||
(_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true);
|
(_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true);
|
||||||
optionsMenu->addAction("Webcam", &_webcam, SLOT(setEnabled(bool)))->setCheckable(true);
|
optionsMenu->addAction("Webcam", &_webcam, SLOT(setEnabled(bool)))->setCheckable(true);
|
||||||
|
optionsMenu->addAction("Toggle Skeleton Tracking", &_webcam, SLOT(setSkeletonTrackingOn(bool)))->setCheckable(true);
|
||||||
optionsMenu->addAction("Cycle Webcam Send Mode", _webcam.getGrabber(), SLOT(cycleVideoSendMode()));
|
optionsMenu->addAction("Cycle Webcam Send Mode", _webcam.getGrabber(), SLOT(cycleVideoSendMode()));
|
||||||
optionsMenu->addAction("Go Home", this, SLOT(goHome()));
|
optionsMenu->addAction("Go Home", this, SLOT(goHome()));
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ int jointVectorMetaType = qRegisterMetaType<JointVector>("JointVector");
|
||||||
int matMetaType = qRegisterMetaType<Mat>("cv::Mat");
|
int matMetaType = qRegisterMetaType<Mat>("cv::Mat");
|
||||||
int rotatedRectMetaType = qRegisterMetaType<RotatedRect>("cv::RotatedRect");
|
int rotatedRectMetaType = qRegisterMetaType<RotatedRect>("cv::RotatedRect");
|
||||||
|
|
||||||
Webcam::Webcam() : _enabled(false), _active(false), _colorTextureID(0), _depthTextureID(0) {
|
Webcam::Webcam() : _enabled(false), _active(false), _colorTextureID(0), _depthTextureID(0), _skeletonTrackingOn(false) {
|
||||||
// the grabber simply runs as fast as possible
|
// the grabber simply runs as fast as possible
|
||||||
_grabber = new FrameGrabber();
|
_grabber = new FrameGrabber();
|
||||||
_grabber->moveToThread(&_grabberThread);
|
_grabber->moveToThread(&_grabberThread);
|
||||||
|
@ -197,7 +197,7 @@ void Webcam::setFrame(const Mat& color, int format, const Mat& depth, float midF
|
||||||
_aspectRatio = aspectRatio;
|
_aspectRatio = aspectRatio;
|
||||||
_faceRect = faceRect;
|
_faceRect = faceRect;
|
||||||
_sending = sending;
|
_sending = sending;
|
||||||
_joints = joints;
|
_joints = _skeletonTrackingOn ? joints : JointVector();
|
||||||
_frameCount++;
|
_frameCount++;
|
||||||
|
|
||||||
const int MAX_FPS = 60;
|
const int MAX_FPS = 60;
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
FrameGrabber* getGrabber() { return _grabber; }
|
FrameGrabber* getGrabber() { return _grabber; }
|
||||||
|
|
||||||
bool isActive() const { return _active; }
|
bool isActive() const { return _active; }
|
||||||
|
|
||||||
bool isSending() const { return _sending; }
|
bool isSending() const { return _sending; }
|
||||||
|
|
||||||
GLuint getColorTextureID() const { return _colorTextureID; }
|
GLuint getColorTextureID() const { return _colorTextureID; }
|
||||||
|
@ -62,13 +63,14 @@ public:
|
||||||
const JointVector& getEstimatedJoints() const { return _estimatedJoints; }
|
const JointVector& getEstimatedJoints() const { return _estimatedJoints; }
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
void renderPreview(int screenWidth, int screenHeight);
|
void renderPreview(int screenWidth, int screenHeight);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void setEnabled(bool enabled);
|
void setEnabled(bool enabled);
|
||||||
void setFrame(const cv::Mat& color, int format, const cv::Mat& depth, float midFaceDepth,
|
void setFrame(const cv::Mat& color, int format, const cv::Mat& depth, float midFaceDepth,
|
||||||
float aspectRatio, const cv::RotatedRect& faceRect, bool sending, const JointVector& joints);
|
float aspectRatio, const cv::RotatedRect& faceRect, bool sending, const JointVector& joints);
|
||||||
|
void setSkeletonTrackingOn(bool toggle) { _skeletonTrackingOn = toggle; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -95,6 +97,8 @@ private:
|
||||||
glm::vec3 _estimatedPosition;
|
glm::vec3 _estimatedPosition;
|
||||||
glm::vec3 _estimatedRotation;
|
glm::vec3 _estimatedRotation;
|
||||||
JointVector _estimatedJoints;
|
JointVector _estimatedJoints;
|
||||||
|
|
||||||
|
bool _skeletonTrackingOn;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FrameGrabber : public QObject {
|
class FrameGrabber : public QObject {
|
||||||
|
|
Loading…
Reference in a new issue