OpenCV Bootcamp

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

Enroll for Free

Installation

Select your preferences and run the install command.

Operating System:
Linux
macOS
Windows
Building From Source:
Yes
No
Language:
Python
C++
Java
Android
iOS
JavaScript
Run this Command:
Default Result: pip3 install opencv-python

Verification

To ensure that OpenCV is installed correctly, we can run the following example to show how to read and display image

Python

Change path/to/image to a real path of an image, then run this demo
				
					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
				
			

C++

Change path/to/image to a real path of an image, then build this demo with OpenCV package and run it
				
					#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;
}
				
			

JavaScript

Copy this code into an html file and open it in your web browser
				
					


  
  <title>Hello OpenCV.js</title>


  <h2>Hello OpenCV.js</h2>
  <p id="status">OpenCV.js is loading...</p>
  <div>
    <div class="inputoutput">
      <img id="imageSrc" alt="No Image" />
      <div class="caption">imageSrc </div>
    </div>
    <div class="inputoutput">
      
      <div class="caption">canvasOutput</div>
    </div>
  </div>
  
    let imgElement = document.getElementById('imageSrc');
    let inputElement = document.getElementById('fileInput');
    inputElement.addEventListener('change', (e) =&gt; {
      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.';
      }
    };
  
  


				
			

Become a Member

Sign up to receive exclusive
discounts and special offers

New Course Launch “Advanced Vision Applications with DL & Transformers” – 40% Exclusive Discount
D
H
M
S
Expired