A method and device for detecting and identifying cigarette codes

Through an automatic identification method combining convolutional neural network and OCR system, the problems of low efficiency and low automation of 32-bit laser code transcription in the prior art are solved, and efficient and accurate encoding recognition and entry are achieved.

CN112434544BActive Publication Date: 2025-02-14GUANGDONG TOBACCO YANGJIANG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011431557.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-09
Publication Date
2025-02-14
Estimated Expiration
2040-12-09

AI Technical Summary

Technical Problem

The prior art relies on manual operation in the transcription process of 32-bit laser code of the cigarette, which has low efficiency, high error rate, and limited automation.

Method used

A smoke encoding detection and recognition method is adopted, combining the processor module, the conveying module, the light source module, the drawing module, the character recognition module and the QR code recognition module, and automatic recognition and entry are achieved through the convolutional neural network and the OCR system.

Benefits of technology

It improves the recognition efficiency and accuracy of cigarette encoding, reduces the error rate of manual operation, and achieves a higher level of automated production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112434544B_ABST
    Figure CN112434544B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of cigarette code recognition and recording, and more specifically, to a method and device for detecting and identifying cigarette codes. Specifically, it includes a processor module and a conveying module, a light source module, a picture acquisition module, a character recognition module, and a two-dimensional code recognition module connected to the processor module. The cigarette moves into the detection and identification area along with the conveying module. The light source module displays different colors under the control of the processor module. At the same time, the industrial picture acquisition module shoots at high speed to shoot the laser code of the cigarette under different light source colors. Among them, the RGB three-color light source is combined into a plurality of colors of light to solve the problem of contrast of laser code character imaging under different color backgrounds. The light source color is changed during the recognition process, and the industrial camera takes pictures multiple times for comparison, so as to achieve the best recognition effect. OCR is performed according to the laser code with the clearest display, which is simple, fast and accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cigarette carton code recognition and reading, and more specifically, to a cigarette carton code detection and recognition method and device. Background Art

[0002] At present, the way to code cigarette cartons is to use a laser marking machine to mark a 32-digit code on each cigarette for anti-counterfeiting, anti-channelling and information query. With the continuous development of modern logistics, all aspects of tobacco logistics are also constantly breaking through and innovating in the direction of automation and intelligence, while most of the 32-digit logistics code transcription of cigarette cartons is still at the stage of manual copying. The surface materials of cigarette cartons are diverse and the colors are complex. Manual transcription is very difficult. It is necessary to copy the 32-digit identification code in various colors. The long-term copying is labor-intensive and easy to damage the eyes. In addition, the manual copying method is inefficient, with a high error rate and complex operating procedures.

[0003] The Chinese patent with publication number CN106650537A discloses a 32-bit laser code recognition reader for cigarette cartons, which converts manual transcription into instrument recognition and reading, thus improving the transcription efficiency of 32-bit laser codes for cigarette cartons. However, the reader still needs to rely on manual sorting and placing on the table for reading, and the degree of automation is very limited. Moreover, the component structure of the solution is complex and the operation is cumbersome, and there is still much room for improvement. Summary of the invention

[0004] In order to overcome the defects of the prior art, the present invention provides a method for detecting and identifying cigarette codes, which can clearly identify laser codes, two-dimensional codes and bar codes on the surface of cigarettes and enter them. At the same time, the transmission belt is combined for production line detection to effectively improve automated production.

[0005] The present invention also provides a cigarette code detection and identification device for implementing the detection and identification method.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A method for detecting and identifying cigarette codes comprises a processor module and a conveying module, a light source module, a picture acquisition module, a character recognition module and a two-dimensional code recognition module connected to the processor module, wherein the light source module is connected to the picture acquisition module, and the picture acquisition module is connected to the character recognition module and the two-dimensional code recognition module; the light source module and the picture acquisition module are located in a detection area; wherein the processor module performs centralized processing and can transmit data with other mobile terminals.

[0008] The method comprises the following steps:

[0009] S1 The conveying module conveys the cigarettes to the detection area, with the coded side of the cigarette facing the identification direction;

[0010] S2: the light source module changes different illumination colors, and the image acquisition module dynamically captures the moving cigarette strips;

[0011] S3: the image acquisition module transmits the captured cigarette image to the character recognition module, which uses the convolutional neural network Faster-RCNN to extract features, generate a convolutional feature map, complete the design of the candidate region generation network and use it to select the target region, perform binary classification on the target region, separate the character foreground class from the background class; and enter the obtained encoding information into the processor module through the OCR system;

[0012] S4 The image acquisition module transmits the captured cigarette image to the QR code recognition module, which sequentially performs image preprocessing, position detection graphics, position correction graphics, perspective transformation, decoding and error correction on the image, and finally obtains the information contained in the QR code and enters the information into the processor module.

[0013] Preferably, the convolutional neural network Faster-RCNN is mainly composed of the following four steps:

[0014] 1. Proposed region: Selective search is used to select multiple high-quality proposed regions for the input image. Each proposed region is selected at different scales and has different shapes and sizes. Each proposed region will be labeled with the category and the true bounding box.

[0015] 2. Feature extraction: Select a pre-trained CNN and truncate it before the output layer, deform each proposed region into the input size required by the network, and extract features from the proposed region through forward calculation;

[0016] Three-target classification: The features of each proposed region together with its labeled category are taken as a sample, and multiple support vector machines are trained to classify the targets, where each support vector machine is used to determine whether the sample belongs to a certain category;

[0017] Four regression boxes: The features of each proposed region together with its annotated bounding box are taken as a sample, and a linear regression model is trained to predict the true bounding box.

[0018] Preferably, the image preprocessing includes grayscale processing, denoising processing, distortion correction processing and binarization processing.

[0019] The grayscale processing converts the image into a grayscale image; the denoising processing uses Gaussian filtering, median filtering or mean filtering to improve the image quality; the distortion correction processing corrects the image through a distortion model to a distortion-free image; the binarization processing uses a fixed threshold method, Otsu method, histogram bimodal thresholding method or local thresholding method.

[0020] Preferably, the perspective transformation obtains a homography matrix according to the coordinates of the three positioning center points of the graphic, the center point of the correction symbol and the four ideal points, and then obtains a standard square image through perspective transformation.

[0021] Preferably, the decoding and error correction are to decode and compare the QR code version information, format information, data and error correction code, convert the data area into a bit stream of 0 and 1, and use the Reed-Solomon error correction algorithm to check and correct the bit stream, determine the QR code encoding format and then decode to obtain the information contained in the QR code.

[0022] Preferably, it further comprises a barcode recognition module connected to the processor module, the image acquisition module is connected to the barcode recognition module, and the processing procedures of the barcode recognition module and the two-dimensional code recognition module are similar.

[0023] Preferably, the system further comprises a display module, which is connected to the processor module and is used to display the detection process and data structure. The display module is a liquid crystal display.

[0024] A cigarette code detection and identification device is used to implement the above detection and identification method, wherein the conveying module is a conveyor belt, the light source module is an RGB three-color strip light source, and the image acquisition module includes an industrial camera and a code reader.

[0025] Among them, the industrial camera and RGB three-color strip light source are both set directly above the conveyor belt. The RGB three-color strip light source is located on both sides of the industrial camera and is symmetrically arranged with the industrial camera as the center; the straight line where the RGB three-color strip light source is located is perpendicular to the conveying direction, and the angle between the irradiation surface of the RGB three-color strip light source and the conveying surface of the conveyor belt is an acute angle. The RGB three-color light source is combined into a variety of colors of light to solve the problem of contrast imaging of laser code characters under different color backgrounds. The color of the light source is changed during the recognition process, and the industrial camera takes pictures multiple times for comparison, so as to achieve the best recognition effect. The industrial camera is a CCD chip camera with high image stability, high transmission capacity and high anti-interference ability.

[0026] Furthermore, the code reader is arranged on a horizontal side of the conveyor belt, and the code scanning direction is perpendicular to the conveying direction. In view of the current cigarette packing style, the barcode of the cigarette is usually located on the side, so the code reader scans the barcode according to the position of the barcode.

[0027] Furthermore, the width of the conveyor belt is adapted to the width of the cigarette strips. In order to better limit the identification area, preferably, the width of the conveyor belt is adapted to the width of the cigarette strips, so that the arrangement shape of the cigarette strips is orderly and standardized into a straight line.

[0028] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention discloses a method and device for detecting and identifying cigarette strip codes, which integrates the recognition technologies of 32-bit laser codes, two-dimensional codes, and bar codes of cigarette strips, and can recognize multiple codes simultaneously. An industrial camera is used in conjunction with an RGB three-color light source, and the recognition efficiency and accuracy are high. Moreover, a conveyor belt is used for standardized transmission, which effectively improves case handling efficiency, reduces the error rate of work, and makes work more intelligent. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a flow chart of the method of the present invention.

[0030] Figure 2 This is a schematic diagram of the Faster RCNN network structure.

[0031] Figure 3 It is based on the MNIST dataset to identify network topology graphs.

[0032] Figure 4 This is a schematic diagram of the network structure of the 32-bit code recognition process.

[0033] Figure 5 It is a schematic diagram of the QR code structure.

[0034] Figure 6 It is a QR code feature area division map.

[0035] Figure 7 This is a comparison chart before and after the QR code perspective transformation.

[0036] Figure 8 It is a transmission state diagram of the device of the present invention.

[0037] Fig. 9 1 is a transmission state diagram of the device of the present invention (different angles).

[0038] Fig.10 It is the overall front view of the device of the present invention.

[0039] Among them, 1 conveyor belt, 2 industrial camera, 3 light source, 4 sensor probe, 5 fixed frame, 51 horizontal bar, 52 vertical bar, 53 slider, 6 code reader, 7 cigarettes. DETAILED DESCRIPTION

[0040] The drawings are only for illustrative purposes and cannot be construed as limiting the present invention. To better illustrate the present embodiment, some parts of the drawings may be omitted, enlarged, or reduced, and do not represent the size of the actual product. For those skilled in the art, it is understandable that some well-known structures and their descriptions may be omitted in the drawings. The positional relationships described in the drawings are only for illustrative purposes and cannot be construed as limiting the present invention.

[0041] Example

[0042] like Figure 1 As shown, the present invention implements a method for detecting and identifying cigarette codes, including a processor module and a conveying module, a light source module, a picture acquisition module, a character recognition module, a QR code recognition module, and a bar code recognition module connected to the processor module. The light source module is connected to the picture acquisition module, and the picture acquisition module is connected to the character recognition module, the QR code recognition module, and the bar code recognition module. The processor module performs centralized processing and can transmit data with other mobile terminals in actual production.

[0043] The method comprises the following steps:

[0044] The S1 conveying module conveys the cigarettes to the detection area, where the light source module and the image acquisition module are located in the detection area, and the coded side of the cigarettes faces the identification direction.

[0045] The S2 light source module changes different illumination colors, while the image acquisition module dynamically captures the moving cigarette strips.

[0046] The S3 image acquisition module transmits the captured cigarette image to the character recognition module, which uses the convolutional neural network Faster-RCNN to extract features, generate a convolutional feature map, complete the design of the candidate area generation network, and use it to select the target area, perform binary classification on the target area, separate the character foreground class from the background class; and enter the obtained encoding information into the processor module through the OCR system.

[0047] The S4 image acquisition module transmits the captured cigarette strip image to the QR code recognition module and the barcode recognition module. The QR code recognition module and the barcode recognition module perform image preprocessing, position detection graphics, position correction graphics, perspective transformation, decoding and error correction on the image in turn, and finally obtain the information contained in the QR code, and enter the QR code information and barcode information into the processor module through the OCR system software.

[0048] The light source module is an RGB three-color strip light source, which is mainly used to cooperate with the image acquisition module to enhance the recognition stability. The surface coding of the cigarette strips currently produced is generally a 32-bit laser code. To ensure the stability of the imaging of the 32-bit laser code under the complex background of the cigarette strips, different lighting effects need to be applied to the 32-bit laser code under different backgrounds. There are different color patterns on the surface of the cigarette packaging. The position of the laser code is random on the surface of the cigarette strips. The same lighting cannot meet all background imaging requirements. It is necessary to illuminate the laser code characters under different backgrounds with different colors of light to achieve the best imaging effect. The light source module uses an RGB three-color light source to change the color of its light according to the value of each luminous color channel. The value of each channel is 0-255, which can be randomly combined into any color of light to solve the problem of character imaging contrast under different color backgrounds. In the technical implementation, it is necessary to test and analyze the character imaging effect under different backgrounds according to the surface color of the cigarette strips. The laser code has depth characteristics, and its characters are not exactly the same in the image. Therefore, it is necessary to take pictures multiple times according to different light intensities and color changes, and then differentially amplify the image to obtain the image with the best contrast effect.

[0049] The image acquisition module includes an industrial camera and a code reader. In actual detection, the 32-bit laser code patterns of various specifications of cigarette strips are very complex, and there are many text or letter areas similar to the cigarette strip codes in the background pattern, which is a great interference factor. In addition, the cigarette strip codes themselves have various complex changes such as rotation, distortion, absence, interruption, and crowding. Therefore, the control algorithm of the image acquisition module adopts a top-down architecture. First, eliminate background interference, roughly detect the approximate area of ​​the double-row characters, and then accurately locate the position of the single row and extract the single-row characters. Adjust the lifting and lowering of the control light source and the imaging lens of the industrial camera, and adjust the intensity of the light source to obtain the best fit 32-bit laser code image. The recognition algorithm subsystem obtains the image, that is, automatically recognizes the 32-bit laser code and displays the result.

[0050] Industrial cameras are multi-spectrum cameras. The exposure of multi-spectrum cameras requires the camera to collect pictures multiple times according to the change of the three-color strip light source. The industrial camera needs to expose according to the frequency of the light source color switching. Because it is a dynamic shooting, the exposure time needs to be as short as possible. The brightness switching speed of the three-color strip light needs to be very fast within the short exposure time. The color brightness of the three-color strip light source changes more than 10 times within 0.5 seconds of exposure. This requires targeted optimization and improvement of the light source modem to meet the imaging requirements. Generally, the barcode of the cigarette strip is scanned first, and the system obtains the specifications of the cigarette strip, adjusts the control of the light source and the lifting and lowering of the imaging lens, and can adjust the light source strength to obtain the best adaptation of the 32-bit laser code image. The recognition algorithm subsystem obtains the image, that is, automatically recognizes the 32-bit laser code and displays the result. If the light source controller cannot make the brightness of the light source reach the normal value in a short time, the image taken will be bright and dark, and cannot meet the normal image requirements.

[0051] Using dual-strip three-color light sources, in view of the dynamic shooting requirements of the conveyor line camera, the strip light source is easy to install and can best cover the detection area of ​​the conveying module to ensure that there are no blind spots in the shooting of cigarette strips. Installing the strip light source at a certain angle to the cigarette strips can better increase the contrast between the 32-bit laser code and the background, and improve the imaging effect. Multi-spectral image fusion is to fuse multiple collected multi-spectral images into one image. Compared with a single image, the fused image can comprehensively reflect the information of multiple original images, thereby obtaining a clear and correct description. Image fusion is the basis of recognition. Before the image fusion process, the original multi-spectral image needs to be preprocessed. The image preprocessing operation can improve the image quality, filter invalid information, and reduce the difficulty of subsequent image fusion processing.

[0052] The image acquisition module acquires the original image, segments and extracts the cigarette image in the image, and obtains an image with only cigarettes, such as Figure 3-4 As shown. After the segmentation and extraction of the cigarette strip image, the next step is to locate the 32-bit laser code on the cigarette strip image. The premise of recognition is to segment the 32-bit laser code separately. Before segmentation, detection and positioning are performed, that is, the position, angle, and direction of each character are determined to completely segment a character. This is because the size, format, and spacing of each character from 0 to 9 are basically unchanged due to laser coding, that is, the angle and shape of the character will not change. Therefore, after determining the angle of a character, the angle of each character can be located according to the angle of a single character. Using deep learning technology, the character positioning of the character recognition module selects the convolutional neural network Faster-RCNN with strong representation ability for feature extraction, generates a convolutional feature map, completes the design of the candidate region generation network and completes the selection of the target area, performs binary classification on the target area, separates the character foreground class from the background class, and then enters the obtained encoding information into the processor module through the OCR system.

[0053] Specifically, the convolutional neural network Faster-RCNN is mainly composed of the following four steps:

[0054] 1. Proposed region: Selective search is used on the input image to select multiple high-quality proposed regions. Each proposed region is selected at different scales and has different shapes and sizes. Each proposed region will be labeled with the category and the true bounding box.

[0055] 2. Feature extraction: Select a pre-trained CNN and truncate it before the output layer, deform each proposed region into the input size required by the network, and extract features from the proposed region through forward calculation;

[0056] 3. Target classification: The features of each proposed region together with its labeled category are taken as a sample, and multiple support vector machines are trained to classify the target, where each support vector machine is used to determine whether the sample belongs to a certain category;

[0057] 4. Regression box: Take the features of each proposed region together with its annotated bounding box as a sample and train a linear regression model to predict the true bounding box.

[0058] like Figure 2 As shown in the figure, Faster-CNN can effectively extract image features through pre-trained convolutional neural network. The convolution part of FastR-CNN is the most time-consuming during training, while the fully connected layer is the most time-consuming during testing. Because we usually refer to the test (forward) speed when we talk about the speed of a model, Fast R-CNN uses truncated SVD to compress the fully connected layer.

[0059] Mathematically, W≈U∑ t V T , where Σ is a diagonal matrix, that is, only the diagonal has values, U is the first t left singular vectors of W, Σt is a diagonal matrix composed of W singular values, and V is the first t right singular vectors of W. TruncatedSVD reduces the number of parameters from uv to t(u+v). The fully connected layer corresponding to W is decomposed into two. The first one uses the weight matrix ΣtVT. When t is much smaller than the original matrix size, the compression effect is more obvious.

[0060] For the recognition part, the LeNet-5 network based on the MNIST dataset needs to be optimized to complete the recognition of the foreground class in the positioning network, such as Figure 3 Finally, based on the SVHN dataset as the basic dataset, the corresponding dataset is constructed according to the specific requirements of the positioning and recognition networks, the training of the two networks is completed, and the trained model is verified on the SVHN dataset to obtain better recognition results and accuracy, as shown in the figure. Figure 4 shown.

[0061] The surface of currently produced cigarette strips is usually printed with a QR code. In order to simultaneously recognize the QR code, a QR code recognition module is used. The QR code recognition module also requires images collected by the image acquisition module.

[0062] Generally, a QR code consists of a coding area and functional graphics including image search graphics, separators, positioning graphics and correction graphics. The QR code structure is shown in the figure below. Figure 5 As shown:

[0063] The common methods and processes for QR code recognition mainly include image preprocessing, positioning position detection graphics, positioning correction graphics, perspective transformation, decoding and error correction.

[0064] Specifically, image preprocessing includes grayscale processing, denoising processing, distortion correction processing, and binarization processing.

[0065] Grayscale processing converts images into grayscale images. Industrial cameras output data in many formats. Black and white cameras directly output grayscale images, while color cameras output formats include YUV422, YUV410, RGB565, RGB888, etc. QR code recognition only requires a single-channel grayscale image, so conversion is required. Taking RGB888 as an example, the conversion formula is as follows:

[0066] Gray=0.2989R+0.5870G+0.1140B

[0067] Gray is the gray of the image. R is the red of the three primary colors, G is the green of the three primary colors, and B is the blue of the three primary colors. The value before each color is the proportion of each color after being adjusted to gray.

[0068] De-noising uses Gaussian filtering, median filtering or mean filtering to improve image quality. Figure 6 The 1:1:3:1:1 feature positioning represented in the figure is inaccurate, and the decoding error in the data stage is also caused. The common noises are mainly Gaussian noise and salt and pepper noise.

[0069] Distortion correction is the process of correcting an image through a distortion model to a distortion-free image. Wide-angle cameras or fisheye cameras of industrial cameras have large distortion. The closer to the edge of the viewing angle, the greater the image deformation. For images with large distortion, not only is the 1:1:3:1:1 feature ratio imbalanced, but the data in the data area does not have a standard module size, which will cause inaccurate decoding. In this case, it is necessary to correct the distortion model to a distortion-free image.

[0070] Binarization can be done by fixed threshold method, Otsu method, histogram bimodal threshold method or local threshold method. Under normal circumstances, the background and the QR code target are clearly distinguished and the illumination is uniform. It is only necessary to use the global binarization method. Common methods include fixed threshold method, Otsu method, histogram bimodal threshold method, etc. However, it is not applicable to the case of uneven illumination, which will cause global brightness imbalance and make it impossible to read the code normally. Therefore, an adaptive local threshold method is required, which can be achieved by using the block threshold re-equalization method. A new generation of barcode technology that uses a black and white rectangular matrix distributed in a plane (two-dimensional direction) according to a certain rule using specific geometric figures to record data symbol information. It consists of a QR code matrix graphic and a QR code number, as well as the explanatory text below. It has the characteristics of large information volume, strong error correction ability, fast reading speed, and all-round reading.

[0071] Specifically, the position detection pattern is located through feature search of the position detection pattern 1:1:3:1:1, with a tolerance of 0.5. The feature is scanned in the horizontal and vertical directions, and multiple penetrations are the candidate position detection images. Through some screening strategies, such as positioning correction, perspective transformation, decoding error correction, QR code image processing, etc., the false position detection patterns are eliminated to determine the true patterns, and then their orientations are determined according to the distances and rotation angles between the three patterns, which are the upper left corner, upper right corner and lower left corner, respectively.

[0072] Specifically, the positioning correction pattern estimates the lower right corner correction symbol based on the three position detection images, and the pattern is positioned similarly to the positioning position detection pattern.

[0073] Specifically, the perspective transformation obtains the homography matrix according to the coordinates of the three positioning center points of the graphic, the center point of the correction symbol and the four ideal points, and then obtains the standard square image through perspective transformation, such as Figure 7 As shown, the perspective transformation formula is as follows:

[0074]

[0075] x=a 11 u+a 12 v+a 13

[0076] y=a 21 u+a 22 v+a 23

[0077] z=a 31 u+a 32 v+a 33

[0078]

[0079]

[0080] Among them, XY, Z represent three center points, the letter starting with a represents the point coordinate information, and K is the system constant.

[0081] Specifically, the decoding and error correction are to decode and compare the QR code version information, format information, data and error correction code, convert the data area into a bit stream of 0 and 1, and use the Reed-Solomon error correction algorithm to check and correct the bit stream. After determining the QR code encoding format, the information contained in the QR code is decoded and entered into the processor module.

[0082] The processing procedures of the barcode recognition module and the two-dimensional code recognition module are similar. The difference is that the barcode recognition module recognizes the barcode. For ease of use, the barcode recognition module and the two-dimensional code recognition module can use the same basic equipment.

[0083] Moreover, this embodiment further includes a display module, which is connected to the processor module and is used to display the detection process and data structure.

[0084] At the same time, in order to implement the identification method, this embodiment also provides a cigarette code detection and identification device, wherein the conveying module is a conveyor belt, such as Figure 8-10 As shown, the specific structure is as follows:

[0085] The device includes a conveyor belt 1, an industrial camera 2, a light source 3, a code reader 6, a sensing probe 4 and a processor. The industrial camera 2, the light source 3, the code reader 6 and the sensing probe 4 are all electrically connected to the processor and are centrally controlled by the processor.

[0086] The industrial camera 2 and the light source 3 are both arranged directly above the conveyor belt 1 . The light source 3 is located on both sides of the industrial camera 2 and is symmetrically arranged with the industrial camera 2 as the center.

[0087] like Fig.10 As shown, in order to implement this setting, the present embodiment further includes a fixing frame 5, which is vertically connected to the side of the conveyor belt 1. Specifically, the fixing frame 5 is a cross-shaped structure, including a cross bar 51 and a vertical bar 52. The cross bar 51 and the vertical bar 52 are slidably connected by a slider 53, and the height of the cross bar 51 can be adjusted as needed. The slider 53 is fixedly connected to the cross bar 51, and the slider 53 is slidably connected to the vertical bar 52 and can be fixed. The position of the slider 53 is usually fixed by bolts or screws. This structure is a commonly used structure in the field, so it is not described in detail.

[0088] Specifically, the industrial camera 2 and the sensing probe 4 are arranged on the vertical rod 52 , and the light source 3 is arranged at two ends of the horizontal rod 51 , wherein the setting height of the industrial camera 2 and the sensing probe 4 is higher than the setting height of the light source 3 .

[0089] The sensing probe 4 is arranged adjacent to the industrial camera 2, close to the starting end of the conveyor belt 1, and senses the position of the cigarette strip 7 before the industrial camera 2. In this embodiment, the sensing probe 4 adopts an infrared sensing sensor, and the industrial camera 2 is a CCD chip camera.

[0090] In this embodiment, the light source 3 is an RGB three-color strip light source, the axis of the light source 3 itself is perpendicular to the conveying direction, and the light source 3 is rotatably connected to the crossbar 51, and the light source 3 rotates around its own axis to change the angle of the irradiation surface. Generally, the angle between the irradiation surface of the light source 3 and the conveying surface of the conveyor belt 1 is an acute angle, the irradiation surface covers a large area, and the light sources 3 on both sides irradiate directly below the industrial camera 2, and when the cigarette strip 7 moves to the industrial camera 2 for shooting, it ensures sufficient brightness.

[0091] In addition, the conveyor belt 1 is driven by a motor, and the width of the conveyor belt 1 is adapted to the width of the cigarette strips 7. During the conveyor belt 1, the cigarette strips 7 are arranged in an orderly and standardized shape to form a straight line, such as Figure 8-9 shown.

[0092] In view of the current packaging style of cigarette cartons 7, the barcode of the cigarette cartons 7 is usually located on the side, and the code reader 6 is used to read the side code of the cigarette cartons 7. Therefore, the code reader 6 is set on the horizontal side of the conveyor belt 1, and the scanning direction is perpendicular to the conveying direction. When the barcode on the side of the cigarette cartons 7 enters the scanning field of view of the code reader 6, the code reader 6 scans the code in time and feeds back to the processor.

[0093] When the cigarette strip 7 is automatically transported, the side with the laser code and QR code faces upwards for camera shooting. The cigarette strip 7 moves with the conveyor belt 1 into the detection and identification area. The light source 3 displays different colors under the control of the processor. At the same time, the industrial camera 2 shoots at high speed to shoot the laser code of the cigarette strip 7 under different colors of the light source 3. Among them, the RGB three-color light source 3 is combined into a variety of colors of light to solve the problem of contrast imaging of laser code characters under different color backgrounds. During the recognition process, the color of the light source 3 is changed, and the industrial camera 2 takes pictures multiple times for comparison, so as to achieve the best recognition effect. The laser code with the clearest display is entered, which is simple, fast and accurate.

[0094] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for detecting and identifying cigarette codes, characterized in that: It includes a processor module and a conveying module, a light source module, a picture acquisition module, a character recognition module, and a two-dimensional code recognition module connected to the processor module. The light source module is connected to the picture acquisition module, and the picture acquisition module is connected to the character recognition module and the two-dimensional code recognition module. The light source module and the picture acquisition module are located in the detection area. The following steps are involved: S1 The conveying module conveys the cigarettes to the detection area, with the coded side of the cigarette facing the identification direction; S2: the light source module changes different illumination colors, and the image acquisition module dynamically captures the moving cigarette strips; S3: the image acquisition module transmits the captured cigarette image to the character recognition module, which uses the convolutional neural network Faster-RCNN to extract features, generate a convolutional feature map, complete the design of the candidate region generation network and use it to select the target region, perform binary classification on the target region, separate the character foreground class from the background class; and enter the obtained encoding information into the processor module through the OCR system; S4: the image acquisition module transmits the captured cigarette image to the QR code recognition module, which sequentially performs image preprocessing, position detection graphics, position correction graphics, perspective transformation, decoding and error correction on the image, and finally obtains the information contained in the QR code and enters the information into the processor module; The convolutional neural network Faster-RCNN is mainly composed of the following four steps:

1. Proposed region: Selective search is used to select multiple high-quality proposed regions for the input image. Each proposed region is selected at different scales and has different shapes and sizes. Each proposed region will be labeled with the category and the true bounding box.

2. Feature extraction: Select a pre-trained CNN and truncate it before the output layer, deform each proposed region into the input size required by the network, and extract features from the proposed region through forward calculation; Three-target classification: The features of each proposed region together with its labeled category are taken as a sample, and multiple support vector machines are trained to classify the targets, where each support vector machine is used to determine whether the sample belongs to a certain category; Four regression boxes: The features of each proposed region together with its annotated bounding box are used as a sample, and a linear regression model is trained to predict the true bounding box; The perspective transformation obtains the homography matrix according to the coordinates of the three positioning center points of the graphic, the center point of the correction symbol and the four ideal points, and then obtains the standard square image through perspective transformation.

2. The cigarette code detection and identification method according to claim 1, characterized in that: The image preprocessing includes grayscale processing, denoising processing, distortion correction processing and binarization processing. The grayscale processing converts the image into a grayscale image; the denoising processing uses Gaussian filtering, median filtering or mean filtering to improve the image quality; the distortion correction processing corrects the image through a distortion model to a distortion-free image; the binarization processing uses a fixed threshold method, Otsu method, histogram bimodal thresholding method or local thresholding method.

3. The cigarette code detection and identification method according to claim 1, characterized in that: The decoding and error correction are to decode and compare the QR code version information, format information, data and error correction code, convert the data area into a bit stream of 0 and 1, and use the Reed-Solomon error correction algorithm to check and correct the bit stream, determine the QR code encoding format and then decode to obtain the information contained in the QR code.

4. The cigarette code detection and identification method according to claim 3, characterized in that: It also includes a barcode recognition module connected to the processor module. The image acquisition module is connected to the barcode recognition module. The processing procedures of the barcode recognition module and the two-dimensional code recognition module are similar.

5. The cigarette code detection and identification method according to claim 4, characterized in that: It also includes a display module, which is connected to the processor module and is used to display the detection process and data structure.

6. A cigarette code detection and identification device, used to implement the detection and identification method of claim 5, characterized in that: The conveying module is a conveyor belt, the light source module is an RGB three-color strip light source, and the image acquisition module includes an industrial camera and a code reader; The industrial camera and the RGB three-color strip light source are both arranged directly above the conveyor belt, and the RGB three-color strip light source is located on both sides of the industrial camera and is symmetrically arranged with the industrial camera as the center; The straight line where the RGB three-color strip light source is located is perpendicular to the conveying direction, and the angle between the irradiation surface of the RGB three-color strip light source and the conveying surface of the conveyor belt is an acute angle.

7. The cigarette code detection and identification device according to claim 6, characterized in that: The code reader is set on the horizontal side of the conveyor belt, and the scanning direction is perpendicular to the conveying direction.

8. The cigarette code detection and identification device according to claim 7, characterized in that: The width of the conveyor belt is adapted to the width of the cigarette strips.

Citation Information

Patent Citations

  • Identification reading inputting instrument of tobacco carton 32-bit laser code

    CN106650537A

  • Cigarette code detection and recognition device

    CN213690646U