mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 14:33:31 +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);
|
||||
(_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->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("Go Home", this, SLOT(goHome()));
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ int jointVectorMetaType = qRegisterMetaType<JointVector>("JointVector");
|
|||
int matMetaType = qRegisterMetaType<Mat>("cv::Mat");
|
||||
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
|
||||
_grabber = new FrameGrabber();
|
||||
_grabber->moveToThread(&_grabberThread);
|
||||
|
@ -197,7 +197,7 @@ void Webcam::setFrame(const Mat& color, int format, const Mat& depth, float midF
|
|||
_aspectRatio = aspectRatio;
|
||||
_faceRect = faceRect;
|
||||
_sending = sending;
|
||||
_joints = joints;
|
||||
_joints = _skeletonTrackingOn ? joints : JointVector();
|
||||
_frameCount++;
|
||||
|
||||
const int MAX_FPS = 60;
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
FrameGrabber* getGrabber() { return _grabber; }
|
||||
|
||||
bool isActive() const { return _active; }
|
||||
|
||||
bool isSending() const { return _sending; }
|
||||
|
||||
GLuint getColorTextureID() const { return _colorTextureID; }
|
||||
|
@ -62,13 +63,14 @@ public:
|
|||
const JointVector& getEstimatedJoints() const { return _estimatedJoints; }
|
||||
|
||||
void reset();
|
||||
void renderPreview(int screenWidth, int screenHeight);
|
||||
void renderPreview(int screenWidth, int screenHeight);
|
||||
|
||||
public slots:
|
||||
|
||||
void setEnabled(bool enabled);
|
||||
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);
|
||||
void setSkeletonTrackingOn(bool toggle) { _skeletonTrackingOn = toggle; };
|
||||
|
||||
private:
|
||||
|
||||
|
@ -95,6 +97,8 @@ private:
|
|||
glm::vec3 _estimatedPosition;
|
||||
glm::vec3 _estimatedRotation;
|
||||
JointVector _estimatedJoints;
|
||||
|
||||
bool _skeletonTrackingOn;
|
||||
};
|
||||
|
||||
class FrameGrabber : public QObject {
|
||||
|
|
Loading…
Reference in a new issue