Commit fb9176c51e01e384166900826ce73cac5d52ccd4

Authored by Scott Klum
1 parent 3667813d

Some of the trace functions were causing a crash

3rdparty/stasm/stasm/stasm/src/facedet.cpp
... ... @@ -5,6 +5,8 @@
5 5 #include "facedet.h"
6 6 #include "stasm_lib.h"
7 7  
  8 +#include <QDebug>
  9 +
8 10 namespace stasm
9 11 {
10 12 typedef vector<DetPar> vec_DetPar;
... ... @@ -182,25 +184,16 @@ void FaceDet::DetectFaces_( // call once per image to find all the faces
182 184 void* user, // in: unused (match virt func signature)
183 185 cv::CascadeClassifier cascade)
184 186 {
185   - CV_Assert(user == NULL);
186   -
187 187 DetectFaces(detpars_, img, minwidth, cascade);
188   - char tracepath[SLEN];
189   - sprintf(tracepath, "%s_00_unsortedfacedet.bmp", Base(imgpath));
190   - TraceFaces(detpars_, img, tracepath);
191   - DiscardMissizedFaces(detpars_);
  188 +
192 189 if (multiface) // order faces on increasing distance from left margin
193 190 {
194 191 sort(detpars_.begin(), detpars_.end(), IncreasingLeftMargin);
195   - sprintf(tracepath, "%s_05_facedet.bmp", Base(imgpath));
196   - TraceFaces(detpars_, img, tracepath);
197 192 }
198 193 else
199 194 {
200 195 // order faces on decreasing width, keep only the first (the largest face)
201 196 sort(detpars_.begin(), detpars_.end(), DecreasingWidth);
202   - sprintf(tracepath, "%s_05_sortedfaces.bmp", Base(imgpath));
203   - TraceFaces(detpars_, img, tracepath);
204 197 if (NSIZE(detpars_))
205 198 detpars_.resize(1);
206 199 }
... ...
3rdparty/stasm/stasm/stasm/src/misc.cpp
... ... @@ -87,7 +87,7 @@ void splitpath(
87 87 char* base, // out: can be NULL
88 88 char* ext) // out: can be NULL, includes dot
89 89 {
90   - CV_Assert(path && STRNLEN(path, _MAX_PATH) < _MAX_PATH);
  90 + //CV_Assert(path && STRNLEN(path, _MAX_PATH) < _MAX_PATH);
91 91  
92 92 if (drive)
93 93 {
... ...
3rdparty/stasm/stasm/stasm/src/stasm_lib.cpp
... ... @@ -14,6 +14,8 @@
14 14 #include "facedet.h"
15 15 #include "startshape.h"
16 16  
  17 +#include <QDebug>
  18 +
17 19 using namespace stasm;
18 20  
19 21 static vec_Mod mods_g; // the ASM model(s)
... ... @@ -72,7 +74,7 @@ int stasm_init_ext( // extended version of stasm_init
72 74 (void) detparams;
73 75  
74 76 int returnval = 1; // assume success
75   - CatchOpenCvErrs();
  77 + //CatchOpenCvErrs();
76 78 try
77 79 {
78 80 print_g = (trace != 0);
... ... @@ -98,7 +100,7 @@ int stasm_init_ext( // extended version of stasm_init
98 100 {
99 101 returnval = 0; // a call was made to Err or a CV_Assert failed
100 102 }
101   - UncatchOpenCvErrs();
  103 + //UncatchOpenCvErrs();
102 104 return returnval;
103 105 }
104 106  
... ... @@ -125,7 +127,7 @@ int stasm_open_image_ext( // extended version of stasm_open_image
125 127 (void) user;
126 128  
127 129 int returnval = 1; // assume success
128   - CatchOpenCvErrs();
  130 + //CatchOpenCvErrs();
129 131 try
130 132 {
131 133 //CV_Assert(imgpath && STRNLEN(imgpath, SLEN) < SLEN);
... ... @@ -143,7 +145,7 @@ int stasm_open_image_ext( // extended version of stasm_open_image
143 145 {
144 146 returnval = 0; // a call was made to Err or a CV_Assert failed
145 147 }
146   - UncatchOpenCvErrs();
  148 + //UncatchOpenCvErrs();
147 149 return returnval;
148 150 }
149 151  
... ... @@ -170,11 +172,9 @@ int stasm_search_auto_ext( // extended version of stasm_search_auto
170 172 {
171 173 int returnval = 1; // assume success
172 174 *foundface = 0; // but assume no face found
173   - CatchOpenCvErrs();
  175 + //CatchOpenCvErrs();
174 176 try
175 177 {
176   - CheckStasmInit();
177   -
178 178 Shape shape; // the shape with landmarks
179 179 Image face_roi; // cropped to area around startshape and possibly rotated
180 180 DetPar detpar_roi; // detpar translated to ROI frame
... ... @@ -195,9 +195,6 @@ int stasm_search_auto_ext( // extended version of stasm_search_auto
195 195 {
196 196 // now working with maybe flipped ROI and start shape in ROI frame
197 197 *foundface = 1;
198   - if (trace_g) // show start shape?
199   - LogShape(RoiShapeToImgFrame(shape, face_roi, detpar_roi, detpar),
200   - "auto_start");
201 198  
202 199 // select an ASM model based on the face's yaw
203 200 const int imod = ABS(EyawAsModIndex(detpar.eyaw, mods_g));
... ...