summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Dennedy <dan@dennedy.org>2015-12-21 06:01:06 (GMT)
committer Dan Dennedy <dan@dennedy.org>2015-12-21 06:01:06 (GMT)
commit7ed3f84e652077df438db0db466a37e36b200347 (patch)
treeac3f7964f24fdb54e0588d22a3882e97519c423d
parent197af824df06d9de29d0e2cde3da48bccfe29147 (diff)
Fix compilation against OpenCV 3.
OpenCV 3 stopped defining CV_VERSION_EPOCH shortly after the version bump to 3. However, CV_VERSION_MAJOR cannot be used because OpenCV 2 had a major version of at least as high as 4.
-rw-r--r--src/filter/facedetect/facedetect.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/filter/facedetect/facedetect.cpp b/src/filter/facedetect/facedetect.cpp
index fd854b0..638e2fe 100644
--- a/src/filter/facedetect/facedetect.cpp
+++ b/src/filter/facedetect/facedetect.cpp
@@ -261,7 +261,7 @@ private:
{
double scale = this->scale == 0? 1.0 : this->scale;
CvScalar colors[5] = {
-#if (CV_VERSION_EPOCH >= 3)
+#if (CV_VERSION_EPOCH != 2)
CvScalar(cvRound(color[0].r * 255), cvRound(color[0].g * 255), cvRound(color[0].b * 255), cvRound(alpha * 255)),
CvScalar(cvRound(color[1].r * 255), cvRound(color[1].g * 255), cvRound(color[1].b * 255), cvRound(alpha * 255)),
CvScalar(cvRound(color[2].r * 255), cvRound(color[2].g * 255), cvRound(color[2].b * 255), cvRound(alpha * 255)),
@@ -297,7 +297,7 @@ private:
}
case 1:
{
-#if (CV_VERSION_EPOCH >= 3)
+#if (CV_VERSION_EPOCH != 2)
CvBox2D box = CvBox2D(CvPoint2D32f(center.x, center.y), CvSize2D32f(r->width / scale, (r->height / scale) * 1.2), 90);
#else
CvBox2D box = {{center.x, center.y}, {r->width / scale, (r->height / scale) * 1.2}, 90};
@@ -307,7 +307,7 @@ private:
}
case 2:
{
-#if (CV_VERSION_EPOCH >= 3)
+#if (CV_VERSION_EPOCH != 2)
CvPoint pt1 = CvPoint(r->x / scale, r->y / scale);
CvPoint pt2 = CvPoint((r->x + r->width) / scale, (r->y + r->height) / scale);
#else