Summary of functions commonly used in OPENCV image processing (2)

Source: Internet
Author: User

1 //Hough Line transform Hough2Vector<vec2f> lines;//defines a vector structure lines used to store the resulting segment vector collection3Houghlines (Dstimage,lines,1, cv_pi/ the, Max);4     //draw each line segment in the diagram, in turn5      for(size_t i =0; i < lines.size (); i++)6     {7         floatRho = lines[i][0],theta = lines[i][1];8 Point pt1,pt2;9         DoubleA = cos (theta), B =sin (theta);Ten         Doublex0 = Rho*a,y0 = rho*b;//A is the line intersection axis perpendicular to the line (x0,y0) = (Rho*cos (theta), Rho*sin (theta)); One         //take the whole function up Cvceil, take down the whole function Cvfloor, rounding function Cvround; A  -pt1.x = Cvround (x0+ +* (-B));//1000 is to take the distance between two points, the amount of control; -Pt1.y = Cvround (y0+ +* (a));//Pt1 is a point on a higher; thept2.x = Cvround (x0- +* (-B));//Pt2 is a point at the lower of A; -Pt2.y = Cvround (y0- +*(a)); -  -Line (Dstimage,pt1,pt2,scalar ( -, -,195),1, CV_AA); +     } -Imshow ("Hough Detection Line chart", dstimage); +     //waitkey (0);

Summary of functions commonly used in OPENCV image processing (2)

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.