OpenCV 2.4.9 Study Notes (1) - Basic Structure

Something about OpenCV (2.4.9 version) study notes, as a record, so he forgot.

Installation and Configuration

  OpenCV download, install, and in various platforms (Windows / Linux, etc.) to configure Internet has a lot of information that they would not have saved. Besides when needed or encountered problems.

The basic modular structure

  OpenCV (Open Source Computer Vision Library), a protocol to follow the BSD open source computer vision library contains hundreds of computer vision algorithms. The latest version should be OpenCV3.0, alpha and beta have it all, I am currently using version 2.4.9,3.0 looks like there are a lot of 3D GPU related updates, very good, and then on the back of version 3.0 Learn. OpenCV 2.x API or a complete C ++ API, of course, there is the interface version supports a number of other languages. OpenCV modules include the following:

  1, core - core module base, defines some basic data structures need to use, as the core object includes a plurality of other modules in the array and other needs Mat.

  2, imgproc - an image processing module, including linear and nonlinear image filtering (Linear and Non-Linear Image Filtering), the geometric image conversion (e.g., zooming (the Resize), affine and perspective transformation (affine and perspective warping), generic table-based remapping), the color space transform (color space conversion) and histogram (histograms) and the like.

  3, video - video analysis module that includes motion estimation (Motion Estimation), background removal / background subtraction (Background Subtraction) and object tracking (Object Tracking) algorithm.

  4, calib3d - 3D image processing in a module comprising a basic multi-view geometry algorithm (basic multiple-view geometry algorithms), the monomer and the stereo camera calibration (Single and Stereo Camera Calibration), the object pose estimation (Object Pose reconstruction Estimation), binocular stereo matching (stereo Correspondence) algorithm and the elements (elements of 3D reconstruction).

  5, features2d - feature detection, description, matching algorithm module, contained significant feature detection algorithm (salient feature detectors), description operator (descriptors) and operator matching algorithm (descriptor matchers).

  6, objdetect - target detection module, detecting comprises detecting physical and some predefined objects, such as the face, eyes, cups, pedestrians, cars and the like.

  7, highgui - UI interface module for video capture (Video Capturing), image and video coding (Image and Video Codecs) and other functions to provide easy to use UI interface.

  8, gpu - gpu module, GPU acceleration modules to support other algorithms.

  9, ml - machine learning module, provides a variety of basic and classic machine learning algorithms for the implementation supports a variety of computer vision functions.

  10, there are other modules with less or is not very large, when used again after the record.

API Description

  Namespace: cv, all of OpenCV methods and functions need to use the namespace. Use cv :: symbols or using namespace cv. Such as:

1 #include "opencv2/core/core.hpp"
2 ...
3 cv::Mat H = cv::findHomography(points1, points2, CV_RANSAC, 5);
4 ...

Or this will do:

1 #include "opencv2/core/core.hpp"
2 using namespace cv;
3 ...
4 Mat H = findHomography(points1, points2, CV_RANSAC, 5 );
5 ...

  Some OpenCV existing or later there will be some new version naming and STL libraries or other libraries because of the same name and conflicts. In this case, it is necessary to write display namespace cv ::, as shown below:

1 Mat a(100, 100, CV_32F);
2 randu(a, Scalar::all(1), Scalar::all(std::rand()));
3 cv::log(a, a);
4 a /= std::log(2.)

 

Reproduced in: https: //www.cnblogs.com/charleshuang/p/4189232.html

Guess you like

Origin blog.csdn.net/weixin_34007886/article/details/93677535