LEGaTO-SmartMirror and therefore MagicMirror² module for simulating gesture, object and face detections and person recognitions. The desired detections are selected through an overlayed GUI widget and detection messages are send in constant intervals to other SmartMirror modules.
The module can be configured by setting the desired values in the MagicMirror config.js
image_width
andimage_height
: Integers; Default: 1920 x 1080 Sets the dimensions of the camera image.simFps
: Integer; Default: 30 Sets the interval at which detection messages are sent. Only set at startup.forceShow
: Boolean; Default: true If true the widget is forced to show even if other modules try to hide it.widgetWidth
: Integer; Default: 0 Sets the width of the GUI widget in pixel. If 0 the width is fitted to the content.widgetHeight
: Integer; Default: 0 Sets the height of the GUI widget in pixel. If 0 the height is fitted to the content.
- The GUI widget can be hidden or shown with the button in the top right.
- To simulate detections activate the category checkbox to the left.
- All coordinates are given in pixels.
- Changes to the detection parameters are instantly applied.
- Add a detection by pressing the green
+
button. - Delete a detection by pressing the red
x
button. Only additional detections can be deleted. - The person recognition simulation uses the data from above fields if their category is active and their
TrackID
equals the one given. Theid
of the given face is then used to log in a user by the DecisionMaker by looking up theid
in the MySQL database. If the corresponding categories are not active a placeholder is used with theid
given in the person entry (Can be used to quickly log in a user).
- To move a detection with the mouse activate
Mousemove
and select a meta-key (Ctrl
,Shift
orAlt
). Now the detection follows the mouse if the meta-key is pressed. - To scale the detections with the mouse wheel activate the
Scale
checkbox. Now the activation dimensions are scaled with turning the mouse wheel.
The names of the gesture and object detections are loaded line by line from the hand.names
and coco.names
textfiles in the public
folder. Empty lines are ignored.
Sent MagicMirror messages:
notification | payload |
---|---|
DETECTED_GESTURES |
{"DETECTED_GESTURES": [{"TrackID": int, "name": string, "w_h": (float, float), "center": (float, float)}]} |
DETECTED_OBJECTS |
{"DETECTED_OBJECTS": [{"TrackID": int, "name": string, "w_h": (float, float), "center": (float, float)}]} |
DETECTED_FACES |
{"DETECTED_FACES": [{"TrackID": int, "name": string, "w_h": (float, float), "center": (float, float), "id": int, "confidence": float}]} |
RECOGNISED_PERSONS |
{"RECOGNIZED_PERSONS": {int: {"TrackID": int, "name": string, "w_h": [float, float], "center": [float, float]}, "face": {...}, "gestures": [...]}} |
Versions relate to tested versions.
- MagicMirror 2.10.1
To install SmartMirror-Detection-Simulator module on an existing SmartMirror instance:
- Clone SmartMirror-Detection-Simulator to the MagicMirror module folder.
- Add module section to the MagicMirror
config.js
:
{
module: 'SmartMirror-Detection-Simulator',
position: 'top-right',
config: {
image_width: 1920,
image_height: 1080,
}
},