From a062da05b42761061630b6d29f3f1efbe676ea4f Mon Sep 17 00:00:00 2001 From: Luke Pomfrey Date: Sat, 30 May 2020 18:17:15 +0000 Subject: [PATCH] Keep all OpenCV classifier results (#36294) --- homeassistant/components/opencv/image_processing.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/opencv/image_processing.py b/homeassistant/components/opencv/image_processing.py index f35d063de50..6b5e4e85513 100644 --- a/homeassistant/components/opencv/image_processing.py +++ b/homeassistant/components/opencv/image_processing.py @@ -160,6 +160,9 @@ class OpenCVImageProcessor(ImageProcessingEntity): """Process the image.""" cv_image = cv2.imdecode(numpy.asarray(bytearray(image)), cv2.IMREAD_UNCHANGED) + matches = {} + total_matches = 0 + for name, classifier in self._classifiers.items(): scale = DEFAULT_SCALE neighbors = DEFAULT_NEIGHBORS @@ -177,8 +180,6 @@ class OpenCVImageProcessor(ImageProcessingEntity): detections = cascade.detectMultiScale( cv_image, scaleFactor=scale, minNeighbors=neighbors, minSize=min_size ) - matches = {} - total_matches = 0 regions = [] # pylint: disable=invalid-name for (x, y, w, h) in detections: