OpenMouthAnalyser::OpenMouthAnalyser():timeoutTimeMs(10000),isCurrentAlignmentValid(false),openMouthThreshold(2.5)
{
    webcamCapture = WebcamCapture::getInstance();
    faceDetector = new FaceDetector();          //faceDetector对象
    faceAligner = FaceAligner::getInstance();
    QObject::connect(this,SIGNAL(doAlignment(cv::Mat,BoundingBox)),faceAligner,SLOT(doAlignment(cv::Mat,BoundingBox)));
    QObject::connect(faceAligner,SIGNAL(alignmentCompete(cv::Mat_<double>)),this,SLOT(receiveNewAlignment(cv::Mat_<double>)));
}
//构造函数
YawAnalyser::YawAnalyser():totalProgressTimeMS(5000),isCurrentAlignmentValid(false),isOpticalFlowCalculaterBusy(false),sliderPhase(0),isProgressTimeout(false)
{
    this->webcamCapture = WebcamCapture::getInstance();
    this->faceDetector = new FaceDetector();          //faceDetector对象
    faceAligner = FaceAligner::getInstance();
    QObject::connect(this,SIGNAL(doAlignment(cv::Mat,BoundingBox)),faceAligner,SLOT(doAlignment(cv::Mat,BoundingBox)));
    QObject::connect(faceAligner,SIGNAL(alignmentCompete(cv::Mat_<double>)),this,SLOT(receiveNewAlignment(cv::Mat_<double>)));

    this->opticalFlowCalculater = OpticalFlowCalculater::getInstance();
    QObject::connect(this,SIGNAL(doCalcOpticalFlow(cv::Mat)),this->opticalFlowCalculater,SLOT(doCalc(cv::Mat)));
    QObject::connect(opticalFlowCalculater,SIGNAL(calcCompete(bool,cv::Mat)),this,SLOT(receiveNewOpticalFlow(bool,cv::Mat)));

    this->norm = cv::Mat(600,800, CV_32FC1);//声明光流模的矩阵
    this->phaseAngle = cv::Mat(600,800, CV_32FC1);
    this->zoneMap = cv::Mat(600,800,CV_8UC1);
}
void QGeoTiledMapTextObjectInfo::brushChanged(const QBrush &/*brush*/)
{
    if (textItem) {
        textItem->setBrush(text->brush());
        doAlignment();
        updateItem();
    }
}
void QGeoTiledMapTextObjectInfo::textChanged(const QString &/*text*/)
{
    textItem->setText(text->text());
    doAlignment();
    updateItem();
}
void QGeoTiledMapTextObjectInfo::penChanged(const QPen &/*pen*/)
{
    textItem->setPen(text->pen());
    doAlignment();
    updateItem();
}
void QGeoTiledMapTextObjectInfo::alignmentChanged(Qt::Alignment /*alignment*/)
{
    doAlignment();
    updateItem();
}
void QGeoTiledMapTextObjectInfo::offsetChanged(const QPoint &/*offset*/)
{
    doAlignment();
    updateItem();
}
void QGeoTiledMapTextObjectInfo::fontChanged(const QFont &/*font*/)
{
    textItem->setFont(text->font());
    doAlignment();
    updateItem();
}