| 20 | } |
| 21 | |
| 22 | bool PatternMatchParameters::Load(obs_data_t *obj) |
| 23 | { |
| 24 | // TODO: Remove this fallback in a future version |
| 25 | if (!obs_data_has_user_value(obj, "patternMatchData")) { |
| 26 | useForChangedCheck = |
| 27 | obs_data_get_bool(obj, "usePatternForChangedCheck"); |
| 28 | threshold = obs_data_get_double(obj, "threshold"); |
| 29 | useAlphaAsMask = obs_data_get_bool(obj, "useAlphaAsMask"); |
| 30 | return true; |
| 31 | } |
| 32 | auto data = obs_data_get_obj(obj, "patternMatchData"); |
| 33 | useForChangedCheck = obs_data_get_bool(data, "useForChangedCheck"); |
| 34 | threshold.Load(data, "threshold"); |
| 35 | // TODO: Remove this fallback in a future version |
| 36 | if (!obs_data_has_user_value(data, "version")) { |
| 37 | threshold = obs_data_get_double(data, "threshold"); |
| 38 | } |
| 39 | useAlphaAsMask = obs_data_get_bool(data, "useAlphaAsMask"); |
| 40 | // TODO: Remove this fallback in a future version |
| 41 | if (!obs_data_has_user_value(data, "matchMode")) { |
| 42 | matchMode = cv::TM_CCORR_NORMED; |
| 43 | } else { |
| 44 | matchMode = static_cast<cv::TemplateMatchModes>( |
| 45 | obs_data_get_int(data, "matchMode")); |
| 46 | } |
| 47 | obs_data_release(data); |
| 48 | return true; |
| 49 | } |
| 50 | |
| 51 | static std::shared_ptr<cv::CascadeClassifier> |
| 52 | initObjectCascade(std::string &path) |
nothing calls this directly
no test coverage detected