How to set up OpenCV.js
(With detailed instructions for compiling from source)
OpenCV.js was created to help with the adaptability of OpenCV in web development. However, I (personally) find that the documentation online and from their official platform is rather uhh…ambiguous so here’s an outline for setting up OpenCV.js that hopefully helps :) There’s be two parts to this — Part I would be an outline of how to use it without compiling from source and Part II would be for people who have too much time to kill (AKA compiling from source) (I’m kidding, please don’t hate me internet — I’m just salty about how much time I spent trying to figure it out). Here goes:
PART I (Use directly without compiling)
Basically you just download the opencv.js file and then include it in the js directory of your project so with a directory like this:
└── openCV_JS ├── README.md ├── index.html └── js └── opencv.js
As for the opencv.js file, I used this version: https://docs.opencv.org/4.0.1/opencv.js but other versions are known to work too or there’s a nightly build at https://docs.opencv.org/master/opencv.js.