mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-14 15:15:22 +03:00
Update frigate_motion.py
This commit is contained in:
parent
4f10f82580
commit
f6ad149b19
@ -1,3 +1,4 @@
|
|||||||
|
import logging
|
||||||
import cv2
|
import cv2
|
||||||
import imutils
|
import imutils
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -5,6 +6,7 @@ import numpy as np
|
|||||||
from frigate.config import MotionConfig
|
from frigate.config import MotionConfig
|
||||||
from frigate.motion import MotionDetector
|
from frigate.motion import MotionDetector
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class FrigateMotionDetector(MotionDetector):
|
class FrigateMotionDetector(MotionDetector):
|
||||||
def __init__(
|
def __init__(
|
||||||
@ -109,6 +111,7 @@ class FrigateMotionDetector(MotionDetector):
|
|||||||
for c in cnts:
|
for c in cnts:
|
||||||
# if the contour is big enough, count it as motion
|
# if the contour is big enough, count it as motion
|
||||||
contour_area = cv2.contourArea(c)
|
contour_area = cv2.contourArea(c)
|
||||||
|
logger.warning("Contour area = " + contour_area)
|
||||||
if contour_area > self.contour_area.value:
|
if contour_area > self.contour_area.value:
|
||||||
x, y, w, h = cv2.boundingRect(c)
|
x, y, w, h = cv2.boundingRect(c)
|
||||||
motion_boxes.append(
|
motion_boxes.append(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user