The invention discloses an automatic alignment and focusing method of a
robot vision
system for tool
damage detection. The automatic alignment and focusing method comprises the step of providing an automatic alignment
algorithm fusing a YOLOv5 network intelligent
region of interest (ROI) and an improved Laplacian automatic focusing
algorithm. Firstly, the tool position is searched, and defogging and
noise reduction are conducted. Then, the center point of the cutter serves as a key feature, and the alignment
pose of the
tail end of the mechanical arm is calculated through multi-point distribution movement and weighted correction least square method optimization. And finally, adaptively and dynamically screening an ROI focusing window, taking a gradient quadratic sum obtained after
convolution operation of the ROI focusing window and a
Laplace operator as a definition evaluation value, determining the focusing
pose of the mechanical arm, and finally obtaining a high-quality cutter damage image. The method overcomes the limitation of a traditional method under the multi-depth-of-field greasy
dirt and dust severe working condition and the complex profile of a detected target, the sharpness
mutation is sensitively reflected, the focusing sensitivity is improved, the alignment center point error is reduced, the background and greasy
dirt and dust interference is effectively eliminated, and the efficiency and flexibility of a tool damage
visual detection system are improved.