Skip to content

Latest commit

 

History

History
executable file
·
173 lines (126 loc) · 33.4 KB

README.md

File metadata and controls

executable file
·
173 lines (126 loc) · 33.4 KB

OpenCV_Projects

This repository includes any projects that I have completed in research, projects, or online classes: (Rajeev Ratan) and Satya Mallick (CEO) AI OpenCV Bootcamp. My main focus is to study fields that cross over Machine Learning (Convolutionary Neural Network, Support Vector Machines, and Clustering of K-means), Computer Vision and Data Science.

Contents:

  1. Basics of Computer Vision and OpenCV
  2. Image Manipulation and Processing
  3. Image Segmentation and Contours
  4. Object Detection Part 1: Intro
  5. Object Detection Part 2: Build a Face, people and Car Detectors
  6. Augmented Reality (AR): Facial Landmark Identification
  7. Simple Machine Learning using OpenCV
  8. Object Tracking and Motion Analysis
  9. Computational Photography
  10. Self Driving Cars
  11. Deep Learning

Sections:

Basics of Computer Vision and OpenCV

Image Processing. Learn some of the basics of image processing such as blurring an image, understanding image morphology, geometric transforms, and image histograms.

OpenCV Intro Learn how to display a simple image
plt.imshow(cv2.cvtColor(input, cv2.COLOR_BGR2RGB))
Grayscaling Grayscaling is a very popular technique in computer vision to find the gradient on edge points of an image.
Colors HSV-Hue Now we know how to convert BGR image to HSV, we can use this to extract a colored object. In HSV, it is more easier to represent a color than in BGR color-space. In our application, we will try to extract a blue colored object.
Colors Gray-RGB In OpenCV we can convert an RGB image into Grayscale by two ways: 1. By using cvtColor function. 2. By using imread function, where the first parameter specifies the image name while the second parameter specifies the format in which we need to add the image.
Color Red-Green-Blue Computers can only understand three colors: red, green, and blue. This topic helps us tweek the color intensity in RGB.
Histogram Histogram helps us understaqnd the distribution behind the colors of an image. This is important to know when you plan on compiling a machine learning algorithm with a balanced dataset
Drawings of Shapes If you ever need to have shapes to interact with the computer vision world like object detection, it's common to create digital shapes to represent them.

Image Manipulation and Processing

In this section we are going to see how we are going to manipulate the image using OpenCV. Here we will learn to apply the following function on an image using OpenCV: (1) Image Transformations – Affine and Non-Affine Transformation (2) Image Translations – Moving image up, down, left and right (3) Rotation of image – Spinning the image (4) Scaling, Resizing, and Interpolation (5) Image Pyramids – Another way of resizing (6) Cropping – Cutting out the image region you want (7) Arithmetic operations for Brightening and Darkening of images

Transformation In this chapter we learn how to transform images for rotation, scaling, bitwise pixel manipulations and edge detection. Before sending a picture or frame into a computer vision model, we need to adjust the features (histogram) in order to change quality.
Img Translation Img Translation will help you crop your picture to adjust the features within your input. For example if you needed to train an AI to detect a specific object, you would want to crop your main label and avoid pixels irrelevant to what your detecting.
Rotations Sometimes objects in an a image that need to be trained are not properly positioned correctly to help the AI understand the features we want to aggregate. Usuaing rotations we can help position the object correctly to help train our algorithm.
Scaling Sometimes zooming into a picture looses pixel quality. With scaling in opencv, we can generate new pixels to prevent blury content with zooming in.
Image Pyramids (Resize) Learn how to resize images to for visiual designers
Region of intrest (Crop) In self driving cars we need to focus on street lanes in order to teach a car to drive by itself. With region of interest, we can crop out a section of an image and focus on the pixels representing a street (Mode info under section (#Self-Driving-Cars))
Bitwise Operations (Mask) After grayscaling an image to detect edges with high gradients, it's neccessary to trigger a bitwise operation and seperate white and black pixels similar to logic gates with 1's and 0's.
Convolutions & Blurring There will be noise with aggregating pixels so using probability algorithms to generate new pixels like Gaussian will reduce noices and blurry content
Sharpening When a picture is blurry we can use interpolation to sharpen images
Thresholding When theres a huge intensity between black and white pixel, we calcualte the thershold in order to find the gradients for edges in an image
Dilation & Erosion The most basic morphological operations are dilation and erosion. Dilation adds pixels to the boundaries of objects in an image, while erosion removes pixels on object boundaries.
Edge Detection Identifying a variety of mathematical methods that aim at identifying points in a digital image at which the image brightness changes sharply or, more formally, has discontinuities.
Perspective & Affine Transforms Affine Transform is a function between affine spaces which preserves points, straight lines and planes.
Live Sketch Using Webcam A live webcam program converting each frame into grayscaling to compute the gradient to visualize the edges. Afterwards reverse bitwise operation to inverse white and black pixels.

Image Segmentation and Contours

Segmenting Images and Obtaining Interesting Points. Apply different algorithms to cluster data, segment images, as well as find and match interesting points in an image.

Segmentation and Contours Segmentation is the understanding of an image at the pixel level. Assigned an object class for each pixel in the image. After performing object clasification for each object, we also have to delineate the boundaries for them.
Sorting Contours With Sorting Contours you can (1) Adjust size/area, along with a template to follow to sort contours by any other arbitrary criteria. (2) Sort contoured regions from left-to-right, right-to-left, top-to-bottom, and bottom-to-top using only a single function.
Approx. Contours & Convex Convex hull (sometimes also called the convex envelope) of a set of points X in the Euclidean plane or Euclidean space is the smallest convex set that contains X.
Contours & Convex Live Stream Convex hull (sometimes also called the convex envelope) of a set of points X in the Euclidean plane or Euclidean space is the smallest convex set that contains X.
Matching Contour A Matching Countour find locations, sizes and orientations of predefined objects in an image. The matcher can be trained to identify and accurately locate objects based on the shape of their boundaries. The contours of objects are detected in a binary image. Hence, it is essential that the objects of interest can be separated from the background.
Identify Contour The contours are a useful tool for shape analysis and object detection and recognition.
Line Detection The Hough Line Transform is a transform used to detect straight lines. OpenCV implements three kinds of Hough Line Transforms:(Standard Hough Transform, SHT),(Multi-Scale Hough Transform, MSHT)and (Progressive Probabilistic Hough Transform, PPHT).
Circle Detection The Hough Circle Transform works in a roughly analogous way to the Hough Line Transform explained in the previous tutorial.
Blob Detection (Flowers) OpenCV provides a convenient way to detect blobs and filter them based on different characteristics.
Counting Shapes Find Contours in the image ( image should be binary as given in your question) Approximate each contour using approxPolyDP function.

Object Detection Part 1: Intro

Feature Description A feature descriptor is a representation of an image or an image patch that simplifies the image by extracting useful information and throwing away extraneous information.
Finding Waldo Using a template image of waldo, we're going find him through pixel matching which is a very static appropach. Biggest tradeoff using template is we cannot use the same static template for a new waldo image. Solution is to train an AI from a series of different waldo images.
Finding Corners To classify and or detect objects from an image, we need to find important features such as edges, corners (also known as interest points), or blobs (also known as regions of interest ). Corners are the intersection of two edges, it represents a point in which the directions of these two edges change. Hence, the gradient of the image (in both directions) have a high variation, which can be used to detect it.
Histogram of Oriented Gradients The distribution ( histograms ) of directions of gradients ( oriented gradients ) are used as features. Gradients ( x and y derivatives ) of an image are useful because the magnitude of gradients is large around edges and corners ( regions of abrupt intensity changes ) and we know that edges and corners pack in a lot more information about object shape than flat regions.

Object Detection Part 2: Build a Face, people and Car Detectors

HAAR Cascade Classifiers HAAR Cascade is a machine learning based approach where a cascade function is trained from a lot of positive and negative images. It is then used to detect objects in other images.
Face and Eye Detection Face & eye detection based on Haar-like classifiers, which is the most common technique in computer-vision for face and eye detection.
Car Video Detection Car detection based on Haar-like classifiers, which is the most common technique in computer-vision for cars.
Pedestrian Video Detection Pedestrian detection based on Haar-like classifiers, which is the most common technique in computer-vision for Pedestrian detection.

Augmented Reality (AR): Facial Landmark Identification

Recognizing Objects. Detect different shapes, faces, people, and learn how to train a detector to detect custom objects and to recognize faces.

Face Analysis and Filtering Locating a face in an image and returning a bounding rectangle / square that contains the face — was a hot research area.
Face Reader (Yawn Detector) Detecting drowsiness in drivers is not an easy task. If you want to develop a robust algorithm, first step is to robustly detect the face and track it over time.
Object Detector - AR
(Keras/TensorFlow)
This application is going to perform object detection from training data gathered on the webcam. The model will be coded in Keras.

Simple Machine Learning using OpenCV

Handwritten Digit Recognition Given an image dataset of numbers, we train the AI model to classify handwritten digits.
Credit Card Reader After performing object detection, we do instance segmentation to display the outline of an object (edge detection).
Facial Recognition The webcam will be activated to gather images of your face in order to find a pattern to classify a face.

Object Tracking and Motion Analysis

It's a displacement of each of the pixel compared to previous frame but how much that pixel move compared to previous frame. A displacement vector of a moving object is also known as the optical flow vector.

HSV Filter In order to filter you have a few options. Generally, you are probably going to convert your colors to HSV, which is "Hue Saturation Value." This can help you actually pinpoint a more specific color, based on hue and saturation ranges, with a variance of value.
Background Subtraction In background substraction, you get the foreground objects alone. But in most of the cases, you may not have such an image, so we need to extract the background from whatever images we have.
Meanshift (Object Tracking) Algorithm for locating the maxima of a density function and for tracking. For Meanshift we need to setup the target, find its histogram so that we can backproject the target on each frame for calculation of meanshift.
CAMshift (Object Tracking) It applies meanshift first. Once meanshift converges, it updates the size of the window. It also calculates the orientation of best fitting ellipse to it. It applies the meanshift with new scaled search window and previous window location. The process is continued until required accuracy is met.
Optical Flow Optical flow is the pattern of apparent motion of image objects between two consecutive frames caused by the movemement of object or camera. It is 2D vector field where each vector is a displacement vector showing the movement of points from first frame to second.
Ball Tracking Detect the presence of a colored ball using computer vision techniques. Track the ball as it moves around in the video frames, drawing its previous positions as it moves.

Computational Photography

Computational Photography. Create panoramas, remove unwanted objects from photos, enhance low light photographs, and work with High Dynamic Range (HDR) images. Calibration and Stereo Images. Learn how to calibrate cameras, remove distortion from images, change the 3D perspective of photographs, and work with stereo images to represent depth information.

Photo Denoising Perform image denoising using Non-local Means Denoising algorithm with several computational optimizations. Noise expected to be a gaussian white noise.
Photo Restoration Using a combination of hough transform and Photo denoising to filter out unwanted content from an image. For example we can remote lines off a picture.
Lisence Plate Recognition Next you will find some code which will let you to detect license plate. This project is divided mainly in two parts: plate detection and character recognition.

Self Driving Cars

Finding Lanes Finding lanes requires the expertise in: Canny edge detection, masking, hough lines transform, and calculating the average slope points.

Deep Learning

Neural Style Transfer (Image)
Neural Style Transfer (Video Stream)
Generate a new image/frame from transferring the style of another source that was optimized. The content from the input remains intact for the output.
Mask_RCNN (Keras/TensorFlow) Mask-RCNN is an advance form of instance segmentation. It contains two sub-problems: object detection and semantic segmentation.