OPENCV3 Introduction to Programming - Chapter VIII (image profile and image segmentation, restoration) study notes

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/hh5233/article/details/98759311

1. Find and contouring

(1) Looking outline: findContours () function
Here Insert Picture Description
Here Insert Picture Description

Note:
Here Insert Picture Description
(2) contouring: drawContours () function
Here Insert Picture Description
Here Insert Picture Description

 层次结构信息:https://blog.csdn.net/qq_36387683/article/details/80472043

2. Find the convex hull of the object

(1) the convex hull concept:
Here Insert Picture Description

(2) Find the convex hull function: convexHull ()
Here Insert Picture Description

The polygonal contour extraction
(1) Returns the outer boundary of the matrix: boundingRect () function
Here Insert Picture Description
(2) find minimum surrounding matrix: minAreaRect () function

Here Insert Picture Description
(3) Find the smallest enclosing circle: minEnclosingCiecle () function
Here Insert Picture Description
Here Insert Picture Description
(4) with a two-dimensional ellipse fitting point set: fitEllipse () function
Here Insert Picture Description
(4) a polygonal approximation curve: approxPolyDP () function
Here Insert Picture Description

 注:轮廓vertor容器contours[i]应该是包含了很多坐标信息,比如一个contours[0]就是一个轮廓的二维坐标点集

4. The image moments: in fact an integrated characteristic descriptors (translation satisfied, stretching, rotation invariance), which can calculate the length and area

Moment of the image (1) opencv in
Here Insert Picture Description
(2 moment calculation function: moments () - this function can return a value as a parameter, a function is calculated by contourArea () and arcLength () area and length
Here Insert Picture Description
(3) calculate the contour area : contourArea () Here Insert Picture Description
(. 4) to calculate the contour length: arcLength () function
Here Insert Picture Description
Here Insert Picture Description
opencv in the member variable understood Moments : https: //blog.csdn.net/ZZS_SZZ/article/details/84778584

(5) watershed algorithm
how feeling "diffuse water filling algorithm" and "watershed filling algorithm," the core idea almost
diffuse water filling algorithm (mainly seed sorting point, then set the threshold automatically selected regional and seed point is connected, then Alternatively the area with a specified color): https: //blog.csdn.net/qq_31531635/article/details/73337887
mask (cover off is unnecessary portion): with a selected image, or a graphic object, treated image (wholly or partially) blocking process performed to control the area or the image processing process. For covering a particular image or object referred to as a mask or template.
Here Insert Picture Description
(1) watershed () function
Here Insert Picture Description
The image patch

Here Insert Picture Description
Here Insert Picture Description
(1) inpainting function: inpaint () function
Here Insert Picture Description
Here Insert Picture Description

to sum up

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/hh5233/article/details/98759311