MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / stasm_open_image_ext

Function stasm_open_image_ext

jni/stasm/stasm_lib.cpp:109–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109int stasm_open_image_ext( // extended version of stasm_open_image
110 const char* image, // in: gray image data, top left corner at 0,0
111 int width, // in: image width
112 int height, // in: image height
113 const char* imgpath, // in: image path, used only for err msgs and debug
114 int multiface, // in: 0=return only one face, 1=allow multiple faces
115 int minwidth, // in: min face width as percentage of img width
116 void* user) // in: NULL or pointer to user abort func
117{
118 int returnval = 1; // assume success
119 CatchOpenCvErrs();
120 try
121 {
122 CV_Assert(imgpath && STRNLEN(imgpath, SLEN) < SLEN);
123 CV_Assert(multiface == 0 || multiface == 1);
124 CV_Assert(minwidth >= 1 && minwidth <= 100);
125
126 CheckStasmInit();
127
128 img_g = Image(height, width,(unsigned char*)image);
129
130#if TRACE_IMAGES
131 strcpy(imgpath_g, imgpath); // save the image path (for naming debug images)
132#endif
133 // call the face detector to detect the face rectangle(s)
134 facedet_g.DetectFaces_(img_g, imgpath, multiface == 1, minwidth, user);
135 }
136 catch(...)
137 {
138 returnval = 0; // a call was made to Err or a CV_Assert failed
139 }
140 UncatchOpenCvErrs();
141 return returnval;
142}
143
144int stasm_open_image( // call once per image, detect faces
145 const char* image, // in: gray image data, top left corner at 0,0

Callers 1

stasm_open_imageFunction · 0.85

Calls 5

CatchOpenCvErrsFunction · 0.85
STRNLENFunction · 0.85
CheckStasmInitFunction · 0.85
UncatchOpenCvErrsFunction · 0.85
DetectFaces_Method · 0.80

Tested by

no test coverage detected