2019-10-23 opencv official website tutorial learning summary

Official website

For image processing, the basic step is:
Step1 acquired image data.
Step2 image smoothing.
Step3 edge detection threshold analysis.
Step4 morphological operations.
STEP5 some of the characteristics points.
Step6 data analysis.

gui characteristics of 1.opencv

1-1. Drawing learning

2. Core Operating Core Operations

2-1. Basic Operation / math / performance measurement and improvement

3.opencv image processing Image Processing in OpenCV

3-1. Color space conversion and object tracking Changing Colorspaces

  • The most commonly used it two kinds BGR ↔ Gray and BGR ↔ HSV
  • BRG need to object tracking image into HSV space. In the HSV space, it is easier than BRG space represents a particular color.

3-2. The image geometric conversion (zoom / pan / rotation / affine / perspective transformation) Geometric Transformations of Images

3-3. Threshold Image (Image Thresholding)
an image thresholding is an image segmentation method implemented. Select an appropriate threshold to determine whether each pixel should belong to the target image region or the background region, generating the final binary image corresponding to the image segmentation.

3-4 image smoothing processing (Smoothing Images) - low-pass filtering

  • Smooth "is generally known as" vague ", is a simple common image processing operations. There are many reasons for smoothing, but is usually used to remove noise and camera distortion in the lower image resolution, smoothing is very important of.
  • Need to use a low-pass filter smoothing. The most commonly used filter is a linear filter.
  • A low pass filter, its role is to remove noise from an image.

3-5. Morphological transformation (Morphological Transformations)

  • Morphological changes can be used to address noise suppression, feature extraction, edge detection, image segmentation, shape recognition, texture analysis, image restoration and reconstruction, image processing such as image compression problems.
  • Erosion, dilation, opening, closing operation, morphological gradient, top hat, black hat, structural elements (nuclear rectangular, circular core, oval core)

3-6. Image gradient (Image will find the Gradients) - high-pass filtering

  • For finding the edge of the object
  • Image edge gradient operation is generally carried out by the image realized. Gradient value may be understood as an image change gradation
  • opencv provides three types of gradient filter, or a high pass filter. Sobel, Scharr and Laplacian.
  • High-pass filter, primarily to image features extracted image recognition, feature here is generally characterized edge texture. Because the edges in the image and texture details are high-frequency signals.

3-7 Edge detection Canny Edge Detection
as follows:

  • Noise reduction (smoothing image - a low pass filter)
  • Calculating image gradients, edge found (high pass filter)
  • Non-maxima suppression, to exclude non-edge pixels
  • Double hysteresis thresholding, a high threshold and a low threshold. Recommended Canny high: low threshold ratio 2: 1: 1-3. When the gray-level gradient above maxVal points are considered true boundary, below minVal it will be discarded. Between the two, depending on the point of whether one is connected to determine the true boundary point, if you think it is also a boundary point, if not abandoned.

3-8. Image pyramid (Image Pyramids) - Image Fusion

  • Laplacian pyramid
  • Using the image pyramid image fusion, it can be fused to two images together seamlessly, without increasing too much on the image data

3-9. Profile

All profiles are connected to the connection point along the boundary curves, these connection points have the same color and intensity.
Profile shape analysis, detection and identification of the target is useful.

3-9-1. Overview / drawing / approximation

  • findContours()
  • drawContours()

3-9-2. Profile features -Contour Features (moment / area of the contour perimeter / convex hull / rectangle / circular / elliptical boundary / linear

3-9-3. Characteristic profile -Contour Properties (aspect ratio / range / compaction / equivalent diameter / direction / mask and pixel / small maximum value / average color intensity and / extreme point)

3-9-4. More function -More Functions (convex defects / polygon point to the test / pattern matching -hu moment)

3-9-5. Profile hierarchy Hierarchy Contours (including four kinds of search mode)

  • The relationship between the profile and the other a profile image
  • Each has a profile contains information: [Next, Previous, First_Child, Parent]
  • RETR_LIST: just extract all the contours, not to create a parent-child relationship. All the contours belong to a hierarchy with.
  • RETR_EXTERNAL: returns only the most external contour, all sub-contours are ignored. Suitable only want the situation of the outermost contour.
  • RETR_CCOMP: will return all the contours and the outline is divided into 2 structure.
  • RETR_TREE: get all the contours, and create a complete hierarchy.

3-10 histogram

Can be understood as the histogram is a graph that allows you to grayscale images have a comprehensive understanding of the distribution.
It is the X-axis pixel values (typically 0-255), Y-axis and the X axis is the number of pixels corresponding points.
Image histogram is another way of understanding.
Histogram of the image, you can intuitively understand the contrast, brightness, intensity distribution. Now all the image processing tools provide a histogram function.

3-10-1. Acquisition, drawing and analysis, mask (Find, Plot, Analyze)

3-10-2. Equalization (Equalization)

  • A good image, pixel values ​​should be published in all areas of the image. If the pixel values ​​of an image are concentrated within a certain range, it is necessary to move up to the second end lateral histogram. This is the histogram equalization.
  • Typically, equalization will increase the contrast of the image.

3-10-3. 2D histogram (2D Histograms)

  • Two-dimensional histogram, we need to consider two features, usually it is used for color histograms.
  • We need to consider two color histogram feature, the pixel color (Hue), and saturation (Saturation).
  • Histogram is preferable to use a color histogram, histogram instead, because the color of the object can be better than the gradation of the object definition object.

3-10-4. Backprojection (Backprojection) - find interesting part / image segmentation
it outputs the input image and the same size (single channel). Each pixel on the output image represents the probability that the target pixel belongs to the object corresponding to the input image. Then Simply put, the output image, we are interested target audience will be more white than others.

3-11 . Image transformation - found image Fourier transform (Image Transforms)

  • Fourier transform is often used to analyze the frequency characteristic of the filter
  • The image amplitude is drastic change boundary portion and noise, which are high frequency portion. Little change in the amplitude part is the low frequency part.

3-12 . Template matching (Template Matching)
template matching method is found in a large template image to image. opencv provide cv.matchTemplate () function to achieve this functionality.

3-13. Hoffman linear transform (Hough Line Transform)
identify a straight line in the image

3-14. Hoffman circular transform (Hough Circle Transform)
to identify the image circle

3-15. Watershed image segmentation algorithm (Image Segmentation with Watershed Algorithm)

3-16. CrabCut interactive foreground extraction algorithm (Interactive Foreground Extraction using GrabCut Algorithm)

4. Detection and features described in Feature Detection and Description

4-1. Understanding of the features Understanding Features

4-2. Harris corner detection Harris Corner Detection

  • It was found in the corners of the image
  • Rotationally invariant

4-3. Shi-Tomasi corner detection Shi-Tomasi Corner Detector & Good Features
to Track for target tracking. Harris corner detection improved

4-4 describes the SIFT (Scale Invariant Feature Transform) Introduction to the SIFT (Scale-Invariant the Feature the Transform)
the SIFT: rotation, zoom scale, luminance variation remains invariant.
step:

  • Scale space extrema detection
  • The key point positioning
  • Direction assignment
  • The key point descriptor
  • The key point matching

4-5. Introduction SURF (SIFT algorithm improved version) Introduction to SURF (Speeded-Up
Robust Features) on the efficiency of SURF algorithm SIFT algorithm run faster than speaking.

4-6. Fast corner detection algorithm (Algorithm for the FAST Corner Detection)
the FAST (Features from the Test Accelerated Segment) algorithm introduced, as well as its solutions flaws and

4-7. The BRIEF (Elementary work of the Independent Binary the Robust Features) descriptor and fast calculation matching

  • BRIEF: Algorithm describe the feature point has been detected, it is a binary coded descriptor using BRIEF matching speed can be greatly improved at the time of image matching.
  • BRIEF disadvantage native more obvious, does not have rotation invariance, scale invariance and do not have the sensitivity to noise, but the algorithm is simple and low computational complexity, fast calculation.

4-8. The ORB (Oriented FAST and Rotated BRIEF)
the ORB taken FAST algorithm detects feature points, the feature point taken BRIEF algorithm descriptor
they solve the problem of SIFT features is the high computational cost, and lack BRIEF feature itself does not rotate degeneration, scale invariance and sensitivity to noise weakness.
BRIEF based FAST and features set forth in the binary signature string (0,1) in the time SIFT than 100 times faster, 10 times faster than SURF, and the match also very effective.

4.9. Feature Matching Feature Matching

  • Brute-Force Matcher match violence
  • Based FLANN matcher. FLANN is Fast Library for Approximate Nearest Neighbors (fast approximate nearest neighbor search base) for short

4-10. Feature matching homography + (Homography, projection map) to find the object (Feature Matching + Homography to find Objects )

  • Homography is a transformation (3 * 3 matrix), maps a point in the drawing points corresponding to the other sheets in FIG.
  • Homography projection plane is defined as a mapping from one plane to another plane.

5. Video Video Analysis Analysis

5-1. Meanshift (mean shift) and on Camshift (continuous adaptive mean shift, the object distance changes in accordance with the tracking window size)
is used for target tracking

5-2. Light Optical Flow Flow
important method of moving image analysis

  • Since optical flow is caused by the camera moving object or image object between two successive frames depends on motion (apparent motion) mode.
  • The optical flow field is a vector, each vector is the first frame to the display point displacement vector (displacement vector) from the second frame moves.

5-3. Background Removal Background Subtraction

6. The three-dimensional reconstruction and camera calibration Camera Calibration and 3D Reconstruction

Three-dimensional reconstruction is the central task of computer vision. Refers to the process of restoring three-dimensional geometry of the object from the two-dimensional image, the main steps are: determining a corresponding point of the image, internal and external camera calibration parameters, key reconstruction, reconstruction dense point, texture mapping,

Camera calibration purposes: determining the position of a point in three-dimensional geometric space in the image surface of the object and its relationship between the corresponding points, the camera imaging geometry model, the model parameter is the geometric parameters of the camera

6-1. Camera calibration Camera Calibration

  • Distortion of an image (distortion): radial distortion and tangential distortion.
  • Camera calibration: find the internal and external parameters, and the distortion parameters of the camera.
  • After calibration is usually do two things: one is due to the distortion of each shot varies, this lens can be corrected by calibrating the distortion aberration correction, generating image correction; the other is a three-dimensional reconstruction images obtained Scenes.

6-2. Pose estimation Pose Estimation
using calculation results of calibration object pose or position of the object in space.
Rendering cube applications.

6-3. Epipolar geometry Epipolar Geometry
As access to configuration information for the entire 3D world through a single image is unlikely. It is possible to use epipolar geometry, through a multi-camera, a relationship between the projection point and the 3D point on the image plane of each camera.

6-4. Stereoscopic image in the depth map Depth Map from Stereo Images

  • Depth map wide range of applications, due to its distance from the camera to objects in the scene can be recorded, may be used to measure the synthesis, 3D reconstruction, and virtual viewpoint
  • Left by the same scene, two right-viewpoint image acquired using stereo matching disparity map matching algorithm, then obtain the depth map.

7. Machine Learning Machine Learning

7-1.KNN algorithm, K neighbors (K-Nearest Neighbor)
7-1-1. Appreciated that the KNN
7-1-2. Use kNN recognize handwritten data OCR (OCR of Hand-written Data using kNN)

7-2.SVM algorithms, support vector machine (Support the Vector Machines (SVM))
7-2-1. Understanding SVM
7-2-2. Using SVM recognize handwritten data OCR (OCR of Hand-written Data using SVM)

7-3.k means clustering (K-Means Clustering)
7-3-1. Understanding Means-K
7-3-2. OpenCV in k-means clustering (K-Means Clustering in OpenCV)

8. Calculate photography Computational Photography

8-1. Denoising Image Denoising
nonlocal mean denoising, Non-Local Means Denoising. Good Gaussian smoothing / median ratio

8-2. The image restoration Inpainting Image
2 algorithms, we need a mask

8-3. High dynamic range image High Dynamic Range (HDR)
provides more dynamic range and image detail, and better reflect the visual effects in the real environment

9. The object detection Object Detection

9-1. Use Haar classifiers face detection Face Detection using Haar Cascades

10.OpenCV-Python Bindings

10-1. OpenCV and python bindings is how to achieve?

Published 122 original articles · won praise 7 · views 20000 +

Guess you like

Origin blog.csdn.net/weixin_42555985/article/details/102694771