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.
1,726 lines • 50 kB
JSON
[
{
"id": "9fd4a5735bb18b0f",
"type": "tab",
"label": "Object Path",
"disabled": false,
"info": "",
"env": []
},
{
"id": "03c5ecfc8135d9c3",
"type": "group",
"z": "9fd4a5735bb18b0f",
"name": "Settings",
"style": {
"stroke": "#000000",
"fill": "#ffffbf",
"label": true,
"color": "#000000"
},
"nodes": [
"2299cfb9f604c585",
"92a3ce88a4d4ebdb",
"81e7381331ee7a4b",
"d49be8e64c1d1686",
"b4fb18bbad48c20e",
"222f697c308ee454",
"8eb3247485dcc931",
"97ce4f9f5f7ca0bf",
"3ed356365b6a298b",
"566d99c544d18ccc",
"7bb1b189d4253792",
"4fa41b822c0b45db",
"6e86143a14a56a9f",
"9e62f9ef8a0652f2",
"cf0ac0b29f0c459c",
"e7aaa80dd3b2fb43",
"22d7e840a21af194",
"89932e7fb74d6646"
],
"x": 254,
"y": 819,
"w": 992,
"h": 302
},
{
"id": "94f96b0b8ac6d0c2",
"type": "group",
"z": "9fd4a5735bb18b0f",
"name": "Output",
"style": {
"stroke": "#000000",
"fill": "#e3f3d3",
"label": true,
"color": "#000000"
},
"nodes": [
"9d1718a80691ad21",
"e25e15bbcd2237c1"
],
"x": 254,
"y": 299,
"w": 482,
"h": 82
},
{
"id": "3963326ed80d4976",
"type": "group",
"z": "9fd4a5735bb18b0f",
"name": "Video & Augmentation",
"style": {
"stroke": "#000000",
"fill": "#bfdbef",
"label": true,
"color": "#000000"
},
"nodes": [
"35aec098292737d4",
"6238f4ba3a0db884",
"99f473a7b959f639",
"882dd150e9e4f9e0"
],
"x": 254,
"y": 419,
"w": 752,
"h": 122
},
{
"id": "a92eaebc8d2e9f03",
"type": "group",
"z": "9fd4a5735bb18b0f",
"name": "Initialization",
"style": {
"stroke": "#000000",
"fill": "#ffffbf",
"label": true,
"color": "#000000"
},
"nodes": [
"e6fc7ad8988617b0",
"79a54f0fabc8c8b3",
"a6bb11afb49bbcff",
"6126716963ae3014",
"7bc0346c73a3d417",
"6a36aa02c8b518d2",
"a50d512fd11f58c4",
"0be311d09cf9f8ee",
"3ef8201898ce0988"
],
"x": 254,
"y": 579,
"w": 992,
"h": 202
},
{
"id": "e84bec260f0199c6",
"type": "group",
"z": "9fd4a5735bb18b0f",
"name": "Exception",
"style": {
"stroke": "#000000",
"fill": "#ffbfbf",
"label": true,
"color": "#000000"
},
"nodes": [
"266c492407f4c7ef",
"b02822eef15f7a10",
"db5d1e22db13abb1",
"619f5f99e538fbb4"
],
"x": 254,
"y": 1159,
"w": 612,
"h": 142
},
{
"id": "f97339366eddd210",
"type": "group",
"z": "9fd4a5735bb18b0f",
"name": "Initialization",
"style": {
"stroke": "#000000",
"fill": "#ffffbf",
"label": true,
"color": "#001f60"
},
"nodes": [
"9c7ecd2ceba7fb6f",
"1a26a9815820859f",
"ba777eda39888a41",
"65cd36921f7baa73",
"470fd3ed4f92d8f0",
"5b04eeec5b85cb94",
"f443f96b21110c8d",
"daab097666a9be41",
"f4a4d4365b21f69b",
"d59ce8f830d58fdd"
],
"x": 254,
"y": 39,
"w": 872,
"h": 222
},
{
"id": "6e86143a14a56a9f",
"type": "junction",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"x": 1220,
"y": 860,
"wires": [
[
"f72aeb99238dc270"
]
]
},
{
"id": "22d7e840a21af194",
"type": "junction",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"x": 800,
"y": 1040,
"wires": [
[
"f7f2164d90e86191"
]
]
},
{
"id": "9d1718a80691ad21",
"type": "Objects",
"z": "9fd4a5735bb18b0f",
"g": "94f96b0b8ac6d0c2",
"version": "1",
"output": "3",
"confidence": "20",
"rotation": "0",
"cog": "1",
"idle": "9999999",
"x": 330,
"y": 340,
"wires": [
[
"e25e15bbcd2237c1"
]
]
},
{
"id": "e25e15bbcd2237c1",
"type": "function",
"z": "9fd4a5735bb18b0f",
"g": "94f96b0b8ac6d0c2",
"name": "Filter",
"func": "var settings = flow.get(\"settings\");\nif(!settings)\n return;\n\nif( msg.payload.distance < settings.distance) \n return;\n\nif( msg.payload.confidence < settings.confidence )\n return;\n\nif( msg.payload.age < settings.age) \n return;\n\nvar classMatch = false;\nsettings.classes.forEach(function (element) {\n if (element === msg.payload.class) \n classMatch = true;\n if (element === \"Head\" && msg.payload.class === \"Face\")\n classMatch = true;\n});\n\nif(!classMatch)\n return;\n\nvar aoiMatch = false;\nmsg.payload.path.forEach(function(position) {\n if (!aoiMatch && \n position.x >= settings.aoi.x1 && \n position.x <= settings.aoi.x2 &&\n position.y >= settings.aoi.y1 &&\n position.y <= settings.aoi.y2)\n aoiMatch = true;\n});\n\nif( !aoiMatch )\n return;\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 660,
"y": 340,
"wires": [
[
"393efcbd740ceaee"
]
]
},
{
"id": "35aec098292737d4",
"type": "ui_template",
"z": "9fd4a5735bb18b0f",
"g": "3963326ed80d4976",
"group": "d9975f8969275bdb",
"name": "Visualization",
"order": 6,
"width": "16",
"height": "16",
"format": "<link rel=\"stylesheet\" href=\"/css/imgareaselect-default.css\">\n<script src=\"/js/jquery.imgareaselect.js\"></script>\n<script src=\"/js/media-stream-player.min.js\"></script>\n\n<div id=\"{{'view_'+$id}}\" style=\"width:800px; height:450px;\">\n <div style=\"width:100%; height:100%; position:relative\">\n <div id=\"{{'video_'+$id}}\" style=\"width:100%; height:100%; position:absolute; top:0px; left:0px;\"></div>\n <canvas id=\"{{'canvas_'+$id}}\" width=\"1000\" height=\"1000\" style=\"width:100%; height:100%; position:absolute; top:0px; left:0px;\"></canvas>\n </div>\n</div>\n\n\n<script>\nvar imageWidth = 800;\nvar imageHeight = 450;\nvar pathList = [];\nvar trackers = {};\nvar selectArea = null;\nvar selectionType = \"None\";\nvar ctx = null;\n\n(function(scope) {\n scope.$watch('msg', function(msg) {\n if( !msg || !msg.topic )\n return;\n console.log(msg.topic);\n\n switch( msg.topic ) {\n case \"init\":\n if( selectArea ) {\n selectArea.setOptions({hide: true});\n selectArea = null;\n }\n ClearCanvas();\n init(scope,msg.payload);\n break;\n\n case \"detections\":\n drawDetections( msg.payload );\n break;\n\n case \"tracker\":\n drawTracker( msg.payload );\n break;\n\n case \"path\":\n drawPath( msg.payload );\n break;\n\n case \"singlePath\":\n ClearCanvas();\n drawPath( msg.payload );\n break;\n\n case \"paths\":\n ClearCanvas();\n pathList = msg.payload;\n msg.payload.forEach(function(path){\n drawPath( path );\n });\n break;\n\n case \"reset\":\n case \"clear\":\n case \"save\":\n ClearCanvas();\n if( selectArea ) {\n selectArea.setOptions({hide: true});\n delete selectArea;\n selectArea = null;\n }\n break;\n\n case \"aoi\":\n case \"birth\":\n case \"death\":\n selectionType = msg.topic;\n if( selectArea ) {\n selectArea.setOptions({hide: true});\n delete selectArea;\n selectArea = null;\n }\n var x1 = parseInt(msg.payload.x1 / 1000 * imageWidth);\n var x2 = parseInt(msg.payload.x2 / 1000 * imageWidth);\n var y1 = parseInt(msg.payload.y1 / 1000 * imageHeight);\n var y2 = parseInt(msg.payload.y2 / 1000 * imageHeight);\n selectArea = $(\"#view_\"+scope.$id).imgAreaSelect( {\n x1:x1, y1:y1, x2:x2, y2:y2,\n show: true, hide:false, minHeight: 5, minWidth: 5, handles: true, movable: true, resizable: true, instance:true,\n onSelectEnd: function( image, area ) {\n var area = {\n id: selectionType,\n x1: parseInt((area.x1/imageWidth) * 1000),\n x2: parseInt((area.x2/imageWidth) * 1000),\n y1: parseInt((area.y1/imageHeight) * 1000),\n y2: parseInt((area.y2/imageHeight) * 1000)\n }\n scope.send({\n topic: selectionType,\n payload: area\n });\n }\n });\n selectArea.setOptions({ show: true });\n break;\n\t\t}\n });\n})(scope);\n\nfunction init( scope, camera ) {\n imageWidth = 800;\n imageHeight = 450;\n var aspect = camera.aspect || \"16:9\";\n var rotation = camera.rotation || 0;\n var resolution = camera.resolution || \"1280x720\";\n\n if( aspect === \"1:1\")\n imageHeight = 800;\n\n if( aspect === \"4:3\")\n imageHeight = 600;\n\n //Setup aspect ration\n if( rotation === 90 || rotation === 270 ) {\n var temp = imageWidth;\n imageWidth = imageHeight;\n imageHeight = temp;\n }\n\n $(\"#view_\"+scope.$id).css(\"width\", imageWidth + \"px\");\n $(\"#view_\"+scope.$id).css(\"height\", imageHeight+\"px\");\n\n $(\"#video_\"+scope.$id).empty();\n var player = '<media-stream-player hostname=\"'+window.location.hostname+'\" format=\"RTP_H264\" compression=\"40\" audio=\"0\" resolution=\"'+ resolution +'\" variant=\"basic\" autoplay></media-stream-player>';\n $(\"#video_\"+scope.$id).append(player);\n \n var canvas = document.getElementById(\"canvas_\"+scope.$id);\n ctx = canvas.getContext(\"2d\");\n\n if( selectArea ) {\n selectArea.setOptions({ hide: true });\n delete selectArea;\n }\n}\n\nfunction ClearCanvas() {\n if(ctx) {\n ctx.beginPath();\n ctx.clearRect(0, 0, 1000, 1000 );\n ctx.stroke();\n }\n}\n\nfunction drawDetections( detections ) {\n if(!ctx)\n return;\n ClearCanvas();\n if( detections.length === 0)\n return;\n\n ctx.beginPath();\n ctx.lineWidth = 3;\n ctx.font = \"30px Arial\";\n ctx.fillStyle = '#FFFF00';\n ctx.strokeStyle = '#FFFF00';\n detections.forEach( function(detection){\n ctx.rect(detection.x, detection.y,detection.w,detection.h );\n var text = detection.class || \"Undefined\";\n if( detection.hasOwnProperty(\"confidence\"))\n text += \" \" + detection.confidence;\n if( detection.hasOwnProperty(\"age\") )\n text += \" \" + detection.age + \"s\";\n ctx.fillText(text, detection.x, detection.y-10 );\n });\n ctx.stroke();\n}\n\nfunction drawTracker( tracker ) {\n if(!ctx)\n return;\n ClearCanvas();\n\n ctx.lineWidth = 3;\n ctx.strokeStyle = '#FFFF00';\n ctx.font = \"30px Arial\";\n ctx.fillStyle = '#FFFF00';\n\n trackers[tracker.id] = tracker;\n if( tracker.active === false )\n delete trackers[tracker.id];\n ctx.beginPath();\n for(var id in trackers) {\n if( trackers[id].hasOwnProperty(\"bx\")) {\n ctx.moveTo(trackers[id].bx,trackers[id].by);\n ctx.lineTo(trackers[id].cx,trackers[id].cy);\n }\n ctx.rect(trackers[id].x, trackers[id].y,trackers[id].w,trackers[id].h );\n var text = trackers[id].class || \"Undefined\";\n if( trackers[id].hasOwnProperty(\"confidence\"))\n text += \" \" + trackers[id].confidence;\n if( trackers[id].hasOwnProperty(\"age\"))\n text += \" \" + trackers[id].age + \"s\";\n ctx.fillText(text, trackers[id].x, trackers[id].y-10);\n }\n ctx.stroke();\n}\n\n\nfunction drawPath( data ) {\n if(!ctx)\n return;\n\n var first = data.path[0];\n var last = data.path[data.path.length-1];\n\n ctx.beginPath();\n ctx.lineWidth = 3;\n ctx.strokeStyle = '#00FF00';\n ctx.font = \"30px Arial\";\n ctx.fillStyle = '#FFFF00';\n ctx.moveTo(first.x, first.y );\n ctx.arc(first.x, first.y, 3, 0, 2 * Math.PI);\n // ctx.fillText(data.class, first.x, first.y - 10 );\n ctx.stroke();\n\n ctx.beginPath();\n ctx.strokeStyle = '#FFFF00';\n ctx.moveTo(data.path[0].x, data.path[0].y );\n for( var i = 1; i < data.path.length; i++ )\n ctx.lineTo(data.path[i].x,data.path[i].y ); ctx.lineTo(last.x,last.y );\n ctx.stroke(); ctx.beginPath();\n ctx.lineWidth=3;\n ctx.strokeStyle='#FF0000';\n ctx.moveTo(last.x, last.y );\n ctx.arc(last.x, last.y, 3, 0, 2 * Math.PI); ctx.stroke();\n}\n\n\n\n</script>",
"storeOutMessages": false,
"fwdInMessages": false,
"resendOnRefresh": false,
"templateScope": "local",
"className": "",
"x": 670,
"y": 500,
"wires": [
[
"6238f4ba3a0db884"
]
]
},
{
"id": "2299cfb9f604c585",
"type": "ui_numeric",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "",
"label": "Minimum age",
"tooltip": "",
"group": "fee77e68bc384be6",
"order": 3,
"width": 0,
"height": 0,
"wrap": false,
"passthru": false,
"topic": "topic",
"topicType": "msg",
"format": "{{value}}s",
"min": 0,
"max": 10,
"step": "0.5",
"className": "",
"x": 800,
"y": 940,
"wires": [
[
"81e7381331ee7a4b"
]
]
},
{
"id": "92a3ce88a4d4ebdb",
"type": "ui_numeric",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "",
"label": "Minimum distance",
"tooltip": "",
"group": "fee77e68bc384be6",
"order": 4,
"width": 0,
"height": 0,
"wrap": false,
"passthru": false,
"topic": "topic",
"topicType": "msg",
"format": "{{value}}%",
"min": 0,
"max": "100",
"step": "10",
"className": "",
"x": 810,
"y": 980,
"wires": [
[
"d49be8e64c1d1686"
]
]
},
{
"id": "81e7381331ee7a4b",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "",
"rules": [
{
"t": "set",
"p": "settings.age",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1040,
"y": 940,
"wires": [
[
"6e86143a14a56a9f"
]
]
},
{
"id": "d49be8e64c1d1686",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "",
"rules": [
{
"t": "set",
"p": "settings.distance",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1030,
"y": 980,
"wires": [
[
"6e86143a14a56a9f"
]
]
},
{
"id": "b4fb18bbad48c20e",
"type": "ui_dropdown",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "Classes",
"label": "Classes",
"tooltip": "",
"place": "Select detection",
"group": "fee77e68bc384be6",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"multiple": true,
"options": [
{
"label": "Human",
"value": "Human",
"type": "str"
},
{
"label": "Head",
"value": "Head",
"type": "str"
},
{
"label": "Bag",
"value": "Bag",
"type": "str"
},
{
"label": "Car",
"value": "Car",
"type": "str"
},
{
"label": "Truck",
"value": "Truck",
"type": "str"
},
{
"label": "Bus",
"value": "Bus",
"type": "str"
},
{
"label": "Bike",
"value": "Bike",
"type": "str"
},
{
"label": "Vehicle",
"value": "Vehicle",
"type": "str"
},
{
"label": "License plate",
"value": "License plate",
"type": "str"
},
{
"label": "Animal",
"value": "Animal",
"type": "str"
}
],
"payload": "",
"topic": "topic",
"topicType": "msg",
"className": "",
"x": 780,
"y": 900,
"wires": [
[
"222f697c308ee454"
]
]
},
{
"id": "222f697c308ee454",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "",
"rules": [
{
"t": "set",
"p": "settings.classes",
"pt": "flow",
"to": "payload",
"tot": "msg",
"dc": true
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1030,
"y": 900,
"wires": [
[
"6e86143a14a56a9f"
]
]
},
{
"id": "6238f4ba3a0db884",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "3963326ed80d4976",
"name": "",
"rules": [
{
"t": "set",
"p": "settings.aoi",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 890,
"y": 500,
"wires": [
[
"e9ec238b4704e967"
]
]
},
{
"id": "99f473a7b959f639",
"type": "ui_button",
"z": "9fd4a5735bb18b0f",
"g": "3963326ed80d4976",
"name": "",
"group": "fee77e68bc384be6",
"order": 4,
"width": "3",
"height": "1",
"passthru": true,
"label": "Start",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 330,
"y": 460,
"wires": [
[
"6d0da52293861184",
"882dd150e9e4f9e0"
]
]
},
{
"id": "8eb3247485dcc931",
"type": "ui_dropdown",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "Confidence",
"label": "Min confidence",
"tooltip": "",
"place": "Select detection",
"group": "fee77e68bc384be6",
"order": 5,
"width": 0,
"height": 0,
"passthru": false,
"multiple": false,
"options": [
{
"label": "10",
"value": 10,
"type": "num"
},
{
"label": "20",
"value": 20,
"type": "num"
},
{
"label": "30",
"value": 30,
"type": "num"
},
{
"label": "40",
"value": 40,
"type": "num"
},
{
"label": "50",
"value": 50,
"type": "num"
},
{
"label": "60",
"value": 60,
"type": "num"
},
{
"label": "70",
"value": 70,
"type": "num"
},
{
"label": "80",
"value": 80,
"type": "num"
},
{
"label": "90",
"value": 90,
"type": "num"
}
],
"payload": "",
"topic": "topic",
"topicType": "msg",
"className": "",
"x": 790,
"y": 860,
"wires": [
[
"89932e7fb74d6646"
]
]
},
{
"id": "393efcbd740ceaee",
"type": "link out",
"z": "9fd4a5735bb18b0f",
"name": "path",
"mode": "link",
"links": [
"4bfe2dbdbad7033a"
],
"x": 925,
"y": 340,
"wires": []
},
{
"id": "4bfe2dbdbad7033a",
"type": "link in",
"z": "9fd4a5735bb18b0f",
"name": "link in 1",
"links": [
"393efcbd740ceaee",
"f7f2164d90e86191"
],
"x": 75,
"y": 500,
"wires": [
[
"35aec098292737d4"
]
]
},
{
"id": "d036398fa5aa847c",
"type": "inject",
"z": "9fd4a5735bb18b0f",
"name": "On start",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "5",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 130,
"y": 660,
"wires": [
[
"e6fc7ad8988617b0"
]
]
},
{
"id": "c79fbe5e1bbd937b",
"type": "comment",
"z": "9fd4a5735bb18b0f",
"name": "path",
"info": "",
"x": 820,
"y": 340,
"wires": []
},
{
"id": "e6fc7ad8988617b0",
"type": "function",
"z": "9fd4a5735bb18b0f",
"g": "a92eaebc8d2e9f03",
"name": "Default settings",
"func": "msg.payload = {\n classes: [\"Human\", \"Car\"],\n age: 1,\n distance: 20,\n confidence: 30,\n aoi: {\n x1: 200,\n y1: 200,\n x2: 800,\n y2: 800\n },\n}\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 620,
"wires": [
[
"79a54f0fabc8c8b3"
]
]
},
{
"id": "79a54f0fabc8c8b3",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "a92eaebc8d2e9f03",
"name": "flow.settings",
"rules": [
{
"t": "set",
"p": "settings",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 570,
"y": 620,
"wires": [
[
"a6bb11afb49bbcff"
]
]
},
{
"id": "a6bb11afb49bbcff",
"type": "file in",
"z": "9fd4a5735bb18b0f",
"g": "a92eaebc8d2e9f03",
"name": "",
"filename": "sdcard/ObjectPath.json",
"filenameType": "str",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 790,
"y": 620,
"wires": [
[
"6126716963ae3014"
]
]
},
{
"id": "6126716963ae3014",
"type": "json",
"z": "9fd4a5735bb18b0f",
"g": "a92eaebc8d2e9f03",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 990,
"y": 620,
"wires": [
[
"7bc0346c73a3d417"
]
]
},
{
"id": "7bc0346c73a3d417",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "a92eaebc8d2e9f03",
"name": "flow.settings",
"rules": [
{
"t": "set",
"p": "settings",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1150,
"y": 620,
"wires": [
[
"1a1d3784f04063f3"
]
]
},
{
"id": "1a1d3784f04063f3",
"type": "link out",
"z": "9fd4a5735bb18b0f",
"name": "Initialized",
"mode": "link",
"links": [
"5122f81c0c9456d6"
],
"x": 1405,
"y": 620,
"wires": []
},
{
"id": "6a36aa02c8b518d2",
"type": "catch",
"z": "9fd4a5735bb18b0f",
"g": "a92eaebc8d2e9f03",
"name": "",
"scope": [
"a6bb11afb49bbcff"
],
"uncaught": false,
"x": 340,
"y": 700,
"wires": [
[
"a50d512fd11f58c4"
]
]
},
{
"id": "a50d512fd11f58c4",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "a92eaebc8d2e9f03",
"name": "flow.settings",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "settings",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 520,
"y": 740,
"wires": [
[
"0be311d09cf9f8ee"
]
]
},
{
"id": "bad2e19486ac97c2",
"type": "link in",
"z": "9fd4a5735bb18b0f",
"name": "Update Settings",
"links": [
"e9ec238b4704e967",
"f72aeb99238dc270"
],
"x": 75,
"y": 740,
"wires": [
[
"a50d512fd11f58c4"
]
]
},
{
"id": "0be311d09cf9f8ee",
"type": "function",
"z": "9fd4a5735bb18b0f",
"g": "a92eaebc8d2e9f03",
"name": "pretty",
"func": "msg.payload = JSON.stringify(msg.payload,null,2);\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 700,
"y": 740,
"wires": [
[
"3ef8201898ce0988"
]
]
},
{
"id": "3ef8201898ce0988",
"type": "file",
"z": "9fd4a5735bb18b0f",
"g": "a92eaebc8d2e9f03",
"name": "",
"filename": "sdcard/ObjectPath.json",
"filenameType": "str",
"appendNewline": false,
"createDir": true,
"overwriteFile": "true",
"encoding": "none",
"x": 920,
"y": 740,
"wires": [
[]
]
},
{
"id": "fcf874e490d6f32f",
"type": "comment",
"z": "9fd4a5735bb18b0f",
"name": "Init",
"info": "",
"x": 1310,
"y": 620,
"wires": []
},
{
"id": "e9ec238b4704e967",
"type": "link out",
"z": "9fd4a5735bb18b0f",
"name": "link out 17",
"mode": "link",
"links": [
"bad2e19486ac97c2"
],
"x": 1045,
"y": 500,
"wires": []
},
{
"id": "41eb94590e74c802",
"type": "comment",
"z": "9fd4a5735bb18b0f",
"name": "Update",
"info": "",
"x": 170,
"y": 740,
"wires": []
},
{
"id": "5122f81c0c9456d6",
"type": "link in",
"z": "9fd4a5735bb18b0f",
"name": "link in 18",
"links": [
"1a1d3784f04063f3"
],
"x": 75,
"y": 860,
"wires": [
[
"97ce4f9f5f7ca0bf"
]
]
},
{
"id": "97ce4f9f5f7ca0bf",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "settings",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 370,
"y": 860,
"wires": [
[
"3ed356365b6a298b",
"566d99c544d18ccc",
"7bb1b189d4253792",
"4fa41b822c0b45db"
]
]
},
{
"id": "3ed356365b6a298b",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "confidence",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.confidence",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 610,
"y": 860,
"wires": [
[
"8eb3247485dcc931"
]
]
},
{
"id": "566d99c544d18ccc",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "classes",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.classes",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 600,
"y": 900,
"wires": [
[
"b4fb18bbad48c20e"
]
]
},
{
"id": "7bb1b189d4253792",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "age",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.age",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 590,
"y": 940,
"wires": [
[
"2299cfb9f604c585"
]
]
},
{
"id": "4fa41b822c0b45db",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "distance",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.distance",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 600,
"y": 980,
"wires": [
[
"92a3ce88a4d4ebdb"
]
]
},
{
"id": "f72aeb99238dc270",
"type": "link out",
"z": "9fd4a5735bb18b0f",
"name": "Settings updated",
"mode": "link",
"links": [
"bad2e19486ac97c2"
],
"x": 1435,
"y": 860,
"wires": []
},
{
"id": "e933dd3e9b5cc8ec",
"type": "comment",
"z": "9fd4a5735bb18b0f",
"name": "Init",
"info": "",
"x": 170,
"y": 860,
"wires": []
},
{
"id": "d406f7eff3b0f84f",
"type": "comment",
"z": "9fd4a5735bb18b0f",
"name": "Updated",
"info": "",
"x": 1320,
"y": 860,
"wires": []
},
{
"id": "2a64224a23f8ab88",
"type": "comment",
"z": "9fd4a5735bb18b0f",
"name": "Visualize",
"info": "",
"x": 170,
"y": 500,
"wires": []
},
{
"id": "9e62f9ef8a0652f2",
"type": "ui_button",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "",
"group": "fee77e68bc384be6",
"order": 6,
"width": 0,
"height": 0,
"passthru": false,
"label": "Set area objects must pass",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 400,
"y": 1040,
"wires": [
[
"cf0ac0b29f0c459c"
]
]
},
{
"id": "cf0ac0b29f0c459c",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "settings.aoi",
"tot": "flow"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "aoi",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 660,
"y": 1040,
"wires": [
[
"22d7e840a21af194"
]
]
},
{
"id": "f7f2164d90e86191",
"type": "link out",
"z": "9fd4a5735bb18b0f",
"name": "link out 19",
"mode": "link",
"links": [
"4bfe2dbdbad7033a"
],
"x": 1445,
"y": 1040,
"wires": []
},
{
"id": "e7aaa80dd3b2fb43",
"type": "ui_button",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "",
"group": "fee77e68bc384be6",
"order": 9,
"width": 0,
"height": 0,
"passthru": false,
"label": "Save",
"tooltip": "",
"color": "",
"bgcolor": "green",
"className": "",
"icon": "",
"payload": "false",
"payloadType": "bool",
"topic": "save",
"topicType": "str",
"x": 670,
"y": 1080,
"wires": [
[
"22d7e840a21af194"
]
]
},
{
"id": "82022016a7bbc0a9",
"type": "comment",
"z": "9fd4a5735bb18b0f",
"name": "Visualize",
"info": "",
"x": 1340,
"y": 1040,
"wires": []
},
{
"id": "89932e7fb74d6646",
"type": "function",
"z": "9fd4a5735bb18b0f",
"g": "03c5ecfc8135d9c3",
"name": "set flow.settings.confidence",
"func": "var settings = flow.get(\"settings\");\nsettings.confidence = parseInt(msg.payload);\nflow.set(\"settings\", settings);\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1020,
"y": 860,
"wires": [
[
"6e86143a14a56a9f"
]
]
},
{
"id": "6d0da52293861184",
"type": "link out",
"z": "9fd4a5735bb18b0f",
"name": "Start",
"mode": "link",
"links": [
"6864a7fac0d973cf"
],
"x": 1045,
"y": 460,
"wires": []
},
{
"id": "9d82f5761a75b02a",
"type": "comment",
"z": "9fd4a5735bb18b0f",
"name": "Start",
"info": "",
"x": 170,
"y": 620,
"wires": []
},
{
"id": "6864a7fac0d973cf",
"type": "link in",
"z": "9fd4a5735bb18b0f",
"name": "link in 27",
"links": [
"6d0da52293861184"
],
"x": 75,
"y": 620,
"wires": [
[
"e6fc7ad8988617b0"
]
]
},
{
"id": "266c492407f4c7ef",
"type": "catch",
"z": "9fd4a5735bb18b0f",
"g": "e84bec260f0199c6",
"name": "",
"scope": null,
"uncaught": true,
"x": 360,
"y": 1200,
"wires": [
[
"b02822eef15f7a10",
"619f5f99e538fbb4"
]
]
},
{
"id": "b02822eef15f7a10",
"type": "function",
"z": "9fd4a5735bb18b0f",
"g": "e84bec260f0199c6",
"name": "Message",
"func": "msg.topic = \"ObjectPath\";\nmsg.payload = msg.error;\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 1200,
"wires": [
[
"db5d1e22db13abb1",
"5cb0b730e6b6d61c"
]
]
},
{
"id": "db5d1e22db13abb1",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "e84bec260f0199c6",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.message",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 760,
"y": 1260,
"wires": [
[
"8414c3f6d74f6d96"
]
]
},
{
"id": "8414c3f6d74f6d96",
"type": "ui_toast",
"z": "9fd4a5735bb18b0f",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"className": "",
"topic": "",
"name": "",
"x": 990,
"y": 1260,
"wires": [
[]
]
},
{
"id": "5cb0b730e6b6d61c",
"type": "link out",
"z": "9fd4a5735bb18b0f",
"name": "exception",
"mode": "link",
"links": [],
"x": 1065,
"y": 1200,
"wires": []
},
{
"id": "239680cdfcf1a986",
"type": "comment",
"z": "9fd4a5735bb18b0f",
"name": "exception",
"info": "",
"x": 960,
"y": 1200,
"wires": []
},
{
"id": "619f5f99e538fbb4",
"type": "debug",
"z": "9fd4a5735bb18b0f",
"g": "e84bec260f0199c6",
"name": "debug 199",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 530,
"y": 1260,
"wires": []
},
{
"id": "882dd150e9e4f9e0",
"type": "function",
"z": "9fd4a5735bb18b0f",
"g": "3963326ed80d4976",
"name": "Init",
"func": "msg.topic = \"init\";\nmsg.payload = {\n aspect: \"16:9\",\n rotation: 0,\n resolution: \"1280x720\"\n}\n\nvar camera = global.get(\"camera\");\nif ( camera ) {\n msg.payload.aspect = camera.aspect;\n msg.payload.rotation = camera.rotation;\n msg.payload.resolution = camera.largest;\n}\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 470,
"y": 460,
"wires": [
[
"35aec098292737d4"
]
]
},
{
"id": "9c7ecd2ceba7fb6f",
"type": "Axis device",
"z": "9fd4a5735bb18b0f",
"g": "f97339366eddd210",
"name": "",
"preset": "a5d60ef5587cc8fc",
"action": "Device Info",
"cgi": "",
"data": "",
"options": "",
"filename": "",
"x": 570,
"y": 140,
"wires": [
[
"1a26a9815820859f",
"f4a4d4365b21f69b"
]
]
},
{
"id": "1a26a9815820859f",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "f97339366eddd210",
"name": "",
"rules": [
{
"t": "set",
"p": "device",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 780,
"y": 140,
"wires": [
[
"65cd36921f7baa73"
]
]
},
{
"id": "ba777eda39888a41",
"type": "inject",
"z": "9fd4a5735bb18b0f",
"g": "f97339366eddd210",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 370,
"y": 140,
"wires": [
[
"9c7ecd2ceba7fb6f",
"470fd3ed4f92d8f0"
]
]
},
{
"id": "65cd36921f7baa73",
"type": "debug",
"z": "9fd4a5735bb18b0f",
"g": "f97339366eddd210",
"name": "Device",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1010,
"y": 140,
"wires": []
},
{
"id": "470fd3ed4f92d8f0",
"type": "Axis camera",
"z": "9fd4a5735bb18b0f",
"g": "f97339366eddd210",
"name": "",
"preset": "a5d60ef5587cc8fc",
"action": "Camera Info",
"resolution": "640x360",
"output": "Base64",
"filename": "",
"options": "",
"data": "",
"x": 570,
"y": 220,
"wires": [
[
"f443f96b21110c8d"
]
]
},
{
"id": "5b04eeec5b85cb94",
"type": "debug",
"z": "9fd4a5735bb18b0f",
"g": "f97339366eddd210",
"name": "Camera",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1020,
"y": 220,
"wires": []
},
{
"id": "f443f96b21110c8d",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "f97339366eddd210",
"name": "",
"rules": [
{
"t": "set",
"p": "camera",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 220,
"wires": [
[
"5b04eeec5b85cb94"
]
]
},
{
"id": "daab097666a9be41",
"type": "comment",
"z": "9fd4a5735bb18b0f",
"g": "f97339366eddd210",
"name": "Initialize by setting device credentials and click the blue box on the left side of \"timestamp\"",
"info": "",
"x": 600,
"y": 80,
"wires": []
},
{
"id": "f4a4d4365b21f69b",
"type": "change",
"z": "9fd4a5735bb18b0f",
"g": "f97339366eddd210",
"name": "",
"rules": [
{
"t": "set",
"p": "name",
"pt": "global",
"to": "payload.hostname",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 780,
"y": 180,
"wires": [
[
"d59ce8f830d58fdd"
]
]
},
{
"id": "d59ce8f830d58fdd",
"type": "debug",
"z": "9fd4a5735bb18b0f",
"g": "f97339366eddd210",
"name": "Name",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1010,
"y": 180,
"wires": []
},
{
"id": "d9975f8969275bdb",
"type": "ui_group",
"name": "Visualization",
"tab": "f40eac25c4fded65",
"order": 1,
"disp": false,
"width": "16",
"collapse": false,
"className": ""
},
{
"id": "fee77e68bc384be6",
"type": "ui_group",
"name": "Settings",
"tab": "f40eac25c4fded65",
"order": 2,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "a5d60ef5587cc8fc",
"type": "Device Access",
"name": "Localhost",
"address": "localhost",
"protocol": "http"
},
{
"id": "f40eac25c4fded65",
"type": "ui_tab",
"name": "Object Path",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]