Fixed another bug with calculating pixels changed
This commit is contained in:
parent
43eac872ed
commit
1aea88d08f
@ -224,7 +224,7 @@ public class VideoDetector extends Detector {
|
|||||||
|
|
||||||
int n = OpenCVHelper.countNonZeroPixels(processed);
|
int n = OpenCVHelper.countNonZeroPixels(processed);
|
||||||
int pixelCount = image.getWidth() * image.getHeight();
|
int pixelCount = image.getWidth() * image.getHeight();
|
||||||
float percentChanged = (float) (n / pixelCount) * 100;
|
float percentChanged = ((float) n / pixelCount) * 100;
|
||||||
|
|
||||||
// Violation Condition
|
// Violation Condition
|
||||||
if (percentChanged> ALARM_THRESHOLD) {
|
if (percentChanged> ALARM_THRESHOLD) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user