Before you begin your journey into the exciting world of Computer Vision, Deep Learning, and AI, you need to become an expert at using the world’s largest resource of Computer Vision, the OpenCV library. This free OpenCV course will teach you how to manipulate images and videos, and detect objects and faces, among other exciting topics in just about 3 hours.
Course Code
OCVBC
Course Code
Preparatory
Available in
Python
Price
Free
Select your preferences and run the install command.
To ensure that OpenCV is installed correctly, we can run the following example to show how to read and display image
import cv2 as cv
img = cv.imread("path/to/image")
cv.imshow("Display window", img)
k = cv.waitKey(0) # Wait for a keystroke in the window
#include
#include
using namespace cv;
int main()
{
std::string image_path = "path/to/image";
Mat img = imread(image_path, IMREAD_COLOR);
imshow("Display window", img);
int k = waitKey(0); // Wait for a keystroke in the window
return 0;
}
Hello OpenCV.js
Hello OpenCV.js
OpenCV.js is loading...
imageSrc
canvasOutput
let imgElement = document.getElementById('imageSrc');
let inputElement = document.getElementById('fileInput');
inputElement.addEventListener('change', (e) => {
imgElement.src = URL.createObjectURL(e.target.files[0]);
}, false);
imgElement.onload = function () {
let mat = cv.imread(imgElement);
cv.imshow('canvasOutput', mat);
mat.delete();
};
var Module = {
// https://emscripten.org/docs/api_reference/module.html#Module.onRuntimeInitialized
onRuntimeInitialized() {
document.getElementById('status').innerHTML = 'OpenCV.js is ready.';
}
};
Sign up to receive exclusive
discounts and special offers