Lines Matching full:double
61 const double pi = 3.1415926535;
72 inline double CalculateTransformationLMS3_0( CvPoint* pTemplPoints, CvPoint* pSrcPoints);
73 inline double CalculateTransformationLMS3( CvPoint* pTemplPoints,
75 double* pdbAverageScale,
76 double* pdbAverageRotate,
77 double* pdbAverageShiftX,
78 double* pdbAverageShiftY );
111 double dbRotateDelta;
112 double dbRotateAngle;
461 cvTrackFace(CvFaceTracker* pFaceTracker, IplImage* imgGray, CvRect* pRects, int nRects, CvPoint* ptRotate, double* dbAngleRotate)
474 double dx = pFaceTracker->face[LEYE].ptCenter.x - pFaceTracker->face[REYE].ptCenter.x;
475 double dy = pFaceTracker->face[LEYE].ptCenter.y - pFaceTracker->face[REYE].ptCenter.y;
476 double d_eyes = sqrt(dx*dx + dy*dy);
577 double vx_prev = double(pFaceTracker->face[LEYE].ptCenter.x + pFaceTracker->face[REYE].ptCenter.x) / 2.0 - pFaceTracker->face[MOUTH].ptCenter.x;
578 double vy_prev = double(pFaceTracker->face[LEYE].ptCenter.y + pFaceTracker->face[REYE].ptCenter.y) / 2.0 - pFaceTracker->face[MOUTH].ptCenter.y;
579 double vx_prev1 = vx_prev * cos(pFaceTracker->dbRotateDelta) - vy_prev * sin(pFaceTracker->dbRotateDelta);
580 double vy_prev1 = vx_prev * sin(pFaceTracker->dbRotateDelta) + vy_prev * cos(pFaceTracker->dbRotateDelta);
585 double vx = double(pFaceTracker->face[LEYE].ptCenter.x + pFaceTracker->face[REYE].ptCenter.x) / 2.0 - pFaceTracker->face[MOUTH].ptCenter.x;
586 double vy = double(pFaceTracker->face[LEYE].ptCenter.y + pFaceTracker->face[REYE].ptCenter.y) / 2.0 - pFaceTracker->face[MOUTH].ptCenter.y;
588 double n1_n2 = (vx * vx + vy * vy) * (vx_prev * vx_prev + vy_prev * vy_prev);
611 }//int FindFaceTracker(CvFaceTracker* pFaceTracker, IplImage* imgGray, CvRect* pRects, int nRects, CvPoint& ptRotate, double& dbAngleRotate)
648 double black = 1;
649 double white = 1;
758 double templ_d01 = sqrt((double)templ_v01.x*templ_v01.x + templ_v01.y*templ_v01.y);
759 double templ_d02 = sqrt((double)templ_v02.x*templ_v02.x + templ_v02.y*templ_v02.y);
760 double prev_d01 = sqrt((double)prev_v01.x*prev_v01.x + prev_v01.y*prev_v01.y);
761 double prev_d02 = sqrt((double)prev_v02.x*prev_v02.x + prev_v02.y*prev_v02.y);
762 double new_d01 = sqrt((double)new_v01.x*new_v01.x + new_v01.y*new_v01.y);
763 double scale = templ_d01 / new_d01;
764 double new_d02 = templ_d02 / scale;
765 double sin_a = double(prev_v01.x * prev_v02.y - prev_v01.y * prev_v02.x) / (prev_d01 * prev_d02);
766 double cos_a = cos(asin(sin_a));
767 double x = double(new_v01.x) * cos_a - double(new_v01.y) * sin_a;
768 double y = double(new_v01.x) * sin_a + double(new_v01.y) * cos_a;
781 face[element[2]].r.width = int(double(pTF->rTempl[element[2]].width) / (scale) + 0.5);
782 face[element[2]].r.height = int(double(pTF->rTempl[element[2]].height) / (scale) + 0.5);
801 double dx = 0, dy = 0, scale = 1, rotate = 0;
802 double e_templ = CalculateTransformationLMS3(ptTempl, ptNew, &scale, &rotate, &dx, &dy);
803 double e_prev = CalculateTransformationLMS3_0(ptPrev, ptNew);
804 double w_eye = double(ppNew[LEYE]->r.width + ppNew[REYE]->r.width) * scale / 2.0;
805 double h_eye = double(ppNew[LEYE]->r.height + ppNew[REYE]->r.height) * scale / 2.0;
806 double w_mouth = double(ppNew[MOUTH]->r.width) * scale;
807 double h_mouth = double(ppNew[MOUTH]->r.height) * scale;
812 4 * (int)pow(w_eye - double(rTempl[LEYE].width + rTempl[REYE].width) / 2.0, 2) +
813 2 * (int)pow(h_eye - double(rTempl[LEYE].height + rTempl[REYE].height) / 2.0, 2) +
814 1 * (int)pow(w_mouth - double(rTempl[MOUTH].width), 2) +
815 1 * (int)pow(h_mouth - double(rTempl[MOUTH].height), 2) +
826 double new_d = sqrt((double)new_v.x*new_v.x + new_v.y*new_v.y);
827 double prev_d = sqrt((double)prev_v.x*prev_v.x + prev_v.y*prev_v.y);
828 double dx = ptTempl[element[0]].x - ptTempl[element[1]].x;
829 double dy = ptTempl[element[0]].y - ptTempl[element[1]].y;
830 double templ_d = sqrt(dx*dx + dy*dy);
831 double scale_templ = new_d / templ_d;
832 double w0 = (double)ppNew[element[0]]->r.width * scale_templ;
833 double h0 = (double)ppNew[element[0]]->r.height * scale_templ;
834 double w1 = (double
835 double h1 = (double)ppNew[element[1]]->r.height * scale_templ;
839 (int)pow(w0 - (double)rTempl[element[0]].width, 2) +
840 (int)pow(h0 - (double)rTempl[element[0]].height, 2) +
841 (int)pow(w1 - (double)rTempl[element[1]].width, 2) +
842 (int)pow(h1 - (double)rTempl[element[1]].height, 2) +
849 inline double CalculateTransformationLMS3( CvPoint* pTemplPoints,
851 double* pdbAverageScale,
852 double* pdbAverageRotate,
853 double* pdbAverageShiftX,
854 double* pdbAverageShiftY )
856 // double WS = 0;
857 double dbAverageScale = 1;
858 double dbAverageRotate = 0;
859 double dbAverageShiftX = 0;
860 double dbAverageShiftY = 0;
861 double dbLMS = 0;
866 double dbXt = double(pTemplPoints[0].x + pTemplPoints[1].x + pTemplPoints[2].x) / 3.0;
867 double dbYt = double(pTemplPoints[0].y + pTemplPoints[1].y + pTemplPoints[2].y ) / 3.0;
868 double dbXs = double(pSrcPoints[0].x + pSrcPoints[1].x + pSrcPoints[2].x) / 3.0;
869 double dbYs = double(pSrcPoints[0].y + pSrcPoints[1].y + pSrcPoints[2].y) / 3.0;
871 double dbXtXt = double(pow2(pTemplPoints[0].x) + pow2(pTemplPoints[1].x) + pow2(pTemplPoints[2].x)) / 3.0;
872 double dbYtYt = double(pow2(pTemplPoints[0].y) + pow2(pTemplPoints[1].y) + pow2(pTemplPoints[2].y)) / 3.0;
874 double dbXsXs = double(pow2(pSrcPoints[0].x) + pow2(pSrcPoints[1].x) + pow2(pSrcPoints[2].x)) / 3.0;
875 double dbYsYs = double(pow2(pSrcPoints[0].y) + pow2(pSrcPoints[1].y) + pow2(pSrcPoints[2].y)) / 3.0;
877 double dbXtXs = double(pTemplPoints[0].x * pSrcPoints[0].x +
880 double dbYtYs = double(pTemplPoints[0].y * pSrcPoints[0].y +
884 double dbXtYs = double(pTemplPoints[0].x * pSrcPoints[0].y +
887 double dbYtXs = double(pTemplPoints[0].y * pSrcPoints[0].x +
905 double cosR = cos(dbAverageRotate);
906 double sinR = sin(dbAverageRotate);
907 double del = dbXsXs + dbYsYs;
910 dbAverageScale = (double(dbXtXs + dbYtYs) * cosR + double(dbXtYs - dbYtXs) * sinR) / del;
911 dbLMS = dbXtXt + dbYtYt - ((double)pow(dbXtXs + dbYtYs,2) + (double)pow(dbXtYs - dbYtXs,2)) / del;
914 dbAverageShiftX = double(dbXt) - dbAverageScale * (double(dbXs) * cosR + double(dbYs) * sinR);
915 dbAverageShiftY = double(dbYt) - dbAverageScale * (double(dbYs) * cosR - double(dbXs) * sinR);
926 inline double CalculateTransformationLMS3_0( CvPoint* pTemplPoints, CvPoint* pSrcPoints)
928 double dbLMS = 0;
933 double dbXt = double(pTemplPoints[0].x + pTemplPoints[1].x + pTemplPoints[2].x) / 3.0;
934 double dbYt = double(pTemplPoints[0].y + pTemplPoints[1].y + pTemplPoints[2].y ) / 3.0;
935 double dbXs = double(pSrcPoints[0].x + pSrcPoints[1].x + pSrcPoints[2].x) / 3.0;
936 double dbYs = double(pSrcPoints[0].y + pSrcPoints[1].y + pSrcPoints[2].y) / 3.0;
938 double dbXtXt = double(pow2(pTemplPoints[0].x) + pow2(pTemplPoints[1].x) + pow2(pTemplPoints[2].x)) / 3.0;
939 double dbYtYt = double(pow2(pTemplPoints[0].y) + pow2(pTemplPoints[1].y) + pow2(pTemplPoints[2].y)) / 3.0;
941 double dbXsXs = double(pow2(pSrcPoints[0].x) + pow2(pSrcPoints[1].x) + pow2(pSrcPoints[2].x)) / 3.0;
942 double dbYsYs = double(pow2(pSrcPoints[0].y) + pow2(pSrcPoints[1].y) + pow2(pSrcPoints[2].y)) / 3.0;
944 double dbXtXs = double(pTemplPoints[0].x * pSrcPoints[0].x +
947 double dbYtYs = double(pTemplPoints[0].y * pSrcPoints[0].y +
951 double dbXtYs = double(pTemplPoints[0].x * pSrcPoints[0].y +
954 double dbYtXs = double(pTemplPoints[0].y * pSrcPoints[0].x +
970 double del = dbXsXs + dbYsYs;
972 dbLMS = dbXtXt + dbYtYt - ((double)pow(dbXtXs + dbYtYs,2) + (double)pow(dbXtYs - dbYtXs,2)) / del;