diff --git a/frontend/src/components/blocks/collection/opencv/Threshold.json b/frontend/src/components/blocks/collection/opencv/Threshold.json index bd409ce4..ee320620 100644 --- a/frontend/src/components/blocks/collection/opencv/Threshold.json +++ b/frontend/src/components/blocks/collection/opencv/Threshold.json @@ -1 +1 @@ -{"editor":{"id":"60e8cdc7-34d3-4beb-80de-2bddc03d423f","locked":false,"offsetX":0,"offsetY":0,"zoom":100,"gridSize":0,"layers":[{"id":"f4fd5b41-3e1a-4182-8a5e-8be002669590","type":"diagram-links","isSvg":true,"transformed":true,"models":{"24de608e-f5bb-45de-8304-5e5bed4b7004":{"id":"24de608e-f5bb-45de-8304-5e5bed4b7004","type":"default","selected":false,"source":"42f6bb63-7252-482d-a7f3-6b56663b4170","sourcePort":"be9fa214-ee16-4021-a6f4-2c6ccc807002","target":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","targetPort":"9003bc47-4862-4317-a655-19234120a0ca","points":[{"id":"97c7d028-2d02-417d-b462-27a11c7af737","type":"point","x":304.5,"y":354.5},{"id":"385f5905-8d63-411f-9e67-4d9ae11333e8","type":"point","x":360.5,"y":425.33331298828125}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"},"1651d64a-2338-4447-8a41-927b053d45df":{"id":"1651d64a-2338-4447-8a41-927b053d45df","type":"default","selected":false,"source":"035c4ce2-fc29-489b-8461-68a82050f5fa","sourcePort":"d24cd2f9-860d-4165-925a-1d6e7db57550","target":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","targetPort":"7a8ae1d7-5550-44a7-9bdb-efa8fffbc3c0","points":[{"id":"d872cdfe-09d2-4e03-911f-681f21f56806","type":"point","x":301.5,"y":669.5},{"id":"07bed4b9-ab2d-4f72-9f94-5cb369b88519","type":"point","x":360.5,"y":611.6666870117188}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"},"f00e117f-f142-4079-bb0b-8249e4248b2a":{"id":"f00e117f-f142-4079-bb0b-8249e4248b2a","type":"default","selected":false,"source":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","sourcePort":"84c3dbd9-b8d6-46a2-83b4-2c672b6ca6b2","target":"961a922a-6682-4abe-b2bc-096b4a31e942","targetPort":"f5f94e30-a2c9-4352-8ff3-9b163740e11c","points":[{"id":"d18dbd5b-88ec-4444-b7dd-a491c559c0da","type":"point","x":1437.1500244140625,"y":518.5},{"id":"9c478c09-8edf-4fa6-ab96-5a99486a1fe6","type":"point","x":1486.5,"y":517.5}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"},"548f6298-a206-4f2a-9021-7ae270f18ba2":{"id":"548f6298-a206-4f2a-9021-7ae270f18ba2","type":"default","selected":false,"source":"0006-88523d6e-871d-4b39-a998-ccf599c8f890","sourcePort":"58e14719-baa6-4d8e-ac50-28bdd06b429f","target":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","targetPort":"6c1de753-46a8-435b-922a-17e17216a9ca","points":[{"id":"8e7ec302-f891-4499-a6ee-a53424c38466","type":"point","x":698,"y":127.5},{"id":"70731f19-f6d3-44e9-a55f-9a140ba5f760","type":"point","x":704.7999877929688,"y":239}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"},"b39c688c-ff35-428a-add8-cff7de6c30de":{"id":"b39c688c-ff35-428a-add8-cff7de6c30de","type":"default","selected":false,"source":"0007-674ec4e7-1eae-4b2d-acf8-73d848ad8ac5","sourcePort":"78a14d59-a014-47e4-819f-9902aef71a51","target":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","targetPort":"dc1c974e-3e78-4827-b331-0fce9bdb0076","points":[{"id":"9fd1f6aa-78c8-4c0a-b025-3790346c8771","type":"point","x":1119,"y":127.5},{"id":"6eb1b7b4-a842-48bb-ba01-f17010cdb2b1","type":"point","x":1093.2833251953125,"y":239}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"}}},{"id":"e5288b4f-d279-465c-83ae-50efec729959","type":"diagram-nodes","isSvg":false,"transformed":true,"models":{"b0a6e3f0-98af-4959-8237-19a66cbabb1e":{"id":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","type":"basic.code","selected":false,"x":352,"y":161,"ports":[{"id":"9003bc47-4862-4317-a655-19234120a0ca","type":"port.input","x":353,"y":417.83331298828125,"name":"Img","alignment":"left","parentNode":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","links":["24de608e-f5bb-45de-8304-5e5bed4b7004"],"in":true,"label":"Img","hideLabel":false},{"id":"7a8ae1d7-5550-44a7-9bdb-efa8fffbc3c0","type":"port.input","x":353,"y":604.1666870117188,"name":"Enable","alignment":"left","parentNode":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","links":["1651d64a-2338-4447-8a41-927b053d45df"],"in":true,"label":"Enable","hideLabel":false},{"id":"84c3dbd9-b8d6-46a2-83b4-2c672b6ca6b2","type":"port.output","x":1429.6500244140625,"y":511,"name":"Out","alignment":"right","parentNode":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","links":["f00e117f-f142-4079-bb0b-8249e4248b2a"],"in":false,"label":"Out","hideLabel":false},{"id":"6c1de753-46a8-435b-922a-17e17216a9ca","type":"port.parameter","x":697.2999877929688,"y":231.5,"name":"Lower Threshold","alignment":"top","parentNode":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","links":["548f6298-a206-4f2a-9021-7ae270f18ba2"],"in":true,"label":"Lower Threshold","hideLabel":false},{"id":"dc1c974e-3e78-4827-b331-0fce9bdb0076","type":"port.parameter","x":1085.7833251953125,"y":231.5,"name":"Upper Threshold","alignment":"top","parentNode":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","links":["b39c688c-ff35-428a-add8-cff7de6c30de"],"in":true,"label":"Upper Threshold","hideLabel":false}],"data":{"code":"import cv2\nimport numpy as np\n\ndef main(inputs, outputs, parameters, synchronise):\n\n lower = parameters.read_number(\"LowerThreshold\"))\n upper = parameters.read_number(\"UpperThreshold\"))\n \n auto_enable = False\n try:\n enable = inputs.read_number(\"Enable\")\n except Exception:\n auto_enable = True\n\n while(auto_enable or inputs.read_number('Enable')):\n frame = inputs.read_image(\"Img\")\n if frame is None:\n continue\n\n frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)\n (T, thresh) = cv2.threshold(frame, lower, upper, cv2.THRESH_BINARY)\n output = cv2.cvtColor(thresh, cv2.COLOR_GRAY2BGR)\n \n outputs.share_image('Out', output)\n\n synchronise()","frequency":"30","params":[{"name":"Lower Threshold"},{"name":"Upper Threshold"}],"ports":{"in":[{"name":"Img"},{"name":"Enable"}],"out":[{"name":"Out"}]},"size":{"width":"958px","height":"500px"}}},"42f6bb63-7252-482d-a7f3-6b56663b4170":{"id":"42f6bb63-7252-482d-a7f3-6b56663b4170","type":"basic.input","selected":false,"x":211,"y":328,"ports":[{"id":"be9fa214-ee16-4021-a6f4-2c6ccc807002","type":"port.output","x":297,"y":347,"name":"input-out","alignment":"right","parentNode":"42f6bb63-7252-482d-a7f3-6b56663b4170","links":["24de608e-f5bb-45de-8304-5e5bed4b7004"],"in":false,"label":"Img","hideLabel":true}],"data":{"name":"Img"}},"961a922a-6682-4abe-b2bc-096b4a31e942":{"id":"961a922a-6682-4abe-b2bc-096b4a31e942","type":"basic.output","selected":false,"x":1478,"y":491,"ports":[{"id":"f5f94e30-a2c9-4352-8ff3-9b163740e11c","type":"port.input","x":1479,"y":510,"name":"output-in","alignment":"left","parentNode":"961a922a-6682-4abe-b2bc-096b4a31e942","links":["f00e117f-f142-4079-bb0b-8249e4248b2a"],"in":true,"label":"output-in","hideLabel":true}],"data":{"name":"Out"}},"035c4ce2-fc29-489b-8461-68a82050f5fa":{"id":"035c4ce2-fc29-489b-8461-68a82050f5fa","type":"basic.input","selected":false,"x":208,"y":643,"ports":[{"id":"d24cd2f9-860d-4165-925a-1d6e7db57550","type":"port.output","x":294,"y":662,"name":"input-out","alignment":"right","parentNode":"035c4ce2-fc29-489b-8461-68a82050f5fa","links":["1651d64a-2338-4447-8a41-927b053d45df"],"in":false,"label":"Enable","hideLabel":true}],"data":{"name":"Enable"}},"0006-88523d6e-871d-4b39-a998-ccf599c8f890":{"id":"0006-88523d6e-871d-4b39-a998-ccf599c8f890","type":"basic.constant","selected":false,"x":637,"y":12,"ports":[{"id":"58e14719-baa6-4d8e-ac50-28bdd06b429f","type":"port.output","x":690.5,"y":120,"name":"constant-out","alignment":"bottom","parentNode":"0006-88523d6e-871d-4b39-a998-ccf599c8f890","links":["548f6298-a206-4f2a-9021-7ae270f18ba2"],"in":false,"label":"Lower Threshold","hideLabel":true}],"data":{"name":"Lower Threshold","value":"127","local":true}},"0007-674ec4e7-1eae-4b2d-acf8-73d848ad8ac5":{"id":"0007-674ec4e7-1eae-4b2d-acf8-73d848ad8ac5","type":"basic.constant","selected":true,"x":1057,"y":11,"ports":[{"id":"78a14d59-a014-47e4-819f-9902aef71a51","type":"port.output","x":1111.5,"y":120,"name":"constant-out","alignment":"bottom","parentNode":"0007-674ec4e7-1eae-4b2d-acf8-73d848ad8ac5","links":["b39c688c-ff35-428a-add8-cff7de6c30de"],"in":false,"label":"Upper Threshold","hideLabel":true}],"data":{"name":"Upper Threshold","value":"255","local":true}}}}]},"version":"3.0","package":{"name":"Threshold","version":"2.0.0","description":"Thresholds an Image","author":"Muhammad Taha, Toshan Luktuke ","image":"data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNTA2LjEgNTA2LjEiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgNTA2LjEgNTA2LjEiIHdpZHRoPSI1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQ4OS42MDkgMGgtNDczLjExOGMtOS4xMDggMC0xNi40OTEgNy4zODMtMTYuNDkxIDE2LjQ5MXY0NzMuMTE4YzAgOS4xMDcgNy4zODMgMTYuNDkxIDE2LjQ5MSA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0OC02LjI0OC0xNi4zNzktNi4yNDgtMjIuNjI3IDBsLTIxLjI1OCAyMS4yNThjLTExLjkzNCAxMS45MzMuNTEyIDMxLjk4OCAxNi41NzEgMjYuNDA5djEyNS4yNTVoLTMyLjE5NmM1LjU4Mi0xNi4wNjUtMTQuNDg1LTI4LjQ5Ny0yNi40MDktMTYuNTcxbC0yMS4yNTggMjEuMjU3Yy02LjI0OSA2LjI0OS02LjI0OSAxNi4zNzkgMCAyMi42Mjh6bTE2Mi44MTggNDkuMTQ4Yy04LjY0NC0xMy41Ny0xNS43OS00OS43OTktMTguOTQ2LTY1LjcxOWgzNy44OTRjLTMuMTQzIDE1Ljg0NS0xMC4yOTggNTIuMTQ1LTE4Ljk0OCA2NS43MTl6bTc2LjY5OC0xNjMuNDM5YzguNjQ3IDEzLjU2OSAxNS43OTYgNDkuODI0IDE4Ljk0OCA2NS43MmgtMzcuODk2YzMuMTQ2LTE1Ljg2OCAxMC4yOTgtNTIuMTQ3IDE4Ljk0OC02NS43MnptLTE0OC45MTEgOS4yNDRjNi4xODggMTUuNjExIDExLjExNyAzOS41OTUgMTQuNDY0IDU2LjQ3NmgtMTQuNDY0eiIvPjwvc3ZnPg=="},"design":{"board":"Python3-Noetic","graph":{"blocks":[{"id":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","type":"basic.code","data":{"code":"import cv2\nimport numpy as np\n\ndef main(inputs, outputs, parameters, synchronise):\n\n lower = parameters.read_number(\"LowerThreshold\"))\n upper = parameters.read_number(\"UpperThreshold\"))\n \n auto_enable = False\n try:\n enable = inputs.read_number(\"Enable\")\n except Exception:\n auto_enable = True\n\n while(auto_enable or inputs.read_number('Enable')):\n frame = inputs.read_image(\"Img\")\n if frame is None:\n continue\n\n frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)\n (T, thresh) = cv2.threshold(frame, lower, upper, cv2.THRESH_BINARY)\n output = cv2.cvtColor(thresh, cv2.COLOR_GRAY2BGR)\n \n outputs.share_image('Out', output)\n\n synchronise()","frequency":"30","params":[{"name":"Lower Threshold"},{"name":"Upper Threshold"}],"ports":{"in":[{"name":"Img"},{"name":"Enable"}],"out":[{"name":"Out"}]},"size":{"width":"958px","height":"19px"}},"position":{"x":352,"y":161}},{"id":"42f6bb63-7252-482d-a7f3-6b56663b4170","type":"basic.input","data":{"name":"Img"},"position":{"x":211,"y":328}},{"id":"961a922a-6682-4abe-b2bc-096b4a31e942","type":"basic.output","data":{"name":"Out"},"position":{"x":1478,"y":491}},{"id":"035c4ce2-fc29-489b-8461-68a82050f5fa","type":"basic.input","data":{"name":"Enable"},"position":{"x":208,"y":643}},{"id":"0006-88523d6e-871d-4b39-a998-ccf599c8f890","type":"basic.constant","data":{"name":"Lower Threshold","value":"127","local":true},"position":{"x":637,"y":12}},{"id":"0007-674ec4e7-1eae-4b2d-acf8-73d848ad8ac5","type":"basic.constant","data":{"name":"Upper Threshold","value":"255","local":true},"position":{"x":1057,"y":11}}],"wires":[{"source":{"block":"42f6bb63-7252-482d-a7f3-6b56663b4170","port":"input-out","name":"Img"},"target":{"block":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","port":"Img","name":"Img"}},{"source":{"block":"035c4ce2-fc29-489b-8461-68a82050f5fa","port":"input-out","name":"Enable"},"target":{"block":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","port":"Enable","name":"Enable"}},{"source":{"block":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","port":"Out","name":"Out"},"target":{"block":"961a922a-6682-4abe-b2bc-096b4a31e942","port":"output-in","name":"output-in"}},{"source":{"block":"0006-88523d6e-871d-4b39-a998-ccf599c8f890","port":"constant-out","name":"Lower Threshold"},"target":{"block":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","port":"Lower Threshold","name":"Lower Threshold"}},{"source":{"block":"0007-674ec4e7-1eae-4b2d-acf8-73d848ad8ac5","port":"constant-out","name":"Upper Threshold"},"target":{"block":"b0a6e3f0-98af-4959-8237-19a66cbabb1e","port":"Upper Threshold","name":"Upper Threshold"}}]}},"dependencies":{}} \ No newline at end of file +{"editor":{"id":"7a330963-48a1-456d-9ed1-2f9e3967c8b6","offsetX":-46,"offsetY":-19,"zoom":100,"gridSize":0,"layers":[{"id":"2990741e-0de7-47ab-bf6d-206ba8f96b9e","type":"diagram-links","isSvg":true,"transformed":true,"models":{"ae48c6f9-0338-475b-ad0f-c6903c04afe3":{"id":"ae48c6f9-0338-475b-ad0f-c6903c04afe3","type":"default","selected":false,"source":"0004-ac7002a6-40c7-4418-962f-7c675c6f001e","sourcePort":"3fd3f5a4-258f-4dbd-b514-550dceded179","target":"33dd5494-98bc-4b04-8a69-51b382dcab04","targetPort":"ddafbdd4-8729-4bcc-a740-c318beb72ba6","points":[{"id":"2928341b-75d6-47b8-b996-c00fdf792f21","type":"point","x":777,"y":180.5},{"id":"fcd73268-c4e5-4109-b2d4-59bd35e04beb","type":"point","x":772.2000122070312,"y":307}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"},"a54359c2-68f1-41e9-b216-90132a934041":{"id":"a54359c2-68f1-41e9-b216-90132a934041","type":"default","selected":false,"source":"0005-112cbdff-42c7-474a-9fa5-68735f94a527","sourcePort":"9e1a9ad4-39aa-4b68-ab87-49e2cc64389d","target":"33dd5494-98bc-4b04-8a69-51b382dcab04","targetPort":"78250a38-3f43-4f1d-9bc1-5ff8eff0d08c","points":[{"id":"1c061d17-e832-45ce-933c-df92aff0376a","type":"point","x":1080,"y":181.5},{"id":"4b234cc2-afbe-4070-8fdb-5ee1b12f44c8","type":"point","x":1082.88330078125,"y":307}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"},"fad61610-1530-4cdb-9a1b-c43648e0e0ac":{"id":"fad61610-1530-4cdb-9a1b-c43648e0e0ac","type":"default","selected":false,"source":"1c04d721-6333-406c-888f-50596ce70b5b","sourcePort":"55477181-3603-4709-8343-7fb95d8a142a","target":"33dd5494-98bc-4b04-8a69-51b382dcab04","targetPort":"df503268-8b0c-4635-abe4-d9a68c24ea96","points":[{"id":"35d51f64-fc03-4843-96b0-bd7154d200df","type":"point","x":432.5,"y":666.5},{"id":"705290ea-a0ff-4235-9991-0d5b5f3362ec","type":"point","x":504.5,"y":643.6666870117188}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"},"4125f060-e74b-4f2e-b338-8d67a25b78e8":{"id":"4125f060-e74b-4f2e-b338-8d67a25b78e8","type":"default","selected":false,"source":"ab27ff70-412a-4feb-b328-824b9555dee8","sourcePort":"2e88feb2-7fa4-441e-be8d-c17d3e4c3038","target":"33dd5494-98bc-4b04-8a69-51b382dcab04","targetPort":"86dfaa43-5b80-444c-bc27-b82b9a335c20","points":[{"id":"0345cc1b-cbc6-40fb-a8ab-ea754c319bb3","type":"point","x":433.5,"y":454.5},{"id":"30f54fb0-c023-4226-8aea-a663f9eff489","type":"point","x":504.5,"y":475.33331298828125}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"},"26ced5b7-64b4-47b6-b064-9998324b0891":{"id":"26ced5b7-64b4-47b6-b064-9998324b0891","type":"default","selected":false,"source":"33dd5494-98bc-4b04-8a69-51b382dcab04","sourcePort":"f5186f9c-972f-44c8-8b15-968bfe8345a0","target":"c818c9da-dc27-4ce7-895a-24e94bdfcc16","targetPort":"3d661d50-0b0d-469b-a0bd-6792c4709904","points":[{"id":"199327ee-b30c-4202-a57d-5345cc8f22ee","type":"point","x":1350.1500244140625,"y":559.5},{"id":"55b0d239-4080-4d09-96ed-33aec2775d7f","type":"point","x":1474.5,"y":547.5}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"}}},{"id":"ffe49c03-0dda-4b28-8744-0db353688078","type":"diagram-nodes","isSvg":false,"transformed":true,"models":{"ab27ff70-412a-4feb-b328-824b9555dee8":{"id":"ab27ff70-412a-4feb-b328-824b9555dee8","type":"basic.input","selected":true,"x":339,"y":427,"ports":[{"id":"2e88feb2-7fa4-441e-be8d-c17d3e4c3038","type":"port.output","x":426,"y":447,"name":"input-out","alignment":"right","parentNode":"ab27ff70-412a-4feb-b328-824b9555dee8","links":["4125f060-e74b-4f2e-b338-8d67a25b78e8"],"in":false,"label":"Img","hideLabel":true}],"data":{"name":"Img"}},"1c04d721-6333-406c-888f-50596ce70b5b":{"id":"1c04d721-6333-406c-888f-50596ce70b5b","type":"basic.input","selected":false,"x":339,"y":640,"ports":[{"id":"55477181-3603-4709-8343-7fb95d8a142a","type":"port.output","x":425,"y":659,"name":"input-out","alignment":"right","parentNode":"1c04d721-6333-406c-888f-50596ce70b5b","links":["fad61610-1530-4cdb-9a1b-c43648e0e0ac"],"in":false,"label":"Enable","hideLabel":true}],"data":{"name":"Enable"}},"33dd5494-98bc-4b04-8a69-51b382dcab04":{"id":"33dd5494-98bc-4b04-8a69-51b382dcab04","type":"basic.code","selected":false,"x":496,"y":229,"ports":[{"id":"86dfaa43-5b80-444c-bc27-b82b9a335c20","type":"port.input","x":497,"y":467.83331298828125,"name":"Img","alignment":"left","parentNode":"33dd5494-98bc-4b04-8a69-51b382dcab04","links":["4125f060-e74b-4f2e-b338-8d67a25b78e8"],"in":true,"label":"Img","hideLabel":false},{"id":"df503268-8b0c-4635-abe4-d9a68c24ea96","type":"port.input","x":497,"y":636.1666870117188,"name":"Enable","alignment":"left","parentNode":"33dd5494-98bc-4b04-8a69-51b382dcab04","links":["fad61610-1530-4cdb-9a1b-c43648e0e0ac"],"in":true,"label":"Enable","hideLabel":false},{"id":"f5186f9c-972f-44c8-8b15-968bfe8345a0","type":"port.output","x":1342.6500244140625,"y":552,"name":"Out","alignment":"right","parentNode":"33dd5494-98bc-4b04-8a69-51b382dcab04","links":["26ced5b7-64b4-47b6-b064-9998324b0891"],"in":false,"label":"Out","hideLabel":false},{"id":"ddafbdd4-8729-4bcc-a740-c318beb72ba6","type":"port.parameter","x":764.7000122070312,"y":299.5,"name":"LowerThreshold","alignment":"top","parentNode":"33dd5494-98bc-4b04-8a69-51b382dcab04","links":["ae48c6f9-0338-475b-ad0f-c6903c04afe3"],"in":true,"label":"LowerThreshold","hideLabel":false},{"id":"78250a38-3f43-4f1d-9bc1-5ff8eff0d08c","type":"port.parameter","x":1075.38330078125,"y":299.5,"name":"UpperThreshold","alignment":"top","parentNode":"33dd5494-98bc-4b04-8a69-51b382dcab04","links":["a54359c2-68f1-41e9-b216-90132a934041"],"in":true,"label":"UpperThreshold","hideLabel":false}],"data":{"code":"import cv2\nimport numpy as np\n\ndef main(inputs, outputs, parameters, synchronise):\n\n lower = parameters.read_number(\"LowerThreshold\")\n upper = parameters.read_number(\"UpperThreshold\")\n \n auto_enable = False\n try:\n enable = inputs.read_number(\"Enable\")\n except Exception:\n auto_enable = True\n\n while(auto_enable or inputs.read_number('Enable')):\n frame = inputs.read_image(\"Img\")\n if frame is None:\n continue\n\n frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)\n (T, thresh) = cv2.threshold(frame, lower, upper, cv2.THRESH_BINARY)\n output = cv2.cvtColor(thresh, cv2.COLOR_GRAY2BGR)\n \n outputs.share_image('Out', output)\n\n synchronise()","frequency":"30","params":[{"name":"LowerThreshold"},{"name":"UpperThreshold"}],"ports":{"in":[{"name":"Img"},{"name":"Enable"}],"out":[{"name":"Out"}]},"size":{"width":"727px","height":"500px"}}},"0004-ac7002a6-40c7-4418-962f-7c675c6f001e":{"id":"0004-ac7002a6-40c7-4418-962f-7c675c6f001e","type":"basic.constant","selected":false,"x":716,"y":65,"ports":[{"id":"3fd3f5a4-258f-4dbd-b514-550dceded179","type":"port.output","x":769.5,"y":173,"name":"constant-out","alignment":"bottom","parentNode":"0004-ac7002a6-40c7-4418-962f-7c675c6f001e","links":["ae48c6f9-0338-475b-ad0f-c6903c04afe3"],"in":false,"label":"Lower Threshold","hideLabel":true}],"data":{"name":"Lower Threshold","value":"127","local":true}},"0005-112cbdff-42c7-474a-9fa5-68735f94a527":{"id":"0005-112cbdff-42c7-474a-9fa5-68735f94a527","type":"basic.constant","selected":false,"x":1019,"y":66,"ports":[{"id":"9e1a9ad4-39aa-4b68-ab87-49e2cc64389d","type":"port.output","x":1072.5,"y":174,"name":"constant-out","alignment":"bottom","parentNode":"0005-112cbdff-42c7-474a-9fa5-68735f94a527","links":["a54359c2-68f1-41e9-b216-90132a934041"],"in":false,"label":"Upper Threshold","hideLabel":true}],"data":{"name":"Upper Threshold","value":"255","local":true}},"c818c9da-dc27-4ce7-895a-24e94bdfcc16":{"id":"c818c9da-dc27-4ce7-895a-24e94bdfcc16","type":"basic.output","selected":false,"x":1466,"y":521,"ports":[{"id":"3d661d50-0b0d-469b-a0bd-6792c4709904","type":"port.input","x":1467,"y":540,"name":"output-in","alignment":"left","parentNode":"c818c9da-dc27-4ce7-895a-24e94bdfcc16","links":["26ced5b7-64b4-47b6-b064-9998324b0891"],"in":true,"label":"output-in","hideLabel":true}],"data":{"name":"Out"}}}}]},"version":"3.0","package":{"name":"Threshold","version":"2.0.0","description":"Thresholds an Image","author":"Muhammad Taha, Toshan Luktuke","image":"data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNTA2LjEgNTA2LjEiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgNTA2LjEgNTA2LjEiIHdpZHRoPSI1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQ4OS42MDkgMGgtNDczLjExOGMtOS4xMDggMC0xNi40OTEgNy4zODMtMTYuNDkxIDE2LjQ5MXY0NzMuMTE4YzAgOS4xMDcgNy4zODMgMTYuNDkxIDE2LjQ5MSAxNi40OTFoNDczLjExOGM5LjEwNyAwIDE2LjQ5MS03LjM4MyAxNi40OTEtMTYuNDkxdi00NzMuMTE4YzAtOS4xMDgtNy4zODQtMTYuNDkxLTE2LjQ5MS0xNi40OTF6IiBmaWxsPSIjYWNlZDcwIi8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wNjUtMTQuNDg1LTI4LjQ5Ny0yNi40MDktMTYuNTcxbC0yMS4yNTggMjEuMjU3Yy02LjI0OSA2LjI0OS02LjI0OSAxNi4zNzkgMCAyMi42Mjh6bTE2Mi44MTggNDkuMTQ4Yy04LjY0NC0xMy41Ny0xNS43OS00OS43OTktMTguOTQ2LTY1LjcxOWgzNy44OTRjLTMuMTQzIDE1Ljg0NS0xMC4yOTggNTIuMTQ1LTE4Ljk0OCA2NS43MTl6bTc2LjY5OC0xNjMuNDM5YzguNjQ3IDEzLjU2OSAxNS43OTYgNDkuODI0IDE4Ljk0OCA2NS43MmgtMzcuODk2YzMuMTQ2LTE1Ljg2OCAxMC4yOTgtNTIuMTQ3IDE4Ljk0OC02NS43MnptLTE0OC45MTEgOS4yNDRjNi4xODggMTUuNjExIDExLjExNyAzOS41OTUgMTQuNDY0IDU2LjQ3NmgtMTQuNDY0eiIvPjwvc3ZnPg=="},"design":{"board":"Python3-Noetic","graph":{"blocks":[{"id":"ab27ff70-412a-4feb-b328-824b9555dee8","type":"basic.input","data":{"name":"Img"},"position":{"x":339,"y":427}},{"id":"1c04d721-6333-406c-888f-50596ce70b5b","type":"basic.input","data":{"name":"Enable"},"position":{"x":339,"y":640}},{"id":"33dd5494-98bc-4b04-8a69-51b382dcab04","type":"basic.code","data":{"code":"import cv2\nimport numpy as np\n\ndef main(inputs, outputs, parameters, synchronise):\n\n lower = parameters.read_number(\"LowerThreshold\")\n upper = parameters.read_number(\"UpperThreshold\")\n \n auto_enable = False\n try:\n enable = inputs.read_number(\"Enable\")\n except Exception:\n auto_enable = True\n\n while(auto_enable or inputs.read_number('Enable')):\n frame = inputs.read_image(\"Img\")\n if frame is None:\n continue\n\n frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)\n (T, thresh) = cv2.threshold(frame, lower, upper, cv2.THRESH_BINARY)\n output = cv2.cvtColor(thresh, cv2.COLOR_GRAY2BGR)\n \n outputs.share_image('Out', output)\n\n synchronise()","frequency":"30","params":[{"name":"LowerThreshold"},{"name":"UpperThreshold"}],"ports":{"in":[{"name":"Img"},{"name":"Enable"}],"out":[{"name":"Out"}]},"size":{"width":"727px","height":"14px"}},"position":{"x":496,"y":229}},{"id":"0004-ac7002a6-40c7-4418-962f-7c675c6f001e","type":"basic.constant","data":{"name":"Lower Threshold","value":"127","local":true},"position":{"x":716,"y":65}},{"id":"0005-112cbdff-42c7-474a-9fa5-68735f94a527","type":"basic.constant","data":{"name":"Upper Threshold","value":"255","local":true},"position":{"x":1019,"y":66}},{"id":"c818c9da-dc27-4ce7-895a-24e94bdfcc16","type":"basic.output","data":{"name":"Out"},"position":{"x":1466,"y":521}}],"wires":[{"source":{"block":"0004-ac7002a6-40c7-4418-962f-7c675c6f001e","port":"constant-out","name":"Lower Threshold"},"target":{"block":"33dd5494-98bc-4b04-8a69-51b382dcab04","port":"LowerThreshold","name":"LowerThreshold"}},{"source":{"block":"0005-112cbdff-42c7-474a-9fa5-68735f94a527","port":"constant-out","name":"Upper Threshold"},"target":{"block":"33dd5494-98bc-4b04-8a69-51b382dcab04","port":"UpperThreshold","name":"UpperThreshold"}},{"source":{"block":"1c04d721-6333-406c-888f-50596ce70b5b","port":"input-out","name":"Enable"},"target":{"block":"33dd5494-98bc-4b04-8a69-51b382dcab04","port":"Enable","name":"Enable"}},{"source":{"block":"ab27ff70-412a-4feb-b328-824b9555dee8","port":"input-out","name":"Img"},"target":{"block":"33dd5494-98bc-4b04-8a69-51b382dcab04","port":"Img","name":"Img"}},{"source":{"block":"33dd5494-98bc-4b04-8a69-51b382dcab04","port":"Out","name":"Out"},"target":{"block":"c818c9da-dc27-4ce7-895a-24e94bdfcc16","port":"output-in","name":"output-in"}}]}},"dependencies":{}} \ No newline at end of file