OpenCV is mandatory when the subject is computer vision. The most popular free computer vision library, OpenCV offers to us many applicability to the image preprocessing, transformation and analysis. Use OpenCV can help us to obtain better results, because before apply any model, we must have good data to train. OpenCV also enable us to apply pre-trained models and, build computer vision applications,
Here, I present some examples how to use OpenCV starting from the basic concepts until deep applications. Most templates examples come from PyImageSearch and other sources. To better understand the templates, I've tried different images and videos, to be confronted with the parameterization of each problem. Let’s go on ahead.
The OpenCV folder is composed by others folders, organized in the follow manner:
-
This folder contains demonstrations of basic operations with OpenCV, as read image from disk or display it. The files inside the folder are:
- Basics OpenCV
- Covered Skills
- Image read
- Image visualization
- Image resize
- Image rotate
- Image smooth
- Image draw
- Covered Skills
- image_transfromation
- Covered Skills
- Translation
- Rotation
- Resizing
- Flipping
- Cropping
- Covered Skills
- image_transfromation2
- Covered Skills
- Image arithmetic
- Bitwise aperation
- Masking
- Splitting and amerging channels
- Covered Skills
- image_histogram
- Coverd Skills
- Image histogram
- Image 2D histogram
- Histogram equalization
- Mask and histogram
- Coverd Skills
- smoothing_blurring
- Coverd Skills
- Blurring with average method
- Blurring with Gaussian method
- Blurring with median method
- Blurring with bilateral method
- Coverd Skills
- threshold
- Covered Skills
- Simple threshold (binary and inverse)
- Adaptive threshold (mean and Gaussian)
- Otsu and Riddler-Calvard method
- Covered Skills
- gradient_edgedetection
- Covered Skills
- Gradient intensity (Laplacian and Sobel method)
- Edge detection (Canny algorithm)
- Covered Skills
- contours
- Covered Skills
- Find contours
- Draw contours
- Covered Skills
- Basics OpenCV
-
Simple application to count object in an image using OpenCV.
- Covered Skills
- convert images to gray scale
- edge detection
- thresholding
- finding, counting, and drawing contours
- conducting erosion and dilation
- mask
- Covered Skills
-
Deep Learning face-detection with openCV
Face detection with OpenCV and pre-trained Deep Neural Network. OpenCV library offers to us an elegant function to load pre-trained neural networks and make predictions. We must to download the weights of the dnn to load with OpenCV. In this project, we make face detection for some images, but it's also possible to make face recognition with your webcam by this file.
- Covered Skills
- OpenCV dnn function
- Create blobs for image transformation with dnn function
- Make face recognition with OpenCV (drawing rectangles and printing the confidence of the prediction)
- Covered Skills
-
Age detection with OpenCV requires two pre-trained models. One for face detection and another for age detection. This project presents face detection for images, and also for video stream.
- Coverd Skills
- OpenCV dnn function
- Create blobs for image transformation
- Extraction of Region of Interest (ROI)
- Prediction inside of ROI (age detection)
- Coverd Skills
-
Face recognition is another task that we can do with OpenCV. Previously, we’ve deployed a simple face detection, but this is not enough to recognize faces. With the face detection, we can grab the region of interest (ROI). From the ROI we can apply a CNN model to encode the faces into a 128-d features vector. As soon as we have the features vector, we can classify each face using a Machine Learning classification model. In this folder, we found two others folders. The first folder is an approach using OpenCV (dnn module to create the feature vector) and a Linear regression model. In the second folder, we deploy the face recognition using the Face Recognition library, this library is shortcut of the dlib library. The method is similar to the first, the difference here is, dlib takes care about image preprocessing, as face alignment, for example. We detect and recognize faces of three Brazilian singers, Chico Buarque, Gilberto Gil and Caetano Veloso.
-
Object detection is fundamental for Computer Vision tasks. For many applications, object detection is the first required step. For example, to count the number of cars on the road, we first detect and then, we use tracking algorithms to obtain the total of vehicles. We consider three pre-trained models, Faster R-CNN, SSD and YOLO, all of them trained on COCO dataset.