--- /dev/null
+AuthType Basic
+AuthName "Please enter your username and password"
+AuthUserFile /home/cubedesigners/demo1/1000pct/.htpasswd
+
+<RequireAny>
+ Require ip 88.190.245.49
+ Require ip 82.251.249.101
+ Require valid-user
+</RequireAny>
\ No newline at end of file
document.addEventListener('DOMContentLoaded', function () {
drawImage('assets/input.jpg', 'input', function () {
- detect();
+ var start=Date.now();
+ detectBoard(input);
+ console.log(Date.now()-start);
});
})
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);
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
<head>
<meta charset="UTF-8">
<title>Title</title>
- <script type="text/javascript" src="https://docs.opencv.org/master/opencv.js"></script>
+ <script src="https://docs.opencv.org/master/opencv.js"></script>
</head>
<body>
<canvas id="template" width="200" height="200"></canvas>