Add option to use pattern matching for "output changed" condition

This will allow you to ignore minor changes in the video output, for
example in noisy video streams.
This commit is contained in:
WarmUpTill
2021-10-31 13:21:40 +01:00
committed by WarmUpTill
parent 4b17314c66
commit 0490c97ad9
3 changed files with 69 additions and 5 deletions

View File

@@ -51,6 +51,7 @@ public:
VideoCondition _condition = VideoCondition::MATCH;
std::string _file = obs_module_text("AdvSceneSwitcher.enterPath");
bool _useAlphaAsMask = false;
bool _usePatternForChangedCheck = false;
PatternMatchData _patternData;
double _patternThreshold = 0.8;
cv::CascadeClassifier _objectCascade;
@@ -65,6 +66,7 @@ public:
int _throttleCount = 3;
private:
bool OutputChanged();
bool ScreenshotContainsPattern();
bool ScreenshotContainsObject();
bool Compare();
@@ -127,6 +129,7 @@ private slots:
void ConditionChanged(int cond);
void ImagePathChanged(const QString &text);
void ImageBrowseButtonClicked();
void UsePatternForChangedCheckChanged(int value);
void PatternThresholdChanged(double);
void UseAlphaAsMaskChanged(int value);
@@ -148,6 +151,7 @@ protected:
QComboBox *_videoSelection;
QComboBox *_condition;
QCheckBox *_usePatternForChangedCheck;
FileSelection *_imagePath;
ThresholdSlider *_patternThreshold;
QCheckBox *_useAlphaAsMask;