Skip to content

Commit

Permalink
Fix image similarity calculation in background filter (#558)
Browse files Browse the repository at this point in the history
* Fix image similarity calculation in background filter

* Update version number in buildspec.json
  • Loading branch information
royshil authored Mar 14, 2024
1 parent 7809a8d commit 2f2a147
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion buildspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
},
"name": "obs-backgroundremoval",
"version": "1.1.11",
"version": "1.1.12",
"author": "Roy Shilkrot",
"website": "https://github.com/royshil/obs-backgroundremoval",
"email": "[email protected]",
Expand Down
3 changes: 2 additions & 1 deletion src/background-filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,8 @@ void background_removal_thread(void *data)
}

if (tf->enableImageSimilarity) {
if (!lastImageBGRA.empty()) {
if (!lastImageBGRA.empty() && !imageBGRA.empty() &&
lastImageBGRA.size() == imageBGRA.size()) {
// calculate PSNR
double psnr =
cv::PSNR(lastImageBGRA, imageBGRA);
Expand Down

0 comments on commit 2f2a147

Please sign in to comment.