From: Vincent Vanwaelscappel Date: Mon, 25 Nov 2019 11:32:38 +0000 (+0100) Subject: wip #3206 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0196f5af2e969de529c7488ce86bc604a5d5b82e;p=1000pourcent.git wip #3206 @0.25 --- diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..bd3550b --- /dev/null +++ b/.htaccess @@ -0,0 +1,9 @@ +AuthType Basic +AuthName "Please enter your username and password" +AuthUserFile /home/cubedesigners/demo1/1000pct/.htpasswd + + + Require ip 88.190.245.49 + Require ip 82.251.249.101 + Require valid-user + \ No newline at end of file diff --git a/.htpasswd b/.htpasswd new file mode 100644 index 0000000..8483fe2 --- /dev/null +++ b/.htpasswd @@ -0,0 +1 @@ +1000pct:$apr1$a0v1CSrP$yGYBvju7bFPsjueBEDux0/ diff --git a/detect.js b/detect.js index 60b9eab..cae2a30 100644 --- a/detect.js +++ b/detect.js @@ -1,6 +1,8 @@ document.addEventListener('DOMContentLoaded', function () { drawImage('assets/input.jpg', 'input', function () { - detect(); + var start=Date.now(); + detectBoard(input); + console.log(Date.now()-start); }); }) @@ -14,8 +16,10 @@ function drawImage(url, canvas, callback) { img.src = url; } -function detect() { - let src = cv.imread('input'); +// Read the image input and detect the contour of the board. +// Return an array of points +function detectBoard(id) { + let src = cv.imread(id); let dst = cv.Mat.zeros(src.rows, src.cols, cv.CV_8UC3); let gray = new cv.Mat(); cv.cvtColor(src, gray, cv.COLOR_BGR2GRAY); @@ -75,6 +79,6 @@ function detect() { const vertex = {x: c.contour.data32S[j * 2], y: c.contour.data32S[j * 2 + 1]}; res.push(vertex); } - console.log(res); cv.imshow('output', dst); + return res; } \ No newline at end of file diff --git a/index.html b/index.html index 533ea0c..e5598a0 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ Title - +