Automatic pick-and-place box control method and system
By employing a dynamic compensation mechanism that combines visual inspection and spreader motion control, pixel position deviations are calculated in real time and dynamically compensated. This solves the problems of detection errors and misalignment in the control of container grabbing and releasing in container terminals, and enables efficient and safe automated spreader operation.
Patent Information
- Application Number
- CN202611056633.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-11-27
AI Technical Summary
In the existing technology, the container terminal automated spreader grabbing and placing control method has problems such as large detection errors, false detection and missed detection caused by reflection, obstruction and changes in lighting. In addition, it lacks the combination of spreader motion control and dynamic compensation, which makes it difficult for the spreader to be accurately positioned, and easily leads to container grabbing failure and container placement collision.
A dynamic compensation mechanism combining visual detection and spreader motion control is adopted. Through the YOLO detection model and fully connected neural network, pixel position deviation is calculated in real time and dynamic compensation control is performed. Combined with the BoTSORT tracking algorithm, the corner points of the spreader and the container are continuously tracked to achieve precise alignment.
It improves the efficiency of automated spreader operations, reduces manual intervention, lowers the risk of accidents, and enhances the spreader's precise positioning capability in dynamic environments.
Smart Images

Figure CN123181558A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated logistics technology, and in particular to an automatic box-grabbing and placing control method and system. Background Technology
[0002] With the continuous improvement of automation levels in container terminals, lifting equipment such as quay cranes and yard cranes are gradually shifting from manual operation to automated and intelligent control. In existing technologies, automatic container handling control typically relies on encoders, lidar, positioning sensors, and remote manual assistance to determine the positional relationship between the spreader and the container. However, in actual terminal operating environments, container surfaces and the terminal site are easily affected by factors such as glare, obstructions, and changes in lighting, leading to problems such as unclear target features, increased detection errors, or false positives and false negatives.
[0003] Furthermore, in existing technologies, most alignment methods based on visual detection directly calculate the actual position deviation based on the pixel coordinates of corner points, ignoring the dynamic changes of the lifting device, resulting in low accuracy of the lifting device during alignment.
[0004] Furthermore, existing technologies often rely on manual intervention to correct positional deviations, lacking a dynamic compensation mechanism deeply integrated with spreader motion control. When there is a positional deviation between the spreader and the target container, the spreader struggles to achieve precise closed-loop alignment control, leading to container grabbing failures, container drop collisions, or container stacking misalignment.
[0005] Therefore, how to design and implement an automatic grabbing and releasing box control method and system with precise coordinate transformation and dynamic compensation control has become an urgent technical problem to be solved. Summary of the Invention
[0006] The present invention aims to provide an automatic grabbing and placing box control method and system.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] An automatic box-grabbing and placing control method includes the following steps:
[0009] S10, Receive the operation instruction and determine the current operation scenario type of the crane, collect an operation scenario image containing the lifting device and the corresponding upper box or an operation scenario image containing the upper box and the corresponding lower box, and current height information; the operation scenario type includes a box-grabbing operation scenario type and a box-lowering operation scenario type; the current height information under the box-grabbing operation scenario type includes the current height of the lifting device, which refers to the vertical distance from the geometric center of the lifting device to the ground in the actual space corresponding to the current operation scenario; the current height information under the box-lowering operation scenario type includes the current height of the upper box, which refers to the vertical distance from the geometric center of the upper box to the ground in the actual space corresponding to the current operation scenario.
[0010] S20, based on the type of work scenario, perform differentiated image preprocessing on the work scenario image to obtain image feature data, and input the image feature data into the pre-trained YOLO detection model to output real-time position pixel coordinates for subsequent calculation of pixel position deviation; the pre-trained YOLO detection model includes at least a lifting device corner detection model, an upper box corner detection model, a lower box hole corner detection model, and a box body detection model;
[0011] If the scenario is a container grabbing operation, the lifting tool corner detection model outputs the real-time pixel coordinates of the lifting tool corner; the upper container corner detection model outputs the corresponding real-time pixel coordinates of the upper container corner; and the container detection model outputs the corresponding upper container calibration pixel size.
[0012] If it is a box placement operation scenario, the upper box corner detection model outputs the real-time pixel coordinates of the upper box corner; the lower box hole corner detection model outputs the corresponding real-time pixel coordinates of the lower box hole corner; and the box body detection model outputs the corresponding lower box calibration pixel size.
[0013] S30, based on the operation scenario type, the current height information is input into the corresponding pre-trained fully connected neural network, which outputs standard position pixel coordinates and standard pixel transformation ratio for subsequent calculation of pixel position deviation and actual deviation; the standard position pixel coordinates refer to the pixel coordinates when the lifting device and the corresponding upper box or the upper box and the corresponding lower box are in a reference alignment state; the standard position pixel coordinates in the box-grabbing operation scenario type include the standard position pixel coordinates of the lifting device corner point and the corresponding standard position pixel coordinates of the upper box corner point; the standard position pixel coordinates in the box-laying operation scenario type include the standard position pixel coordinates of the upper box corner point and the corresponding standard position pixel coordinates of the lower box box hole corner point;
[0014] S40, calculate the pixel position deviation based on the real-time position pixel coordinates and the standard position pixel coordinates, calculate the relative position pixel deviation based on the pixel position deviation, convert the relative position pixel deviation into the actual deviation according to the standard pixel transformation ratio, and perform dynamic compensation control based on the actual deviation to achieve precise alignment and box grabbing or box placing actions; the dynamic compensation control uses a pre-trained YOLO detection model combined with the BoTSORT tracking algorithm for dynamic continuous tracking and synchronously updates the current height information; the actual deviation includes grabbing deviation in the box grabbing operation scenario and placement deviation in the box placing operation scenario.
[0015] Further, the differential image preprocessing in step S20 includes:
[0016] If it is a box-grabbing operation scenario, perform image denoising and illumination equalization processing on the entire operation scenario image to obtain image feature data containing the corner points of the lifting device and the corresponding corner points of the upper box;
[0017] If it is a box placement operation scenario, extract a portion of the image containing the corner points of the upper box and the corresponding corner points of the lower box, and perform image denoising and illumination equalization processing to obtain image feature data containing the corner points of the upper box and the corresponding corner points of the lower box.
[0018] Furthermore, the image denoising employs a known digital noise reduction algorithm in the industry, as detailed below:
[0019] ,
[0020] In the formula, x and y are the horizontal and vertical coordinates of the current pixel to be processed, and I... out (x,y) represents the pixel value at coordinates (x,y) in the output image after denoising. in (x+k,y+l) represents the pixel value at coordinates (x+k,y+l) in the original input image, where (x+k,y+l) is within the neighborhood of the current pixel to be processed (x,y). n represents the radius of the filtering window, k represents the offset of the neighboring pixel on the horizontal axis, l represents the offset of the neighboring pixel on the vertical axis, φ represents the standard deviation of the Gaussian kernel function, used to control the image smoothing intensity, and G(k,l,φ) represents the two-dimensional Gaussian kernel function, used to calculate the weights corresponding to the neighboring pixels. The digital noise reduction algorithm can remove salt-and-pepper noise and Gaussian noise from the image, reduce the impact of dock dust and water mist on image quality, and preserve the integrity of the image features.
[0021] The illumination equalization employs a well-known histogram equalization algorithm within the industry, as detailed below:
[0022] ,
[0023] In the formula, r k This represents the original grayscale value of grayscale level k before equalization, s k Represents the original grayscale value r k The grayscale value obtained after equalization mapping, T(r) k () represents the grayscale transformation function, N represents the total number of pixels participating in the histogram statistics, Y represents the total number of gray levels in the image, and the maximum gray level is Y-1. i This represents the number of pixels at gray level i. This represents the cumulative distribution probability of pixels with gray levels no greater than k. min() is a minimum value function used to limit the mapped gray values to a range no greater than the maximum gray value Y-1. round() is an integer function. The histogram equalization algorithm is used to adjust the gray distribution of the image, which can solve the problem of uneven lighting caused by strong direct light, shadows, and backlighting at the dock, and make the overall brightness of the image tend to be uniform.
[0024] Furthermore, the box detection model performs anomaly filtering on the real-time position pixel coordinates, specifically including:
[0025] If the real-time pixel coordinates of the upper box corner and the lower box hole corner are outside the detection frame of the box detection model, then the real-time pixel coordinates of the upper box corner and the lower box hole corner are determined to be abnormal pixel coordinates and filtered out.
[0026] Furthermore, in step S30, the training process of the fully connected neural network includes:
[0027] S31, based on the operation scenario type, acquire historical operation scenario images of the spreader and the corresponding upper container reference alignment under different historical height information, or historical operation scenario images of the upper container and the corresponding lower container reference alignment. Each historical operation scenario image is associated with the corresponding historical height information. The historical height information includes the historical height of the spreader in the container grabbing operation scenario type, which refers to the vertical distance from the geometric center of the spreader to the ground in the historical operation scenario image. In the container placement operation scenario type, it includes the historical height of the upper container, which refers to the vertical distance from the geometric center of the upper container to the ground in the historical operation scenario image. The labeled position pixel coordinates refer to the position pixel coordinates output after verification under the reference alignment state corresponding to the historical operation scenario image, which are used to train a fully connected neural network.
[0028] S32, based on the job scenario type, after performing differential image preprocessing on the historical job scenario images, the pre-trained YOLO detection model outputs the corresponding labeled pixel coordinates and labeled pixel size, as follows:
[0029] If the scenario is a container grabbing operation, the lifting tool corner detection model outputs the pixel coordinates of the lifting tool corner mark position; the upper container corner detection model outputs the corresponding pixel coordinates of the upper container corner mark position; and the container detection model outputs the corresponding upper container calibration pixel size.
[0030] If it is a box placement operation scenario, the upper box corner detection model outputs the pixel coordinates of the upper box corner mark position; the lower box hole corner detection model outputs the corresponding pixel coordinates of the lower box hole corner mark position; and the box body detection model outputs the corresponding lower box calibration pixel size.
[0031] S33, based on the operation scenario type, determine the annotation pixel transformation ratio according to the actual size of the box and the calibration pixel size, and construct a training sample set; the calibration pixel size includes the calibration pixel size of the upper box and the calibration pixel size of the lower box;
[0032] S34, based on the job scenario type, a pre-trained fully connected neural network is trained using the training sample set to obtain the corresponding fully connected neural network; the pre-trained fully connected neural network includes a first fully connected neural network for the box-grabbing job scenario type and a second fully connected neural network for the box-placing job scenario type.
[0033] S35, based on the work scenario type, input the current height information into the corresponding pre-trained fully connected neural network, and output the standard pixel transformation ratio and standard position pixel coordinates, including:
[0034] If it is a container grabbing operation scenario, the current height of the spreader is input into the first fully connected neural network, and the standard pixel transformation ratio, the standard position pixel coordinates of the spreader corner point and the corresponding standard position pixel coordinates of the upper container corner point are output.
[0035] In the case of a box placement operation, the current height of the upper box is input into the second fully connected neural network, which outputs the standard pixel transformation ratio, the standard position pixel coordinates of the upper box corner, and the corresponding standard position pixel coordinates of the lower box hole corner.
[0036] Further, step S33 includes:
[0037] If it is a box grabbing operation scenario, the annotation pixel transformation ratio is obtained by transforming the actual size of the upper box and the corresponding upper box calibrated pixel size. All the historical heights of the lifting equipment are used as input samples, and all the annotation pixel transformation ratios, the pixel coordinates of the corner annotation positions of the lifting equipment and the pixel coordinates of the corresponding corner annotation positions of the upper box are used as training labels to construct the first training sample set.
[0038] If it is a box placement operation scenario, the annotation pixel transformation ratio is obtained by transforming the actual size of the lower box and the corresponding lower box calibration pixel size. All the historical heights of the upper box are used as input samples, and all the annotation pixel transformation ratios, the pixel coordinates of the upper box corner annotation positions and the pixel coordinates of the corresponding lower box hole corner annotation positions are used as training labels to construct a second training sample set.
[0039] Further, step S34 includes training the loss function:
[0040] ,
[0041] In the formula, L represents the training loss function;
[0042] α and β represent weighting coefficients that are greater than 0;
[0043] K p This is expressed as the standard pixel transformation ratio predicted by the fully connected neural network;
[0044] K t This is represented as the transformation ratio of the labeled pixels;
[0045] P sp The standard location pixel coordinates are represented by the prediction of the fully connected neural network.
[0046] P st The coordinates are represented as the pixel coordinates of the labeled position.
[0047] Furthermore, in step S40, the BoTSORT tracking algorithm is used to perform correlation matching on the features of the corner points of the lifting device, the corner points of the upper box, and / or the corner points of the lower box opening in the continuous operation scene image, so as to maintain the consistency of the corner points of the lifting device, the corner points of the upper box, and / or the corner points of the lower box opening.
[0048] Further, step S40 includes:
[0049] S41, based on the operation scenario type, calculate the pixel position deviation according to the real-time position pixel coordinates and the standard position pixel coordinates; the pixel position deviation includes the corner pixel position deviation of the lifting device and the corresponding upper box corner pixel position deviation in the box grabbing operation scenario type; and includes the corner pixel position deviation of the upper box and the corresponding lower box hole corner pixel position deviation in the box placing operation scenario type.
[0050] S42, Based on the job scenario type, calculate the relative position pixel deviation according to the pixel position deviation:
[0051] If it is a container grabbing operation scenario, calculate the relative position pixel deviation between the lifting device and the corresponding upper container based on the pixel position deviation of the corner point of the lifting device and the corresponding pixel position deviation of the corner point of the upper container;
[0052] If it is a box placement operation scenario, calculate the relative position pixel deviation between the upper box and the corresponding lower box based on the pixel position deviation of the upper box corner point and the corresponding pixel position deviation of the lower box hole corner point.
[0053] S43, convert the relative position pixel deviation into the actual deviation according to the standard pixel transformation ratio; S44, compare the actual deviation with a preset deviation allowable limit; if the actual deviation does not exceed the preset deviation allowable limit, then directly execute step S46;
[0054] S45, based on the type of work scenario, if the actual deviation exceeds the preset allowable deviation limit, a compensation control command is generated according to the actual deviation in the direction of the large vehicle, the direction of the small vehicle, and / or the lifting direction, and dynamic compensation control is executed until the actual deviation enters the preset allowable deviation limit; the dynamic compensation control command can be generated based on PID control algorithm, sliding mode control algorithm, or model predictive control algorithm;
[0055] S46, Based on the job scenario type, when the actual deviation falls within the preset deviation allowable limit...
[0056] If it is a container grabbing operation scenario, perform precise alignment control of the corner points of the lifting device and the corresponding corner points of the upper container, and then perform the container grabbing action after completing the precise alignment control.
[0057] If it is a box placement operation scenario, perform precise alignment control of the upper box corner point and the corresponding lower box hole corner point, and then perform the box placement action after completing the precise alignment control.
[0058] Repeat steps S41 to S45 until the actual deviation falls within the preset allowable deviation limit. Furthermore, during the dynamic compensation control process in step S45, the current altitude information is continuously and synchronously updated.
[0059] If it is a container grabbing operation scenario, the current height of the spreader is continuously obtained, and the updated current height of the spreader is input into the first fully connected neural network to update the standard position pixel coordinates of the spreader corner, the corresponding standard position pixel coordinates of the upper container corner, and the standard pixel transformation ratio.
[0060] If it is a box placement operation scenario, the current height of the upper box is continuously obtained, and the updated current height of the upper box is input into the second fully connected neural network to update the standard position pixel coordinates of the upper box corner, the corresponding standard position pixel coordinates of the lower box hole corner, and the standard pixel transformation ratio.
[0061] The actual deviation is further updated based on the updated standard position pixel coordinates and standard pixel transformation ratio. Based on the same inventive concept, this invention also discloses an automatic gripper and place box system for use in the aforementioned automatic gripper and place box control method, the automatic gripper and place box system comprising:
[0062] The image acquisition module is used to receive work instructions, determine the current work scene type according to the work instructions, and acquire work scene images and current height information;
[0063] The image processing module is used to perform differential image preprocessing. It uses a pre-trained YOLO detection model combined with the BoTSORT tracking algorithm to output real-time position pixel coordinates, and uses a pre-trained fully connected neural network to output standard position pixel coordinates and standard pixel transformation ratio. It calculates pixel position deviation and relative position pixel deviation, and converts the relative position pixel deviation into actual deviation according to the standard pixel transformation ratio.
[0064] The instruction generation module is used to generate control instructions based on the actual deviation. The control instructions include one or more of the following: dynamic compensation control instructions, precise alignment instructions, box grabbing instructions, box placement instructions, and power on / off instructions.
[0065] The drive control module is used to perform dynamic compensation control, precise alignment control, and box-grabbing or box-releasing actions. Further, the image processing module includes:
[0066] The image preprocessing unit is used to perform differentiated image preprocessing on the work scene image and output image feature data;
[0067] The YOLO target tracking and detection unit includes a lifting device corner detection model, an upper box corner detection model, a lower box hole corner detection model, and a box body detection model. It is used to perform dynamic tracking and detection of the image feature data in conjunction with the BoTSORT tracking algorithm, and output the real-time position pixel coordinates and calibration pixel size.
[0068] Fully connected neural network units include:
[0069] The first fully connected neural network is used to output the standard position pixel coordinates and standard pixel transformation ratio in the box grabbing operation scenario.
[0070] The second fully connected neural network is used to output the standard position pixel coordinates and standard pixel transformation ratio in the box placement operation scenario.
[0071] The deviation calculation unit is used to calculate pixel position deviation and relative position pixel deviation;
[0072] A coordinate transformation unit is used to convert the relative position pixel deviation into an actual deviation according to the standard pixel transformation ratio;
[0073] The drive control module includes:
[0074] The dynamic compensation unit is used to perform dynamic compensation control.
[0075] Precision alignment unit, used to perform precise alignment control;
[0076] The box gripping and / or box releasing control unit is used to perform box gripping and / or box releasing actions.
[0077] The present invention has the following advantages over the prior art:
[0078] 1. A dynamic compensation mechanism combining visual inspection and spreader motion control is adopted. Compensation control commands are dynamically generated based on the actual position deviation. During the correction process, the relative position pixel deviation between the spreader and the corresponding upper box, and between the upper box and the corresponding lower box is continuously calculated and the actual deviation is updated in real time. This forms a closed-loop control of visual inspection, deviation calculation, dynamic compensation and precise alignment, which reduces manual intervention, lowers the risk of accidents and improves the automation efficiency of spreader operations.
[0079] 2. A fully connected neural network trained on historical operation scene images aligned with different historical height benchmarks of the lifting equipment is used to establish a mapping relationship between the current height information and the standard pixel transformation ratio and the standard position pixel coordinates. The standard pixel transformation ratio and the standard position pixel coordinates are output, so that the actual deviation calculation can adapt to the dynamic perspective changes during the lifting process of the lifting equipment, thereby improving the accuracy and anti-interference of the actual deviation calculation.
[0080] 3. A differentiated image preprocessing scheme is adopted. The whole image is processed according to the box-grabbing operation scenario, and a partial area is processed according to the box-placing operation scenario. Invalid background interference is removed. Combined with image denoising and illumination equalization processing, the impact of factors such as reflection, occlusion and day and night illumination changes on image quality is reduced, the target features are highlighted and the accuracy of feature extraction is improved. Attached Figure Description
[0081] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0082] Figure 1 This is a block diagram of an automatic box-grabbing and placing system in one embodiment;
[0083] Figure 2 This is a flowchart of an automatic grabbing and placing box control method in the embodiment;
[0084] Figure 3 This is an image preprocessing logic block diagram of an automatic box-grabbing and releasing control method in an embodiment;
[0085] Figure 4 This is a flowchart of the first fully connected neural network for an automatic grabbing and placing box control method in an embodiment.
[0086] Figure reference numerals: 1-Image acquisition module; 2-Image processing module; 21-Image preprocessing unit; 211-Scene judgment logic; 212-Image differentiation preprocessing logic; 22-YOLO target tracking and detection unit; 23-Fully connected neural network unit; 24-Obstruction calculation unit; 25-Coordinate transformation unit; 3-Instruction generation module; 34-Position deviation dynamic compensation logic; 341-Position deviation judgment logic; 4-Drive control module; 41-Dynamic compensation unit; 42-Precise alignment unit; 43-Grab and release box control unit. Detailed Implementation
[0087] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0088] The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Of course, these are merely examples and are not intended to limit the present invention.
[0089] The following is in conjunction with the appendix Figure 1 To be continued Figure 4 The embodiments of the invention will be described in detail.
[0090] Example 1
[0091] Please see the appendix Figure 1 The automatic grabbing and placing box control system provided in this embodiment may include:
[0092] The crane may be any one of the following: a quay crane, a rail-mounted gantry crane, and a rubber-tired gantry crane;
[0093] Image acquisition module 1 can be installed on crane trolleys, lifting devices, beams, or other locations capable of capturing images of the work scene. The image acquisition module 1 can use an industrial camera as the image acquisition device. The industrial camera can be a strong light and fog-resistant type, with waterproof, dustproof, fog-penetrating, and strong light suppression functions to adapt to complex working environments such as ports and storage yards.
[0094] The image acquisition module 1 may employ at least one of a laser rangefinder, an encoder, a depth camera, a binocular vision device, or a positioning sensor to detect current height information.
[0095] Image processing module 2 may include an edge computing device, an industrial computer, an embedded processor, a GPU computing unit, an AI acceleration module, or a combination thereof. Image processing module 2 is communicatively connected to image acquisition module 1 and is used to receive the work scene image and current height information, performing functions such as differentiated image preprocessing, deviation calculation, and coordinate transformation. Specifically, image processing module 2 can run the software programs or algorithm models corresponding to image preprocessing unit 21, YOLO target tracking and detection unit 22, fully connected neural network unit 23, deviation calculation unit 24, and coordinate transformation unit 25.
[0096] The instruction generation module 3 can be implemented by an industrial computer, a programmable logic controller (PLC), an edge controller, or an embedded control board. The instruction generation module 3 is communicatively connected to the image processing module 2 and is used to generate control instructions based on the actual deviation output by the image processing module 2. The control instructions may include one or more of the following: dynamic compensation control instructions, precise alignment instructions, box-grabbing instructions, box-placing instructions, and power-on / off instructions.
[0097] Drive control module 4, which is communicatively connected to instruction generation module 3; drive control module 4 includes:
[0098] The dynamic compensation unit 41 can be a PLC, industrial controller, embedded motion control board, DSP controller or FPGA controller, used to receive dynamic compensation control commands and complete the position correction of the spreader in the direction of the trolley, the direction of the carriage, the lifting direction and the rotation direction.
[0099] The precision alignment unit 42 can be a PLC, industrial controller, embedded motion control board, DSP controller or FPGA controller, used to control the lifting device to correct its position according to the precision alignment command.
[0100] The box grabbing and releasing control unit 43 can specifically employ one or more of the following: a hoisting motor, a lifting device translation mechanism, a lifting device fine-tuning mechanism, a lifting device rotation mechanism, a hydraulic cylinder, a locking pin mechanism, and a braking mechanism, to complete the box grabbing and releasing actions.
[0101] Implementation effect
[0102] With the aforementioned hardware structure, the automatic box grabbing and releasing system can acquire corresponding operation scene images and current height information in both box grabbing and box releasing operation scenarios, and generate control commands based on actual deviations and height information, thereby realizing dynamic compensation control, precise alignment control, box grabbing and box releasing control of the crane.
[0103] Example 2
[0104] This embodiment provides an automatic box-grabbing and placing control method, which is implemented based on the automatic box-grabbing and placing control system hardware platform disclosed in Embodiment 1, and involves box-grabbing operation scenarios.
[0105] It should be noted that the terms "first" and "second" in this embodiment are only used to distinguish similar technical features under different types of work scenarios, and do not indicate quantity, order or importance.
[0106] As attached Figure 2 As shown, the specific steps of this embodiment include:
[0107] In the scenario of lifting container grabbing, when the crane receives the lifting container grabbing operation instruction, the system automatically starts and controls the industrial camera of the image acquisition module 1 to enter the working mode. The industrial camera adjusts the camera parameters (including exposure and strong light suppression level) according to the lighting environment or preset scene. After completing the camera initialization action, it enters the working state and acquires the operation scene image including the lifting container and the corresponding upper container in real time, and transmits the operation scene image to the image processing module 2.
[0108] As attached Figure 3 As shown, after the image processing module 2 determines the scene type of the box-grabbing operation through the scene judgment logic 211, the image preprocessing unit 21 executes the image differentiation preprocessing logic 212 to obtain the preprocessed image feature data, and transmits the image feature data to the YOLO target tracking and detection unit 22. The image differentiation preprocessing logic 212 includes:
[0109] Image preprocessing unit 21 performs image denoising and illumination equalization on the entire work scene image, highlighting the corner features of the lifting equipment and the corresponding upper box corners in the entire image; the image denoising process uses a digital denoising algorithm, which can be achieved using the following industry-known formulas. get:
[0110]
[0111] In the formula, x and y represent the horizontal and vertical coordinates of the current pixel to be processed;
[0112] Iout (x,y) represents the pixel value at coordinates (x,y) of the output image after denoising.
[0113] I in (x+k,y+l) represents the pixel value at coordinates (x+k,y+l) in the original input image, where the coordinates (x+k,y+l) are within the neighborhood of the current pixel (x,y) to be processed.
[0114] n represents the radius of the filtering window;
[0115] k represents the offset of the neighboring pixel on the horizontal axis;
[0116] l represents the offset of a neighboring pixel on the vertical axis;
[0117] φ represents the standard deviation of the Gaussian kernel function, used to control the intensity of image smoothing;
[0118] G(k,l,φ) represents a two-dimensional Gaussian kernel function, used to calculate the weights of pixels in the neighborhood.
[0119] The illumination equalization process employs a histogram equalization algorithm, which can be achieved using the following industry-known formula. get:
[0120]
[0121] In the formula, r k This represents the original gray value with gray level number k before equalization;
[0122] s k Represents the original grayscale value r k The grayscale value obtained after equalization mapping;
[0123] T(r k ) represents the grayscale transformation function;
[0124] N represents the total number of pixels participating in the histogram statistics;
[0125] Y represents the total number of gray levels in the image, with the maximum gray level being Y-1;
[0126] n i This represents the number of pixels at gray level i.
[0127] This represents the cumulative distribution probability of pixels with gray levels not greater than k;
[0128] min() represents the minimum value function, which is used to limit the mapped gray values to a range no greater than the maximum gray value Y-1;
[0129] round() is the rounding function.
[0130] It should be noted that in actual dock operation environments, if the same image preprocessing strategy is applied to images of different operation scenarios, the system is easily subject to a lot of invalid background interference, resulting in problems such as the target features in the image not being prominent or obvious. Therefore, through the image differential preprocessing logic 212 in this embodiment, the whole image preprocessing operation is corresponding to the type of container grabbing operation, highlighting the features of the corner points of the spreader and the corresponding corner points of the upper container, thereby reducing the detection error and data noise of subsequent modules.
[0131] Before processing the image feature data, the YOLO detection model needs to be pre-trained, including:
[0132] First, images of container grabbing and unloading operations under different environmental conditions at the dock (such as backlighting, rain and fog, dust, etc.) are collected to construct an operation scenario dataset.
[0133] Secondly, the corner points of the lifting device, the corner points of the upper box, the corner points of the lower box hole, the outline of the upper box and the outline of the lower box in the operation scene dataset are labeled, and data augmentation is performed by brightness adjustment, contrast adjustment, occlusion simulation and reflection simulation to obtain the enhanced training image.
[0134] Then, the enhanced training images are input into the YOLO detection model. Specifically, the target category, detection box position, and confidence score can be output through the backbone network, feature fusion network, and detection head. The model parameters are updated based on the detection box localization loss, target confidence loss, and target category loss. Unique identifiers are assigned to the corner points of the spreader, the upper box, the lower box hole, the upper box body contour, and the lower box body contour. The BoTSORT tracking algorithm is used for continuous dynamic tracking. Specifically, the BoTSORT tracking algorithm is used to perform correlation matching on the features of the corner points of the spreader, the upper box, and / or the lower box hole in the continuous operation scene image to maintain the consistency of the corner points of the spreader, the upper box, and / or the lower box hole.
[0135] Finally, when the detection accuracy and detection speed on the validation dataset meet the preset requirements, the pre-trained YOLO detection model is obtained, including the splice corner detection model, the upper box corner detection model, the lower box hole corner detection model, and the box body detection model.
[0136] It should be noted that the training images are only used during the training phase of the YOLO detection model. During training, the YOLO detection model cannot pre-capture image features such as the corner points of the lifting device, the corresponding corner points of the upper box, and the outline of the box. Therefore, this embodiment uses the training images to train the YOLO detection model, enabling the trained YOLO detection model to output the corresponding real-time position pixel coordinates, calibration pixel size, and labeled position pixel coordinates during the actual operation phase.
[0137] The YOLO target tracking and detection unit 22 transmits the labeled pixel coordinates and calibrated pixel size to the fully connected neural network unit 23, and transmits the real-time position pixel coordinates to the deviation calculation unit 24. Specifically, this includes:
[0138] The lifting device corner detection model outputs the real-time pixel coordinates of the lifting device corner points;
[0139] The upper box corner detection model outputs the corresponding real-time pixel coordinates of the upper box corners.
[0140] The box detection model outputs the corresponding upper box calibration pixel size;
[0141] The box detection model performs anomaly filtering on the real-time position pixel coordinates of the corresponding upper box corner. After determining the detection area corresponding to the real-time position pixel coordinates of the corresponding upper box corner, if the real-time position pixel coordinates of the corresponding upper box corner are outside the detection frame of the box detection model, then the real-time position pixel coordinates of the corresponding upper box corner are judged as abnormal pixel coordinates and filtered out.
[0142] If the real-time pixel coordinates of the corresponding upper box corner point are located within the corresponding box detection frame, then the pixel position deviation is calculated.
[0143] As attached Figure 4 As shown, before calculating the pixel position deviation, the fully connected neural network needs to be pre-trained to construct the mapping relationship between the current height of the lifting device and the standard pixel transformation ratio, and between the current height of the lifting device and the standard position pixel coordinates. The current height of the lifting device refers to the vertical distance from the geometric center of the lifting device to the ground in the actual space corresponding to the current work scene image, including:
[0144] First, historical operation scene images are acquired when the spreader is aligned with the corresponding upper box reference at different historical heights. Each historical operation scene image is associated with the corresponding spreader height. Image denoising and illumination equalization are performed on the entire historical operation scene image. The spreader corner detection model outputs the pixel coordinates of the spreader corner annotation position as one of the training labels of the first fully connected neural network. The upper box corner detection model outputs the corresponding pixel coordinates of the upper box corner annotation position as one of the training labels of the first fully connected neural network. The historical height of the spreader refers to the vertical distance from the geometric center of the spreader to the ground in the historical operation scene image.
[0145] Then, based on the actual size of the upper box and the corresponding upper box calibrated pixel size, the annotation pixel transformation ratio is determined as one of the training labels of the first fully connected neural network; all the historical heights of the lifting gear are used as input samples, and all the annotation pixel transformation ratios, the pixel coordinates of the corner annotation positions of the lifting gear and the pixel coordinates of the corresponding upper box corner annotation positions are used as the training labels to construct the first training sample set.
[0146] Finally, a pre-trained first fully connected neural network is trained using the first training sample set. The first fully connected neural network outputs the standard pixel transformation ratio, the standard position pixel coordinates of the lifting device corner point, and the corresponding standard position pixel coordinates of the upper box corner point, which are used to calculate the actual deviation.
[0147] The training process of the first fully connected neural network further includes a training loss function used to constrain the standard pixel transformation ratio and the standard position pixel coordinates of the output, including:
[0148] ,
[0149] In the formula, L represents the training loss function;
[0150] α and β represent weighting coefficients greater than 0, which make the standard pixel transformation ratio error term and the standard position pixel coordinate error term similar in magnitude;
[0151] K p The standard pixel transformation ratio, denoted as the standard pixel transformation ratio predicted by the fully connected neural network, is, in the case of a box-grabbing operation scenario, at least including a standard pixel transformation ratio K. p1i ;
[0152] K t The labeled pixel transformation ratio is represented as K, and the labeled pixel transformation ratio includes at least the labeled pixel transformation ratio K. t1i ;
[0153] P sp The standard position pixel coordinates predicted by the fully connected neural network include at least the standard position pixel coordinates P of the sling corner. sp1i and the corresponding standard position pixel coordinates P of the upper corner point sp2i ;
[0154] P st The pixel coordinates of the marked position are represented as follows, including at least the standard position pixel coordinates P of the lifting glove corner. st1i and the corresponding standard position pixel coordinates P of the upper corner point st2i ;
[0155] Specifically, firstly, the historical height of the lifting device is used to construct an input vector, and then the input vector is normalized:
[0156] In the i-th benchmark training sample of the first training sample set, the input of the first fully connected neural network includes the historical height of the lifting gear, then the input vector X 1i for:
[0157] X 1i =[H 1i ],
[0158] In the formula, H 1i This represents the historical height of the lifting device corresponding to the i-th training sample;
[0159] To reduce the impact of different units on the training process, the input vector X... 1i Normalization is performed:
[0160] ,
[0161] In the formula, This represents the normalized input vector;
[0162] μ X X represents the input vector in the training sample set. 1i The mean vector of the corresponding dimension;
[0163] σ X X represents the input vector in the training sample set. 1i The standard deviation vector of the corresponding dimension.
[0164] Then, the normalized input vector The first fully connected neural network is input, wherein the first fully connected neural network sequentially passes through a first hidden layer, a second hidden layer, and an output layer for forward propagation, including:
[0165] The network parameters θ of the first fully connected neural network:
[0166] θ={w1,b1,w2,b2,w3,b3},
[0167] In the formula, w1, w2, and w3 represent the weight matrices;
[0168] b1, b2, b3 represent bias vectors;
[0169] The forward propagation function Y(θ) of the first fully connected neural network ip :
[0170] ,
[0171] In the formula, Indicates the activation function;
[0172] According to the forward propagation process function Y(θ) ip The predicted output vector y of the first fully connected neural network is calculated. ip for:
[0173] y ip =[K p1i ,P sp1i ,P sp2i ],
[0174] In the formula, K p1i This represents the standard pixel transformation ratio predicted by the i-th training sample;
[0175] P sp1i This represents the pixel coordinates of the standard position of the lifting device corner point predicted by the i-th training sample;
[0176] P sp2i This represents the pixel coordinates of the corresponding standard position of the upper corner point predicted by the i-th training sample.
[0177] The predicted output is then compared with the training labels. The training labels are:
[0178] y it =[K t1i ,P st1i ,P st2i ],
[0179] K t1i Indicates the scaling ratio of the labeled pixels;
[0180] P st1i This indicates the pixel coordinates of the corner point markings on the lifting device;
[0181] P st2i This indicates the pixel coordinates of the corresponding corner point of the upper box.
[0182] Alternatively, the training labels y can also be... it Normalization is performed based on the mean and standard deviation of the corresponding training sample set to reduce the impact of data with different dimensions on the training process. Training labels y it The normalization process and the input vector X 1i The normalization process is the same, so it will not be repeated here.
[0183] According to the predicted output vector y ip and the training label y it The error between them is used to construct the loss function:
[0184] ,
[0185] In the formula, α and β represent weighting coefficients;
[0186] P sp Represented as a vector [P] sp1i, P sp2i ];
[0187] P st Represented as a vector [P] st1i, P st2i ].
[0188] For the first training sample set containing Q training samples, the total loss function is:
[0189] ,
[0190] Where Q represents the total number of training samples in the first training sample set.
[0191] Finally, minimize the total training loss function L 1Q To achieve the goal, update the network parameters θ using gradient descent:
[0192] ,
[0193] In the formula, θ r Represented as the network parameters after the r-th iteration;
[0194] θ r+1 This is represented as the network parameters after the (r+1)th iteration;
[0195] η represents the learning rate;
[0196] L(θ r Let ) represent the loss function for the r-th iteration;
[0197] This is represented as the gradient of the loss function in the r-th iteration with respect to the network parameters after the r-th iteration.
[0198] After multiple iterations, when the training loss converges, the first fully connected neural network that has been pre-trained is obtained.
[0199] It should be understood that the above explanation using the i-th benchmark alignment training sample as an example does not constitute a limitation on the number of training samples. In the actual training process, the training sample set includes multiple benchmark alignment training samples. The first fully connected neural network is trained in batches based on the multiple benchmark alignment training samples, and the model parameters are iteratively updated according to the training loss function corresponding to the multiple benchmark alignment training samples to obtain the trained first fully connected neural network.
[0200] It should be noted that the historical operation scene images are only used for the training phase of the first fully connected neural network. During training, the fully connected neural network cannot obtain the standard pixel transformation ratio and standard position pixel coordinates in advance by inputting the current height of the lifting device. Therefore, in this embodiment, the fully connected neural network is trained using the historical operation scene images, so that the trained first fully connected neural network can output the corresponding standard pixel transformation ratio and standard position pixel coordinates by inputting the current height of the lifting device during the actual operation phase.
[0201] The current height of the spreader is input into the first fully connected neural network to obtain the standard pixel transformation ratio and standard position pixel coordinates, which are used for subsequent calculation of pixel position deviation and actual deviation. The standard position pixel coordinates include the standard position pixel coordinates of the spreader corner and the corresponding standard position pixel coordinates of the upper box corner. The standard pixel transformation ratio is used to represent the conversion relationship between image pixel distance and actual spatial distance under the current height of the spreader and the reference alignment state.
[0202] The fully connected neural network unit 23 transmits the standard position pixel coordinates to the deviation calculation unit 24 and the standard pixel transformation ratio to the coordinate transformation unit 25. The deviation calculation unit 24 calculates the pixel position deviation by combining the real-time position pixel coordinates and the standard position pixel coordinates, calculates the relative position pixel deviation based on the pixel position deviation, and transmits the relative position pixel deviation to the coordinate transformation unit 25. Specifically:
[0203] The deviation calculation unit 24 calculates the pixel position deviation of the corner point of the lifting device based on the real-time position pixel coordinates of the corner point of the lifting device and the standard position pixel coordinates of the corner point of the lifting device.
[0204] Calculate the corresponding pixel position deviation of the upper box corner point based on the real-time position pixel coordinates of the corresponding upper box corner point and the corresponding standard position pixel coordinates of the upper box corner point.
[0205] The relative position pixel deviation between the lifting device and the upper box is calculated based on the pixel position deviation of the corner point of the lifting device and the corresponding pixel position deviation of the corner point of the upper box.
[0206] The coordinate transformation unit 25 converts the relative position pixel deviation into the gripping deviation between the lifting device and the corresponding upper box according to the standard pixel transformation ratio, and transmits the gripping deviation to the instruction generation module 3.
[0207] It should be noted that the above-mentioned setting of outputting the standard pixel transformation ratio through the fully connected neural network unit 23 and converting the relative position pixel deviation into a grasping deviation through the coordinate transformation unit 25 is only an optimization scheme for this embodiment to further improve the position compensation accuracy and resist dynamic changes in viewing angle during the dynamic lifting of the lifting device, and does not constitute an absolute limitation on the overall technical solution of the present invention. In other alternative embodiments of the present invention, the system can also use the preset internal and external parameters (i.e., camera calibration matrix) of the industrial camera in the image acquisition module 1 to establish a three-dimensional spatial geometric mapping model to correct or compensate the standard pixel transformation ratio output by the fully connected neural network.
[0208] The instruction generation module 3, image processing module 2, and drive control module 4 together constitute the position deviation dynamic compensation logic 34, forming a closed-loop dynamic compensation. The closed-loop dynamic compensation includes:
[0209] Position deviation judgment logic 341 compares the grasping deviation with a preset allowable deviation limit, and performs diversion control based on the comparison result:
[0210] If the grasping deviation exceeds the preset allowable deviation limit, the instruction generation module 3 generates a dynamic compensation control instruction for the lifting device in the direction of the trolley, the direction of the carriage, and / or the lifting direction based on the grasping deviation, and activates the dynamic compensation unit 41.
[0211] The dynamic compensation unit 41 performs position compensation according to the dynamic compensation control command, which can be generated based on PID control algorithm, sliding mode control algorithm or model predictive control algorithm. During the position compensation process, the image acquisition module 1 continuously acquires the work scene image, the deviation calculation unit 24 continuously calculates the relative position pixel deviation of the corner point of the lifting device and the corresponding upper box corner point, and the coordinate transformation unit 25 continuously updates the grasping deviation until the grasping deviation enters the preset deviation allowable limit, and then the precise alignment unit 42 is activated.
[0212] The precision alignment unit 42 performs precision alignment control of the corner points of the spreader and the corresponding corner points of the upper box. After completing the precision alignment, it starts the grab-and-release box control unit 43, which performs the grab-and-release box action and sends a signal to the system to end the operation after completion.
[0213] If the grasping deviation does not exceed the preset deviation allowable limit, it means that the initial position of the current lifting device and the corresponding upper box has met the safety operation requirements. The system skips the dynamic compensation unit 41 and directly triggers the precision alignment unit 42 and the grasping and releasing control unit 43. After completing the grasping action, it sends an end-of-operation signal to the system.
[0214] Before the grasping deviation reaches the preset allowable deviation limit, the system repeatedly executes the steps of dynamic compensation control, work scene image acquisition, relative position pixel deviation calculation, grasping deviation update and grasping deviation comparison until the precise alignment condition is met.
[0215] Implementation effect
[0216] This implementation method achieves deep coupling between the image acquisition module 1 and the image processing module 2, dynamically calculating the grasping deviation between the corner point of the spreader and the corresponding corner point of the upper box. It then utilizes the position deviation judgment logic 341 and the drive control module 4 to form a closed-loop dynamic compensation control, significantly reducing the operational risks of manual intervention and improving the automated operation efficiency and system safety of the spreader grasping the box. Through a pre-trained first fully connected neural network, a mapping relationship is established between the current height of the spreader and the standard pixel transformation ratio and the standard position pixel coordinates. This solves the problem of coordinate conversion accuracy distortion under dynamic height conditions in traditional fixed calibration methods, improving the alignment accuracy of the box grasping operation.
[0217] Example 3
[0218] This embodiment provides an automatic box-grabbing and placing control method, which is also based on the automatic box-grabbing and placing control system described in Embodiment 1. Compared with Embodiment 2, this embodiment is generally executed after the box-grabbing operation scenario described in Embodiment 2 is completed, and is used for the control process involving the box-placing operation scenario.
[0219] The hardware architecture, system software underlying module division, and general algorithm formulas (such as digital noise reduction formulas, histogram equalization formulas, etc.) used in this embodiment are exactly the same as those in Embodiment 2, and will not be repeated here.
[0220] This embodiment provides an automatic box-grabbing and placing control method, which relates to a box-placing operation scenario. The differences from Embodiment 2 include:
[0221] Image acquisition module 1 acquires real-time images of the work scene, including the upper box and the corresponding lower box, and transmits the work scene image data to image processing module 2.
[0222] As attached Figure 3 As shown, after the image processing module 2 determines the box placement operation scenario type through the scene judgment logic 211, the image preprocessing unit 21 executes the image differentiation preprocessing logic 212 to obtain the preprocessed image feature data, and transmits the image feature data to the YOLO target tracking and detection unit 22. The image differentiation preprocessing logic 212 includes:
[0223] The image preprocessing unit 21 extracts a portion of the image containing the corner points of the upper box and the corresponding corner points of the lower box holes, performs image denoising and illumination equalization processing, removes invalid background interference outside the detection area, and highlights the features of the corner points of the upper box and the corresponding corner points of the lower box holes in the detection area.
[0224] The YOLO target tracking and detection unit 22, through the pre-trained YOLO detection model, outputs the corresponding real-time position pixel coordinates and calibration pixel size; and transmits the real-time position pixel coordinates to the deviation calculation unit 24. Specifically, this includes:
[0225] The upper box corner detection model outputs the real-time pixel coordinates of the upper box corner points;
[0226] The lower box hole corner detection model outputs the corresponding real-time pixel coordinates of the lower box hole corner.
[0227] The box detection model outputs the corresponding lower box calibration pixel size;
[0228] The box detection model performs anomaly filtering on the real-time position pixel coordinates of the corresponding lower box hole corner points located outside the detection frame of the box detection model.
[0229] Before calculating the pixel position deviation, the fully connected neural network also needs to be pre-trained. The difference lies in the following process: constructing the mapping relationship between the current height of the upper box and the standard pixel transformation ratio, and between the current height of the upper box and the standard position pixel coordinates. The current height of the upper box refers to the vertical distance from the geometric center of the upper box to the ground in the actual space corresponding to the current work scene image, including:
[0230] First, historical operation scene images are collected when the upper box is at different historical heights and aligned with the corresponding lower box reference. Each historical operation scene image is associated with the corresponding upper box height. The upper box corner detection model outputs the pixel coordinates of the upper box corner annotation position as one of the training labels of the second fully connected neural network. The lower box hole corner detection model outputs the pixel coordinates of the corresponding lower box hole corner annotation position as one of the training labels of the second fully connected neural network. The historical height of the upper box refers to the vertical distance from the geometric center of the upper box to the ground in the historical operation scene image.
[0231] Then, based on the actual dimensions of the corresponding lower box and the corresponding labeled pixel dimensions of the lower box, the pixel transformation ratio is determined as one of the training labels for the second fully connected neural network; all the historical heights of the upper boxes are used as input samples, and all the pixel transformation ratios of the labeled pixels, the pixel coordinates of the corner points of the upper boxes and the pixel coordinates of the corner points of the corresponding lower boxes are used as training labels to construct a second training sample set.
[0232] Finally, a pre-trained second fully connected neural network is obtained by training the second training sample set. The second fully connected neural network outputs the standard pixel transformation ratio, the standard position pixel coordinates of the upper box corner point, and the corresponding standard position pixel coordinates of the lower box hole corner point, which are used to calculate the actual deviation.
[0233] The training process of the second fully connected neural network also includes a training loss function L (which can have the same form as the training loss function of the first fully connected neural network in Example 2), specifically:
[0234] In the i-th benchmark training sample of the second training sample set, the input of the second fully connected neural network includes the historical height of the upper box, then the input vector X 2i for:
[0235] X 2i =[H 2i ],
[0236] In the formula, H 2i This represents the historical height of the upper box corresponding to the i-th training sample;
[0237] The input vector X 2i After normalization, the input is fed into the second fully connected neural network for forward propagation, yielding the predicted output vector z of the second fully connected neural network. ip for:
[0238] z ip =[K p2i ,P sp3i ,P sp4i ],
[0239] In the formula, K p2i This represents the standard pixel transformation ratio predicted by the i-th training sample;
[0240] P sp3i This represents the standard pixel coordinates of the upper corner point predicted by the i-th training sample;
[0241] P sp4i This represents the pixel coordinates of the standard position of the corner point of the lower box hole predicted by the i-th training sample.
[0242] The predicted output is then compared with the training labels. The training labels are:
[0243] z it =[K t2i ,P st3i ,P st4i ],
[0244] In the formula, K t2i Indicates the scaling ratio of the labeled pixels;
[0245] P st3i This indicates the pixel coordinates of the corner point of the upper box.
[0246] P st4i This indicates the pixel coordinates of the corresponding corner point markings of the lower box.
[0247] Alternatively, the training labels z can also be... it Normalization is performed based on the mean and standard deviation of the corresponding training sample set to reduce the impact of data with different dimensions on the training process. The training label z... it The normalization process and the input vector X 2i The normalization process is the same, so it will not be repeated here.
[0248] According to the predicted output vector z ip and the training label z it The error between them is used to construct the loss function:
[0249] ,
[0250] In the formula, α and β represent weighting coefficients;
[0251] P sp Represented as a vector [P] sp3i, P sp4i ];
[0252] P st Represented as a vector [P] st3i, P st4i ].
[0253] For the second training sample set containing M training samples, the total loss function is:
[0254] ,
[0255] Where M represents the total number of training samples in the second training sample set.
[0256] Finally, minimize the total training loss function L 2M With the goal of achieving the desired outcome, after multiple iterations, when the training loss function L... 2M Upon convergence, the pre-trained second fully connected neural network is obtained.
[0257] The current height of the upper box is input into the second fully connected neural network to obtain the standard pixel transformation ratio and standard position pixel coordinates, which are used for subsequent calculation of pixel position deviation and actual deviation; the standard position pixel coordinates include the standard position pixel coordinates of the corner point of the upper box and the corresponding standard position pixel coordinates of the corner point of the lower box hole.
[0258] The deviation calculation unit 24 calculates the pixel position deviation of the upper box corner point based on the real-time position pixel coordinates of the upper box corner point and the standard position pixel coordinates of the upper box corner point.
[0259] Calculate the corresponding pixel position deviation of the lower box hole corner point based on the real-time position pixel coordinates of the corresponding lower box hole corner point and the corresponding standard position pixel coordinates of the lower box hole corner point.
[0260] The relative position pixel deviation between the upper and lower boxes is calculated based on the pixel position deviation of the upper box corner points and the corresponding pixel position deviation of the lower box hole corner points.
[0261] The coordinate transformation unit 25 converts the relative position pixel deviation into the placement deviation between the upper box and the corresponding lower box according to the standard pixel transformation ratio, and transmits the placement deviation to the instruction generation module 3.
[0262] The instruction generation module 3, image processing module 2, and drive control module 4 together constitute the position deviation dynamic compensation logic 34, forming a closed-loop dynamic compensation. The closed-loop dynamic compensation includes:
[0263] Position deviation judgment logic 341 compares the placement deviation with a preset allowable deviation limit, and performs diversion control based on the comparison result:
[0264] If the placement deviation exceeds the preset allowable deviation limit, the instruction generation module 3 generates a dynamic compensation control instruction for the lifting device in the direction of the trolley, the direction of the carriage, and / or the lifting direction based on the placement deviation, and activates the dynamic compensation unit 41.
[0265] The dynamic compensation unit 41 performs position compensation according to the dynamic compensation control command, which can be generated based on PID control algorithm, sliding mode control algorithm or model predictive control algorithm; during the position compensation process, the coordinate transformation unit 25 continuously updates the placement deviation until the placement deviation enters the preset deviation allowable limit, and then the precise alignment unit 42 is activated.
[0266] The precision alignment unit 42 performs precision alignment control of the upper box corner point and the corresponding lower box hole corner point. After completing the precision alignment, it starts the box gripping and releasing control unit 43, which performs the box releasing action and sends a work stop signal to the system after completion.
[0267] If the placement deviation does not exceed the preset deviation limit, it means that the initial position of the upper box and the corresponding lower box has met the safety operation requirements. The system skips the dynamic compensation unit 41 and directly triggers the precise alignment unit 42 and the box grabbing and placing control unit 43. After completing the box placement action, it sends an end-of-operation signal to the system.
[0268] Before the placement deviation reaches the preset allowable deviation limit, the system cyclically executes dynamic compensation control, work scene image acquisition, relative position pixel deviation calculation, placement deviation update and placement deviation comparison steps until the precise alignment condition is met.
[0269] Implementation effect
[0270] This embodiment divides the detection area based on the location of the corner points of the upper box and the corresponding corner points of the lower box openings, focusing on the corner points of the upper box and the corresponding corner points of the lower box openings. It eliminates invalid background noise outside the detection area, significantly improving the feature contrast of the corner points of the upper box and the corresponding corner points of the lower box openings, thereby enhancing the target detection accuracy in the box placement operation scenario. Furthermore, through the dynamic position deviation compensation logic 34, the detection area is continuously monitored. When the placement deviation exceeds a preset limit, the dynamic compensation unit 41 can drive the lifting device to correct its attitude and position, ensuring that the upper box is in a reference alignment state before approaching the corresponding lower box, greatly reducing the risk of box collisions and box overturning.
[0271] It should be noted that the steps of the automatic box-grabbing and releasing control method described in this embodiment are merely an exemplary process for implementing the technical solution of this invention, used to illustrate the data transmission relationship, processing logic, and control relationship between modules, and do not constitute a limitation on the scope of protection of this invention. Provided that the functions of grabbing and releasing boxes, differential image preprocessing, target detection and tracking, standard position pixel coordinate acquisition, actual position deviation calculation, and dynamic compensation of the lifting device position can be achieved, the execution order, execution subject, data processing method, and module division of each step can be adjusted, merged, split, or replaced according to the actual application scenario.
Claims
1. An automatic gripping and placing box control method, characterized in that, Includes the following steps: S10, Receive the operation instruction, determine the current operation scenario type of the crane, and collect the operation scenario image and current height information; the current height information includes the current height of the lifting device under the box grabbing operation scenario type; the current height information includes the current height of the upper box under the box placing operation scenario type; S20, based on the job scenario type, perform differentiated image preprocessing on the job scenario image, and input the preprocessed image feature data into the pre-trained YOLO detection model, and output the corresponding real-time position pixel coordinates and calibration pixel size; In the case of container grabbing operations, the pre-trained YOLO detection model includes a spreader corner detection model, which outputs the real-time pixel coordinates of the spreader corner; an upper container corner detection model, which outputs the corresponding real-time pixel coordinates of the upper container corner; and a container detection model, which outputs the corresponding upper container calibration pixel size. In the box placement operation scenario, the upper box corner detection model outputs the real-time position pixel coordinates of the upper box corner, the lower box hole corner detection model outputs the corresponding real-time position pixel coordinates of the lower box hole corner, and the box body detection model outputs the corresponding lower box calibration pixel size. S30, based on the type of work scenario, input the current height information into the corresponding pre-trained fully connected neural network, and output the corresponding standard position pixel coordinates and standard pixel transformation ratio; S40, calculate the pixel position deviation based on the real-time position pixel coordinates and the standard position pixel coordinates, further calculate the relative position pixel deviation, and convert the relative position pixel deviation into the actual deviation by combining the standard pixel transformation ratio; perform dynamic compensation control based on the actual deviation to achieve precise alignment and box grabbing or box releasing actions; the dynamic compensation control uses the YOLO detection model combined with the BoTSORT tracking algorithm for dynamic continuous tracking and synchronously updates the current height information.
2. The automatic gripping and releasing box control method according to claim 1, characterized in that, The differential image preprocessing in step S20 includes: If it is a box-grabbing operation scenario, perform image denoising and illumination equalization processing on the entire operation scenario image to obtain image feature data containing the corner points of the lifting device and the corresponding corner points of the upper box; If it is a box placement operation scenario, extract a portion of the image containing the corner points of the upper box and the corresponding corner points of the lower box, and perform image denoising and illumination equalization processing to obtain image feature data containing the corner points of the upper box and the corresponding corner points of the lower box.
3. The automatic grabbing and placing box control method according to claim 2, characterized in that, The box detection model performs anomaly filtering on the real-time position pixel coordinates, specifically including: If the real-time pixel coordinates of the upper box corner and the lower box hole corner are outside the detection frame of the box detection model, then the real-time pixel coordinates of the upper box corner and the lower box hole corner are determined to be abnormal pixel coordinates and filtered out.
4. The automatic grabbing and placing box control method according to claim 3, characterized in that, The training and output process of the fully connected neural network in step S30 includes: S31, based on the operation scenario type, obtain historical operation scenario images of the spreader and the corresponding upper container reference aligned under different historical height information, or historical operation scenario images of the upper container and the corresponding lower container reference aligned, and each of the historical operation scenario images is associated with the corresponding historical height information; the historical height information includes the historical height of the spreader under the container grabbing operation scenario type, and includes the historical height of the upper container under the container dropping operation scenario type. S32, based on the job scenario type, after performing differential image preprocessing on the historical job scenario images, the pre-trained YOLO detection model outputs the corresponding labeled pixel coordinates and labeled pixel size, as follows: If the scenario is a container grabbing operation, the lifting tool corner detection model outputs the pixel coordinates of the lifting tool corner mark position; the upper container corner detection model outputs the corresponding upper container corner mark position pixel coordinates. If it is a box placement operation scenario, the upper box corner detection model outputs the pixel coordinates of the upper box corner mark position; the lower box hole corner detection model outputs the corresponding pixel coordinates of the lower box hole corner mark position. S33, based on the operation scenario type, determine the annotation pixel transformation ratio according to the actual size of the box and the calibration pixel size, and construct a training sample set; the calibration pixel size includes the calibration pixel size of the upper box and the calibration pixel size of the lower box; S34, based on the job scenario type, a pre-trained fully connected neural network is trained using the training sample set to obtain the corresponding fully connected neural network; the pre-trained fully connected neural network includes a first fully connected neural network for the box-grabbing job scenario type and a second fully connected neural network for the box-placing job scenario type. S35, based on the work scenario type, input the current height information into the corresponding pre-trained fully connected neural network, and output the standard pixel transformation ratio and standard position pixel coordinates, including: If it is a container grabbing operation scenario, the current height of the spreader is input into the first fully connected neural network, and the standard pixel transformation ratio, the standard position pixel coordinates of the spreader corner point and the corresponding standard position pixel coordinates of the upper container corner point are output. In the case of a box placement operation, the current height of the upper box is input into the second fully connected neural network, which outputs the standard pixel transformation ratio, the standard position pixel coordinates of the upper box corner, and the corresponding standard position pixel coordinates of the lower box hole corner.
5. The automatic grabbing and placing box control method according to claim 4, characterized in that, Step S33 includes: If it is a box grabbing operation scenario, the annotation pixel transformation ratio is obtained by transforming the actual size of the upper box and the corresponding upper box calibrated pixel size. All the historical heights of the lifting equipment are used as input samples. The first training sample set is constructed using all the annotation pixel transformation ratios, the pixel coordinates of the corner annotation positions of the lifting equipment, and the pixel coordinates of the corresponding corner annotation positions of the upper box as training labels. If it is a box placement operation scenario, the annotation pixel transformation ratio is obtained by transforming the actual size of the lower box and the corresponding lower box calibration pixel size. The historical height of all the upper boxes is used as input samples, and the annotation pixel transformation ratio, the pixel coordinates of the upper box corner annotation position, and the pixel coordinates of the corresponding lower box box hole corner annotation position are used as training labels to construct a second training sample set.
6. The automatic grabbing and placing box control method according to claim 5, characterized in that, Step S34 includes training the loss function: , In the formula, L represents the training loss function; α and β represent weighting coefficients that are greater than 0; K p This is expressed as the standard pixel transformation ratio predicted by the fully connected neural network; K t This is represented as the transformation ratio of the labeled pixels; P sp The standard location pixel coordinates are represented by the prediction of the fully connected neural network. P st The coordinates are represented as the pixel coordinates of the labeled position.
7. The automatic gripping and releasing box control method according to claim 1, characterized in that, Step S40 includes: S41, based on the operation scenario type, calculate the pixel position deviation according to the real-time position pixel coordinates and the standard position pixel coordinates; the pixel position deviation includes the corner pixel position deviation of the lifting device and the corresponding upper box corner pixel position deviation in the box grabbing operation scenario type; and includes the corner pixel position deviation of the upper box and the corresponding lower box hole corner pixel position deviation in the box placing operation scenario type. S42, Based on the job scenario type, calculate the relative position pixel deviation according to the pixel position deviation: If it is a container grabbing operation scenario, calculate the relative position pixel deviation between the lifting device and the corresponding upper container based on the pixel position deviation of the corner point of the lifting device and the corresponding pixel position deviation of the corner point of the upper container; If it is a box placement operation scenario, calculate the relative position pixel deviation between the upper box and the corresponding lower box based on the pixel position deviation of the upper box corner point and the corresponding pixel position deviation of the lower box hole corner point. S43, convert the relative position pixel deviation into the actual deviation according to the standard pixel transformation ratio; S44, compare the actual deviation with a preset deviation allowable limit; if the actual deviation does not exceed the preset deviation allowable limit, then directly execute step S46; S45, based on the type of work scenario, if the actual deviation exceeds the preset allowable deviation limit, generate compensation control commands in the direction of the large vehicle, the direction of the small vehicle, and / or the lifting direction according to the actual deviation, and execute dynamic compensation control; repeat steps S41 to S45 until the actual deviation enters the preset allowable deviation limit; S46, Based on the job scenario type, when the actual deviation falls within the preset deviation allowable limit... If it is a container grabbing operation scenario, perform precise alignment control of the corner points of the lifting device and the corresponding corner points of the upper container, and then perform the container grabbing action after completing the precise alignment control. If it is a box placement operation scenario, perform precise alignment control of the upper box corner point and the corresponding lower box hole corner point, and then perform the box placement action after completing the precise alignment control.
8. The automatic grabbing and placing box control method according to claim 7, characterized in that, During the dynamic compensation control process in step S45, the current altitude information is continuously and synchronously updated, including: In the container grabbing operation scenario, the current height of the spreader is continuously acquired, and the standard position pixel coordinates of the spreader corner point, the corresponding standard position pixel coordinates of the upper container corner point, and the standard pixel transformation ratio are continuously updated through the first fully connected neural network, and the actual deviation is further updated. In the box placement operation scenario, the current height of the upper box is continuously obtained, and the standard position pixel coordinates of the corner point of the upper box, the corresponding standard position pixel coordinates of the corner point of the lower box and the standard pixel transformation ratio are continuously updated through the second fully connected neural network, and the actual deviation is further updated. The actual deviation is further updated based on the updated standard position pixel coordinates and standard pixel transformation ratio.
9. An automatic box-grabbing and placing system, comprising the automatic box-grabbing and placing control method according to claim 8, characterized in that, The automatic grabbing and releasing box control method according to any one of claims 1 to 8 includes: The image acquisition module is used to receive work instructions, determine the current work scene type according to the work instructions, and acquire work scene images and current height information; The image processing module is used to perform differential image preprocessing. It uses a pre-trained YOLO detection model combined with the BoTSORT tracking algorithm to output real-time position pixel coordinates, and uses a pre-trained fully connected neural network to output standard position pixel coordinates and standard pixel transformation ratio. It calculates pixel position deviation and relative position pixel deviation, and converts the relative position pixel deviation into actual deviation according to the standard pixel transformation ratio. The instruction generation module is used to generate control instructions based on the actual deviation. The control instructions include one or more of the following: dynamic compensation control instructions, precise alignment instructions, box grabbing instructions, box placement instructions, and power on / off instructions. The drive control module is used to perform dynamic compensation control, precise alignment control, box grabbing action, or box releasing action.
10. The automatic box-grabbing and placing system according to claim 9, characterized in that: The image processing module includes: The image preprocessing unit is used to perform differentiated image preprocessing on the work scene image and output image feature data; The YOLO target tracking and detection unit includes a splice corner detection model, an upper box corner detection model, a lower box hole corner detection model, and a box body detection model, used to output real-time position pixel coordinates and calibration pixel size; the fully connected neural network unit includes: The first fully connected neural network is used to output the standard position pixel coordinates and standard pixel transformation ratio in the box grabbing operation scenario. The second fully connected neural network is used to output the standard position pixel coordinates and standard pixel transformation ratio in the box placement operation scenario. The deviation calculation unit is used to calculate pixel position deviation and relative position pixel deviation; A coordinate transformation unit is used to convert the relative position pixel deviation into an actual deviation according to the standard pixel transformation ratio; The drive control module includes: The dynamic compensation unit is used to perform dynamic compensation control. Precision alignment unit, used to perform precise alignment control; The box gripping and / or box releasing control unit is used to perform box gripping and / or box releasing actions.
