This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta | |
name="viewport" | |
content="width=device-width,initial-scale=1,shrink-to-fit=no" | |
/> | |
<link rel="shortcut icon" href="./favicon.png" /> | |
<!-- Primary Meta Tags --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<video class="input_video"></video> | |
<div class="canvas-container"> | |
<canvas class="output_canvas" width="1280px" height="720px"> | |
</canvas> | |
</div> | |
<div class="loading"> | |
<div class="spinner"></div> | |
<div class="message"> | |
Loading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Jimp = require('jimp'); | |
async function onRuntimeInitialized(){ | |
// load local image file with jimp. It supports jpg, png, bmp, tiff and gif: | |
var jimpSrc = await Jimp.read('./lena.png'); | |
// `jimpImage.bitmap` property has the decoded ImageData that we can use to create a cv:Mat | |
var src = cv.matFromImageData(jimpSrc.bitmap); | |
// following lines is copy&paste of opencv.js dilate tutorial: | |
let dst = new cv.Mat(); | |
let M = cv.Mat.ones(5, 5, cv.CV_8U); | |
let anchor = new cv.Point(-1, -1); |