[mod_cv] Replace deprecated definitions and update configure.ac to check renamed opencv4.pc on Debian Bullseye.

This commit is contained in:
Andrey Volk 2021-09-22 19:13:24 +03:00
parent 2505b45134
commit e9fde845de
2 changed files with 9 additions and 7 deletions

View File

@ -1408,7 +1408,9 @@ PKG_CHECK_MODULES([VLC], [libvlc >= 2.1.0],[
PKG_CHECK_MODULES([OPENCV], [opencv >= 2.4.5],[
AM_CONDITIONAL([HAVE_OPENCV],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])])
PKG_CHECK_MODULES([OPENCV], [opencv4 >= 2.4.5],[
AM_CONDITIONAL([HAVE_OPENCV],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])])])
PKG_CHECK_MODULES([OPUSFILE_DECODE], [opusfile >= 0.5],[
AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[true])],[

View File

@ -37,7 +37,7 @@
#include <switch.h>
#include "highgui.h"
#include "opencv2/highgui/highgui_c.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@ -596,9 +596,9 @@ void detectAndDraw(cv_context_t *context)
context->cascade->detectMultiScale( smallImg, detectedObjs,
context->search_scale, context->neighbors, 0
|CV_HAAR_FIND_BIGGEST_OBJECT
|CV_HAAR_DO_ROUGH_SEARCH
|CV_HAAR_SCALE_IMAGE
|CASCADE_FIND_BIGGEST_OBJECT
|CASCADE_DO_ROUGH_SEARCH
|CASCADE_SCALE_IMAGE
,
Size(context->max_search_w, context->max_search_h) );
@ -679,7 +679,7 @@ void detectAndDraw(cv_context_t *context)
//|CV_HAAR_FIND_BIGGEST_OBJECT
//|CV_HAAR_DO_ROUGH_SEARCH
//|CV_HAAR_DO_CANNY_PRUNING
|CV_HAAR_SCALE_IMAGE
|CASCADE_SCALE_IMAGE
,
Size(30, 30) );
@ -690,7 +690,7 @@ void detectAndDraw(cv_context_t *context)
//printf("WTF %d\n", object_neighbors);
//cout << "Detected " << object_neighbors << " object neighbors" << endl;
const int rect_height = cvRound((float)img.rows * object_neighbors / max_neighbors);
CvScalar col = CV_RGB((float)255 * object_neighbors / max_neighbors, 0, 0);
cv:Scalar col = CV_RGB((float)255 * object_neighbors / max_neighbors, 0, 0);
rectangle(img, cvPoint(0, img.rows), cvPoint(img.cols/10, img.rows - rect_height), col, -1);
parse_stats(&context->nestDetected, nestedObjects.size(), context->skip);