摘要 |
The present disclosure relates to a method and a device for detecting a straight line. The method includes: acquiring a gradient histogram feature set of each of respective pixel points in an image, wherein the gradient histogram feature set is configured to reflect straight line characteristics of a local area where the pixel point locates (102); determining at least one candidate direction of a straight line to be detected according to the gradient histogram feature sets of the respective pixel points (104); and determining a precise direction and a precise position of the straight line to be detected according to the at least one candidate direction (106). The present disclosure may avoid the influences of errors caused by binarization sufficiently, and increase the accuracy of the detection of the straight line. |