return error;
}
- char *haarcascadeFilepath;
- error = mv_engine_config_get_string_attribute_c(
- engine_cfg,
- "MV_FACE_DETECTION_MODEL_FILE_PATH",
- &haarcascadeFilepath);
-
/* default path */
+ cv::Size minSize(0, 0);
+ cv::Rect roi(-1, -1, -1, -1);
std::string haarcascadeFilePathStr =
-- "/usr/share/OpenCV/haarcascades/haarcascade_frontalface_alt2.xml";
++ "/usr/share/opencv4/haarcascades/haarcascade_frontalface_alt2.xml";
+ if (engine_cfg) {
+ int minWidth, minHeight;
- if (error == MEDIA_VISION_ERROR_NONE) {
- LOGI("Haarcascade file was set as default");
- haarcascadeFilePathStr = std::string(haarcascadeFilepath);
-
- free(haarcascadeFilepath);
- haarcascadeFilepath = NULL;
- } else {
- LOGE("Error occurred during face detection haarcascade file receiving."
+ /* set face detection model */
+ char *haarcascadeFilepath;
+ error = mv_engine_config_get_string_attribute_c(
+ engine_cfg,
+ "MV_FACE_DETECTION_MODEL_FILE_PATH",
+ &haarcascadeFilepath);
+ if (error == MEDIA_VISION_ERROR_NONE) {
+ LOGI("Haarcascade file was set as default");
+ haarcascadeFilePathStr = std::string(haarcascadeFilepath);
+
+ free(haarcascadeFilepath);
+ haarcascadeFilepath = NULL;
+ } else {
+ LOGE("Error occurred during face detection haarcascade file receiving."
" (%i)", error);
- }
+ }
- static FaceDetector faceDetector;
-
- if (!faceDetector.loadHaarcascade(haarcascadeFilePathStr)) {
- LOGE("Loading Haarcascade failed");
- return MEDIA_VISION_ERROR_INVALID_PARAMETER;
- }
-
- cv::Rect roi(-1, -1, -1, -1);
- error = mv_engine_config_get_int_attribute_c(
+ /* Ser roi to be detected */
+ error = mv_engine_config_get_int_attribute_c(
engine_cfg,
MV_FACE_DETECTION_ROI_X,
&roi.x);
BuildRequires: pkgconfig(libtbm)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(capi-system-info)
- BuildRequires: pkgconfig(opencv) >= 3.4.0
-#BuildRequires: pkgconfig(opencv) >= 3.4.1
+ BuildRequires: pkgconfig(opencv4)
BuildRequires: pkgconfig(zbar)
BuildRequires: pkgconfig(glib-2.0)
# Change to the pkgconfig(zint) after zint package refactor