| With the development of global economy and trade and the implementation of China’s opening-up policy,the realization of automation and intelligent operations is the development trend of the future logistics and transportation industry.However,domestic cranes still lack stable,safe and efficient loading and unloading methods at ports,highways and railway stations.Therefore,it is increasingly important to study the automatic alignment technology of crane spreaders and containers during loading and unloading operations.In order to consider the effect of spreader swing during crane operation,and study the intelligent positioning technology of container and spreader based on machine vision.The focus in the paper is on the tracking and identification of container keyholes,the positioning and equilibrium position fitting method of keyhole center,the measurement and conversion of relative distances between cranes and containers.The main work and results of the paper are as follows:(1)Combining the OpenCV function library and Python software and using Zhang’s checkerboard calibration method to calibrate the internal parameters and distortion coefficients of the camera,so as to pave the way for using image information accurately and visual measurement.(2)Preprocess the first frame of the video stream to be tracked.In order to obtain the keyhole area image of the first frame,after segmenting the first frame image,the paper proposed a detection algorithm based on sliding window relocation algorithm and transfer learning network.This method gives specific strategies in sample classification,network training,model selection,fast and accurate positioning,and so on.At the same time,the paper provides corresponding solutions aimed at the problem of paint peeling and rust spots in the keyhole area image.(3)In order to accurately track and locate the change of the keyhole center position in the video stream,the paper proposed a keyhole tracking and center positioning algorithm based on the video stream.Firstly,based on the container keyhole area image in the first frame,apply the tracking algorithm to track and obtain the keyhole area image in each frame of the video stream.After getting the keyhole area image,extract the corresponding Canny contour image and use the contour repair algorithm to repair it,then use the keyhole center positioning method to obtain the keyhole center position.Finally,use the coordinate system transformation to get the pixel coordinates of the keyhole center for each frame of the tracking image.This method mainly includes contour repair algorithm,keyhole center positioning algorithm,tracking algorithm,and keyhole center coordinate system conversion algorithm.It not only introduced and analyzed them in detail,but also showed the actual application results.(4)The important prerequisite for the crane to achieve automatic alignment is to obtain the relative distance between the crane and the container.that is to say that the keyhole center position in the balanced state needs to be fitted according to the obtained keyhole center in the first place,and then combine with the visual measurement algorithm to measure the horizontal and vertical distance between the camera center and the corresponding keyhole center.Finally,obtain the relative distance between the crane and the container through model conversion.The data fitting and intercepting method,visual measurement process and required parameters,and conversion model are detailedly discussed in the paper.(5)In order to verify the feasibility and practicability of the algorithm in the paper,a model experiment is performed on the entire process.The experimental results show that after calibrating the system deviation,the positioning results produced by the algorithm in the paper can basically meet the alignment accuracy requirements. |