The invention discloses a
visual detection method and device for the straightness of a
pipe, and relates to the technical field of
pipe straightness detection.The straightness of the
pipe is detected in the process that the pipe moves forwards along the axis, two cameras with imaging planes perpendicular to each other are arranged on the circumference of the pipe, and the main optical axes of the two cameras are both perpendicular to the axial direction of the pipe; obtaining internal and external parameters of the two cameras through calibration and establishing a three-dimensional coordinate
system; determining the image taking frequency of a camera according to the pipe length and the movement speed, so that an overlapping area exists between adjacent frames of the camera; the two cameras
shoot two pipe images at the same time according to the image taking frequency,
feature extraction is conducted on the two pipe images respectively to obtain the pixel coordinates of the central axis of the pipe, and a three-dimensional coordinate
point set of the central axis of the current section of the pipe is obtained through calculation; calculating a splicing matrix between the adjacent frames according to an overlapping area between the adjacent frames, and splicing the three-dimensional coordinate point sets of the central axes of the multiple sections of pipes to obtain a three-dimensional coordinate
point set of the central axis of the whole pipe; and performing straight
line fitting on the three-dimensional coordinate
point set of the central axis of the whole pipe, and evaluating the straightness of the pipe by using a straight
line fitting error. The device has the advantages of being simple in structure, low in cost, capable of achieving online detection, high in precision, good in universality and the like, and can be rapidly applied to straightness detection of various pipes.