Dynamic tracking method of crane hook
Through the combination of the ball machine and the AI detection module, the dynamic tracking and monitoring of the traveling hook is realized, which solves the problem that traditional workers cannot monitor the status of the hook in real time, reduces safety hazards and work risks, and improves production efficiency.
Patent Information
- Application Number
- CN202211349438.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-10-31
AI Technical Summary
Workers in traditional steel plants cannot monitor the status of the crane hook in real time, which poses potential safety hazards, harsh working conditions, and high potential operating risks.
A ball camera is used to obtain the image of the traveling hook, and the center point coordinates and boundary information of the adaptive rectangular frame are obtained through the AI detection module and transmitted to the ball camera control module to realize dynamic tracking and monitoring of the traveling hook, including moving, zooming in, and zooming out. and static operation to keep the hook clearly displayed on the dome screen.
It realizes real-time monitoring of the traveling hook, reduces the operational risks of workers working on-site, reduces potential safety hazards, and improves the safety and efficiency of the production environment.
Smart Images

Figure CN115988320B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of dynamic tracking, and in particular to a method for dynamic tracking of a crane hook. Background Art
[0002] As the popularity of factory intelligence gradually increases, the intelligence, informationization and unmanned operation of cranes have become an important part of the construction and transformation of smart factories. In traditional steel mills, workers need to observe on-site whether the crane hook is hanging objects, and cannot monitor the status of the hook in real time. In addition, due to the harsh on-site environment, workers working on-site will have potential operational risks and safety hazards. Summary of the invention
[0003] The present invention provides a method for dynamically tracking a crane hook to overcome the above technical problems.
[0004] In order to achieve the above object, the technical solution of the present invention is:
[0005] A method for dynamically tracking a crane hook comprises the following steps:
[0006] S1: Acquire an image of a crane hook through a ball camera, including a first crane hook image and a second crane hook image; the second crane hook image is an image of the first crane hook image taken by the ball camera in the previous sampling period of the ball camera;
[0007] S2: Obtain the center point coordinates P1 and the upper left vertex coordinates A of the first adaptive rectangular frame in the first crane hook image through the AI detection module. 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 , and the center point coordinates P2 of the second adaptive rectangular frame in the second crane hook image, and transmit them to the ball camera control module;
[0008] S3: The ball camera control module determines the coordinates of the center point P1 and the upper left vertex A of the first adaptive rectangular frame according to the coordinates of the center point P1 and the upper left vertex A of the first adaptive rectangular frame. 11 , the coordinates of the lower right vertex of the first adaptive rectangular frame A 12 , and the center point coordinates P2 of the second adaptive rectangular frame, control the ball camera to track the crane hook.
[0009] Furthermore, in S3, the control logic for controlling the ball camera is as follows:
[0010] S31: Determine whether the center point coordinates P1 of the first adaptive rectangular frame and the center point coordinates P2 of the second adaptive rectangular frame satisfy: |x1-x2|>thresold or |y1-y2|>thresold,
[0011] If so, execute S32;
[0012] If not, execute S34;
[0013] S32: Determine whether the upper left vertex coordinate A of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 satisfy (x 12 - x 11 ) × (y 12 - y 11 ) > cS;
[0014] If so, perform a shrinking operation during movement on the first overhead crane hook image;
[0015] If not, execute S33;
[0016] S33: Determine whether the upper left vertex coordinate A of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 satisfy (x 12 - x 11 ) × (y 12 - y 11 ) < dS;
[0017] If so, perform an enlarging operation during movement on the first overhead crane hook image;
[0018] If not, perform a movement operation on the first overhead crane hook image;
[0019] S34: Determine whether the center point coordinate P1 of the first adaptive rectangular frame, the upper left vertex coordinate A of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 satisfy
[0020] If so, execute S35, otherwise execute S36;
[0021] S35: Determine whether the upper left vertex coordinate A of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 satisfy (x 12 - x 11 ) × (y 12 - y 11 ) < dS. If so, perform an enlarging operation at rest. If not, the first overhead crane hook image remains stationary and no operation is performed on the first overhead crane hook image;
[0022] S36: Determine whether the upper left vertex coordinate A of the first adaptive rectangular frame11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 Does it satisfy (x 12 -x 11 )×(y 12 -y 11 )>cS;
[0023] If yes, performing a zoom-out operation on the first crane hook image;
[0024] If not, a moving operation is performed on the first crane hook image.
[0025] Where: W is the width of the ball machine screen, H is the height of the ball machine screen; x1 is the horizontal coordinate of the center point P1 of the first adaptive rectangular frame; y1 is the vertical coordinate of the center point P1 of the first adaptive rectangular frame; x 11 The coordinate A of the upper left vertex of the first adaptive rectangular frame 11 The horizontal axis of y 11 The coordinate A of the upper left vertex of the first adaptive rectangular frame 11 The vertical coordinate of 12 A is the coordinate of the lower right vertex of the first adaptive rectangular frame 12 The horizontal axis of y 12 A is the coordinate of the lower right vertex of the first adaptive rectangular frame 12 The vertical coordinate of the dome camera; S is the resolution of the ball camera plane; x2 is the horizontal coordinate of the center point P2 of the second adaptive rectangular frame; y2 is the vertical coordinate of the center point P2 of the second adaptive rectangular frame; a is the range coefficient of the center point of the crane hook; b is the range coefficient of the adaptive rectangular frame of the crane hook; thresold is the offset threshold, c is the judgment coefficient of the hook adaptive rectangular frame reduction; d is the judgment coefficient of the hook adaptive rectangular frame enlargement.
[0026] Furthermore, the zooming-out operation during movement is to firstly take the center O of the ball camera screen as a base point, proportionally reduce the first adaptive rectangular frame by a first threshold multiple; and then move the center point coordinate P1 of the first adaptive rectangular frame to the center O of the ball camera screen.
[0027] Furthermore, the zoom-in operation during movement is to firstly take the center O of the ball camera screen as the base point, proportionally zoom in the first adaptive rectangular frame by a second threshold multiple; and then move the center point coordinate P1 of the first adaptive rectangular frame to the center O of the ball camera screen.
[0028] Furthermore, the static zooming operation is to use the center O of the ball camera screen as a base point and proportionally zoom the first adaptive rectangular frame by a second threshold multiple.
[0029] Furthermore, the zooming out operation in stillness is to reduce the first adaptive rectangular frame proportionally by a first threshold multiple based on the center O of the ball camera screen.
[0030] Furthermore, the moving operation is to move the center point coordinate P1 of the first adaptive rectangular frame to the center O of the ball camera screen.
[0031] Furthermore, in S3, the logic of controlling the ball camera also includes: when the AI detection module does not detect the center point coordinate P1 of the first adaptive rectangular frame and the upper left vertex coordinate A of the first adaptive rectangular frame within the first time threshold, 11 , the coordinates of the lower right vertex of the first adaptive rectangular frame A 12 , execute the operation of returning to the preset point.
[0032] Furthermore, the speed at which the ball camera acquires the first crane hook image and the second crane hook image is 25fps.
[0033] Beneficial effect: The method for dynamic tracking of a crane hook of the present invention obtains the image of the crane hook through a ball camera, and obtains the center point coordinates of the first adaptive rectangular frame in the first crane hook image, the upper left vertex coordinates of the first adaptive rectangular frame and the lower right vertex coordinates of the first adaptive rectangular frame through an AI detection module, as well as the center point coordinates of the second adaptive rectangular frame in the second crane hook image, and transmits these coordinates to the ball camera control module for controlling the ball camera, so as to perform dynamic and clear real-time monitoring of the hook on the ball camera screen, thereby reducing the operational risks of workers working on site and reducing safety hazards. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0035] Figure 1 It is a flow chart of the method for dynamic tracking of a crane hook of the present invention;
[0036] Figure 2 It is a framework diagram of a crane hook dynamic tracking system in an embodiment of the present invention;
[0037] Figure 3 It is a framework diagram of a crane hook dynamic tracking system in another embodiment of the present invention;
[0038] Figure 4 It is a schematic diagram of the operation of reducing the first crane hook image in an embodiment of the present invention;
[0039] Figure 5Schematic diagram of movement operation in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] This embodiment provides a method for dynamically tracking a crane hook. Figure 1 , including the following steps,
[0042] S1: Acquire the first and second images of the crane hook through the ball camera; the second image of the crane hook is an image of the first image of the crane hook taken by the ball camera in the previous sampling period of the ball camera; specifically, the second image of the crane hook and the first image of the crane hook are two adjacent frames of images taken successively by the ball camera.
[0043] In the embodiment of the present invention, Hikvision SDK is used to control the ball camera; it can rotate according to the detected position of the hook, and adjust the hook image on the ball camera screen according to the size of the hook in the detected image.
[0044] S2: Obtain the center point coordinates P1 and the upper left vertex coordinates A of the first adaptive rectangular frame in the first crane hook image through the AI detection module. 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 , and the center point coordinates P2 of the second adaptive rectangular frame in the second crane hook image, the upper left vertex coordinates A of the second adaptive rectangular frame 21 and the coordinate A of the lower right vertex of the second adaptive rectangular box 22 , and transmit it to the ball machine control module;
[0045] Specifically, the first adaptive rectangular box / the second adaptive rectangular box is a rectangular box formed by the boundary information of the hook in the first vehicle hook image / the second vehicle hook image detected after the AI detection module is learned through the neural network model. Specifically, the rectangular box formed by the topmost point, the bottommost point, the leftmost point and the rightmost point of the detected hook is used as the first adaptive rectangular box / the second adaptive rectangular box.
[0046] Specifically, this embodiment is based on the RTSP protocol, calls OpenCV to obtain real-time ball camera video data, that is, the real-time first and second vehicle hook images, and processes the image size of the first and second vehicle hook images to the size required by the deep neural network. At this time, the video frame data format read in is the ndarray data format of numpy, and is in BGR format, so the image is first converted to RGB format. Regardless of BGR or RGB format, the video frames read at this stage are in H*W*C format, and neural network frameworks such as Pytorch require video frames in C*H*W format as input, so it is necessary to process the image format, transpose 0, 1, 2 channels into 2, 0, 1 channels, and then process the video frames into tensors supported by Pytorch. During neural network reasoning, a channel is used to specify the batch size, and then the data is represented by a floating point type and normalized, so that the ideal input data of the AI detection module can be obtained, that is, the first and second vehicle hook images that can be input to the AI detection module.
[0047] The AI detection module in this embodiment is equipped with an AI detection algorithm that uses YOLOX or YOLOv5 as a training model. Before the algorithm is implemented, it is necessary to collect a data set to train the detection algorithm to ensure the correctness of the algorithm. Data sets are crucial to AI algorithms. Before actual operation, a large number of data sets are needed to train the AI algorithm. Too few data sets will cause overfitting. Therefore, it is necessary to collect as comprehensive a data set as possible to train the algorithm in order to make the detection accurate. In terms of training models, this embodiment uses the cutting-edge neural network of One Stage's YOLO series, which can achieve a very high target detection rate while meeting high real-time detection on site, avoiding the camera from losing the target. Since there may be many targets similar to crane hooks on site, we use data enhancement methods in training to avoid false detection of targets. Specifically, before transmitting each frame of the image, the video stream address is first parsed and decoded to obtain the bgr image data, so as to decode the video stream and obtain the first crane hook image and the second crane hook image. The video stream parsing and video stream decoding operations are encapsulated through the Opencv third-party library. When used, the corresponding stream address is directly opened, that is, each frame of the ball camera image, that is, the crane hook image, can be read at a specified rate. The underlying algorithm uses ffmpeg to support video stream encoding and decoding.
[0048] Specifically, this embodiment uses an AI detection algorithm to identify the hook, obtain the center point coordinates P1 of the first adaptive rectangular frame in the first vehicle hook image, the upper left vertex coordinates A 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12, and the center point coordinates P2 of the second adaptive rectangular frame in the second crane hook image, the upper left vertex coordinates A of the second adaptive rectangular frame 21 and the coordinate A of the lower right vertex of the second adaptive rectangular box 22 The method adopted is the existing technology, which is the function included in the software installed in the AI monitoring module.
[0049] By performing AI analysis on the first crane hook image and the second crane hook image, the position of the hook in the image is determined, specifically, the center point coordinate P1 of the first adaptive rectangular frame in the first crane hook image and the upper left vertex coordinate A of the first adaptive rectangular frame are obtained. 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 , and the center point coordinates P2 of the second adaptive rectangular frame in the second crane hook image, the upper left vertex coordinates A of the second adaptive rectangular frame 21 and the coordinate A of the lower right vertex of the second adaptive rectangular box 22 , and transmitted to the ball camera control module to guide the ball camera to track the crane hook in real time, wherein the first crane hook image and the second crane hook image are two adjacent frames of images acquired by the ball camera. The second crane hook image is the previous image of the first crane hook image taken by the ball camera;
[0050] Figure 2 In the , AI target detection method is written in Python, which can support deep learning frameworks such as Pytorch, Tensorflow, ONNX, OpenVINO, TensorRT, etc. The video stream decoding part is implemented by OpenCV, and the algorithm can use a variety of SOTA real-time target detection frameworks such as YOLOv5 and YOLOX. After the AI reasoning is completed, the point information of the tracking target will be transmitted to the ball camera control module through urllib3 based on http, and combined with Hikvision SDK to realize the control of Hikvision ball cameras.
[0051] Figure 3 In the , AI target detection method is written in C++ language, which is designed for the TensorRT framework for inference acceleration and is more suitable for deployment in low-latency scenarios. The video stream decoding part is implemented by FFmpeg or Gstreamer. After operator conversion, the algorithm can use YOLOv5 and YOLOX real-time target detection frameworks. After the AI inference is completed, the point information of the tracking target is transmitted through Cinatra based on HTTP and given to the ball camera control module. Combined with Hikvision SDK, the control of Hikvision ball cameras can be realized.
[0052] S3: The ball camera control module determines the coordinates of the center point P1 and the upper left vertex A of the first adaptive rectangular frame according to the coordinates of the center point P1 and the upper left vertex A of the first adaptive rectangular frame.11 , the coordinates of the lower right vertex of the first adaptive rectangular frame A 12 , and the center point coordinate P2 of the second adaptive rectangular frame is used to control the ball camera to track the crane hook.
[0053] Specifically, the ball machine control module in this embodiment uses C++ as the programming language; the AI detection module uses Python as the design language; there is cross-language communication between the two, the C++ control end uses the cinatra third-party library, and the AI end uses the urllib3 third-party library, so as to realize cross-language communication between C++ and Python based on the http protocol, which is used to transmit control signals, etc.
[0054] Specifically, after the dynamic tracking system is started, the ball camera control module continuously monitors the local port through the http server, and monitors the control signal from the AI detection module, that is, the coordinates of the center point of the hook in the first and second driving hook images and the coordinates of the upper left vertex of the adaptive rectangular frame and the lower right vertex of the hook adaptive rectangular frame. The entire hook adaptive rectangular frame can be locked and drawn through two vertices; each driving hook image is composed of pixels arranged one by one, for example, a 1280×720 image is composed of 921600 pixels. The information transmitted by the AI detection module is the coordinates of the center point of the target object (i.e., the hook) in the image, and the pixel point information of the object boundary (i.e., the coordinates of the upper left vertex of the hook adaptive rectangular frame and the coordinates of the lower right vertex of the hook adaptive rectangular frame), and then logical control is performed through the coordinates of the center point of the target object in the image. After each control, the target object's position information (i.e., the coordinates of the center point of the first hook, the coordinates of the upper left vertex of the first hook's adaptive rectangular frame, and the coordinates of the lower right vertex of the first hook's adaptive rectangular frame) will be retained for comparison with the next signal (i.e., the coordinates of the center point of the second hook, the coordinates of the upper left vertex of the second hook's adaptive rectangular frame, and the coordinates of the lower right vertex of the second hook's adaptive rectangular frame). The main controls include the following categories:
[0055] In S3, the control logic for controlling the ball camera is as follows:
[0056] S31: Determine whether the center point coordinates P1 of the first adaptive rectangular frame and the center point coordinates P2 of the second adaptive rectangular frame satisfy: |x1-x2|>thresold or |y1-y2|>thresold,
[0057] If yes, execute S32;
[0058] If not, execute S34;
[0059] S32: Determine the coordinate A of the upper left vertex of the first adaptive rectangular frame 11and the lower right vertex coordinate A of the first adaptive rectangular frame 12 Does it satisfy (x 12 -x 11 )×(y 12 -y 11 )>cS;
[0060] If yes, performing a zoom-out operation on the first crane hook image;
[0061] If not, execute S33;
[0062] Preferably, the zooming-out operation during movement is to firstly take the center of the ball camera screen as the base point, proportionally reduce the first adaptive rectangular frame by a first threshold multiple; and then move the center point coordinate P1 of the first adaptive rectangular frame to the center of the ball camera screen;
[0063] Specifically, in the embodiment, the first adaptive rectangular frame is proportionally reduced by 0.5 times with the center of the ball camera screen as the base point;
[0064] S33: Determine the coordinate A of the upper left vertex of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 Does it satisfy (x 12 -x 11 )×(y 12 -y 11 ) <dS;
[0065] If yes, performing a zoom-in operation on the first crane hook image;
[0066] If not, performing a moving operation on the first crane hook image;
[0067] Preferably, the zoom-in operation during movement is to firstly take the center of the ball camera screen as the base point, and proportionally zoom in the first adaptive rectangular frame by a second threshold multiple; and then move the center point coordinate P1 of the first adaptive rectangular frame to the center of the ball camera screen;
[0068] Specifically, in the embodiment, the first adaptive rectangular frame is proportionally enlarged by 2 times with the center of the ball camera screen as the base point;
[0069] S34: Determine the center point coordinate P1 of the first adaptive rectangular frame and the upper left vertex coordinate A of the first adaptive rectangular frame. 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 Is it satisfied?
[0070] If yes, execute S35, otherwise execute S36;
[0071] S35: Determine the upper left vertex coordinate A of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 whether they satisfy (x 12 - x 11 ) × (y 12 - y 11 ) < dS. If so, perform the zoom-in operation during stillness. If not, the first overhead crane hook image is stationary and no operation is performed on the first overhead crane hook image;
[0072] Preferably, the zoom-in operation during stillness is to proportionally zoom in the first adaptive rectangular frame by a second threshold multiple with the center of the dome camera screen as the base point;
[0073] Specifically, if the distance between the center point coordinates of the first hook and the center point coordinates of the second hook given in two AI signals is less than a preset threshold, then the tracking system determines that the object has not moved or this small-scale deviation is an error caused by the on-site environment. In this case, it is determined that the hook is stationary, so no control is performed on the dome camera, no operation is performed on the first overhead crane hook image, and the position of the dome camera is not changed.
[0074] S36: Determine the upper left vertex coordinate A of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 whether they satisfy (x 12 - x 11 ) × (y 12 - y 11 ) > cS;
[0075] If so, perform the zoom-out operation during stillness on the first overhead crane hook image; At this time, the area of the hook in the first overhead crane hook image is too large, that is, the hook is relatively close to the dome camera lens, and the system will perform the zoom-out operation through the Hikvision SDK. In special cases, if the hook moves towards the lens, then the center position information of the object remains unchanged, but the overall area of the object will become larger and larger. In this case, the position of the dome camera does not change, and only the focal length of the dome camera is adjusted to perform the zoom-out operation.
[0076] If not, perform the movement operation on the first overhead crane hook image.
[0077] Preferably, the zoom-out operation during stillness is to proportionally zoom out the first adaptive rectangular frame by a first threshold multiple with the center of the dome camera screen as the base point;
[0078] Preferably, the movement operation is to move the center point coordinate P1 of the first adaptive rectangular frame to the center of the dome camera screen;
[0079] Where: W is the width of the ball machine screen, H is the height of the ball machine screen; x1 is the horizontal coordinate of the center point coordinate P1 of the first adaptive rectangular frame; y1 is the vertical coordinate of the center point coordinate P1 of the first adaptive rectangular frame; x 11 The coordinate A of the upper left vertex of the first adaptive rectangular frame 11 The horizontal axis of y 11 A is the coordinate of the upper left vertex of the first adaptive rectangular frame 11 The vertical coordinate of 12 A is the coordinate of the lower right vertex of the first adaptive rectangular frame 12 The horizontal axis of y 12 A is the coordinate of the lower right vertex of the first adaptive rectangular frame 12 The vertical coordinate of the ball camera plane; S is the resolution of the ball camera plane; x2 is the horizontal coordinate of the center point coordinate P2 of the second adaptive rectangular frame; y2 is the vertical coordinate of the center point coordinate P2 of the second adaptive rectangular frame; a is the range coefficient of the center point of the crane hook; b is the range coefficient of the crane hook adaptive rectangular frame; thresold is the offset threshold, c is the judgment coefficient of the hook adaptive rectangular frame reduction; d is the judgment coefficient of the hook adaptive rectangular frame enlargement; in this embodiment, the coefficients a, b, c, and d are determined by the on-site staff based on experience and after multiple debugging of the system, so that the tracking system of this embodiment can make the hook in the area of the adaptive rectangular frame have the best effect when the staff observes, and can ensure that the hook is tracked without loss. In this embodiment, the value of c is 1 / 8, and the value of d is 1 / 64.
[0080] Specifically, according to the distance between P1 and P2, it can be determined whether the hook has moved. At the same time, the size of the hook in the ball camera screen can also be determined, that is, by calculating the coordinates A of the upper left vertex of the first adaptive rectangular frame. 11 , the coordinates of the lower right vertex of the first adaptive rectangular frame A 12 and the coordinate A of the upper left vertex of the second adaptive rectangular box 21 and the coordinate A of the lower right vertex of the second adaptive rectangular box 22 Analyze the position in the entire ball machine plane and calculate the area of the hook's adaptive rectangular frame. If the area of the hook's adaptive rectangular frame is too small relative to the entire ball machine screen (less than ), the ball camera control module controls the ball camera to zoom in, so that the size of the object in the ball camera screen is moderate, that is, the area of the adaptive rectangular block is and The specific setting is based on the comfort of the operator who is tracking and monitoring the hook. For example, if the target object is moving in the direction away from the lens, the center point of the hook will not change, but the upper left and lower right vertices of the adaptive rectangular frame will change, and the size of the adaptive rectangular frame will become smaller and smaller. At this time, the system will perform a static zoom operation, the ball camera position remains unchanged, and the focal length is simply adjusted. By passing a zoom signal to the camera through the Hikvision SDK, it is possible to zoom in according to the camera's magnification.
[0081] In the zoom-in and zoom-out operations, when the AI signal arrives, the center point position and object area of the first and second crane hook images are judged at the same time. If the center point is significantly offset and the object area changes significantly, the ball camera is controlled to track the object first, then zoom in or out, and then move, changing the position of the image on the ball camera screen so that the image is always in the right size and position.
[0082] In S3, the logic for controlling the ball camera also includes:
[0083] When the AI detection module does not obtain the first crane hook image within the first time threshold, the center point coordinate P1 of the first adaptive rectangular frame and the upper left vertex coordinate A of the first adaptive rectangular frame are not detected. 11 , the coordinates of the lower right vertex of the first adaptive rectangular frame A 12 , execute the operation of returning to the preset point;
[0084] Specifically, the AI detection module will send point information to the ball camera control module only when it detects the hook. Therefore, when the ball camera does not detect an object for a long time during an operation, that is, it does not detect the center point coordinate P1 of the first adaptive rectangular frame, the upper left vertex coordinate A 11 , the coordinates of the lower right vertex of the first adaptive rectangular frame A 12 If no object appears at the same time, the ball camera is controlled to return to the preset point, that is, the pre-set position, and wait for the next detection. A timing and statistics program is set inside the ball camera control module, and this operation is performed when no AI signal is received within the first time threshold. Specifically, in this embodiment, the position of the ball camera when the system is started is the position of the initial preset point, and timing is performed after each signal. If no object is detected for more than five seconds, the return to preset point operation will be executed, returning to the position where the ball camera was when the system was started, and waiting for the next tracking.
[0085] The communication protocol in this embodiment is the http protocol, and the dome camera control module and the AI detection algorithm communicate using the http protocol. The main transmission content involved is the transmission of control information, that is, the center point coordinates P_1 of the first adaptive rectangular frame in the first vehicle hook image, the upper left vertex coordinates A_11 of the first adaptive rectangular frame, and the lower right vertex coordinates A_12 of the first adaptive rectangular frame, as well as the center point coordinates P_2 of the second adaptive rectangular frame in the second vehicle hook image, the upper left vertex coordinates A_21 of the second adaptive rectangular frame, and the lower right vertex coordinates A_22 of the second adaptive rectangular frame are transmitted to the dome camera control module; wherein, the control module collects the dome camera image at a speed of 25fps, and the sending frequency should be comprehensively considered in combination with the rate of the AI detection module.
[0086] The working principle of the present invention is as follows:
[0087] After the AI in this embodiment detects the hook in the image, it will obtain the bounding box and confidence of the target object. There is a very low probability that the number of detected targets in this stage is more than one. In order to make the ball camera always track a specified driving hook target, the AI detection module selects the target with the highest confidence in the structure of the neural network output for subsequent extraction. After determining the hook to be tracked, we calculate the center point of the bounding box, that is, the center point of the hook's adaptive box in the image. With the position of the center point pixel in the image, we can call the Hikvision SDK in the future to control the direction of the ball camera. In addition, in addition to the center point information, the boundary information of the hook's bounding box (adaptive box) also has an important influence on the control of the ball camera. The size of the bounding box reflects to a certain extent the distance of the target from the camera. When the bounding box is too small, the system will dynamically enlarge the area where the driving hook is located based on the size of the bounding box, to assist the driving driver in real-time operation and clearly observe the hook. The boundary information of the bounding box is obtained by the coordinate A of the upper left vertex of the first adaptive rectangular box. 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 To demonstrate, with the subsequent control logic, the camera zooms and shrinks the lens to expand the field of view, so that even if the hook moves quickly, the ball camera can keep track of the target. And it can solve the problem that traditional ball camera control can only track the hook moving on a fixed path and at a fixed speed.
[0088] Figure 4 A schematic diagram of the shrinking operation on the adaptive frame of the hook in an embodiment of the present invention is shown. The shrinking operation of the present invention is performed based on the center O of the ball camera screen, so when the adaptive frame is operated, the adaptive frame of the hook will not be lost.
[0089] Figure 5 A schematic diagram of moving the adaptive frame of the hook in an embodiment of the present invention is shown, wherein the position P in the second traveling hook image is moved to the position Q where the adaptive frame of the first traveling hook image is located, that is, it moves to the center point position O of the ball camera screen.
[0090] The present invention combines AI detection technology and ball camera control, uses a ball camera to replace human eyes to intelligently track the crane hook, tracks the real-time status of the overhead crane hook, and transmits the status of the hook to the control platform in real time, playing a visual auxiliary role. It successfully realizes the intelligent tracking of targets on industrial sites, expands the application scenarios of ball cameras, and realizes the dynamic tracking of crane hooks in industrial environments. It can also reduce the work pressure of workers and avoid potential operational risks that may occur in the production process as much as possible, which helps to improve production efficiency.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for dynamic tracking of a crane hook, characterized in that: The steps include: S1: Acquire an image of a crane hook through a ball camera, including a first crane hook image and a second crane hook image; the second crane hook image is an image of the first crane hook image taken by the ball camera in the previous sampling period of the ball camera; S2: Obtain the center point coordinates P1 and the upper left vertex coordinates A of the first adaptive rectangular frame in the first crane hook image through the AI detection module. 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 , and the center point coordinates P2 of the second adaptive rectangular frame in the second crane hook image, and transmit them to the ball camera control module; S3: The ball camera control module determines the coordinates of the center point P1 and the upper left vertex A of the first adaptive rectangular frame according to the coordinates of the center point P1 and the upper left vertex A of the first adaptive rectangular frame. 11 , the coordinates of the lower right vertex of the first adaptive rectangular frame A 12 , and the center point coordinate P2 of the second adaptive rectangular frame, control the ball camera to track the crane hook; In S3, the control logic for controlling the ball camera is as follows: S31: Determine whether the center point coordinates P1 of the first adaptive rectangular frame and the center point coordinates P2 of the second adaptive rectangular frame satisfy: |x1-x2|>thresold or |y1-y2|>thresold, If yes, execute S32; If not, execute S34; S32: Determine the coordinate A of the upper left vertex of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 Does it satisfy (x 12 -x 11 )×(y 12 -y 11 )>cS; If yes, performing a zoom-out operation on the first crane hook image; If not, execute S33; The zooming-out operation during movement is to firstly take the center O of the ball camera screen as the base point, and proportionally reduce the first adaptive rectangular frame by a first threshold multiple; and then move the center point coordinate P1 of the first adaptive rectangular frame to the center O of the ball camera screen; S33: Determine the coordinate A of the upper left vertex of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 Does it satisfy (x 12 -x 11 )×(y 12 -y 11 ) <dS; If yes, a zoom-in operation is performed on the first crane hook image; the zoom-in operation is to firstly take the center O of the ball camera screen as the base point, and proportionally enlarge the first adaptive rectangular frame by a second threshold multiple; and then move the center point coordinate P1 of the first adaptive rectangular frame to the center O of the ball camera screen; If not, a moving operation is performed on the first crane hook image; the moving operation is to move the center point coordinate P1 of the first adaptive rectangular frame to the center O of the ball camera screen; S34: Determine the center point coordinate P1 of the first adaptive rectangular frame and the upper left vertex coordinate A of the first adaptive rectangular frame. 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 Is it satisfied? If yes, execute S35, otherwise execute S36; S35: Determine the upper left vertex coordinate A of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 whether they satisfy (x 12 - x 11 ) × (y 12 - y 11 ) < dS. If so, perform the zoom-in operation during stillness. If not, the first overhead crane hook image is still, and no operation is performed on the first overhead crane hook image; S36: Determine the coordinate A of the upper left vertex of the first adaptive rectangular frame 11 and the lower right vertex coordinate A of the first adaptive rectangular frame 12 Does it satisfy (x 12 -x 11 )×(y 12 -y 11 )>cS; If yes, performing a zoom-out operation on the first crane hook image; If not, performing a moving operation on the first crane hook image; Where: W is the width of the ball machine screen, H is the height of the ball machine screen; x1 is the horizontal coordinate of the center point P1 of the first adaptive rectangular frame; y1 is the vertical coordinate of the center point P1 of the first adaptive rectangular frame; x 11 The coordinate A of the upper left vertex of the first adaptive rectangular frame 11 The horizontal axis of y 11 The coordinate A of the upper left vertex of the first adaptive rectangular frame 11 The vertical coordinate of 12 A is the coordinate of the lower right vertex of the first adaptive rectangular frame 12 The horizontal axis of y 12 A is the coordinate of the lower right vertex of the first adaptive rectangular frame 12 The vertical coordinate of the dome camera; S is the resolution of the ball camera plane; x2 is the horizontal coordinate of the center point P2 of the second adaptive rectangular frame; y2 is the vertical coordinate of the center point P2 of the second adaptive rectangular frame; a is the range coefficient of the center point of the crane hook; b is the range coefficient of the adaptive rectangular frame of the crane hook; thresold is the offset threshold, c is the judgment coefficient of the hook adaptive rectangular frame reduction; d is the judgment coefficient of the hook adaptive rectangular frame enlargement.
2. A method for dynamic tracking of a crane hook according to claim 1, characterized in that: The static zooming operation is to use the center O of the ball camera screen as a base point and proportionally zoom the first adaptive rectangular frame by a second threshold multiple.
3. A method for dynamic tracking of a crane hook according to claim 1, characterized in that: The zooming out operation in stillness is to reduce the first adaptive rectangular frame proportionally by a first threshold multiple based on the center O of the ball camera screen.
4. A method for dynamic tracking of a crane hook according to claim 1, characterized in that: In the step S3, the logic for controlling the ball camera further includes: when the AI detection module does not detect the center point coordinate P1 of the first adaptive rectangular frame and the upper left vertex coordinate A of the first adaptive rectangular frame within the first time threshold, 11 , the coordinates of the lower right vertex of the first adaptive rectangular frame A 12 , execute the operation of returning to the preset point.
5. A method for dynamic tracking of a crane hook according to claim 1, characterized in that: The speed at which the ball camera acquires the first and second images of the crane hook is 25 fps.
Citation Information
Patent Citations
Intelligent tower crane eye with voice control and video assisting device
CN106006382A
A face following method and device based on a monocular camera
CN109831616A
Method for accurately positioning moving object based on deep learning
CN109934848A
Target tracking method and device for pan-tilt camera, medium and electronic equipment
CN114764817A
