diff --git a/3rdparty/stasm/stasm/stasm/src/facedet.cpp b/3rdparty/stasm/stasm/stasm/src/facedet.cpp index 72aeffd..ca29b31 100755 --- a/3rdparty/stasm/stasm/stasm/src/facedet.cpp +++ b/3rdparty/stasm/stasm/stasm/src/facedet.cpp @@ -5,6 +5,8 @@ #include "facedet.h" #include "stasm_lib.h" +#include + namespace stasm { typedef vector vec_DetPar; @@ -182,25 +184,16 @@ void FaceDet::DetectFaces_( // call once per image to find all the faces void* user, // in: unused (match virt func signature) cv::CascadeClassifier cascade) { - CV_Assert(user == NULL); - DetectFaces(detpars_, img, minwidth, cascade); - char tracepath[SLEN]; - sprintf(tracepath, "%s_00_unsortedfacedet.bmp", Base(imgpath)); - TraceFaces(detpars_, img, tracepath); - DiscardMissizedFaces(detpars_); + if (multiface) // order faces on increasing distance from left margin { sort(detpars_.begin(), detpars_.end(), IncreasingLeftMargin); - sprintf(tracepath, "%s_05_facedet.bmp", Base(imgpath)); - TraceFaces(detpars_, img, tracepath); } else { // order faces on decreasing width, keep only the first (the largest face) sort(detpars_.begin(), detpars_.end(), DecreasingWidth); - sprintf(tracepath, "%s_05_sortedfaces.bmp", Base(imgpath)); - TraceFaces(detpars_, img, tracepath); if (NSIZE(detpars_)) detpars_.resize(1); } diff --git a/3rdparty/stasm/stasm/stasm/src/misc.cpp b/3rdparty/stasm/stasm/stasm/src/misc.cpp index 200409e..3dfe63e 100755 --- a/3rdparty/stasm/stasm/stasm/src/misc.cpp +++ b/3rdparty/stasm/stasm/stasm/src/misc.cpp @@ -87,7 +87,7 @@ void splitpath( char* base, // out: can be NULL char* ext) // out: can be NULL, includes dot { - CV_Assert(path && STRNLEN(path, _MAX_PATH) < _MAX_PATH); + //CV_Assert(path && STRNLEN(path, _MAX_PATH) < _MAX_PATH); if (drive) { diff --git a/3rdparty/stasm/stasm/stasm/src/stasm_lib.cpp b/3rdparty/stasm/stasm/stasm/src/stasm_lib.cpp index d8e55f2..b627297 100755 --- a/3rdparty/stasm/stasm/stasm/src/stasm_lib.cpp +++ b/3rdparty/stasm/stasm/stasm/src/stasm_lib.cpp @@ -14,6 +14,8 @@ #include "facedet.h" #include "startshape.h" +#include + using namespace stasm; static vec_Mod mods_g; // the ASM model(s) @@ -72,7 +74,7 @@ int stasm_init_ext( // extended version of stasm_init (void) detparams; int returnval = 1; // assume success - CatchOpenCvErrs(); + //CatchOpenCvErrs(); try { print_g = (trace != 0); @@ -98,7 +100,7 @@ int stasm_init_ext( // extended version of stasm_init { returnval = 0; // a call was made to Err or a CV_Assert failed } - UncatchOpenCvErrs(); + //UncatchOpenCvErrs(); return returnval; } @@ -125,7 +127,7 @@ int stasm_open_image_ext( // extended version of stasm_open_image (void) user; int returnval = 1; // assume success - CatchOpenCvErrs(); + //CatchOpenCvErrs(); try { //CV_Assert(imgpath && STRNLEN(imgpath, SLEN) < SLEN); @@ -143,7 +145,7 @@ int stasm_open_image_ext( // extended version of stasm_open_image { returnval = 0; // a call was made to Err or a CV_Assert failed } - UncatchOpenCvErrs(); + //UncatchOpenCvErrs(); return returnval; } @@ -170,11 +172,9 @@ int stasm_search_auto_ext( // extended version of stasm_search_auto { int returnval = 1; // assume success *foundface = 0; // but assume no face found - CatchOpenCvErrs(); + //CatchOpenCvErrs(); try { - CheckStasmInit(); - Shape shape; // the shape with landmarks Image face_roi; // cropped to area around startshape and possibly rotated DetPar detpar_roi; // detpar translated to ROI frame @@ -195,9 +195,6 @@ int stasm_search_auto_ext( // extended version of stasm_search_auto { // now working with maybe flipped ROI and start shape in ROI frame *foundface = 1; - if (trace_g) // show start shape? - LogShape(RoiShapeToImgFrame(shape, face_roi, detpar_roi, detpar), - "auto_start"); // select an ASM model based on the face's yaw const int imod = ABS(EyawAsModIndex(detpar.eyaw, mods_g));