OpenCV Fitline Linear fitting function learning

Source: Internet
Author: User

is a detailed description of the line fitting function in the OPENCV Official document:

The Fitline () function is used to fit a point set in a two-dimensional or three-dimensional space in a straight line. A total of six parameters:

Param 1: The set of points entered, either Mat or VECTOR<>, which can be either a two-dimensional point set or a three-dimensional point set.

For example:

vector<point> points;

Param 2: Fit the result, i.e. a straight line. In a two-dimensional space, a line can be defined as

vec4f Line;

In a two-dimensional plane, (line[0],line[1]) represents a direction vector for a line, (Line[2],line[3]) that represents a point on a line.

Param 3: The fitting method, the CV_DIST_L2 is the simplest and fastest least squares, the recommended use.

PARAM 4: The value of the parameter C in the fitting method is set to 0, the optimal value is automatically selected.

Param 5 & param 6: Officially recommended 0.01.

OpenCV Fitline Linear fitting function learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.