UNPKG

node-red-contrib-axis-host

Version:

Axis Devices resource binding nodes that provides access to events, image capture and analytics data. Node-RED must be running on the Axis Device.

209 lines (203 loc) 7.93 kB
<script type="text/x-red" data-template-name="Objects"> <div class="form-row"> <label for="node-input-version"><i class="icon-tag"></i> Device</label> <select id="node-input-version"> <option value="1">Camera</option> <option value="3">D2110 Radar</option> </select> </div> <div class="form-row version1"> <label for="node-input-output"><i class="icon-tag"></i> Output</label> <select id="node-input-output"> <option value="1">Detections</option> <option value="2">Tracker</option> <option value="3">Path</option> </select> </div> <div class="form-row version3"> <label for="node-input-units"><i class="icon-tag"></i> Units</label> <select id="node-input-units"> <option value="0">Meters & m/s</option> <option value="1">Meters & km/h</option> <option value="2">Feet & mph</option> </select> </div> <div class="form-row version1"> <label for="node-input-confidence"><i class="icon-tag"></i> Confidence</label> <select id="node-input-confidence"> <option value="0">Any</option> <option value="10">10 or more</option> <option value="20">20 or more</option> <option value="30">30 or more</option> <option value="40">40 or more</option> <option value="50">50 or more</option> <option value="60">60 or more</option> <option value="70">70 or more</option> <option value="80">80 or more</option> <option value="90">90 or more</option> <option value="100">100 or more</option> </select> </div> <div class="form-row version1"> <label for="node-input-rotation"><i class="icon-tag"></i> Rotation</label> <select id="node-input-rotation"> <option value="0">0</option> <option value="90">90</option> <option value="180">180</option> <option value="270">270</option> </select> </div> <div class="form-row version1"> <label for="node-input-cog"><i class="icon-tag"></i> CoG</label> <select id="node-input-cog"> <option value="0">Center of object</option> <option value="1">Middle-bottom (feet/wheels)</option> </select> </div> <div class="form-row version2"> <label for="node-input-idle"><i class="icon-tag"></i> Max idle</label> <select id="node-input-idle"> <option value="9999999">Forever</option> <option value="10">10 seconds</option> <option value="30">30 seconds</option> <option value="60">1 minute</option> <option value="120">2 minutes</option> <option value="300">5 minutes</option> <option value="600">10 minutes</option> <option value="1800">30 minutes</option> <option value="3600">1 hour</option> </select> </div> </script> <script type="text/javascript"> RED.nodes.registerType('Objects',{ category: 'Axis', color: '#FFCC33', defaults: { version: { value:"1"}, output: { value:"2"}, units: { value:"40"}, confidence: { value:"40"}, rotation: { value:"0"}, cog: { value:"0"}, idle: { value:"9999999"} }, icon: "font-awesome/fa-object-ungroup", inputs: 0, outputs:1, label: function() { var text = ""; if( this.output === "1") text = "Detections"; if( this.output == "2") text = "Tracker"; if( this.output == "3") text = "Path"; return text; }, oneditprepare: function() { $("#node-input-version").change(function() { if( $("#node-input-version").val() === "1") { $(".version1").show(); $(".version2").show(); $(".version3").hide(); } if( $("#node-input-version").val() === "2") { $("#node-input-version").val("1"); $(".version1").show(); $(".version2").show(); $(".version3").hide(); } if( $("#node-input-version").val() === "3") { $(".version1").hide(); $(".version2").hide(); $(".version3").show(); } if( $("#node-input-version").val() === "4") { $("#node-input-version").val("1"); $(".version1").show(); $(".version2").show(); $(".version3").hide(); } }); } }); </script> <script type="text/x-red" data-help-name="Objects"> <p> Objects provides data from the cameras object detection analytics. </p> <h3>Configuration</h3> <p> <b>Version</b><br/> As video analytics evolve, new features may not be avaialbel in older firmware.<br/> Select Version based on the camera firmware version. </p> <p> <b>Output</b><br/> Select Detections, Tracker or Path depending on the use case.<br> <p>Detections are tycially used for real-time visalization use cases</p> <p>Trackers are tycially used for automation use cases. Trackers are only published when moving some distance</p> <p>Paths are tycially used for post data processing use cases e.g. pushed into a database.</p> </p> <p> <b>Confidence</b><br/> Set the minimum confidence level to suppress unwanted detections. Look at the output confidence value to find a good level. </p> <p> <b>Rotation</b><br/> The analytics data has no sense of the camera rotation. If the camera is mounted upsidedown you may need to set 180 degrees to align image/video to the data. If the camera is rotated to "portrait mode", select 90 or 270 degrees, depending on the rotation direction. </p> <p> <b>CoG: Center of Gravity</b><br/> Defines the position of cx and cy. Depending on use case and camera mounting you may want these values to be in the center of the bounding box or places at the center-bottom. If the camera is mounted in the ceiling, looking stright down you should use "Center". If the camera is mounted on the wall, having a perspective view, select bottom (feet). </p> <p> <b>Max Idle</b><br/> The maximum time an object may be present in the scene before it is classified as dead. </p> <h3>Coordindate system</h3> <p> The coordintate system is [0,0...1000,1000] regardless of camera aspect ratio. The origo is in the top-left corner. To map coordinate to pixels: pixelX = (x / 1000) * image width; pixelY = (y / 1000) * image height <p> <h3>Property description</h3> <p> <pre> id: Unique ID of each object that can be used to tracker a specific object active: true while the object is being tracked. false when object is lost (left scene) class: Class name class: Class type distance: Distance traveled in percent of camera view. Distance may be longer than 100% if object moves back and forth. velocity: Depending on device color: Humen upper body or vehicle color color2: Human lower body vehicle: true/false if classified as vehicle face: true/false if classified as face is visable hat: "","Hat" or "Helmet" age: Seconds the object has been in scene birth: Timestamp when the object was detected. EPOCH ms resolution. timestamp: Current/last timestamp. EPOCH ms resolution x: Bounding box x position y: Bounding box y position w: Bounding box width h: Bounding box height cx: Center of gravity X. Placement depends on node configuration. cy: Center of gravity X bx: Birth X (center of gravity) by: Birth y (center of gravity) dx: Total delta X movement from bx. Negative value means left, positiv means right dy: Total delta Y movement from by. Negative value means up, positiv means down dwell: The longest dwell period in seconds in a single sample position path: An Array of sampled positions the object had moving through the scene. The first sample is the first place the object entered the scene { x: Sample position X y: Sample position Y d: Dwell time in seconds in the sampled position } </pre> </p> </script>