summaryrefslogtreecommitdiff
path: root/facedetect
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-05-21 19:43:54 +0200
committerJörg Frings-Fürst <debian@jff.email>2022-05-21 19:43:54 +0200
commit9e0516824a0f79514aca5d6dbb1aa21cd247ba05 (patch)
tree9764868c78e104cc18bb6c59f6a8a8a952b30d28 /facedetect
parent4c548cd33f0614e666d9049e41b4f129629cf182 (diff)
New upstream version 0.30.16upstream/0.30.16
Diffstat (limited to 'facedetect')
-rw-r--r--facedetect/meson.build5
-rw-r--r--facedetect/shotwell-facedetect.cpp6
2 files changed, 7 insertions, 4 deletions
diff --git a/facedetect/meson.build b/facedetect/meson.build
index 6724abc..bd5f3c3 100644
--- a/facedetect/meson.build
+++ b/facedetect/meson.build
@@ -1,6 +1,9 @@
subproject = ('facedetect')
add_languages('cpp')
-facedetect_dep = dependency('opencv', version : ['>= 2.3.0'], required : true)
+facedetect_dep = dependency('opencv4', version : ['>= 4.0.0'], required : false)
+if not facedetect_dep.found()
+ facedetect_dep = dependency('opencv', version : ['>= 3.4.0'], required : true)
+endif
executable('shotwell-facedetect',
'shotwell-facedetect.cpp',
dependencies : facedetect_dep,
diff --git a/facedetect/shotwell-facedetect.cpp b/facedetect/shotwell-facedetect.cpp
index 1b09379..1c10580 100644
--- a/facedetect/shotwell-facedetect.cpp
+++ b/facedetect/shotwell-facedetect.cpp
@@ -34,7 +34,7 @@ void help() {
void detectFaces(Mat &img, CascadeClassifier &cascade, double scale) {
Mat gray;
- cvtColor(img, gray, CV_BGR2GRAY);
+ cvtColor(img, gray, cv::COLOR_BGR2GRAY);
Mat smallImg(cvRound(img.rows / scale), cvRound(img.cols / scale), CV_8UC1);
Size smallImgSize = smallImg.size();
@@ -43,7 +43,7 @@ void detectFaces(Mat &img, CascadeClassifier &cascade, double scale) {
equalizeHist(smallImg, smallImg);
vector<Rect> faces;
- cascade.detectMultiScale(smallImg, faces, 1.1, 2, CV_HAAR_SCALE_IMAGE, Size(30, 30));
+ cascade.detectMultiScale(smallImg, faces, 1.1, 2, cv::CASCADE_SCALE_IMAGE, Size(30, 30));
int i = 0;
for (vector<Rect>::const_iterator r = faces.begin(); r != faces.end(); r++, i++) {
@@ -117,7 +117,7 @@ int main(int argc, const char** argv) {
}
- Mat image = imread(inputName, 1);
+ Mat image = cv::imread(inputName, 1);
if (image.empty()) {