-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RSDK-9931] Let the config have an optional maximum bounding box (#31)
The intention here is that if the camera provides a corrupted frame and everything suddenly goes gray for a moment, that shouldn't count as motion. This also means that if someone bumps the camera and the entire scene shifts to the left, that also shouldn't count as motion. Tried on an Orin Nano: seems to work! If I don't mention it in the config, the behavior seems unchanged, and if I do mention it, large bounding boxes do not appear, while small ones still do. I was unable to get a corrupted image, so can't ensure that those are no longer considered noise. I've also made some other cleanup changes: - Remove trailing whitespace. Ideally we'd never have any to begin with - Don't raise raw `Exception`s, because the only way to catch them is to catch all exceptions. Instead, raise something specific (in these cases, I went with `ValueError`, but could be convinced of other types, too). My hope is that reviewing commit-by-commit is easy, and makes it clear why each change occurred. * remove trailing whitespace * raise ValueError instead of raw Exceptions * add validation for optional max_box_size in config * store max_box_size as a field in the class * flip if statement, and fix likely off-by-one error * pull out temporary value to a variable * check the max box size in addition to the min * get tests to pass * add new passing tests * remove print statements: they just print a useless '<CaptureAllResult object at 0xffff99489f30>' * getMD in the tests is a static method * refactor shared code to helper function, tests still pass
- Loading branch information
1 parent
36b20f6
commit 17a28a5
Showing
6 changed files
with
96 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters