Split macro-condition-video.cpp UI into per-widget files
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled

This makes it easier to conditionally exclude video-edit-object.cpp
from the build when OpenCV >= 5 drops CascadeClassifier support.
This commit is contained in:
WarmUpTill
2026-07-18 22:13:54 +02:00
committed by WarmUpTill
parent 1030868a75
commit 107d77f1b8
23 changed files with 1098 additions and 861 deletions

View File

@@ -1,6 +1,5 @@
#include "opencv-helpers.hpp"
#include <log-helper.hpp>
#include "log-helper.hpp"
namespace advss {
@@ -135,29 +134,6 @@ double MatchPattern(QImage &img, QImage &pattern, double threshold,
matchColor);
}
std::vector<cv::Rect> MatchObject(QImage &img, cv::CascadeClassifier &cascade,
double scaleFactor, int minNeighbors,
const cv::Size &minSize,
const cv::Size &maxSize)
{
if (img.isNull() || cascade.empty()) {
return {};
}
auto image = QImageToMat(img);
cv::Mat frameGray;
cv::cvtColor(image, frameGray, cv::COLOR_RGBA2GRAY);
cv::equalizeHist(frameGray, frameGray);
std::vector<cv::Rect> objects;
try {
cascade.detectMultiScale(frameGray, objects, scaleFactor,
minNeighbors, 0, minSize, maxSize);
} catch (const std::exception &e) {
vblog(LOG_INFO, "detectMultiScale failed: %s", e.what());
}
return objects;
}
uchar GetAvgBrightness(QImage &img)
{
if (img.isNull()) {