1 canny edge detection edge detection
The effect is as follows:
2. How to use a computer to identify and detect straight lines?
Note: Not expressed in polar coordinates
1 Formula derivation
and uniquely determine a straight line: (the tangent of is the slope)
Additional knowledge: Trigonometric functions
Tangent_Baidu Encyclopedia (baidu.com)
Function name |
official |
---|---|
sinθ=y/r |
|
cosine function |
cosθ=x/r |
tangent function |
tanθ=y/x |
cotangent function |
cotθ=x/y |
secant function |
secθ=r/x |
cosecant function |
cscθ=r/y |
2 Start counting and vote for the straight line
对 和Trial area:
Calculate the position information (x, y) of the edge point using all angle intervals and vote in the above table.
Complete your vote:
Each group is a straight line. The more votes it gets, the more likely it is that it is the target straight line.
3. Code learning
I haven’t learned yet, but I have learned to write.