Barrel characteristic positioning method and device for barrel-shaped labeling machine
Through the barrel feature positioning method based on pre-trained network and random forest regression model, the problem of low barrel positioning efficiency in the existing technology is solved, and a high-precision and efficient labeling process is realized, which is suitable for a variety of industrial applications.
Patent Information
- Application Number
- CN202411148571.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-08-21
AI Technical Summary
When existing labeling technology deals with barrels of different sizes, shapes and materials, the positioning efficiency is low, making it difficult to achieve accurate fit, which affects product quality and production efficiency.
The barrel feature positioning method based on pre-trained barrel feature recognition network and random forest regression model is adopted. Video stream data is obtained through multiple cameras, barrel features are identified and angle position information is generated, and precise positioning is achieved using server-side control.
It improves the accuracy and production efficiency of barrel feature positioning, is suitable for barrels of different shapes and sizes, reduces manual intervention and errors, and improves the automation level and product quality of the production line.
Smart Images

Figure CN119295540A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of artificial intelligence, and in particular relates to a method and a device for locating drum features of a drum labeling machine. Background Art
[0002] Drum labeling machine is a widely used equipment in industrial production process, mainly used to accurately attach labels to the surface of drums. Its application covers many fields such as food, beverage, chemical, medicine, etc. In these industries, drums are usually used to hold various liquid, solid or powdered substances. Therefore, ensuring the correct positioning and attachment of labels on the surface of drums is of great significance to the appearance of products, brand recognition and information transmission.
[0003] In the traditional labeling process, accurately locating the position and orientation of the drum is a key challenge. Because the geometric shapes and sizes of the drums vary, and there may be slight deviations due to tolerances in the manufacturing process. Therefore, ensuring the accuracy of the fit of the label to the drum is one of the key factors to ensure product quality and aesthetics.
[0004] Existing labeling technologies usually rely on mechanical positioning devices or optical sensors to detect and adjust the position of the barrels. However, these methods may encounter some challenges when dealing with barrels of different sizes, shapes and materials. For example, mechanical positioning devices may need to be adjusted for barrels of different sizes, and optical sensors may misjudge when facing reflective or transparent materials.
[0005] Therefore, developing a universal and efficient method for locating barrel features is of great significance for the stable operation of labeling machines and adapting to different production needs. The method should be able to achieve reliable positioning on barrels of different types, sizes and materials to ensure accurate labeling. This can not only improve production efficiency, but also reduce human intervention and errors, ultimately improving the automation level of the production line and product quality. Summary of the invention
[0006] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a method and device for locating drum features for a drum labeling machine, so as to at least solve the problems of versatility and low positioning efficiency in the traditional labeling process in the related art.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] In a first aspect, the present invention provides a method for locating features of a barrel for a barrel labeling machine, comprising the following steps:
[0009] Based on a plurality of preset cameras, video stream data of the barrel is acquired, a pre-trained barrel feature recognition network is used to perform feature recognition on the video stream data, and the recognized target features and the camera numbers corresponding to the target features are saved in a buffer file;
[0010] Initialize the buffer file. When the execution signal from the server is monitored, the command task is executed according to the execution signal and the current buffer file is cleared.
[0011] After clearing the buffer file, wait for a new piece of recognition data in the buffer file, input the recognition data in the buffer file into the pre-established barrel position angle model, and obtain the current angle position information of the target feature;
[0012] Generate state information based on the current angular position information of the barrel target feature, wherein the state information is used to indicate that the angular position information is the latest;
[0013] The angle position information and the state information are transmitted to the server side, and the server side moves the target feature of the barrel to the designated position according to the received angle position information and state information.
[0014] As a preferred technical solution, the method of obtaining the video stream data of the barrel based on the preset multiple cameras is specifically as follows:
[0015] A camera is set at four directions on the side of the barrel respectively, and the video stream data of the side of the barrel is obtained by using the camera. Each camera covers a 90° range of the side of the barrel.
[0016] As a preferred technical solution, the pre-trained barrel feature recognition network is used to perform feature recognition on the video stream data, and the recognized target features and the camera numbers corresponding to the target features are saved in a buffer file, specifically:
[0017] The target feature identified by the barrel feature recognition network is represented by a rectangular bounding box, and the target feature information of the barrel is identified in the acquired video stream data, and the bounding box marks the target category information and target confidence corresponding to the identified target feature;
[0018] After identifying the bounding box corresponding to the target feature, according to the target category information and target confidence of the target, select the target whose target category information is the set category and the target confidence meets the set threshold, and then use the target as the barrel target feature, and the bounding box corresponding to the target is the bounding box corresponding to the described barrel target feature;
[0019] The camera number of the video stream data from which the target feature of the identified barrel originates and the x-coordinate of the center coordinate of the bounding box are set as the identified feature information, and the identified feature information is the target feature and the camera number corresponding to the target feature.
[0020] As a preferred technical solution, the clearing of the buffer file and waiting for a piece of identification data in the buffer file is specifically:
[0021] First, wait for the execution signal from the server, and listen to the execution signal from the specified register on the server;
[0022] After waiting for the execution signal given by the designated register on the server side, clear the buffer file storing the recognized barrel feature identification information, wherein the barrel feature identification information is the target feature and the camera number corresponding to the target feature;
[0023] Finally, wait for the latest barrel feature recognition information to be saved in the buffer file.
[0024] As a preferred technical solution, the barrel position angle model is a model trained and fitted based on random forest regression, specifically:
[0025] After obtaining the latest recognized barrel feature information in the buffer file, the camera number in the feature information and the x-coordinate of the center coordinate of the bounding box are input into the barrel position angle model to obtain the current angle position information of the barrel target feature;
[0026] The barrel position angle model outputs a position angle information whose value is between 0° and 360°. The camera number of the identified barrel feature information and the x-coordinate of the center coordinate of the bounding box are input into the barrel feature position angle model, and regression analysis is performed based on multiple decision trees. The multiple decision trees are constructed by randomly selecting subsets and features in the data set, and finally a predicted position angle information is output.
[0027] As a preferred technical solution, the recognition data in the buffer file is input into the pre-established barrel position angle model to obtain the current angle position information of the target feature, specifically:
[0028] Initialize the position information, status information, waiting signal and real angle information of the buffer file;
[0029] A plurality of identification data are input into the barrel position angle model to obtain a plurality of angle position information, and an average value of the plurality of angle position information is calculated and the average value is used as the output of the barrel position angle model.
[0030] As a preferred technical solution, after transmitting the position information and the status information to the server, first determine whether the transmitted angle position information is the latest. If it is the latest, the server will transfer the target feature of the barrel to the specified position; after the operation is completed, wait for the next barrel to arrive at the specified position.
[0031] In a second aspect, the present invention provides a barrel feature positioning system for a barrel labeling machine, comprising a target feature acquisition module, an initialization module, an angle position information acquisition module, a state information acquisition module, and a server execution module;
[0032] The target feature acquisition module is used to acquire the video stream data of the barrel based on a plurality of preset cameras, perform feature recognition on the video stream data using a pre-trained barrel feature recognition network, and save the recognized target features and the camera numbers corresponding to the target features into a buffer file;
[0033] The initialization module is used to initialize the buffer file. When the execution signal of the server is monitored, the instruction task is executed according to the execution signal and the current buffer file is cleared;
[0034] The angle position information acquisition module is used to clear the buffer file, wait for a new piece of identification data in the buffer file, input the identification data in the buffer file into the pre-established barrel position angle model, and obtain the angle position information of the target feature at present;
[0035] The state information acquisition module is used to generate state information based on the current angular position information of the barrel target feature, and the state information is used to indicate that the angular position information is the latest;
[0036] The server execution module is used to transmit the angle position information and the status information to the server end, and the server end moves the target feature of the barrel to the specified position according to the received angle position information and status information.
[0037] In a third aspect, the present invention provides an electronic device, the electronic device comprising:
[0038] at least one processor; and,
[0039] a memory communicatively connected to the at least one processor; wherein,
[0040] The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to perform the drum feature positioning method for a drum labeling machine.
[0041] In a fourth aspect, the present invention provides a computer-readable storage medium storing a program, which, when executed by a processor, implements the method for locating barrel features for a barrel labeling machine.
[0042] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0043] The general method for positioning the barrel features of the barrel labeling machine provided by the present invention, first of all, the system adopts an advanced neural network algorithm, which can achieve higher precision positioning of the barrel features, ensure the accurate attachment of the label, and thus improve the accuracy and consistency of labeling. Secondly, by using the pre-trained barrel feature recognition network, the system can quickly identify the barrel features, and quickly generate position information through the real-time data processing module, which speeds up the processing speed of the entire labeling process and improves production efficiency. Not only that, the system adopts a general method, is suitable for barrels of different shapes and sizes, and has a certain fault tolerance, so that it can be widely used in a variety of industrial fields. Most importantly, through the control of the server-side operation module, the entire labeling process has a high degree of automation, the operation process is simpler, the possibility of manual intervention and operation errors is reduced, the stability and reliability of the production line are improved, and the production cost is also reduced. In summary, the barrel feature positioning method and the general system of the present invention have obvious advantages in improving labeling accuracy, accelerating processing speed, improving versatility and simplifying operation procedures, and are expected to play an important role in industrial production and promote production automation and intelligentization. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 This is the barrel feature positioning method for a barrel labeling machine according to Example 1 of the present application.
[0046] Figure 2 It is a schematic diagram of the camera and barrel position structure in embodiments 1, 2, 3, and 4.
[0047] Figure 3 This is the workflow diagram of step S1 of Example 1 of the present application.
[0048] Figure 4 It is a workflow diagram of the barrel position angle model in step S3 of Example 1 of the present application.
[0049] Figure 5This is the workflow diagram of the server side in step S5 of Example 1 of the present application.
[0050] Figure 6 Embodiment 2 of the present application provides a workflow diagram for deploying a barrel feature positioning method for a barrel labeling machine to an industrial assembly line.
[0051] Figure 7 Embodiment 3 of the present application provides a barrel feature positioning system for a barrel labeling machine.
[0052] Figure 8 Embodiment 4 of the present application provides an electronic device for implementing a method for locating barrel features for a barrel labeling machine. DETAILED DESCRIPTION
[0053] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0054] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0055] Object detection algorithm is a key technology in the field of computer vision, which aims to identify objects in images or videos and determine their locations. The algorithm is usually divided into two stages: first, feature representation is extracted from the input image through a feature extraction network (such as a convolutional neural network); then, the category or bounding box of each region of interest is identified through a classifier or regressor. Currently popular object detection algorithms include region-based methods (such as R-CNN, Fast R-CNN, Faster R-CNN), single-stage methods (such as YOLO, SSD), and some hybrid algorithms that combine the two methods. This algorithm is widely used in image recognition, intelligent monitoring, autonomous driving and other fields, and has become one of the important algorithms that have attracted much attention in the field of computer vision.
[0056] DeepStream is a high-performance real-time data processing platform launched by NVIDIA. It combines GPU accelerated computing, deep learning model support and real-time stream processing technology to provide users with powerful tools and libraries for accelerating the development and deployment of applications such as video analysis and object detection. Its flexible deployment options and easy-to-use development interface enable developers to quickly build high-performance, low-latency real-time data processing applications.
[0057] The random forest regression algorithm is a machine learning method based on decision tree ensembles. It performs regression prediction by constructing multiple decision trees and taking their average or voting results. When constructing each decision tree, the random forest uses random feature selection and bootstrap sampling techniques to increase the diversity and generalization ability of the model. This enables the random forest to effectively process high-dimensional data and large-scale data sets, with strong robustness and predictive performance. It is widely used in finance, medicine and other fields when solving regression problems.
[0058] Example 1
[0059] like Figure 1 As shown, in this embodiment 1, a method for locating barrel features for a barrel labeling machine includes the following steps:
[0060] Step S1: Feature recognition.
[0061] Specifically, based on a plurality of preset cameras, video stream data of the barrel is acquired, a pre-trained barrel feature recognition network is used to perform feature recognition on the video stream data, and the recognized target features and the camera numbers corresponding to the target features are saved in a buffer file;
[0062] In this embodiment, if Figure 2 As shown in the figure, a camera is set at four directions on the side of the barrel, and the video stream data of the side of the barrel is obtained by using the camera, and each camera covers a 90° range of the side of the barrel. That is, a frame of video stream data of the barrel is obtained by four cameras at four directions of the barrel, and feature recognition is performed on the obtained stream data, and the barrel feature information generated by recognition and the corresponding camera number are saved in the buffer file.
[0063] Further, such as Figure 3 As shown, step S1 is specifically as follows:
[0064] Step S101: Turn on the camera.
[0065] In this embodiment, before executing the embodiment of the present application, Figure 2 As shown, you need to turn on the four cameras in four directions on the side of the barrel first. Each camera covers 90° of the side of the barrel. The four cameras can completely cover the entire side of the barrel.
[0066] Step S102: Read video stream data through the camera.
[0067] In this embodiment, the Deepstream tool is used to read the real-time video streams of four cameras, and the barrel target features are recognized frame by frame on the video stream data read by the four cameras.
[0068] Step S103: Identify the video stream data.
[0069] In this embodiment, a pre-trained barrel feature recognition network is used to detect the feature position of the barrel in the side images of the barrel acquired by four cameras, and the camera corresponding to the target feature recognition is determined, wherein the pre-trained barrel feature recognition network is a neural network trained based on a target detection algorithm.
[0070] Step S104: Identify the characteristic information of the barrel.
[0071] In this embodiment, the target feature identified by the barrel feature recognition network is represented by a rectangular bounding box, and the target feature information of the barrel is identified in the video stream data obtained by four cameras. The bounding box marks the target category information and target confidence corresponding to the identified barrel target feature. After the bounding box corresponding to the target feature of the barrel in the image is identified, the target whose target category information is a set category and whose target confidence meets the set threshold is selected according to the target category information and target confidence of the target. The target is then used as the barrel target feature, and the bounding box corresponding to the target is the bounding box corresponding to the described barrel target feature; the camera number of the video stream data from which the identified barrel target feature originates and the x-coordinate of the center coordinate of the bounding box are set as the identified feature information.
[0072] Step S105: Save the identified barrel feature information into a buffer file; return to step S102
[0073] In this embodiment, the recognized barrel feature information and the corresponding camera number are saved in a buffer file in real time.
[0074] S2. Initialize the buffer file. When the execution signal from the server is monitored, the command task is executed according to the execution signal and the current buffer file is cleared.
[0075] Step S2 specifically includes:
[0076] Step S201: Connect to the server, and connect the industrial computer to the server.
[0077] In this embodiment, before executing the positioning method of the embodiment of the present application, the industrial computer is first connected to the server side, so that the data processing module and the server-side operation module can communicate.
[0078] Step S202: Initialize parameters.
[0079] In this embodiment, before executing the positioning method of the embodiment of the present application, it is necessary to initialize the location information, status information, waiting signal and other parameters of the buffer file.
[0080] Step S203: monitor the execution signal from the server.
[0081] In this embodiment, before executing the positioning method of the embodiment of the present application, it is necessary to monitor the signal of the register on the server side. The register is the location where the execution signal is stored in the operation module on the server side.
[0082] Step S204: Determine the signal.
[0083] In this embodiment, before executing the embodiment of the present application, it is necessary to first determine the signal of the server-side register. If the signal is 1, proceed to step S205, otherwise, return to step S203.
[0084] Step S205: Clear the buffer file.
[0085] In this embodiment, before executing the embodiment of the present application, it is necessary to first clear the feature information and camera number of the barrel stored in the buffer file by the feature recognition module.
[0086] After clearing the buffer file, wait for a new piece of identification data in the buffer file (i.e., the target feature and the camera number corresponding to the target feature), input the identification data in the buffer file into the pre-established barrel position angle model, and obtain the current angle position information of the target feature;
[0087] S3, after clearing the buffer file, wait for a new piece of identification data in the buffer file (i.e., the target feature and the camera number corresponding to the target feature), input the identification data in the buffer file into the pre-established barrel position angle model, and obtain the current angle position information of the target feature;
[0088] Furthermore, the barrel position angle model is a model trained and fitted based on random forest regression, specifically:
[0089] After obtaining the latest recognized barrel feature information in the buffer file, the camera number in the feature information and the x-coordinate of the center coordinate of the bounding box are input into the barrel position angle model to obtain the current angle position information of the barrel target feature;
[0090] The barrel position angle model outputs a position angle information whose value is between 0° and 360°. The camera number of the identified barrel feature information and the x-coordinate of the center coordinate of the bounding box are input into the barrel feature position angle model, and regression analysis is performed based on multiple decision trees. The multiple decision trees are constructed by randomly selecting subsets and features in the data set, and finally a predicted position angle information is output.
[0091] In one embodiment, Figure 4 As shown, the working process of the barrel position angle model is as follows:
[0092] Step S301: Start the feature recognition module.
[0093] In this embodiment, if Figure 2 As shown, four cameras in four directions of the barrel respectively obtain one frame of stream data of the barrel, perform feature recognition on the obtained stream data, and save the barrel feature information and camera number generated by the recognition into a buffer file.
[0094] Step S302: Initialize the barrel position.
[0095] In this embodiment, the position of the target feature of the barrel is first initialized to a position of 0°.
[0096] Step S303: Suck up the barrel.
[0097] In this embodiment, the barrel is sucked up to increase the accuracy of the feature recognition module in identifying the barrel features, which is indispensable for making a data set.
[0098] Step S304: Initialize parameters.
[0099] In this embodiment, before executing the positioning method of the embodiment of the present application, it is necessary to initialize parameters such as the position, status information, waiting signal, and true angle information of the buffer file.
[0100] Step S305: Determine the accumulated rotation angle.
[0101] In this embodiment, the cumulative rotation angle of the barrel feature is determined. If the cumulative rotation angle of the barrel feature is less than 360°, the process goes to step S306 to send an execution signal 1 to the server. If the cumulative rotation angle of the barrel feature is greater than or equal to 360°, the data set is created.
[0102] Step S306: Send execution signal 1 to the server.
[0103] In this embodiment, it is necessary to automatically collect and produce data sets and use existing modules, so the data processing module needs to set the register execution signal of the server side to 1 first.
[0104] Step S307: monitor the execution signal given by the server.
[0105] In this embodiment, the data processing module needs to monitor the server-side register execution signal.
[0106] Step S308: Determine the signal.
[0107] In this embodiment, the data processing module determines the execution signal of the monitored server, and if the execution signal is 1, the process goes to step S309 to clear the buffer file.
[0108] Step S309: Clear the buffer file.
[0109] In this embodiment, before reading the characteristic information of the barrel recognized by the characteristic recognition module (the barrel is already in place), the characteristic information stored in the buffer file needs to be cleared.
[0110] Step S310: The data set is created.
[0111] Step S311: Wait for 5 identification data in the buffer file.
[0112] In the embodiment, the data processing module needs to wait for 5 new barrel feature data to be stored in the buffer file after being emptied.
[0113] Step S312: Calculate the average value of the barrel feature information.
[0114] In this embodiment, the data processing module needs to extract the latest 5 barrel feature information in the buffer file, calculate the average value of the barrel feature information (x coordinate of the center coordinate of the bounding box), and use the average value as the barrel feature information recognized by the feature recognition module.
[0115] Step S313: Save the camera number, barrel feature information, and the position angle of the current barrel target feature into a data set file.
[0116] In this embodiment, the data processing module saves the camera number, barrel feature information and accumulated angle information (the actual position angle of the barrel feature) into a data set file. Each piece of data in the data set is composed of these three items of data.
[0117] Step S314: Angle increment step.
[0118] In this embodiment, the accumulated angle of the barrel feature needs to add the step length to the accumulated angle to serve as the next round of accumulated angle of the barrel feature.
[0119] Step S315: Send the step angle and status information to the server-side operation module. Return to step S305 to determine the cumulative angle.
[0120] In this embodiment, the data processing module needs to send the step angle and status information to the server-side operation module to control the step angle of the barrel target feature rotation, and then perform the next round of data collection.
[0121] The process ends.
[0122] S4, generating state information based on the current angular position information of the barrel target feature, wherein the state information is used to indicate that the angular position information is the latest;
[0123] S5. The angle position information and the status information are transmitted to the server, and the server moves the target feature of the barrel to a designated position according to the received angle position information and status information.
[0124] In a specific embodiment, Figure 5 As shown, the workflow on the server side is as follows:
[0125] Step S501: Wait for the next barrel to arrive at the designated position.
[0126] In this embodiment, before executing the embodiment of the present application, it is necessary to wait for the barrel to reach the specified position.
[0127] Step S502: Send execution signal 1.
[0128] In this embodiment, after detecting that the barrel has reached the designated position, the server-side operation module sends an execution signal 1 to the data processing module to start processing the data for identifying the target features of the barrel.
[0129] Step S503: Wait for the return of location information and status information.
[0130] In this embodiment, it is necessary to wait for the data processing module to return the direction, angle and status information of the drum that needs to be rotated.
[0131] Step S504: Determine whether the processing time exceeds 10 seconds.
[0132] In this embodiment, it is determined whether the data processing time exceeds 10 seconds. If the data processing time exceeds 10 seconds, go to step S505 to set the execution signal to 0; if the data processing time does not exceed 10 seconds, go to step S506 to determine the status information; whether the processing time exceeds 10 seconds does not affect subsequent operations. When the data processing time exceeds 10 seconds, setting the execution signal to 0 can conveniently control the start of the next process.
[0133] Step S505: Set the execution signal to 0.
[0134] In this embodiment, setting the execution signal to 0 can facilitate the control of the start of the next process.
[0135] Step S506: Determine the status information.
[0136] In this embodiment, the status information sent by the data processing module can be judged to identify the latest position information of the barrel sent to the server-side operation module.
[0137] Step S507: operate the barrel according to the position information.
[0138] In this embodiment, the server-side operation module performs corresponding operations on the barrel according to the barrel position information (the direction and angle that the barrel needs to rotate) transmitted by the data processing module, so that the barrel target feature is rotated to a specific position.
[0139] Step S508: Set the execution signal to 0.
[0140] In this embodiment, after the corresponding operation is performed on the barrel, the execution signal in the register is set to 0 to facilitate the control of the start of the next process.
[0141] Step S509: Wait for the current barrel operation to be completed. Return to step S501
[0142] In this embodiment, after waiting for the drum to complete rotation and be put down and the roller to be conveyed forward, the process returns to step S501 and waits for the next drum to arrive at the designated position, and a new process is performed.
[0143] Example 2
[0144] like Figure 6 As shown, Example 6 of the present application provides a workflow diagram for deploying a barrel feature positioning method for a barrel labeling machine to an industrial assembly line, and the process includes the following steps:
[0145] Step S601: Install a fixed camera.
[0146] In this embodiment, four cameras need to be fixed according to the actual assembly line scene to ensure that all areas on the side of the barrel are covered without blind spots. The following steps all depend on the installation settings of the four cameras and the camera parameters.
[0147] Step S602: Create a barrel target feature data set.
[0148] In this embodiment, if Figure 8As shown, the four cameras are used to collect images of the barrel target features, and as many images as possible are collected to cover all situations of the location of the barrel target features; then annotations are made based on the collected images; each collected image and the annotation information corresponding to the image constitute a data in the data set.
[0149] Step S603: training a barrel target feature recognition model.
[0150] In this embodiment, the pre-trained barrel feature recognition network is a neural network trained based on a target detection algorithm; the barrel target feature data set produced in step S602 is input into the target detection algorithm network for supervised training, and finally a barrel feature recognition model is generated.
[0151] Step S604: Create a barrel feature position angle data set.
[0152] In this embodiment, a barrel feature position angle data set is produced. First, the current position angle of the barrel target feature is set to 0°; the suction cup is controlled to suck up the barrel; the barrel feature information is identified, and the camera number, barrel feature information and the actual current position angle of the barrel target feature are saved in the data set file; the rotation step angle is 0.1° (the step size is generally set to the accuracy of the turntable); the above operations are repeated until the cumulative rotation angle reaches 360°, and the data set is produced.
[0153] Step S605: training and fitting the barrel feature position angle model.
[0154] In this embodiment, the barrel feature position angle model is trained and fitted based on a random forest regression algorithm; the random forest regression algorithm randomly selects the features and data samples of the barrel feature position angle data set produced in step S604 to construct multiple decision tree models to generate a barrel feature position angle model.
[0155] Step S606: Use on an automated assembly line.
[0156] In this embodiment, after completing the above steps, a general method for positioning barrel features of a barrel labeling machine can be deployed on an automated production line and can be used for all barrel-shaped objects with extractable features on the side.
[0157] Example 3
[0158] See also Figure 7 In another embodiment of the present application, a barrel feature positioning system 100 for a barrel labeling machine is provided, the system comprising a target feature acquisition module 101, an initialization module 102, an angle position information acquisition module 103, a state information acquisition module 104 and a server execution module 105;
[0159] The target feature acquisition module 101 is used to acquire video stream data of the barrel based on a plurality of preset cameras, perform feature recognition on the video stream data using a pre-trained barrel feature recognition network, and save the recognized target features and the camera numbers corresponding to the target features into a buffer file;
[0160] The initialization module 102 is used to initialize the buffer file. When the execution signal of the server is monitored, the instruction task is executed according to the execution signal and the current buffer file is cleared;
[0161] The angle position information acquisition module 103 is used to clear the buffer file, wait for a new identification data (i.e., the target feature and the camera number corresponding to the target feature) to be saved in the buffer file, input the identification data in the buffer file into the pre-established barrel position angle model, and obtain the angle position information of the target feature at present;
[0162] The state information acquisition module 104 is used to generate state information based on the current angular position information of the target feature, and the state information is used to indicate that the angular position information is the latest;
[0163] The server execution module 105 is used to transmit the angle position information and the status information to the server, and the server moves the target feature of the barrel to a specified position according to the received angle position information and status information.
[0164] It can be understood that in this embodiment, the target feature acquisition module 101 collects images of the four angles of the side of the barrel and identifies the target features of the barrel in the images of the four angles, generates barrel feature information and camera number, and generates the position angle data of the current barrel target feature according to the processing of the data by the angle position information acquisition module 102. The angle position information acquisition module 102 generates the direction and angle that the barrel needs to rotate according to the predicted current barrel target feature position angle data, and the angle position information acquisition module 102 also generates a state information, and transmits the direction, angle and state information to the server execution module 105, and performs corresponding operations on the barrel according to the received information. When the server execution module 105 completes the operation on the barrel, it puts down the barrel. One process ends.
[0165] In a further embodiment, the target feature acquisition module 101 includes a camera, the angle position information acquisition module 102 is a single chip microcomputer or a computer or a central processing chip, and the server execution module 105 includes a baffle, a suction cup, a roller and a PLC controller;
[0166] The camera is used to collect images of the four angles of the barrel side, and identify the collected images to generate barrel feature information and camera numbers and transmit them to the angle position information acquisition module 102;
[0167] The baffle is used to assist the next barrel to reach the designated position;
[0168] The suction cup is used to suck up, put down and rotate the drum in a specified direction and angle;
[0169] The roller is used to convey the drum forward;
[0170] The PLC controller is used to receive the information transmitted by the angle position information acquisition module 102, and control the baffle, the suction cup and the roller to perform corresponding operations according to the information;
[0171] The target feature acquisition module 101 communicates with the angle position information acquisition module 102 via a USB interface; the server-side operation module communicates with the angle position information acquisition module 102 via a network cable interface.
[0172] It should be noted that the barrel feature positioning system for a barrel-shaped labeling machine of the present invention corresponds one to one with the barrel feature positioning method for a barrel-shaped labeling machine of the present invention. The technical features and beneficial effects described in the embodiment of the barrel feature positioning method for a barrel-shaped labeling machine are applicable to the embodiment of the barrel feature positioning method for a barrel-shaped labeling machine. For specific contents, please refer to the description in the embodiment of the method of the present invention, which will not be repeated here. It is hereby declared.
[0173] In addition, in the implementation of the barrel feature positioning system for a barrel labeling machine in the above embodiment, the logical division of each program module is only an example. In actual application, the above functions can be assigned to different program modules as needed, for example, for the configuration requirements of the corresponding hardware or the convenience of software implementation. That is, the internal structure of the barrel feature positioning system for a barrel labeling machine is divided into different program modules to complete all or part of the functions described above.
[0174] Example 4
[0175] See also Figure 8 In one embodiment, an electronic device for implementing a barrel feature positioning method for a barrel labeling machine is provided. The electronic device 200 may include a first processor 201, a first memory 202 and a bus, and may also include a computer program stored in the first memory 202 and executable on the first processor 201, such as a barrel feature positioning program 203 for a barrel labeling machine.
[0176] The first memory 202 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the first memory 202 may be an internal storage unit of the electronic device 200, such as a mobile hard disk of the electronic device 200. In other embodiments, the first memory 202 may also be an external storage device of the electronic device 200, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 200. Further, the first memory 202 may also include both an internal storage unit of the electronic device 200 and an external storage device. The first memory 202 can not only be used to store application software and various types of data installed in the electronic device 200, such as the code of the barrel feature positioning program 203 for the barrel labeling machine, but also be used to temporarily store data that has been output or is to be output.
[0177] In some embodiments, the first processor 201 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The first processor 201 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes various functions and processes data of the electronic device 200 by running or executing programs or modules stored in the first memory 202, and calling data stored in the first memory 202.
[0178] Figure 8 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 8 The structure shown does not constitute a limitation on the electronic device 200 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0179] The barrel feature positioning program 203 for the barrel labeling machine stored in the first memory 202 in the electronic device 200 is a combination of multiple instructions. When running in the first processor 201, it can achieve:
[0180] Based on a plurality of preset cameras, video stream data of the barrel is acquired, a pre-trained barrel feature recognition network is used to perform feature recognition on the video stream data, and the recognized target features and the camera numbers corresponding to the target features are saved in a buffer file;
[0181] Initialize the buffer file. When the execution signal from the server is monitored, the command task is executed according to the execution signal and the current buffer file is cleared.
[0182] After clearing the buffer file, wait for a new piece of recognition data in the buffer file, input the recognition data in the buffer file into the pre-established barrel position angle model, and obtain the current angle position information of the target feature;
[0183] Generate state information based on the current angular position information of the target feature, wherein the state information is used to indicate that the angular position information is the latest;
[0184] The angle position information and the state information are transmitted to the server side, and the server side moves the target feature of the barrel to the designated position according to the received angle position information and state information.
[0185] Furthermore, if the module / unit integrated in the electronic device 200 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0186] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0187] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0188] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A method for locating drum features for a drum labeling machine, characterized in that: The steps include: Based on a plurality of preset cameras, video stream data of the barrel is acquired, a pre-trained barrel feature recognition network is used to perform feature recognition on the video stream data, and the recognized target features and the camera numbers corresponding to the target features are saved in a buffer file; Initialize the buffer file. When the execution signal from the server is monitored, the command task is executed according to the execution signal and the current buffer file is cleared. After clearing the buffer file, wait for a new piece of recognition data in the buffer file, input the recognition data in the buffer file into the pre-established barrel position angle model, and obtain the current angle position information of the target feature; Generate state information based on the current angular position information of the barrel target feature, wherein the state information is used to indicate that the angular position information is the latest; The angle position information and the state information are transmitted to the server side, and the server side moves the target feature of the barrel to the designated position according to the received angle position information and state information.
2. The method for locating the drum feature of a drum labeling machine according to claim 1, characterized in that: The method of obtaining the video stream data of the barrel based on the preset multiple cameras is specifically as follows: A camera is set at four directions on the side of the barrel respectively, and the video stream data of the side of the barrel is obtained by using the camera. Each camera covers a 90° range of the side of the barrel.
3. The method for locating the drum feature of a drum labeling machine according to claim 1, characterized in that: The pre-trained barrel feature recognition network is used to perform feature recognition on the video stream data, and the recognized target features and the camera numbers corresponding to the target features are saved in a buffer file, specifically: The target feature identified by the barrel feature recognition network is represented by a rectangular bounding box, and the target feature information of the barrel is identified in the acquired video stream data, and the bounding box marks the target category information and target confidence corresponding to the identified target feature; After identifying the bounding box corresponding to the target feature, according to the target category information and target confidence of the target, select the target whose target category information is the set category and the target confidence meets the set threshold, and then use the target as the barrel target feature, and the bounding box corresponding to the target is the bounding box corresponding to the described barrel target feature; The camera number of the video stream data from which the target feature of the identified barrel originates and the x-coordinate of the center coordinate of the bounding box are set as the identified feature information, and the identified feature information is the target feature and the camera number corresponding to the target feature.
4. The method for locating drum features for a drum labeling machine according to claim 1, characterized in that: The clearing of the buffer file and waiting for a piece of identification data in the buffer file are specifically: First, wait for the execution signal from the server, and listen to the execution signal from the specified register on the server; After waiting for the execution signal given by the designated register on the server side, clear the buffer file storing the recognized barrel feature identification information, wherein the barrel feature identification information is the target feature and the camera number corresponding to the target feature; Finally, wait for the latest barrel feature recognition information to be saved in the buffer file.
5. The method for locating drum features for a drum labeling machine according to claim 1, characterized in that: The barrel position angle model is a model trained and fitted based on random forest regression, specifically: After obtaining the latest recognized barrel feature information in the buffer file, the camera number in the feature information and the x-coordinate of the center coordinate of the bounding box are input into the barrel position angle model to obtain the current angle position information of the barrel target feature; The barrel position angle model outputs a position angle information, the value of which is between 0° and 360°. The camera number of the identified barrel feature information and the x-coordinate of the center coordinate of the bounding box are input into the barrel feature position angle model, and regression analysis is performed based on multiple decision trees. The multiple decision trees are constructed by randomly selecting subsets and features in the data set, and finally a predicted position angle information is output.
6. The method for locating drum features for a drum labeling machine according to claim 1, characterized in that: Input the recognition data in the buffer file into the pre-established barrel position angle model to obtain the current angle position information of the target feature, specifically: Initialize the position information, status information, waiting signal and real angle information of the buffer file; A plurality of identification data are input into the barrel position angle model to obtain a plurality of angle position information, and an average value of the plurality of angle position information is calculated and the average value is used as the output of the barrel position angle model.
7. The method for locating drum features for a drum labeling machine according to claim 1, characterized in that: After transmitting the position information and the status information to the server, first determine whether the transmitted angle position information is the latest. If it is the latest, the server will transfer the target feature of the barrel to the specified position; after the operation is completed, wait for the next barrel to arrive at the specified position.
8. A barrel feature positioning system for a barrel labeling machine, characterized in that: It includes a target feature acquisition module, an initialization module, an angle position information acquisition module, a state information acquisition module and a server execution module; The target feature acquisition module is used to acquire video stream data of the barrel based on a plurality of preset cameras, perform feature recognition on the video stream data using a pre-trained barrel feature recognition network, and save the recognized target features and the camera numbers corresponding to the target features into a buffer file; The initialization module is used to initialize the buffer file. When the execution signal of the server is monitored, the instruction task is executed according to the execution signal and the current buffer file is cleared; The angle position information acquisition module is used to clear the buffer file, wait for a new piece of identification data in the buffer file, input the identification data in the buffer file into the pre-established barrel position angle model, and obtain the angle position information of the target feature at present; The state information acquisition module is used to generate state information based on the current angular position information of the barrel target feature, and the state information is used to indicate that the angular position information is the latest; The server execution module is used to transmit the angle position information and the status information to the server side, and the server side moves the target feature of the barrel to the specified position according to the received angle position information and status information.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the barrel feature positioning method for a barrel labeling machine as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a program, characterized in that: When the program is executed by a processor, the barrel feature positioning method for a barrel labeling machine according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Traffic cone bucket detection positioning method and system based on deep learning, and storage medium
CN112183485A
Validation analysis of human target
US20120159290A1