MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / MarkPatternMatch

Method MarkPatternMatch

plugins/video/preview-dialog.cpp:327–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327void PreviewImage::MarkPatternMatch(
328 QImage &screenshot, const PatternMatchParameters &patternMatchParams,
329 const PatternImageData &patternImageData)
330{
331 cv::Mat result;
332 double matchValue = MatchPattern(screenshot, patternImageData,
333 patternMatchParams.threshold, result,
334 patternMatchParams.useAlphaAsMask,
335 patternMatchParams.matchMode);
336 emit ValueUpdate(matchValue);
337 if (result.total() == 0 || countNonZero(result) == 0) {
338 emit StatusUpdate(obs_module_text(
339 "AdvSceneSwitcher.condition.video.patternMatchFail"));
340 } else if (result.cols == 1 && result.rows == 1) {
341 emit StatusUpdate(obs_module_text(
342 "AdvSceneSwitcher.condition.video.patternMatchSuccessFullImage"));
343 } else {
344 emit StatusUpdate(obs_module_text(
345 "AdvSceneSwitcher.condition.video.patternMatchSuccess"));
346 markPatterns(result, screenshot, patternImageData.rgbaPattern);
347 }
348}
349
350void PreviewImage::MarkObjectMatch(
351 QImage &screenshot,

Callers

nothing calls this directly

Calls 4

MatchPatternFunction · 0.85
obs_module_textFunction · 0.85
markPatternsFunction · 0.85
totalMethod · 0.45

Tested by

no test coverage detected