Roller bed bar batch tracking method and device, electronic equipment and storage medium
By setting up a camera array and a bar recognition model on the roller table to identify the color coding of the bar images, the problem of bar batch confusion is solved, and accurate batch tracking and efficient production management are achieved.
Patent Information
- Application Number
- CN202510831416.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-09-26
AI Technical Summary
During the steel production process, it is difficult to accurately track the position of each batch of bars on the conveyor roller in real time, resulting in the mixing of bars from different batches, affecting the normal progress of the production process and the consistency of product quality.
By setting up a camera array on the roller table, collecting roller table images and inputting them into a pre-trained bar recognition model, the color codes in the bar images are identified, the start and end of the bar batch are determined, and accurate positioning of the bar batch is achieved.
It achieves accurate tracking of bar batches, avoids batch confusion, improves production efficiency and product quality consistency, and reduces hardware requirements and usage costs.
Smart Images

Figure CN120707831A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a roller bar batch tracking method, device, electronic equipment and storage medium. Background Art
[0002] In steel production, billets undergo a series of rolling processes, including roughing, intermediate, and finishing, before being cut into long bars. These bars are then conveyed to a cooling bed, where they are aligned and then transferred to a conveyor roller conveyor. From there, they are transported to a cold shear, where they are cold-sheared according to pre-set production specifications. After cold shearing, the bars are transported to a bundling rack for subsequent packaging and storage. However, throughout this entire production process, particularly during the conveyor roller conveyor's journey from the cold shear to the bundling rack, it is difficult to accurately track the position of each batch of bars on the conveyor roller conveyor in real time.
[0003] Currently, in actual production, there is a lack of effective automated tracking methods to monitor the real-time location of bar batches. If the next batch of bars has already reached the conveyor rollers before the current batch of bars has completed the entire conveying and cold shearing process, bars from different batches can easily become mixed. This mixing of bar batches can cause serious production accidents. On the one hand, mixed bar batches can disrupt subsequent production processes. For example, during bundling, bars of different specifications or batches can be mixed together, making it impossible to bundle them according to established standards. This not only affects product packaging quality but can also cause damage during transportation and storage. On the other hand, during subsequent processing and use of the steel, mixed bar batches cannot meet customer requirements for consistent product specifications and quality, seriously affecting the product's market competitiveness. Summary of the Invention
[0004] In view of the shortcomings of the above-mentioned related technologies, the present invention provides a roller bar batch tracking method, device, electronic equipment and storage medium to solve the technical problem of how to track the position of each batch of bars on the roller in real time and accurately.
[0005] The present invention provides a roller conveyor bar batch tracking method, which includes: obtaining roller conveyor images of multiple tracking points of a target roller conveyor, inputting the roller conveyor images into a pre-trained bar recognition model to obtain a bar recognition frame in the roller conveyor image; if the bar recognition frame is within a preset area, extracting the image in the bar recognition frame to obtain a bar image; performing color recognition on the bar image, if the color recognition result of the bar image is a first color, determining that the bar located after the tracking point corresponding to the bar image is a bar from the same batch; if the color recognition result of the bar image is a second color, determining that the bar located before the tracking point corresponding to the bar image is a bar from the same batch, the first color is used to identify the first bar in the same batch of bars, and the second color is used to identify the last bar in the same batch of bars.
[0006] In one embodiment of the present invention, if the tracking point includes a head point and a tail point, after color recognition is performed on the rod image, the method further includes obtaining multiple frames of rod images of the head point, and if the number of images with the color recognition result of the first color in the multiple frames of rod images of the head point exceeds a preset number threshold, it is determined that tracking of a new batch of rods has started; and obtaining multiple frames of rod images of the tail point, and if the number of images with the color recognition result of the first color in the multiple frames of rod images of the tail point exceeds the preset number threshold, it is determined that tracking of the new batch of rods has ended.
[0007] In one embodiment of the present invention, color recognition of the rod image includes: obtaining a set of all pixels in the rod image, and a first color code, a second color code, and a third color code corresponding to each pixel in the set, wherein the first color code is determined based on the code of the blue channel in the rod image, the second color code is determined based on the code of the green channel in the rod image, and the third color code is determined based on the code of the red channel in the rod image; if the first color code of the pixel is greater than a preset first color threshold, the second color code is less than a preset second color threshold, and the third color code is less than a preset third color threshold, then the pixel is determined as a first color pixel; and obtaining the number of pixels of the first color pixel, and if the number of pixels of the first color pixel is greater than the preset pixel threshold, then the color recognition result of the rod image is the first color.
[0008] In one embodiment of the present invention, color recognition of the rod image further includes: obtaining a set of all pixels in the rod image, and a first color code, a second color code, and a third color code corresponding to each pixel in the set, wherein the first color code is determined based on the code of the blue channel in the rod image, the second color code is determined based on the code of the green channel in the rod image, and the third color code is determined based on the code of the red channel in the rod image; if the first color code of the pixel is less than a preset first color threshold, the second color code is greater than a preset second color threshold, and the third color code is less than a preset third color threshold, then the pixel is determined as a second color pixel; and obtaining the number of pixels of the second color pixel. If the number of pixels of the second color pixel is greater than the preset pixel threshold, the color recognition result of the rod image is the second color.
[0009] In one embodiment of the present invention, before obtaining roller images of multiple tracking points of the target roller, the method further includes: setting a camera array on the target roller, the camera array at least including a camera set at a preset distance from the starting position of the target roller and a camera set at a preset distance from the ending position of the target roller; using the actual coordinate position of each camera in the camera array as a tracking point; wherein the transportation direction of the target roller is from the starting position to the ending position.
[0010] In one embodiment of the present invention, after obtaining the bar image, the method further includes: obtaining the actual coordinate position of each camera in the camera array, and obtaining the actual coordinate position corresponding to the bar image based on the actual coordinate position of the camera corresponding to the bar image; tracking the first bar of the same batch in the target roller based on the actual coordinate position corresponding to the bar image having the first color as the color recognition result;
[0011] and / or,
[0012] The last bar of the same batch in the target roller is tracked based on the actual coordinate position corresponding to the bar image whose color recognition result is the second color.
[0013] In one embodiment of the present invention, before inputting the roller image into a pre-trained bar recognition model, the method further includes obtaining historical roller images, marking the bars in the historical roller images, and obtaining a bar recognition training set; inputting the bar recognition training set into a preset target recognition model for training to obtain the bar recognition model, wherein the input of the bar recognition model is the roller image, and the output of the bar recognition model is the bar recognition box.
[0014] The present invention also provides a roller bar batch tracking device, which includes: an image input module for acquiring roller images of multiple tracking points of a target roller, inputting the roller images into a pre-trained bar recognition model, and obtaining a bar recognition frame in the roller image; an image extraction module for extracting the image in the bar recognition frame to obtain a bar image if the bar recognition frame is within a preset area; a batch tracking module for performing color recognition on the bar image, and if the color recognition result of the bar image is a first color, determining that the bar located after the tracking point corresponding to the bar image is a bar from the same batch; if the color recognition result of the bar image is a second color, determining that the bar located before the tracking point corresponding to the bar image is a bar from the same batch, the first color is used to identify the first bar in the same batch of bars, and the second color is used to identify the last bar in the same batch of bars.
[0015] The present invention also provides an electronic device, which includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the roller bar batch tracking method as described in any one of the above embodiments.
[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer is caused to execute the roller bar batch tracking method as described in any one of the above embodiments.
[0017] Beneficial effects of the present invention: The present invention provides a method, device, electronic device and storage medium for tracking batches of roller bars. The method includes obtaining roller images of multiple tracking points of a target roller, inputting the roller images into a pre-trained bar recognition model, and obtaining a bar recognition frame in the roller image. If the bar recognition frame is within a preset area, the image in the bar recognition frame is extracted to obtain a bar image, and color recognition is performed on the bar image. If the color recognition result of the bar image is a first color, the bars located after the corresponding tracking point of the bar image are determined to be bars from the same batch. If the color recognition of the bar recognition image is a second result, the bars located before the corresponding tracking point of the bar image are determined to be bars from the same batch. By using this method to track batches of bar transport rollers based on machine vision, not only can the batch positions of the bars be accurately tracked, but the calculation amount is small, the hardware requirements are low, and the use cost is low. It can be applied to different factory areas at low cost and high efficiency.
[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 1 is a schematic diagram of an implementation environment of a roller conveyor bar batch tracking method according to an exemplary embodiment of the present invention;
[0020] Figure 2 is a flow chart of a roller bar batch tracking method shown in an exemplary embodiment of the present invention;
[0021] Figure 3 is a detailed flow chart of a roller bar batch tracking method shown in an exemplary embodiment of the present invention;
[0022] Figure 4 is a block diagram of a roller bar batch tracking device according to an exemplary embodiment of the present invention;
[0023] Figure 5 It is a structural diagram of an electronic device shown in an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0024] The following describes the embodiments of the present invention through specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.
[0025] It should be noted that the illustrations provided in the following embodiments are merely schematic illustrations of the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape, and size of components in actual implementation. In actual implementation, the type, quantity, and proportion of each component may be changed arbitrarily, and the component layout may also be more complex.
[0026] It should be noted that, in the present invention, "first," "second," and the like are merely used to distinguish similar objects, and do not limit the order or precedence of similar objects. The variations of "including," "having," and the like indicate that the scope of the subject of the term is not exclusive, in addition to the examples indicated by the term.
[0027] It should be understood that the various numbers and step numbers used in this disclosure are for ease of description and are not intended to limit the scope of this disclosure. The order of numbers in this disclosure does not imply a specific order of execution; the order of execution of each process is determined by its function and inherent logic.
[0028] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the embodiments of the present invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring the embodiments of the present invention.
[0029] The embodiments of the present invention respectively provide a roller bar batch tracking method, a roller bar batch tracking device, an electronic device, a computer-readable storage medium, and a computer program product, which will be described in detail below.
[0030] See also Figure 1 , Figure 1 It is a schematic diagram of an implementation environment of a roller bar batch tracking method shown in an exemplary embodiment of the present invention.
[0031] like Figure 1 As shown, the implementation environment may include an image acquisition device 101 and a computer device 102, wherein the computer device may be at least one of a microcomputer, an embedded computer, a neural network computer, etc. The image acquisition device 101 is a camera array installed on the roller conveyor, which is used to capture roller conveyor images and transmit the roller conveyor images to the computer device 102 for roller conveyor bar batch tracking.
[0032] See also Figure 2 , Figure 2 This is a flow chart of a roller bar batch tracking method according to an exemplary embodiment of the present invention. This method can be applied to Figure 1 The implementation environment shown is as follows. The method may also be applicable to other exemplary implementation environments and be specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.
[0033] like Figure 2 As shown, in an exemplary embodiment, the roller bar batch tracking method includes at least steps S210 to S230, which are described in detail as follows:
[0034] Step S210: obtaining roller conveyor images of a plurality of tracking points of a target roller conveyor, inputting the roller conveyor images into a pre-trained bar recognition model, and obtaining a bar recognition frame in the roller conveyor images.
[0035] For example, the bar identification frame can be represented by the coordinates of the upper left corner and the lower right corner of the bar identification frame, for example {x left ,y top ,x right ,y bottom}, where x leftis the coordinate of the upper left corner of the bar identification box on the x-axis of the image, top is the coordinate of the upper left corner of the bar identification frame on the y-axis of the image, x right is the coordinate of the lower right corner of the bar identification box on the x-axis of the image, bottom is the coordinate of the lower right corner of the bar identification box on the y-axis of the image.
[0036] In one embodiment of the present invention, before obtaining roller images of multiple tracking points of the target roller, the roller bar batch tracking method also includes: setting a camera array on the target roller, the camera array at least including a camera set at a preset distance from the starting position of the target roller and a camera set at a preset distance from the ending position of the target roller; using the actual coordinate position of each camera in the camera array as a tracking point; wherein the transportation direction of the target roller is from the starting position to the ending position.
[0037] In one embodiment of the present invention, before the roller image is input into the pre-trained rod recognition model, the process also includes obtaining historical roller images, labeling the rods in the historical roller images, and obtaining a rod recognition training set; inputting the rod recognition training set into a preset target recognition model for training to obtain a rod recognition model, wherein the input of the rod recognition model is the roller image, and the output of the rod recognition model is a rod recognition box.
[0038] Step S220 : If the bar material identification frame is within the preset area, the image in the bar material identification frame is extracted to obtain a bar material image.
[0039] For example, the preset area may be {R left ,R top ,R right ,R bottom}, where R left is the coordinate of the upper left corner of the preset area on the x-axis of the image, R top is the coordinate of the upper left corner of the preset area on the y-axis of the image, R right is the coordinate of the lower right corner of the preset area on the x-axis of the image, R bottom It is the coordinate of the lower right corner of the preset area on the y-axis of the image.
[0040] For example, if the bar identification frame {x left ,y top ,x right ,y bottom}In the preset area{R left ,R top ,R right ,R bottom}, it means that the rod has reached the preset area corresponding to the camera.
[0041] For example, obtaining multiple roller conveyor image frames and determining whether the bar identification frame in one of the roller conveyor image frames is within a preset area requires the following conditions to be met:
[0042] x left >R left
[0043] y top >R top
[0044] x right <R right
[0045] y bottom <R bottom
[0046] If a frame of roller conveyor image meets the above conditions, the number of frames where the bar is in place is increased by 1. After all the multiple frames of images are judged to be in place based on the above conditions, the multiple frames of roller conveyor images are used to judge whether the bar identification frame in the multiple frames of roller conveyor images has reached the preset area:
[0047]
[0048] Where check is the bar in place flag. When check is 1, it indicates that the bar identification frame is within the preset area. When check is 0, it indicates that the bar identification frame is not within the preset area. m is the number of frames in which the bar is in place, and n is the preset threshold for the number of frames in which the bar is in place.
[0049] In one embodiment of the present invention, after obtaining the bar image, the roller bar batch tracking method further includes:
[0050] The actual coordinate position of each camera in the camera array is obtained, and the actual coordinate position corresponding to the bar image is obtained based on the actual coordinate position of the camera corresponding to the bar image; the first bar of the same batch in the target roller is tracked based on the actual coordinate position corresponding to the bar image with the color recognition result of the first color.
[0051] In one embodiment of the present invention, after obtaining the bar image, the roller bar batch tracking method further includes: tracking the last bar of the same batch in the target roller based on the actual coordinate position corresponding to the bar image with the second color as the color recognition result.
[0052] Step S23, color recognition is performed on the bar image. If the recognition result of the bar image is the first color, the bar located after the corresponding tracking point in the bar image is determined to be a bar from the same batch. If the color recognition result of the bar image is the second color, the bar located before the corresponding tracking point in the bar image is determined to be a bar from the same batch. The first color is used to identify the first bar in the same batch, and the second color is used to identify the last bar in the same batch.
[0053] For example, before the bars enter the roller table, the first bar of the same batch of bars is sprayed blue, and the last bar of the same batch is sprayed green. In one embodiment, before the bars are cut, the head of the bar before cutting can be sprayed blue, and the tail of the bar before cutting can be sprayed green, so that the first bar of the same batch of bars formed after the same bar is cut can be sprayed blue, and the last bar of the same batch can be sprayed green.
[0054] For example, in this embodiment, the transport direction of the roller conveyor is from front to back. If the bar image recognition result indicates that the bar image of the first color is followed by the tracking point corresponding to the bar image of the first color, then the bar is placed on the roller conveyor after the bar image of the first color and is from the same batch. If the bar image recognition result indicates that the bar image of the second color is followed by the tracking point corresponding to the bar image of the second color, then the bar is placed on the roller conveyor before the bar image of the second color and is from the same batch.
[0055] In one embodiment of the present invention, color recognition of a rod image includes: obtaining a set of all pixels in the rod image, and a first color code, a second color code, and a third color code corresponding to each pixel in the set, wherein the first color code is determined based on the code of the blue channel in the rod image, the second color code is determined based on the code of the green channel in the rod image, and the third color code is determined based on the code of the red channel in the rod image; if the first color code of the pixel is greater than a preset first color threshold, the second color code is less than a preset second color threshold, and the third color code is less than a preset third color threshold, then the pixel is determined as a first color pixel; and obtaining the number of pixels of the first color pixel. If the number of pixels of the first color pixel is greater than the preset pixel threshold, then the color recognition result of the rod image is the first color.
[0056] Exemplarily, to determine whether the rod image is the first color, the following conditions need to be used for determination, where the first color may be blue, the second color may be green, and the third color may be red.
[0057]
[0058] Among them, N bis the number of pixels of the first color; A is the set of all pixels in the rod image, (x, y) is the coordinates of the pixel on the x-axis and y-axis of the image; R(x, y), G(x, y), and B(x, y) are the third color code, second color code, and first color code of the pixel (x, y), respectively; R_b_max is the preset third color threshold corresponding to the first color, G_b_max is the preset second color threshold corresponding to the first color, and B_b_min is the preset first color threshold corresponding to the first color. Pixels that meet the above conditions are defined as first color pixels. In one embodiment of the present application, the first color can be blue, the second color can be green, and the third color can be red.
[0059] Exemplarily, obtaining a color recognition result of the stick image according to the number of pixels of the first color in the stick image includes:
[0060]
[0061] Among them, N b is the number of pixels of the first color (in this embodiment, it can be the number of pixels of blue pixels), color_b is a flag indicating that the color recognition result is the first color. When it is 1, the color recognition result of the rod image is the first color; when it is 0, the color recognition result of the rod image is not the first color; h is a preset pixel threshold.
[0062] In one embodiment of the present invention, color recognition of the rod image further includes: obtaining a set of all pixels in the rod image, and a first color code, a second color code, and a third color code corresponding to each pixel in the set, wherein the first color code is determined based on the code of the blue channel in the rod image, the second color code is determined based on the code of the green channel in the rod image, and the third color code is determined based on the code of the red channel in the rod image; if the first color code of the pixel point is less than a preset first color threshold, the second color code is greater than a preset second color threshold, and the third color code is less than a preset third color threshold, then the pixel point is determined as a second color pixel point; and obtaining the number of pixels of the second color pixel point. If the number of pixels of the second color pixel point is greater than the preset pixel threshold, then the color recognition result of the rod image is the second color.
[0063] Exemplarily, whether the rod image is the second color is determined by the following conditions, where the first color may be blue, the second color may be green, and the third color may be red.
[0064]
[0065] Among them, N gis the number of second color pixels; A is the set of all pixels in the rod image, (x, y) is the coordinates of the pixel on the x-axis and y-axis of the image; R(x, y), G(x, y), and B(x, y) are the third color code, second color code, and first color code of the pixel (x, y), respectively; R_g_max is the preset third color threshold corresponding to the second color, G_g_min is the preset second color threshold corresponding to the second color, and B_g_max is the preset first color threshold corresponding to the second color. Pixels that meet the above conditions are used as second color pixels. In one embodiment of the present application, the first color can be blue, the second color can be green, and the third color can be red.
[0066] Exemplarily, obtaining a color recognition result of the stick image according to the number of second color pixels in the stick image includes:
[0067]
[0068] Among them, N g is the number of pixels of the second color, color_g is the flag that the color recognition result is the second color. When it is 1, the color recognition result of the rod image is the second color. When it is 0, the color recognition result of the rod image is not the second color. f is the preset pixel threshold.
[0069] In one embodiment of the present invention, if the tracking points include head points and tail points, after color recognition is performed on the rod images, the roller bar batch tracking method further includes: obtaining multiple frames of rod images at the head point, and if the number of images with the color recognition result of the first color in the multiple frames of rod images at the head point exceeds a preset number threshold, it is determined that tracking of a new batch of rods has started; obtaining multiple frames of rod images at the tail point, and if the number of images with the color recognition result of the first color in the multiple frames of rod images at the tail point exceeds a preset number threshold, it is determined that tracking of the new batch of rods has ended.
[0070] Exemplarily, obtaining multiple frames of bar images, and when the image recognition results of the multiple frames of bar images are blue, determining the start of a new batch of bar images includes:
[0071]
[0072] Here, test_i is the flag that indicates the start of a new batch of bars. When it is 1, a new batch of bars has started; when it is 0, a new batch of bars has not started. m is the number of frames in the multi-frame bar image whose color recognition result is blue, and n is the preset number threshold.
[0073] Exemplarily, obtaining multiple frames of bar images, and when the image recognition results of the multiple frames of bar images are green, determining the start of a new batch of bar images includes:
[0074]
[0075] Among them, test_j is the flag of the end of this batch of bars. When it is 1, the batch of bars has ended, and when it is 0, the batch of bars has not ended; m is the number of frames in the multi-frame bar image whose color recognition result is green, and n is the preset number threshold.
[0076] Figure 3 is a detailed flow chart of a roller bar batch tracking method shown in an exemplary embodiment of the present invention, according to Figure 3 As shown, the detailed process of the roller conveyor bar batch tracking method includes obtaining multiple frames of roller conveyor images from a video stream captured by any camera in the camera array. After preprocessing the images, including but not limited to slicing and cleaning, the processed roller conveyor images are input into a pre-trained model for inference. The inference results determine whether the bar detection frame is within a preset area. If no bar is present, it indicates that the roller conveyor area corresponding to the roller conveyor image does not contain any bar. If so, the number of frames in which the bar detection frame is within the preset area is accumulated. If the number of frames in which the bar is present exceeds a preset threshold, the bar in the roller conveyor area corresponding to the roller conveyor image is determined to have reached the designated area. Image information in the bar detection frame is extracted to obtain a bar image. If the bar in the bar image is green, the number of frames in which the bar is green is accumulated. When the number of frames in which the bar is green exceeds the threshold, the current batch of bars ends. If the bar in the bar image is blue, the number of frames in which the bar is blue is accumulated. When the number of frames in which the bar is blue exceeds the threshold, a new batch of bars begins. If the color of the bars in the bar image is neither blue nor green, it means that the roller conveyor is transporting bars of the corresponding batch and the batch number of the bars has not changed.
[0077] Exemplarily, the roller images captured by multiple cameras in the camera array are processed in the same way. After obtaining the bar color corresponding to the roller image, the actual roller position corresponding to the roller image can be obtained based on the camera position corresponding to the roller image, thereby realizing the tracking of roller batches.
[0078] Exemplarily, each camera corresponds to an actual in-place area in the actual roller conveyor (the actual in-place area is a preset area in the roller conveyor image). Each actual in-place area corresponds to a bar batch number. When the color recognition result of the roller conveyor image captured by the camera is the first color (which can be blue), the actual in-place area corresponding to the camera is transporting the first bar of a new batch, and the corresponding bar batch number is incremented by 1. When the color recognition result of the roller conveyor image captured by the camera is the second color (which can be green), the actual in-place area corresponding to the camera is the last bar of the corresponding bar batch number. If the color recognition result of the roller conveyor image captured by the camera is neither the first color nor the second color, it means that the intermediate bar of the corresponding bar batch number is in motion in the actual in-place area corresponding to the camera.
[0079] See also Figure 4 , Figure 4 This is a block diagram of a roller bar batch tracking device according to an exemplary embodiment of the present invention. Figure 1 The implementation environment shown is as follows. The apparatus may also be applicable to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the apparatus is applicable.
[0080] like Figure 4 As shown, the exemplary roller bar batch tracking device includes:
[0081] An image input module 401 is used to obtain roller images of multiple tracking points of a target roller, input the roller images into a pre-trained bar recognition model, and obtain a bar recognition frame in the roller images;
[0082] An image extraction module 402 is configured to extract an image in the bar identification frame to obtain a bar image if the bar identification frame is within a preset area;
[0083] The batch tracking module 403 is used to perform color recognition on the bar image. If the color recognition result of the bar image is a first color, the bar located after the tracking point corresponding to the bar image is determined to be a bar from the same batch. If the color recognition result of the bar image is a second color, the bar located before the tracking point corresponding to the bar image is determined to be a bar from the same batch. The first color is used to identify the first bar in the same batch, and the second color is used to identify the last bar in the same batch.
[0084] Before the image input module 401 obtains the roller images of multiple tracking points of the target roller, it also includes: setting a camera array on the target roller, the camera array at least includes a camera set at a preset distance from the starting position of the target roller, and a camera set at a preset distance from the ending position of the target roller; the actual coordinate position of each camera in the camera array is used as a tracking point; wherein the transportation direction of the target roller is from the starting position to the ending position.
[0085] Before the image input module 401 inputs the roller image into the pre-trained bar recognition model, it also includes obtaining historical roller images, marking the bars in the historical roller images, and obtaining a bar recognition training set; inputting the bar recognition training set into the preset target recognition model for training to obtain a bar recognition model, the input of the bar recognition model is the roller image, and the output of the bar recognition model is the bar recognition box.
[0086] After obtaining the bar image, the image extraction module 402 further includes: obtaining the actual coordinate position of each camera in the camera array, obtaining the actual coordinate position corresponding to the bar image based on the actual coordinate position of the camera corresponding to the bar image; tracking the first bar of the same batch on the target roller based on the actual coordinate position corresponding to the bar image whose color recognition result is the first color;
[0087] and / or,
[0088] The last bar of the same batch in the target roller is tracked based on the actual coordinate position corresponding to the bar image whose color recognition result is the second color.
[0089] The batch tracking module 403 obtains multiple frames of bar images at the head point. If the number of images with the first color as the color recognition result in the multiple frames of bar images at the head point exceeds a preset number threshold, it is determined that tracking of a new batch of bars has started; and obtains multiple frames of bar images at the tail point. If the number of images with the first color as the color recognition result in the multiple frames of bar images at the tail point exceeds a preset number threshold, it is determined that tracking of the new batch of bars has ended.
[0090] The batch tracking module 403 performs color recognition on the rod image, including: obtaining a set of all pixels in the rod image, and a first color code, a second color code, and a third color code corresponding to each pixel in the set, wherein the first color code is determined based on the code of the blue channel in the rod image, the second color code is determined based on the code of the green channel in the rod image, and the third color code is determined based on the code of the red channel in the rod image; if the first color code of the pixel is greater than a preset first color threshold, the second color code is less than a preset second color threshold, and the third color code is less than a preset third color threshold, the pixel is determined as a first color pixel; and the number of pixels of the first color pixel is obtained. If the number of pixels of the first color pixel is greater than the preset pixel threshold, the color recognition result of the rod image is the first color.
[0091] The batch tracking module 403 performs color recognition on the rod image and further includes: obtaining a set of all pixels in the rod image, and a first color code, a second color code, and a third color code corresponding to each pixel in the set, wherein the first color code is determined based on the code of the blue channel in the rod image, the second color code is determined based on the code of the green channel in the rod image, and the third color code is determined based on the code of the red channel in the rod image; if the first color code of the pixel is less than a preset first color threshold, the second color code is greater than a preset second color threshold, and the third color code is less than a preset third color threshold, then the pixel is determined as a second color pixel; and obtaining the number of pixels of the second color pixel. If the number of pixels of the second color pixel is greater than the preset pixel threshold, then the color recognition result of the rod image is the second color.
[0092] Through the above device, the batches of bar transport rollers are tracked based on machine vision by this method, which not only can accurately track the batch positions of the bars, but also has a small amount of calculation, low hardware requirements, and low usage costs. It can be used in different factory areas at low cost and high efficiency.
[0093] It is understood that the roller conveyor bar batch tracking device provided in the above embodiment and the roller conveyor bar batch tracking method provided in the above embodiment are based on the same concept, wherein the specific manner in which the roller conveyor bar batch tracking method performs operations has been described in detail in the above embodiment and will not be repeated here. In actual applications, the roller conveyor bar batch tracking device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the roller conveyor bar batch tracking device into different functional modules, and then implement all or part of the functions of the corresponding functional modules through the roller conveyor bar batch tracking method described in the above embodiment. This is not specifically limited here. For example, the image input module 401 includes a module for executing step S210 and its related steps, the image extraction module 402 includes a module for executing step S220 and its related steps, and the batch tracking module 403 includes a module for executing step S230 and its related steps.
[0094] Figure 5 FIG1 shows a schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present invention. Figure 5 The computer system 500 of the electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0095] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503, such as executing the method described in the above embodiment. Various programs and data required for system operation are also stored in the RAM 503. The CPU 501, ROM 502 and RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0096] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output section 507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 508 including a hard disk; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. Removable media 511, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 510 as needed, so that computer programs read from the removable media can be installed in the storage section 508 as needed.
[0097] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product that includes a computer program carried on a computer-readable medium, the computer program including a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 509 and / or installed from a removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the various functions defined in the system of the present invention are performed.
[0098] It should be noted that the computer-readable medium shown in the embodiments of the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium may, for example, be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal may take a variety of forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0099] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two boxes shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0100] The units involved in the embodiments of the present invention may be implemented in software or hardware, and the units described may also be provided in a processor. In some cases, the names of these units do not limit the units themselves.
[0101] Another aspect of the present invention provides a computer-readable storage medium storing a computer program. When executed by a computer processor, the computer program causes the computer to perform the roller conveyor bar batch tracking method described above. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently and not be incorporated into the electronic device.
[0102] Another aspect of the present invention provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the roller bar batch tracking method provided in each of the above embodiments.
[0103] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, any equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical principles disclosed herein are intended to be covered by the claims of the present invention.
Claims
1. A roller bar batch tracking method, characterized in that: The method comprises: Acquire roller conveyor images of multiple tracking points of a target roller conveyor, input the roller conveyor images into a pre-trained bar recognition model, and obtain a bar recognition frame in the roller conveyor images; If the bar identification frame is within the preset area, extracting the image in the bar identification frame to obtain a bar image; Color recognition is performed on the rod image. If the color recognition result of the rod image is a first color, the rod located after the tracking point corresponding to the rod image is determined to be a rod from the same batch. If the color recognition result of the rod image is a second color, the rod located before the tracking point corresponding to the rod image is determined to be a rod from the same batch. The first color is used to identify the first rod in the same batch, and the second color is used to identify the last rod in the same batch.
2. The roller bar batch tracking method according to claim 1, characterized in that: If the tracking points include a head point and a tail point, after performing color recognition on the bar image, the method further includes: Acquire multiple frames of bar images at the head point, and if the number of images with a color recognition result of the first color in the multiple frames of bar images at the head point exceeds a preset number threshold, determine that tracking of a new batch of bar materials has begun; A plurality of frames of bar images at the tail point are obtained, and if the number of images whose color recognition result is the first color in the plurality of frames of bar images at the tail point exceeds the preset number threshold, it is determined that tracking of the new batch of bars is terminated.
3. The roller bar batch tracking method according to claim 1 or 2, characterized in that: Performing color recognition on the bar image includes: Obtaining a set of all pixels in the stick image, and a first color code, a second color code, and a third color code corresponding to each pixel in the set, wherein the first color code is determined based on a code of a blue channel in the stick image, the second color code is determined based on a code of a green channel in the stick image, and the third color code is determined based on a code of a red channel in the stick image; If the first color code of the pixel is greater than a preset first color threshold, the second color code is less than a preset second color threshold, and the third color code is less than a preset third color threshold, the pixel is determined to be a first color pixel; The number of pixels of the first color is obtained. If the number of pixels of the first color is greater than a preset pixel threshold, the color recognition result of the bar image is the first color.
4. The roller bar batch tracking method according to claim 1 or 2, characterized in that: Performing color recognition on the bar image further includes: Obtaining a set of all pixels in the stick image, and a first color code, a second color code, and a third color code corresponding to each pixel in the set, wherein the first color code is determined based on a code of a blue channel in the stick image, the second color code is determined based on a code of a green channel in the stick image, and the third color code is determined based on a code of a red channel in the stick image; If the first color code of the pixel point is less than a preset first color threshold, the second color code is greater than a preset second color threshold, and the third color code is less than a preset third color threshold, the pixel point is determined to be a second color pixel point; The number of pixels of the second color is obtained. If the number of pixels of the second color is greater than a preset pixel threshold, the color recognition result of the bar image is the second color.
5. The roller bar batch tracking method according to claim 1, characterized in that: Before acquiring roller conveyor images of a plurality of tracking points of the target roller conveyor, the method further includes: A camera array is provided on the target roller conveyor, wherein the camera array includes at least a camera provided at a preset distance from a starting position of the target roller conveyor and a camera provided at a preset distance from an ending position of the target roller conveyor; Using the actual coordinate position of each camera in the camera array as a tracking point; Wherein, the transport direction of the target roller conveyor is from the starting position to the ending position.
6. The roller bar batch tracking method according to claim 5, characterized in that: After obtaining the bar image, the method further includes: Acquire the actual coordinate position of each camera in the camera array, and obtain the actual coordinate position corresponding to the rod image based on the actual coordinate position of the camera corresponding to the rod image; Tracking the first bar of the same batch in the target roller conveyor based on the actual coordinate position corresponding to the bar image having the first color as the color recognition result; and / or, The last bar of the same batch in the target roller is tracked based on the actual coordinate position corresponding to the bar image whose color recognition result is the second color.
7. The roller bar batch tracking method according to claim 1, characterized in that: Before inputting the roller image into the pre-trained bar recognition model, the method further includes: Obtaining historical roller conveyor images, marking the bars in the historical roller conveyor images, and obtaining a bar recognition training set; The bar material recognition training set is input into a preset target recognition model for training to obtain the bar material recognition model. The input of the bar material recognition model is the roller image, and the output of the bar material recognition model is the bar material recognition frame.
8. A roller bar batch tracking device, characterized in that: The device comprises: An image input module is used to obtain roller images of multiple tracking points of a target roller, input the roller images into a pre-trained bar recognition model, and obtain a bar recognition frame in the roller images; An image extraction module is used to extract the image in the bar identification frame to obtain a bar image if the bar identification frame is within a preset area; The batch tracking module is used to perform color recognition on the bar image. If the color recognition result of the bar image is a first color, the bar located after the tracking point corresponding to the bar image is determined to be a bar from the same batch. If the color recognition result of the bar image is a second color, the bar located before the tracking point corresponding to the bar image is determined to be a bar from the same batch. The first color is used to identify the first bar in the same batch, and the second color is used to identify the last bar in the same batch.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the roller bar batch tracking method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the roller bar batch tracking method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Object detection method, object detection device and electronic equipment
CN112347887A
Bar saw cutting one-by-one tracking method based on multi-target video tracking
CN114581478A
Automatic tracking system and tracking method for steel material information
CN114669594A
Bar sawing area material tracking method and device
CN118351362A
Automatic number separation system for steel billet rolling on bar production line
CN120094969A