From a62d0dd4836608d56a9525a0827785dd9788a259 Mon Sep 17 00:00:00 2001 From: Teagan Glenn Date: Wed, 7 Jun 2017 16:21:55 -0600 Subject: [PATCH 1/3] Remove old hub page --- .../image_processing.opencv.markdown | 43 ++++++++++- source/_components/opencv.markdown | 75 ------------------- 2 files changed, 39 insertions(+), 79 deletions(-) delete mode 100644 source/_components/opencv.markdown diff --git a/source/_components/image_processing.opencv.markdown b/source/_components/image_processing.opencv.markdown index 99554722af68..1a6de230c958 100644 --- a/source/_components/image_processing.opencv.markdown +++ b/source/_components/image_processing.opencv.markdown @@ -2,7 +2,7 @@ layout: page title: "OpenCV" description: "Instructions how to integrate OpenCV image processing into Home Assistant." -date: 2017-01-25 00:00 +date: 2017-06-24 00:00 sidebar: true comments: false sharing: true @@ -10,9 +10,44 @@ footer: true logo: opencv.png ha_category: Image Processing featured: false -ha_release: 0.44 +ha_release: 0.47 --- -The `opencv` image processing platform allows you to create a standalone image processor without the linked camera entity as mentioned in the [OpenCV page](https://home-assistant.io/components/opencv). +[OpenCV](http://www.opencv.org) is an open source computer vision image and video processing library. -Please refer to the [component](/components/opencv/) configuration on how to setup the image processor. +Some pre-defined classifiers can be found here: https://github.com/opencv/opencv/tree/master/data + +### {% linkable_title Configuration %} + +To setup OpenCV with Home Assistant, add the following section to your `configuration.yaml` file: + +```yaml +# Example configuration.yaml entry +image_processing: + - platform: opencv + name: Front Door Faces + source: + - entity_id: camera.front_door + classifier: + mom: /path/to/classifier.xml +``` + +- **name** (*Required*): The name of the OpenCV image processor. +- **source** array (*Required*): List of image sources. + - **entity_id** (*Required*): A camera entity id to get picture from. + - **name** (*Optional*): This parameter allows you to override the name of your `image_processing` entity. +- **classifier** (*Optional*): Dictionary of name to path to the classifier xml file. If this field is not provided, a face classifier will be downloaded from OpenCV's github repo. + +**classifier** may either be a path to a classier file or defined as: + +```yaml + mom: + file: /path/to/classifier/xml + neighbors: 4 + min_size: (40, 40) + scale: 1.1f +``` + +- **file** (*Required*): The path to the classifier xml file. +- **scale** (*Optional*): The scale to perform when processing, this is a `float` value that must be greater than or equal to `1.0`, default is `1.1`. +- **neighbors** (*Optional*): The minimum number of neighbors required for a match, default is `4`. The higher this number, the more picky the matching will be; lower the number, the more false positives you may experience. diff --git a/source/_components/opencv.markdown b/source/_components/opencv.markdown deleted file mode 100644 index 0ea2dcc9f813..000000000000 --- a/source/_components/opencv.markdown +++ /dev/null @@ -1,75 +0,0 @@ ---- -layout: page -title: "OpenCV" -description: "Instructions how to setup OpenCV within Home Assistant." -date: 2017-04-01 22:36 -sidebar: true -comments: false -sharing: true -footer: true -logo: opencv.png -ha_category: Hub -ha_release: 0.44 -ha_iot_class: "Local Push" ---- - -[OpenCV](http://www.opencv.org) is an open source computer vision image and video processing library. - -Some pre-defined classifiers can be found here: https://github.com/opencv/opencv/tree/master/data - -### {% linkable_title Configuration %} - -To setup OpenCV with Home Assistant, add the following section to your `configuration.yaml` file: - -```yaml -# Example configuration.yaml entry -opencv: - classifier_group: - - name: Family - add_camera: True - entity_id: - - camera.front_door - - camera.living_room - classifier: - - file_path: /path/to/classifier/face.xml - name: Bob - - file_path: /path/to/classifier/face_profile.xml - name: Jill - min_size: (20, 20) - color: (255, 0, 0) - scale: 1.6 - neighbors: 5 - - file_path: /path/to/classifier/kid_face.xml - name: Little Jimmy -``` - -Configuration variables: - -- **name** (*Required*): The name of the OpenCV image processor. -- **entity_id** (*Required*): The camera entity or list of camera entities that this classification group will be applied to. -- **classifier** (*Required*): The classification configuration for to be applied: - - **file_path** (*Required*): The path to the HAARS or LBP classification file (xml). - - **name** (*Optional*): The classification name, the default is `Face`. - - **min_size** (*Optional*): The minimum size for detection as a tuple `(width, height)`, the default is `(30, 30)`. - - **color** (*Optional*): The color, as a tuple `(Blue, Green, Red)` to draw the rectangle when linked to a dispatcher camera, the default is `(255, 255, 0)`. - - **scale** (*Optional*): The scale to perform when processing, this is a `float` value that must be greater than or equal to `1.0`, default is `1.1`. - - **neighbors** (*Optional*): The minimum number of neighbors required for a match, default is `4`. The higher this number, the more picky the matching will be; lower the number, the more false positives you may experience. - -Once OpenCV is configured, it will create an `image_processing` entity for each classification group/camera entity combination as well as a camera so you can see what Home Assistant sees. - -The attributes on the `image_processing` entity will be: - -```json -'matches': { - 'Bob': [ - (x, y, w, h) - ], - 'Jill': [ - (x, y, w, h) - ], - 'Little Jimmy': [ - (x, y, w, h) - ] -} -``` - From 6a6d4c99211a0ced34c1f7dc75e001a57b8b4447 Mon Sep 17 00:00:00 2001 From: Teagan Glenn Date: Wed, 7 Jun 2017 16:23:59 -0600 Subject: [PATCH 2/3] Update wording --- source/_components/image_processing.opencv.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/image_processing.opencv.markdown b/source/_components/image_processing.opencv.markdown index 1a6de230c958..88cd3ad60789 100644 --- a/source/_components/image_processing.opencv.markdown +++ b/source/_components/image_processing.opencv.markdown @@ -38,7 +38,7 @@ image_processing: - **name** (*Optional*): This parameter allows you to override the name of your `image_processing` entity. - **classifier** (*Optional*): Dictionary of name to path to the classifier xml file. If this field is not provided, a face classifier will be downloaded from OpenCV's github repo. -**classifier** may either be a path to a classier file or defined as: +**classifier** may also be defined as a dictionary of names to classifier configurations: ```yaml mom: From b08714b9c6bb92a92760878cc451b17944f35c17 Mon Sep 17 00:00:00 2001 From: Teagan Glenn Date: Thu, 8 Jun 2017 10:56:12 -0600 Subject: [PATCH 3/3] Reset date --- source/_components/image_processing.opencv.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/image_processing.opencv.markdown b/source/_components/image_processing.opencv.markdown index 88cd3ad60789..de29cbee7452 100644 --- a/source/_components/image_processing.opencv.markdown +++ b/source/_components/image_processing.opencv.markdown @@ -2,7 +2,7 @@ layout: page title: "OpenCV" description: "Instructions how to integrate OpenCV image processing into Home Assistant." -date: 2017-06-24 00:00 +date: 2017-01-25 00:00 sidebar: true comments: false sharing: true