Instant lottery ticket sorting device and method based on visual identification and weight sensing
By combining visual recognition and weight sensing technology in the instant lottery sorting system, the problems of inefficiency and inaccuracy of traditional sorting methods are solved, and efficient and accurate instant lottery sorting is achieved, suitable for diverse and similar lottery types.
Patent Information
- Application Number
- CN202510363010.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-05-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional lottery sorting method relies on manual operations, is inefficient and inaccurate enough. In addition, existing automation technologies such as barcode recognition and RFID have limitations, making it difficult to achieve accurate sorting under the various types of lottery types and similar appearances.
The instant lottery sorting device based on visual recognition and weight sensing is adopted. The appearance image and weight value of the lottery are obtained simultaneously through appearance acquisition and weight sensing module. The weight correction and appearance feature assist extraction module determine the weight detection range, extract the characteristics of the lottery type and count the quantity, and the feature vector generation and the lottery sorting module integrate the feature generation type differentiation feature vector, which is used to determine the actual type of the lottery and realize sorting through the robotic arm.
It realizes efficient, accurate and low-cost instant lottery sorting, reduces manual sorting errors, improves overall work quality, and is suitable for the lottery industry and other similar sorting fields.
Smart Images

Figure CN120054889A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lottery sorting, and particularly to an instant lottery sorting device and method based on visual recognition and weight sensing. Background Art
[0002] In the lottery industry, instant lottery, as a popular lottery type, has a large sales volume and a wide variety of issued types. With the continuous development of the lottery market, higher requirements are put forward for the sorting efficiency and accuracy of instant lottery. Efficient and accurate sorting work can not only ensure the smooth progress of the lottery sales link, but also improve the efficiency of operation management, reduce labor costs, and is crucial for the healthy development of the lottery industry.
[0003] Traditional instant lottery sorting methods mainly rely on manual operation. Staff rely on visual inspection of the lottery appearance, manually distinguish lottery types and conduct sorting. This method not only consumes a large amount of manpower, but also has low efficiency. Long-term work is likely to cause fatigue of the staff, thus affecting the sorting accuracy. With the development of technology, some automated sorting technologies have gradually been applied to the lottery industry. Common technologies include identifying lottery information and conducting sorting based on barcode recognition, radio frequency identification (RFID), etc. However, these technologies have certain limitations, such as the barcode may be damaged, the RFID tag has a high cost and needs to be pre-implanted, etc. The instant lottery sorting device and method based on visual recognition and weight sensing provide a new solution for lottery sorting. Visual recognition technology can quickly and accurately obtain the appearance characteristics of lottery tickets, and weight sensing technology can provide an additional dimension of recognition. The combination of these two technologies is expected to break through the limitations of traditional sorting methods and achieve more efficient, accurate and low-cost instant lottery sorting. With the continuous progress of artificial intelligence and sensor technology, this sorting method based on multi-technology integration has broad application prospects in the lottery industry and other similar sorting fields, and will promote the development of lottery sorting work towards intelligence and automation. Whether it is the visual recognition technology that solely relies on appearance or the weight sensing technology that only depends on weight, the information obtained is single-dimensional. In the face of complex situations such as diverse lottery types and similar appearances, it is difficult to accurately distinguish lottery types, resulting in sorting errors.
[0004] Therefore, the present invention proposes an instant lottery sorting device and method based on visual recognition and weight sensing. Summary of the Invention
[0005] The present invention provides an instant lottery sorting device and method based on visual recognition and weight sensing. In the device, the appearance acquisition and weight sensing module synchronously acquires the appearance image and weight value of each group of instant lottery tickets conveyed by the belt, providing multi-dimensional data for sorting; the weight correction and appearance feature auxiliary extraction module determines the weight detection range based on the appearance image, judges whether the weight value is within this range, and if not, re-acquires it until it meets the requirements. Only then, based on this weight value, it extracts the lottery type discrimination features from the appearance image and counts the number of lottery tickets, ensuring accurate data and mining lottery feature information; the feature vector generation and lottery sorting module integrates the lottery type discrimination features, quantity, and weight value to generate a type discrimination feature vector, determines the actual type of the lottery based on this, and sorts it through the robotic arm, realizing efficient automation from feature extraction to classification and sorting, improving the efficiency and accuracy of lottery sorting, reducing manual sorting errors, and improving the overall work quality.
[0006] The present invention provides an instant lottery sorting device based on visual recognition and weight sensing, comprising: An appearance acquisition and weight sensing module, configured to acquire the appearance image of each group of instant lottery tickets conveyed by the belt, and at the same time, acquire the weight value of each group of instant lottery tickets; A weight correction and appearance feature auxiliary extraction module, configured to determine the weight detection range based on the appearance image of each group of instant lottery tickets, judge whether the weight value of each group of instant lottery tickets is within the corresponding weight detection range. If so, based on the weight value of each group of instant lottery tickets, extract the lottery type discrimination features from the appearance image of each group of instant lottery tickets, and count the number of lottery tickets in each group of instant lottery tickets based on the appearance image of each group of instant lottery tickets. Otherwise, re-acquire the weight value of the corresponding group of instant lottery tickets until the weight value of the latest acquired corresponding group of instant lottery tickets is within the corresponding weight detection range. Then, based on the weight value of the latest acquired corresponding group of instant lottery tickets, extract the lottery type discrimination features from the appearance image of the corresponding group of instant lottery tickets, and count the number of lottery tickets in each group of instant lottery tickets based on the appearance image of the corresponding group of instant lottery tickets; A feature vector generation and lottery sorting module, configured to generate a type discrimination feature vector for each group of instant lottery tickets based on the lottery type discrimination features, quantity, and weight value of each group of instant lottery tickets, determine the actual type of each group of instant lottery tickets based on the type discrimination feature vector of each group of instant lottery tickets, and perform sorting processing based on the robotic arm.
[0007] Optionally, the appearance acquisition and weight sensing module includes: A belt transmission speed adjustment sub-module, configured to, based on the photoelectric sensors arranged at the front ends of the visual recognition area and the weight sensing area, detect in real time whether the instant lottery tickets enter the visual recognition area and the weight sensing area. If so, reduce the belt transmission speed to the preset transmission speed value; A high-speed image acquisition sub-module, which is used to acquire the appearance images of each group of instant lottery tickets conveyed by the belt based on a camera set above the belt in the visual recognition area; A dynamic weight sensing sub-module, which is used to acquire the weight values of each group of instant lottery tickets conveyed by the belt based on a weight sensor set in the weight sensing area.
[0008] Optionally, a weight correction and appearance feature auxiliary extraction module, including: A weight detection range acquisition sub-module, which is used to determine the weight detection range based on the shape features in the appearance images of each group of instant lottery tickets; A first weight determination sub-module, which is used to regard the weight value of the corresponding group of instant lottery tickets as the actual weight value of the corresponding group of instant lottery tickets when it is determined that the weight value of each group of instant lottery tickets is within the corresponding weight detection range; A second weight determination sub-module, which is used to re-acquire the weight value of the corresponding group of instant lottery tickets when it is determined that the weight value of each group of instant lottery tickets is not within the corresponding weight detection range, until the latest obtained weight value of the corresponding group of instant lottery tickets is within the corresponding weight detection range, and then regard the latest obtained weight value of the corresponding group of instant lottery tickets as the actual weight value of the corresponding group of instant lottery tickets; A type difference feature auxiliary extraction sub-module, which is used to count the number of lottery tickets in the corresponding group of instant lottery tickets based on the actual weight value and appearance image of each group of instant lottery tickets, and extract the lottery type difference features in the appearance image of the corresponding group of instant lottery tickets.
[0009] Optionally, the weight detection range acquisition sub-module includes: A color feature extraction unit, which is used to generate the color histogram and gray-level co-occurrence matrix of the appearance image of each group of instant lottery tickets; A contour feature extraction unit, which is used to extract the lottery contour in the appearance image of each group of instant lottery tickets, determine the length of each side of the lottery contour, and generate a set of adjacent side length ratios of the lottery contour based on the ratio of adjacent side lengths of the lottery contour and the reciprocal of the ratio of adjacent side lengths; A weight detection range upper and lower limit calculation unit, which is used to calculate the upper and lower limit values of the weight detection range of each group of instant lottery tickets based on the color histogram and gray-level co-occurrence matrix of the appearance image of each group of instant lottery tickets and the set of adjacent side length ratios of the lottery contour: A weight detection range determination unit, which is used to determine the weight detection range based on the upper and lower limit values of the weight detection range.
[0010] Optionally, the weight detection range upper and lower limit calculation unit calculates the upper and lower limit values of the weight detection range of each group of instant lottery tickets based on the color histogram and gray-level co-occurrence matrix of the appearance image of each group of instant lottery tickets and the set of adjacent side length ratios of the lottery contour, including: ; ; In the formula, is the upper limit value of the weight detection range of a single instant lottery ticket, is the upper limit mapping function of the weight detection range, is the lower limit value of the weight detection range of a single instant lottery ticket, is the lower limit mapping function of the weight detection range, is the total number of color values in the color histogram of the appearance image of a single instant lottery ticket, is the height of the appearance image of a single instant lottery ticket, is the width of the appearance image of a single instant lottery ticket, is the Dirac function. When holds, , otherwise it is 0, is the color value at position in the color histogram of the appearance image of a single instant lottery ticket, is the set of all color values within the preset color value range, is the number of gray levels in the gray-level co-occurrence matrix of the appearance image of a single instant lottery ticket, is the element in the th row and th column of the gray-level co-occurrence matrix of the appearance image of a single instant lottery ticket, is the total number of elements in the set of contour adjacent side length ratios, is the th element in the set of contour adjacent side length ratios.
[0011] Optionally, the type discrimination feature auxiliary extraction sub-module includes: A lottery ticket quantity statistics unit for statistically determining the quantity of lottery tickets in the corresponding group of instant lottery tickets based on the appearance images of each group of instant lottery tickets; A single-ticket weight statistics unit for determining the weight of a single lottery ticket in the corresponding group of instant lottery tickets based on the actual weight value and the quantity of lottery tickets in the corresponding group of instant lottery tickets; A color discrimination feature extraction unit for matching the corresponding weight range in the preset database based on the weight of a single lottery ticket in each group of instant lottery tickets, and extracting the lottery type color discrimination feature from the appearance image of the corresponding group of instant lottery tickets based on the color feature distribution constraint quantity pre-matched for the corresponding weight range; A texture discrimination feature extraction unit for matching the corresponding weight range in the preset database based on the weight of a single lottery ticket in each group of instant lottery tickets, and extracting the lottery type texture discrimination feature from the appearance image of the corresponding group of instant lottery tickets based on the texture feature distribution constraint quantity pre-matched for the corresponding weight range; Among them, the lottery type distinguishing features include lottery type color distinguishing features and lottery type texture distinguishing features.
[0012] Optionally, the lottery quantity statistical unit includes: An image processing sub-unit for binarizing, filling gaps, and removing noise points from the appearance image of each group of instant lottery tickets to obtain a processed appearance image; A gap segmentation sub-unit for identifying adjacent lottery ticket gaps in the processed appearance image by a projection-based segmentation method, and statistically calculating the number of lottery tickets in the corresponding group of instant lottery tickets based on the adjacent lottery ticket gaps in the processed appearance image.
[0013] Optionally, the feature vector generation and lottery ticket sorting module includes: A distinguishing feature vector generation sub-module for generating a type distinguishing feature vector for each group of instant lottery tickets based on the lottery type distinguishing features, the number of lottery tickets, and the weight value of each group of instant lottery tickets; A lottery type determination sub-module for determining the actual type of each group of instant lottery tickets based on the type distinguishing feature vector of each group of instant lottery tickets; A sorting control sub-module for determining the sorting path of each group of instant lottery tickets based on the actual type of each group of instant lottery tickets, and performing sorting control on each group of instant lottery tickets based on the corresponding sorting path.
[0014] Optionally, the lottery type determination sub-module includes: A feature similarity calculation unit for calculating the similarity between the type distinguishing feature vector of each group of instant lottery tickets and the type distinguishing feature vectors of each preset lottery type; A first type determination unit for, when the maximum similarity exceeds the preset similarity, regarding the preset lottery type corresponding to the maximum similarity as the actual type of the corresponding group of instant lottery tickets; A damage degree evaluation unit for, when the maximum similarity does not exceed the preset similarity, evaluating the damage degree of the appearance image of the corresponding group of instant lottery tickets based on an appearance damage evaluation model to obtain the appearance damage degree of the corresponding group of instant lottery tickets; A second type determination unit for, when the appearance damage degree of the corresponding group of instant lottery tickets does not exceed the preset damage degree threshold, re-extracting the type distinguishing feature vector of the corresponding group of instant lottery tickets until the similarity between the newly obtained type distinguishing feature vector and the type distinguishing feature vectors of at least one preset lottery type exceeds the preset similarity, and then regarding the preset lottery type corresponding to the corresponding maximum similarity as the actual type of the corresponding group of instant lottery tickets; A damage prompt unit for, when the appearance damage degree of the corresponding group of instant lottery tickets exceeds the preset damage degree threshold, issuing an appearance damage prompt.
[0015] Optionally, a method for the instant lottery sorting device based on visual recognition and weight sensing includes: S1: Obtain the appearance images of each group of instant lotteries conveyed by the belt. Meanwhile, obtain the weight value of each group of instant lotteries. S2: Determine the weight detection range based on the appearance images of each group of instant lotteries, and judge whether the weight value of each group of instant lotteries is within the corresponding weight detection range. If so, extract the lottery type discrimination features from the appearance images of each group of instant lotteries based on the weight value of each group of instant lotteries, and count the number of lotteries in each group of instant lotteries based on the appearance images of each group of instant lotteries. Otherwise, re-obtain the weight value of the corresponding group of instant lotteries until the weight value of the latest obtained corresponding group of instant lotteries is within the corresponding weight detection range. Then, extract the lottery type discrimination features from the appearance images of the corresponding group of instant lotteries based on the latest obtained weight value of the corresponding group of instant lotteries, and count the number of lotteries in each group of instant lotteries based on the appearance images of the corresponding group of instant lotteries. S3: Generate a type discrimination feature vector for each group of instant lotteries based on the lottery type discrimination features, the number of lotteries, and the weight value of each group of instant lotteries. Determine the actual type of each group of instant lotteries based on the type discrimination feature vector of each group of instant lotteries and perform sorting processing based on the robotic arm.
[0016] The beneficial effects of the present invention compared with the prior art are as follows: In the device, the appearance acquisition and weight sensing module synchronously obtains the appearance images and weight values of each group of instant lotteries conveyed by the belt, providing multi-dimensional data for sorting; the weight correction and appearance feature assisted extraction module determines the weight detection range based on the appearance images, judges whether the weight value is within this range, and if not, re-obtains it until it meets the requirements. Then, based on the weight value, it extracts the lottery type discrimination features from the appearance images and counts the number of lotteries, ensuring accurate data and mining lottery feature information; the feature vector generation and lottery sorting module integrates the lottery type discrimination features, the number, and the weight value to generate a type discrimination feature vector, determines the actual type of the lottery based on this, and sorts it through the robotic arm, realizing efficient automation from feature extraction to classification and sorting, improving the efficiency and accuracy of lottery sorting, reducing manual sorting errors, and improving the overall work quality.
[0017] Other features and advantages of the present invention will be described in the subsequent specification, and, in part, will become obvious from the specification or will be understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the structures specifically pointed out in this application document.
[0018] The technical solutions of the present invention will be further described in detail below through the accompanying drawings and embodiments. Description of the Drawings
[0019] The accompanying drawings are used to provide a further understanding of the present invention and form a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the accompanying drawings: Figure 1 It is a schematic diagram of the instant lottery sorting device based on visual recognition and weight sensing in the embodiment of the present invention; Figure 2 It is a schematic diagram of the internal functional sub - modules of the appearance acquisition and weight sensing module in the embodiment of the present invention. Detailed implementation manners
[0020] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention and are not used to limit the present invention.
[0021] Reference Figure 1 , the present invention provides an implementation manner of an instant lottery sorting device based on visual recognition and weight sensing, including: An appearance acquisition and weight sensing module, which is used to acquire the appearance images of each group of instant lotteries conveyed by the belt. At the same time, it acquires the weight value of each group of instant lotteries; A weight correction and appearance feature auxiliary extraction module, which is used to determine the weight detection range based on the appearance images of each group of instant lotteries, and judge whether the weight value of each group of instant lotteries is within the corresponding weight detection range. If so, it extracts the lottery type discrimination features in the appearance images of each group of instant lotteries based on the weight value of each group of instant lotteries, and counts the number of lotteries in each group of instant lotteries based on the appearance images of each group of instant lotteries. Otherwise, it re - acquires the weight value of the corresponding group of instant lotteries until the weight value of the latest - acquired corresponding group of instant lotteries is within the corresponding weight detection range. Then, it extracts the lottery type discrimination features in the appearance images of the corresponding group of instant lotteries based on the latest - obtained weight value of the corresponding group of instant lotteries, and counts the number of lotteries in each group of instant lotteries based on the appearance images of the corresponding group of instant lotteries; A feature vector generation and lottery sorting module, which is used to generate the type discrimination feature vectors of each group of instant lotteries based on the lottery type discrimination features, the number of lotteries, and the weight value of each group of instant lotteries, determine the actual type of each group of instant lotteries based on the type discrimination feature vectors of each group of instant lotteries, and perform sorting processing based on the robotic arm.
[0022] In this embodiment: A single group of instant lotteries: refers to a batch of instant lotteries that are processed and analyzed as a whole during the belt conveying process. For example, a certain number of instant lotteries that enter the detection link through the belt each time are regarded as a single group of instant lotteries, so that the system can perform operations such as appearance image acquisition, weight measurement, and subsequent feature extraction and sorting on them.
[0023] Appearance image of a single - group instant lottery: An image obtained by a camera set above the belt in the visual recognition area, which reflects the overall appearance information of a single - group instant lottery. This image contains appearance features such as the color, pattern, and text of the lottery in this group, providing a visual data basis for operations such as determining the weight detection range, extracting distinguishing features of lottery types, and counting the number of lotteries. For example, information such as the color distribution and contour shape of the lottery in the image can be used for subsequent analysis.
[0024] Weight value of a single - group instant lottery: Measured by a weight sensor set in the weight sensing area, representing the mass value of a single - group instant lottery. Together with the appearance image, this weight value provides multi - dimensional data support for judging the lottery type. For example, due to factors such as paper material and printing process, different types of instant lotteries may have different weight ranges, and the weight value is one of the important bases for determining the lottery type.
[0025] Weight detection range: A weight interval determined based on the shape features in the appearance image of a single - group instant lottery. Specifically, by generating the color histogram and gray - level co - occurrence matrix of the appearance image, extracting the lottery contour to determine the set of adjacent side - length ratios, and then calculating the upper and lower limits of the weight detection range to determine this range. If the weight value of a single - group instant lottery is within this range, it is considered that this weight value is valid, and subsequent feature extraction and other operations can be carried out based on this weight value; if not, the weight value needs to be obtained again. For example, by analyzing the appearance image features, it is calculated that the weight detection range of a certain single - group instant lottery is [5 grams, 7 grams].
[0026] Distinguishing features of lottery types: Features used to distinguish different types of instant lotteries, including color - distinguishing features and texture - distinguishing features of lottery types. Based on the actual weight value of a single - group instant lottery, match the corresponding weight interval in the preset database, and extract the color and texture feature distribution constraints pre - matched in this interval from the appearance image. For example, a certain lottery type may have specific color combinations and texture patterns, and these features can be used as the basis for distinguishing from other types of lotteries.
[0027] Number of lotteries in each group of instant lotteries: By performing image processing on the appearance image of each group of instant lotteries (such as binary processing, gap filling, and noise point removal), and then using a projection - based segmentation method to identify the gaps between adjacent lotteries, the number of lottery tickets contained in each group of instant lotteries is counted. This quantity information, together with the distinguishing features of lottery types, weight values, etc., is used to generate a distinguishing feature vector to determine the actual type of the lottery. For example, after image processing and gap recognition, it is counted that the number of lotteries in a certain group of instant lotteries is 10.
[0028] Generate a type discrimination feature vector for each group of instant lottery tickets based on the lottery type discrimination features, the number of lottery tickets, and the weight value of each group of instant lottery tickets: Integrate the lottery type discrimination features (such as color, texture, and other feature information) extracted from each group of instant lottery tickets, the statistically obtained number of lottery tickets, and the measured weight value to generate a vector that can comprehensively reflect the characteristics of this group of lottery tickets. This vector serves as the key basis for determining the actual type of the lottery tickets. By calculating the similarity with the type discrimination feature vectors of each preset lottery type, the actual type of this group of lottery tickets can be judged. For example, combine the color and texture feature values of a certain group of lottery tickets, the number of lottery tickets being 10, the weight value being 6 grams, etc. into a feature vector [0.8, 0.6, 10, 6] according to specific rules (this is just an example).
[0029] Robotic arm: In this embodiment, it is a device used to perform the sorting operation of instant lottery tickets. Based on the determined actual type of each group of instant lottery tickets, the robotic arm grabs, transports, and performs other operations on the lottery tickets according to the sorting path determined by the sorting control sub-module, sorts the lottery tickets to the corresponding positions, and realizes automated sorting processing. For example, in an actual application scenario, the robotic arm can accurately place different types of lottery tickets into different collection boxes respectively.
[0030] The actual type of instant lottery tickets: It is determined by calculating the similarity between the type discrimination feature vector of each group of instant lottery tickets and the type discrimination feature vectors of each preset lottery type. If the maximum similarity exceeds the preset similarity, the preset lottery type corresponding to the maximum similarity is regarded as the actual type of this group of instant lottery tickets; if the maximum similarity does not exceed the preset similarity, it is necessary to further evaluate the degree of damage to the appearance of the lottery tickets, and re-extract the feature vector according to different situations to determine the actual type or issue a damage prompt. For example, after similarity calculation, the similarity between a certain group of lottery tickets and the feature vector of the preset "sports event theme" lottery type is the highest and exceeds the preset value, then the actual type of this group of instant lottery tickets is the "sports event theme" lottery.
[0031] Based on the robotic arm for sorting processing: After determining the actual type of each group of instant lottery tickets, the sorting control sub-module determines the corresponding sorting path for each group of lottery tickets, and the robotic arm operates on the lottery tickets according to this path. The robotic arm accurately places instant lottery tickets of different actual types to the corresponding positions through actions such as grabbing and moving, completes the sorting process, and realizes the automated classification of instant lottery tickets. For example, the robotic arm transports a group of lottery tickets with the actual type of first prize lottery tickets to a dedicated collection area for first prize lottery tickets.
[0032] In an alternative embodiment, the appearance acquisition and weight sensing module, refer to Figure 2 , includes: The belt transmission speed adjustment sub-module is used to detect in real time whether the instant lottery ticket enters the visual recognition area and the weight sensing area based on the photoelectric sensors set at the front ends of the visual recognition area and the weight sensing area. If so, it reduces the belt transmission speed to a preset transmission speed value. The high-speed image acquisition sub-module is used to acquire the appearance images of each group of instant lottery tickets conveyed by the belt based on the cameras set above the belt in the visual recognition area. The dynamic weight sensing sub-module is used to acquire the weight values of each group of instant lottery tickets conveyed by the belt based on the weight sensors set in the weight sensing area.
[0033] In this embodiment: Visual recognition area: This is a specific area during the belt conveying process. A camera is set above this area to acquire the appearance images of each group of instant lottery tickets. When the instant lottery tickets enter this area through the belt conveying, the camera can capture the appearance of the lottery tickets and obtain image data containing information such as colors, patterns, and words, providing visual basic data for subsequent operations such as determining the weight detection range, extracting the distinguishing features of lottery ticket types, and counting the quantity based on the appearance images. For example, when a group of instant lottery tickets enters the visual recognition area, the camera quickly captures their appearance images for further analysis by the system.
[0034] Weight sensing area: It is also a specific area on the belt conveying path, and weight sensors are set in this area. When each group of instant lottery tickets is conveyed to this area by the belt, the weight sensors will measure the weight value of this group of lottery tickets. This weight value, combined with the appearance image information obtained from the visual recognition area, provides important data support for judging the lottery ticket type, determining its features, etc. For example, when a certain group of instant lottery tickets arrives at the weight sensing area, the weight sensors immediately measure their weight value and transmit it to the system.
[0035] The photoelectric sensors set at the front ends of the visual recognition area and the weight sensing area: These photoelectric sensors are used to detect in real time whether the instant lottery tickets enter the visual recognition area and the weight sensing area. When instant lottery tickets approach these two areas through the belt, the photoelectric sensors can sense them. Once the lottery tickets are detected approaching, corresponding actions will be triggered, such as transmitting signals to the belt transmission speed adjustment sub-module to reduce the belt transmission speed to a preset transmission speed value, so that the camera can obtain clearer appearance images of the lottery tickets and the weight sensors can measure the weight values of the lottery tickets more accurately. For example, when the photoelectric sensors detect that instant lottery tickets are approaching the visual recognition area, they quickly send signals to reduce the belt speed to ensure the quality of image acquisition.
[0036] Preset transmission speed value: It is the preset belt transmission speed. When the photoelectric sensors set at the front ends of the visual recognition area and the weight sensing area detect that the instant lottery is about to enter these two areas, the belt transmission speed adjustment sub-module will reduce the belt transmission speed to this preset transmission speed value. The setting of this speed value is to ensure that the camera can obtain a clear appearance image of the lottery in the visual recognition area, and the weight sensor can accurately measure the weight value of the lottery in the weight sensing area. For example, the preset transmission speed value may be set to 5 centimeters per second. Such a speed can not only ensure the detection efficiency but also ensure the accuracy of the acquired data.
[0037] Weight sensor set in the weight sensing area: This sensor is specifically used to measure the weight value of each group of instant lotteries conveyed into the weight sensing area by the belt. It is a key device for obtaining lottery weight data, and the measured weight value is one of the important bases for the entire lottery sorting system to judge the lottery type and determine relevant features. For example, the weight sensor adopts high-precision pressure sensing technology, which can accurately measure the weight of each group of instant lotteries and feedback the weight value to the system in real time for subsequent processing.
[0038] In an alternative embodiment, the weight correction and appearance feature auxiliary extraction module includes: Weight detection range acquisition sub-module, which is used to determine the weight detection range based on the shape features in the appearance image of each group of instant lotteries; First weight determination sub-module, which is used to regard the weight value of the corresponding group of instant lotteries as the actual weight value of the corresponding group of instant lotteries when it is determined that the weight value of each group of instant lotteries is within the corresponding weight detection range; Second weight determination sub-module, which is used to re-acquire the weight value of the corresponding group of instant lotteries when it is determined that the weight value of each group of instant lotteries is not within the corresponding weight detection range, until the latest obtained weight value of the corresponding group of instant lotteries is within the corresponding weight detection range, and then regard the latest obtained weight value of the corresponding group of instant lotteries as the actual weight value of the corresponding group of instant lotteries; Type difference feature auxiliary extraction sub-module, which is used to count the number of lotteries in the corresponding group of instant lotteries based on the actual weight value and appearance image of each group of instant lotteries, and extract the lottery type difference features from the appearance image of the corresponding group of instant lotteries.
[0039] In this embodiment: The shape features in the appearance image refer to the information related to the lottery shape extracted from the appearance image of a single group of instant lotteries. These features play a key role in determining the weight detection range. The specific extraction methods include: Contour features: Through specialized image processing means, the contour of the lottery ticket is accurately extracted from the appearance image, and then the length of each side of the lottery ticket contour is determined. On this basis, the ratio of adjacent side lengths of the lottery ticket contour and its reciprocal are calculated to generate a set of contour adjacent side length ratios. For example, if the lottery ticket is rectangular, the ratio of its length to width and the ratio of width to length constitute the elements in this set. These ratio relationships can reflect the characteristics of the lottery ticket shape. Different types of lottery tickets may have different contour adjacent side length ratios, thus assisting in judging the type of lottery ticket and its corresponding reasonable weight range.
[0040] Derivation of color and texture related shape features: Generate the color histogram and gray-level co-occurrence matrix of the appearance image. The color histogram can show the distribution of various colors in the image, and the gray-level co-occurrence matrix can reflect the spatial distribution characteristics of the gray levels in the image, indirectly reflecting the information related to the shape. For example, the specific color distribution of a certain lottery ticket may be related to its shape design, or the texture shows a certain pattern within a specific shape area. By analyzing these color and texture feature data and combining with the contour features, the shape features of the lottery ticket are comprehensively determined, and finally used to calculate the upper and lower limits of the weight detection range, and then determine the weight detection range.
[0041] Re-obtain the weight value of the corresponding group of instant lottery tickets: When the weight correction and appearance feature auxiliary extraction module determines that the weight value of a certain group of instant lottery tickets is not within the weight detection range determined based on its appearance image, the operation of re-obtaining the weight value of this group of instant lottery tickets will be executed. This is because the weight value outside the range may be caused by measurement errors, lottery anomalies, etc., and cannot be used as valid data for subsequent lottery type discrimination feature extraction and lottery quantity statistics based on the weight value. For example, due to external factors such as belt vibration interfering, the weight value measured for the first time may be inaccurate, so it is necessary to re-obtain it. The weight sensor set in the weight sensing area measures the weight of this group of lottery tickets again until the latest obtained weight value falls within the corresponding weight detection range, and then it is regarded as the actual weight value of the corresponding group of instant lottery tickets, and subsequent feature extraction and quantity statistics are carried out based on this to ensure the data accuracy and reliability of the entire lottery sorting process.
[0042] In an alternative embodiment, the weight detection range acquisition sub-module includes: A color feature extraction unit for generating the color histogram and gray-level co-occurrence matrix of the appearance image of each group of instant lottery tickets; A contour feature extraction unit for extracting the lottery ticket contour from the appearance image of each group of instant lottery tickets, determining the length of each side of the lottery ticket contour, and generating a set of contour adjacent side length ratios of each group of instant lottery tickets based on the ratio of adjacent side lengths of the lottery ticket contour and the reciprocal of the ratio of adjacent side lengths; A weight detection range upper and lower limit calculation unit, which is used to calculate the upper and lower limit values of the weight detection range for each group of instant lottery tickets based on the color histogram, gray-level co-occurrence matrix of the appearance image of each group of instant lottery tickets, and the set of contour adjacent side length ratios: A weight detection range determination unit, which is used to determine the weight detection range based on the upper and lower limit values of the weight detection range.
[0043] In this embodiment, a color histogram and a gray-level co-occurrence matrix of the appearance image of each group of instant lottery tickets are generated: Color histogram: It is a statistical representation of the color distribution of an image. By counting the frequencies of different color values appearing in the appearance image of each group of instant lottery tickets, a color histogram is generated. For example, assuming the image color value range is 0 - 255, the color histogram will record the number of times each color value appears in the image. This helps analyze the proportion of various colors in the image. Different types of lottery tickets may have unique color distribution patterns, providing color feature information for subsequent determination of the weight detection range.
[0044] Gray-level co-occurrence matrix: It is used to describe the spatial correlation between pixels of different gray levels in an image. After the appearance image of each group of instant lottery tickets is converted into a gray-scale image, the gray-level co-occurrence matrix is calculated. It takes into account the distance and direction information between pixels and can reflect the texture features of the image. For example, closely arranged pixels of the same gray level will show a specific numerical distribution in the matrix, and different textured lottery ticket areas will be differently reflected in the gray-level co-occurrence matrix, which is important for determining the weight detection range based on image features.
[0045] Using image processing algorithms, such as edge detection algorithms (such as the Canny algorithm, etc.), to process the appearance image of each group of instant lottery tickets. These algorithms determine the edges of objects by identifying the sudden changes in the pixel gray values in the image, thereby outlining the contours of the lottery tickets. For example, in the appearance image, there is an obvious gray difference between the lottery ticket and the background, and the edge detection algorithm can accurately extract the contour of the lottery ticket, preparing for subsequent determination of side lengths and shape features.
[0046] After extracting the lottery ticket contour, the length of each side is determined through geometric analysis of the contour. This may involve operations such as coordinate calculation and distance measurement. For example, for a digitized contour image, the Euclidean distance between adjacent contour points is calculated to determine the side length. Accurately determining each side length is to further analyze the shape features of the lottery ticket. Different types of lottery tickets may have differences in shape dimensions, and this side length information is an important basis for generating the set of contour adjacent side length ratios and determining the weight detection range.
[0047] Calculate the ratio of the lengths of two adjacent sides in the lottery outline to obtain the ratio of adjacent side lengths. At the same time, calculate its reciprocal, and form a set with these ratios and reciprocals. For example, if the lengths of two adjacent sides of a lottery outline are a and b respectively, the ratios of adjacent side lengths are a / b and b / a, and they are included in the set of ratios of adjacent side lengths of the outline. This set reflects the proportional characteristics of the lottery shape. Different types of lotteries may have different shape ratios. Through this set, the lottery shape can be described more precisely, providing key information about the shape for determining the weight detection range.
[0048] In this embodiment, the upper and lower limit values of the weight detection range for each group of instant lotteries define a reasonable range for the weight of this group of lotteries, and are used to judge whether the actually measured weight value is valid.
[0049] In this embodiment, based on the upper and lower limit values of the weight detection range, the weight detection range is determined. From the calculated upper and lower limit values of the weight detection range for each group of instant lotteries, a weight interval is determined, that is, the weight detection range is . If the actually measured weight value of a certain group of instant lotteries is within this range, it means that this weight value is relatively reasonable, and subsequent operations such as extracting the distinguishing features of the lottery type and counting the number of lotteries can be based on this weight value; if it is not within this range, the weight value needs to be obtained again to ensure the accuracy of the data and the reliability of subsequent processing.
[0050] In an alternative embodiment, the upper and lower limit calculation unit of the weight detection range calculates the upper and lower limit values of the weight detection range for each group of instant lotteries based on the color histogram and gray-level co-occurrence matrix of the appearance image of each group of instant lotteries and the set of ratios of adjacent side lengths of the outline, including: ; ; In the formula, is the upper limit value of the weight detection range for a single group of instant lotteries, is the upper limit mapping function of the weight detection range, is the lower limit value of the weight detection range for a single group of instant lotteries, is the lower limit mapping function of the weight detection range, is the total number of color values in the color histogram of the appearance image of a single group of instant lotteries, is the height of the appearance image of a single group of instant lotteries, is the width of the appearance image of a single group of instant lotteries, is the Dirac function. When , , otherwise it is 0, is the color value at position in the color histogram of the appearance image of a single group of instant lotteries, is the set of all color values within a preset color value range. is the number of gray levels of the gray-level co-occurrence matrix of the appearance image of a single-group instant lottery ticket. For the gray-level co-occurrence matrix of the appearance image of a single-group instant lottery ticket, the row and the column element. is the total number of elements in the set of contour adjacent side length ratios. For the set of contour adjacent side length ratios, the th element.
[0051] In this embodiment: The upper limit mapping function of the weight detection range: is a function used to calculate the upper limit value of the weight detection range of a single-group instant lottery ticket, denoted by . It comprehensively considers multiple characteristic parameters of the appearance image of a single-group instant lottery ticket. Through a specific mathematical mapping relationship, these parameters are integrated and calculated to obtain the upper limit value of the weight detection range, so as to define the maximum value range that the weight of this group of lottery tickets may reach. For example, ; If the color of the appearance image of a certain group of lottery tickets is rich, and the contour side length ratios show a certain specific relationship, etc., these factors jointly affect and determine a corresponding weight upper limit value through the upper limit mapping function of the weight detection range.
[0052] The lower limit mapping function of the weight detection range: This function is denoted as , and is used to calculate the lower limit value of the weight detection range of a single-group instant lottery ticket. Similarly, it depends on many characteristic parameters of the appearance image of a single-group instant lottery ticket, and according to specific mathematical rules, these parameters are comprehensively calculated to obtain the lower limit value of the weight detection range. This lower limit value sets the minimum value range that the weight of this group of lottery tickets should reach. For example, ; For a lottery ticket image with specific color distribution, texture characteristics, and shape ratios, the lower limit of its weight is calculated through the lower limit mapping function of the weight detection range. If the actually measured weight of the lottery ticket is lower than this lower limit, it may not meet the normal weight range of this group of lottery tickets; Among them, , , and , , are the respective weights of the color characteristics, texture characteristics, and shape characteristics when calculating the upper limit value and the lower limit value of the weight detection range.
[0053] In an alternative embodiment, the type discrimination feature assisted extraction sub-module includes: A lottery number statistics unit for statistically calculating the number of lottery tickets in each corresponding group of instant lottery tickets based on the appearance images of each group of instant lottery tickets; A single-ticket weight statistics unit for determining the weight of a single lottery ticket in each corresponding group of instant lottery tickets based on the actual weight value and the number of lottery tickets in the corresponding group of instant lottery tickets; A color discrimination feature extraction unit for matching a corresponding weight range in a preset database based on the weight of a single lottery ticket in each group of instant lottery tickets, and extracting lottery type color discrimination features from the appearance images of the corresponding group of instant lottery tickets based on the color feature distribution constraint amount pre-matched for the corresponding weight range; A texture discrimination feature extraction unit for matching a corresponding weight range in a preset database based on the weight of a single lottery ticket in each group of instant lottery tickets, and extracting lottery type texture discrimination features from the appearance images of the corresponding group of instant lottery tickets based on the texture feature distribution constraint amount pre-matched for the corresponding weight range; Among them, the lottery type discrimination features include lottery type color discrimination features and lottery type texture discrimination features.
[0054] In this embodiment: determining the weight of a single lottery ticket in each corresponding group of instant lottery tickets based on the actual weight value and the number of lottery tickets in the corresponding group of instant lottery tickets means dividing the actual weight value of the corresponding group of instant lottery tickets by the number of lottery tickets in this group. For example, if the actual weight value of a group of lottery tickets is 50 grams and the number is 10, then the weight of a single lottery ticket is 50÷10 = 5 grams. Doing so can obtain the average weight of each lottery ticket, providing basic data for subsequent feature extraction based on the weight of a single lottery ticket.
[0055] The preset database is a database that has been established in advance and stores various relevant information. In this embodiment, it contains data such as the corresponding relationships between different weight ranges and color feature distribution constraint amounts, texture feature distribution constraint amounts, etc. These data are obtained through the analysis and summary of a large number of instant lottery ticket samples of different types, providing a reference basis for the type recognition of instant lottery tickets.
[0056] Matching a corresponding weight range in the preset database based on the weight of a single lottery ticket in each group of instant lottery tickets means comparing the calculated weight of a single lottery ticket with the existing weight ranges in the preset database. For example, if the weight of a single lottery ticket is 5 grams and there is a weight range of [4 - 6 grams] in the preset database, then it can be determined that the weight of this single lottery ticket matches this range. Through this matching, corresponding color and texture and other feature information can be found for further determining the lottery type.
[0057] The color feature distribution constraint quantity pre-matched with the weight range is a constraint parameter related to color features preset for each weight range in the preset database. These constraint quantities describe the possible feature distribution of lottery tickets in the color aspect within that weight range. For example, in a certain weight range, it may be stipulated that the proportion of the red area should be between 30% - 50%, and the proportion of the blue area should be between 20% - 40%, etc., which is used as the basis for judging whether the color features of the lottery ticket conform to the corresponding lottery ticket type in that weight range.
[0058] Based on the color feature distribution constraint quantity pre-matched with the corresponding weight range, extracting the lottery type color discrimination feature from the appearance image of the corresponding group of instant lottery tickets means extracting the color features that can reflect the difference in lottery ticket types from the appearance image of this group of lottery tickets according to the color feature distribution constraint quantity matched with the weight range in the preset database. For example, based on the color proportion constraint corresponding to a certain weight range mentioned above, analyze the distribution of various colors in the image, and extract color features such as the shape, position, and transition between colors of specific color blocks. These features can be used to distinguish different types of lottery tickets.
[0059] Determining the texture feature extraction constraint quantity based on the weight of a single lottery ticket in each group of instant lottery tickets and matching the corresponding weight range in the preset database. Similarly, first determine a constraint quantity for texture feature extraction according to the weight of a single lottery ticket, and then find the weight range in the preset database that matches it. For example, determine a constraint quantity for texture complexity according to the weight of a single lottery ticket, and then match it with the weight range in the preset database to find the corresponding range in order to obtain the texture feature information corresponding to that range.
[0060] Based on the texture feature distribution constraint quantity pre-matched with the corresponding weight range, extracting the lottery type texture discrimination feature from the appearance image of the corresponding group of instant lottery tickets means extracting the texture features that can reflect the difference in lottery ticket types from the appearance image of this group of lottery tickets according to the texture feature distribution constraint quantity corresponding to that weight range in the preset database. For example, the texture feature distribution constraint quantity corresponding to a certain weight range stipulates the density and direction of texture lines, etc. According to these constraints, extract the corresponding texture features from the image, such as the thickness of the texture and the regularity of the texture. These texture features help to accurately distinguish different types of instant lottery tickets.
[0061] In an alternative embodiment, the lottery ticket quantity statistics unit includes: An image processing sub-unit for performing binarization processing, gap filling, and noise point removal on the appearance image of each group of instant lottery tickets to obtain a processed appearance image; A gap segmentation subunit is used to identify adjacent lottery gaps in the processed appearance image through a projection-based segmentation method, and count the number of lottery tickets in the corresponding group of instant lottery tickets based on the adjacent lottery gaps in the processed appearance image.
[0062] In this embodiment: The appearance images of each group of instant lottery tickets are binarized, gap-filled, and noise points removed to obtain a processed appearance image. This series of operations aims to optimize the image quality for more accurate counting of the number of lottery tickets.
[0063] Binarization is to convert a color or grayscale appearance image into an image with only two colors (usually black and white). By setting a threshold, pixels with values greater than the threshold in the image are set to one color, and those less than the threshold are set to another color. For example, if the threshold is set to 128, pixels with values greater than 128 become white, and those less than or equal to 128 become black. This can highlight the difference between the lottery tickets and the background, simplify the image information, and facilitate subsequent processing.
[0064] Gap filling is because in the binarized image, there may be some small gaps between or within the lottery tickets, which may affect the judgment of the overall shape and number of lottery tickets. Through a specific algorithm, the information of surrounding pixels is used to fill these gaps to make the shape of the lottery tickets more complete. For example, using the closing operation in morphological operations, first dilating and then eroding, can effectively fill small holes and gaps.
[0065] Noise point removal is because the image may be affected by various interferences during acquisition, generating some isolated pixel points that are irrelevant to the main body of the lottery tickets, namely noise points. Using a filtering algorithm, such as median filtering, replacing the current pixel value with the median value of the pixels in the neighborhood, can effectively remove these noise points and avoid interference with subsequent analysis. After this series of processing, the obtained processed appearance image is clearer and more accurate, providing a better data basis for counting the number of lottery tickets.
[0066] Identifying adjacent lottery gaps in the processed appearance image through a projection-based segmentation method and counting the number of lottery tickets in the corresponding group of instant lottery tickets based on the adjacent lottery gaps in the processed appearance image is the key step in counting the number of lottery tickets.
[0067] The projection-based segmentation method is to project the processed appearance image in the horizontal or vertical direction to obtain a projection histogram. Since there are gaps between lottery tickets, it will be manifested as a low valley area in the projection histogram. For example, in the horizontal projection histogram, the position corresponding to the lottery ticket area has a higher accumulated pixel value, while the pixel value at the lottery ticket gap is lower, forming a low valley. By analyzing the positions and numbers of these low valleys, adjacent lottery gaps can be identified.
[0068] After identifying adjacent lottery gaps, the number of instant lottery tickets in the corresponding group can be counted based on the number of gaps. Suppose 9 adjacent lottery gaps are identified, then the number of instant lottery tickets in this group is 10, because there is one gap between two lottery tickets, and the number of lottery tickets is 1 more than the number of gaps. This method utilizes the characteristics of lottery arrangement and can relatively accurately count the number of instant lottery tickets in each group, providing important information for subsequent determination of lottery types.
[0069] In an alternative embodiment, the feature vector generation and lottery sorting module includes: A distinguishing feature vector generation sub-module, which is used to generate a type distinguishing feature vector for each group of instant lottery tickets based on the lottery type distinguishing features, the number of lottery tickets, and the weight value of each group of instant lottery tickets; A lottery type determination sub-module, which is used to determine the actual type of each group of instant lottery tickets based on the type distinguishing feature vector of each group of instant lottery tickets; A sorting control sub-module, which is used to determine the sorting path of each group of instant lottery tickets based on the actual type of each group of instant lottery tickets, and perform sorting control on each group of instant lottery tickets based on the corresponding sorting path.
[0070] In this embodiment: Generate a type distinguishing feature vector for each group of instant lottery tickets based on the lottery type distinguishing features, the number of lottery tickets, and the weight value of each group of instant lottery tickets: Integrate the lottery type distinguishing features (including color distinguishing features and texture distinguishing features, etc.) possessed by each group of instant lottery tickets, the statistically obtained number of lottery tickets, and the measured weight value together to construct a vector that can comprehensively represent the characteristics of this group of lottery tickets. This vector can be understood as a digital "identity identifier" of this group of lottery tickets, which is convenient for subsequent comparison with the feature vectors of preset lottery types to determine its actual type. For example, suppose the lottery type distinguishing features are quantized to obtain a set of numerical values (such as the color feature is represented by [0.2, 0.3, 0.1], and the texture feature is represented by [0.4, 0.2, 0.3]), the number of lottery tickets is 20, and the weight value is 100 grams. According to a specific combination rule (such as arranging the color feature numerical values first, followed by the texture feature numerical values, then the number of lottery tickets, and finally the weight value), the generated type distinguishing feature vector may be [0.2, 0.3, 0.1, 0.4, 0.2, 0.3, 20, 100]. Different groups of lottery tickets will generate different type distinguishing feature vectors due to their different types, quantities, and weights. In this way, multiple feature information of lottery tickets is unified into one vector, which is convenient for the system to perform fast and accurate analysis and judgment.
[0071] Determine the sorting path of each group of instant lottery tickets based on the actual type of each group of instant lottery tickets, and perform sorting control on each group of instant lottery tickets based on the corresponding sorting path: After the actual type of each instant lottery ticket is determined by comparing the type-differentiating feature vectors, the system will determine the corresponding sorting path for each group of lottery tickets according to the pre-set rules. This rule may be formulated based on factors such as the storage locations and sales channels of different lottery ticket types. For example, for the first prize lottery tickets, their sorting path may point to a dedicated first prize lottery ticket collection box; for lottery tickets with a specific theme, their sorting path may lead to the corresponding theme lottery ticket storage area. After determining the sorting path, the sorting control of each group of instant lottery tickets is based on this path. This is usually executed by the sorting control sub-module, which sends instructions to execution devices such as robotic arms, commanding the robotic arms to accurately grasp and transport each group of instant lottery tickets to the corresponding positions according to the determined sorting path, thus completing the sorting process. For example, after receiving the instruction, the robotic arm grabs a group of lottery tickets determined to be the second prize from the conveyor belt, moves along the set path, and places them in the second prize lottery ticket collection area, thereby realizing the automatic classification and sorting of instant lottery tickets. In addition, the gripping strength or gripping force of the corresponding robotic arm can be controlled according to the appearance damage value obtained as described above.
[0072] In an alternative embodiment, the lottery ticket type determination sub-module includes: A feature similarity calculation unit for calculating the similarity between the type-differentiating feature vector of each group of instant lottery tickets and the type-differentiating feature vectors of each preset lottery ticket type; A first type determination unit for, when the maximum similarity exceeds the preset similarity, regarding the preset lottery ticket type corresponding to the maximum similarity as the actual type of the corresponding group of instant lottery tickets; A damage degree evaluation unit for, when the maximum similarity does not exceed the preset similarity, evaluating the appearance damage degree of the appearance image of the corresponding group of instant lottery tickets based on the appearance damage evaluation model to obtain the appearance damage degree of the corresponding group of instant lottery tickets; A second type determination unit for, when the appearance damage degree of the corresponding group of instant lottery tickets does not exceed the preset damage degree threshold, re-extracting the type-differentiating feature vector of the corresponding group of instant lottery tickets until the similarity between the newly obtained type-differentiating feature vector and the type-differentiating feature vectors of at least one preset lottery ticket type exceeds the preset similarity, and then regarding the preset lottery ticket type corresponding to the corresponding maximum similarity as the actual type of the corresponding group of instant lottery tickets; A damage prompt unit for, when the appearance damage degree of the corresponding group of instant lottery tickets exceeds the preset damage degree threshold, issuing an appearance damage prompt.
[0073] In this embodiment: Calculate the similarity between the type-differentiating feature vector of each group of instant lottery tickets and the type-differentiating feature vectors of each preset lottery ticket type: The type discrimination feature vectors generated from the lottery type discrimination features, the number of lottery tickets, and the weight values of each group of instant lottery tickets are compared with the type discrimination feature vectors corresponding to various preset lottery types using a specific similarity calculation method. For example, the cosine similarity algorithm can be used. This algorithm measures the similarity between two vectors by calculating the cosine value of the angle between them. The closer the cosine value is to 1, the more similar the two vectors are. Through this calculation, the similarity degree values between each group of instant lottery tickets and various preset lottery types can be obtained, and based on this, it can be judged which preset type the group of lottery tickets is most likely to belong to. For example, if the similarity calculation result between the type discrimination feature vector of a group of instant lottery tickets and the type discrimination feature vector of the preset "sports theme" lottery type is 0.8, and the similarity with the type discrimination feature vector of the "scenery theme" lottery type is 0.4, it indicates that this group of lottery tickets is more similar to the "sports theme" lottery type.
[0074] The preset similarity is a preset standard value used to determine whether the similarity between the type discrimination feature vector of each group of instant lottery tickets and the type discrimination feature vector of the preset lottery type is high enough to determine the actual type of this group of lottery tickets. If the calculated similarity exceeds the preset similarity, it is considered that this group of instant lottery tickets matches the corresponding preset lottery type, and this preset lottery type can be regarded as the actual type of this group of lottery tickets. For example, the preset similarity is set to 0.7. When the similarity calculation result between a group of instant lottery tickets and a certain preset lottery type is 0.75, which is greater than the preset similarity, then it is determined that the actual type of this group of lottery tickets is the corresponding preset lottery type. The setting of the preset similarity needs to consider various factors, such as the degree of difference between lottery types and the accuracy requirements of actual sorting, to balance the accuracy and efficiency of sorting.
[0075] The appearance damage assessment model is a specially constructed model for assessing the appearance damage of instant lottery tickets. It may be implemented based on image processing technology, machine learning algorithms, etc. The model analyzes the appearance images of lottery tickets, identifies the damage features in the images, such as scratches, tears, stains, etc., and conducts quantitative assessment based on these features. For example, a deep learning model is used to train the appearance images of lottery tickets so that it can learn the image feature differences between normal lottery tickets and damaged lottery tickets. When a group of appearance images of instant lottery tickets is input, the model can analyze whether there are abnormal areas in the images and give the damage assessment result of this group of lottery tickets based on information such as the size, shape, position of the abnormal areas and the comparison with the normal areas.
[0076] Based on the appearance damage assessment model, the damage degree of the appearance image of the corresponding group of instant lottery tickets is evaluated to obtain the appearance damage degree of the corresponding group of instant lottery tickets: The appearance image of each group of instant lottery tickets is input into the appearance damage assessment model, and the model will analyze and process the image according to the internal set assessment algorithm. The model first identifies various damage-related features in the image, and then makes a comprehensive calculation based on factors such as the severity and quantity of these features, and finally outputs a value to represent the appearance damage degree of this group of instant lottery tickets. For example, the appearance damage assessment model may quantify the damage degree into a numerical range of 0 - 100, where 0 means no damage at all, and 100 means extremely severe damage. If the appearance damage degree of the appearance image of a certain group of lottery tickets is 20 after being evaluated by the model, it indicates that there is a certain degree of damage to this group of lottery tickets, but the damage situation is not serious. This appearance damage degree provides a basis for subsequent judgment on whether to re-extract the feature vector or issue a damage prompt.
[0077] The preset damage degree threshold is a critical value set in advance for judging whether the appearance damage degree of instant lottery tickets is acceptable. After obtaining the appearance damage degree of the corresponding group of instant lottery tickets based on the appearance damage assessment model, it is compared with the preset damage degree threshold. If the appearance damage degree does not exceed the threshold, it means that the damage degree of the lottery tickets is within the acceptable range, and there may only be some minor damages, which do not affect the accurate judgment of the lottery ticket type. At this time, an attempt can be made to re-extract the type discrimination feature vector of this group of instant lottery tickets to further determine its accurate type; if the appearance damage degree exceeds the threshold, it indicates that the lottery tickets are severely damaged and may not be able to accurately determine the type through conventional methods. At this time, an appearance damage prompt needs to be issued. For example, the preset damage degree threshold is set to 30. If the appearance damage degree of a certain group of lottery tickets is 25 and does not exceed the threshold, the operation of re-extracting the feature vector is performed; if the appearance damage degree is 40 and exceeds the threshold, a damage prompt is issued.
[0078] Re - extract the type - distinguishing feature vectors of the corresponding group of instant lottery tickets: When it is found that the maximum similarity between the type - distinguishing feature vectors of a group of instant lottery tickets and the type - distinguishing feature vectors of each preset lottery type does not exceed the preset similarity, and the appearance damage degree of this group of lottery tickets does not exceed the preset damage threshold, it means that the previously extracted feature vectors may not accurately reflect the true type of this group of lottery tickets, but the damage degree of the lottery tickets is not so severe that they cannot be recognized. At this time, the system will analyze the appearance image of this group of instant lottery tickets again. According to the method of extracting lottery type - distinguishing features before (such as matching the distribution constraints of color and texture features based on the weight of a single lottery ticket in another preset database, etc.), re - extract the lottery type - distinguishing features, and combine the number and weight values of the lottery tickets to generate the type - distinguishing feature vectors again. Through re - extraction, it is expected to obtain a feature vector that can more accurately match the preset lottery type, so as to determine the actual type of this group of lottery tickets. For example, if the similarity between the feature vectors extracted for the first time and the preset type does not meet the standard, during re - extraction, due to further processing of the image or more accurate feature matching, the similarity between the new feature vector and a certain preset lottery type may exceed the preset similarity, thus accurately determining the lottery type.
[0079] When the appearance damage degree of a group of instant lottery tickets exceeds the preset damage threshold, the system will issue an appearance damage prompt. This prompt is usually presented in an intuitive way, such as displaying prominent prompt information on the operation interface to inform the operator that there is a relatively serious damage situation for this group of lottery tickets, and they may not be accurately sorted. For example, a red warning box pops up on the interface of the control software, showing words such as "The appearance of this group of lottery tickets is severely damaged, please handle manually". The purpose of the appearance damage prompt is to timely notify relevant personnel to perform special processing on these damaged lottery tickets, such as manual inspection, repair, or separate classification, etc., to avoid sorting errors or other problems caused by damaged lottery tickets.
[0080] The present invention provides an implementation manner of the method for the instant lottery ticket sorting device based on visual recognition and weight sensing, including: S1: Obtain the appearance images of each group of instant lottery tickets conveyed by the belt. At the same time, obtain the weight value of each group of instant lottery tickets; This step uses a system based on belt conveyance, and two sets of important data are collected simultaneously through devices set in specific areas. In the visual recognition area, with the help of a camera installed above the belt, obtain the appearance images of each group of instant lottery tickets. These images contain appearance information such as the color, pattern, and text of the lottery tickets. At the same time, in the weight sensing area, rely on the set weight sensors to obtain the weight values of each group of instant lottery tickets. For example, when a group of instant lottery tickets passes through the visual recognition area and the weight sensing area in sequence through the belt, the camera quickly takes the appearance images, and the weight sensor synchronously measures the weight of this group of lottery tickets. This step provides basic data for the subsequent analysis and sorting of lottery tickets.
[0081] S2: Determine the weight detection range based on the appearance image of each group of instant lottery tickets, and judge whether the weight value of each group of instant lottery tickets is within the corresponding weight detection range. If so, extract the lottery type discrimination features from the appearance image of each group of instant lottery tickets based on the weight value of each group, and count the number of lottery tickets in each group based on the appearance image of each group of instant lottery tickets. Otherwise, re-obtain the weight value of the corresponding group of instant lottery tickets until the weight value of the latest obtained corresponding group of instant lottery tickets is within the corresponding weight detection range, and then extract the lottery type discrimination features from the appearance image of the corresponding group of instant lottery tickets based on the latest obtained weight value of the corresponding group, and count the number of lottery tickets in each group based on the appearance image of the corresponding group of instant lottery tickets; First, determine the weight detection range based on the appearance image of each group of instant lottery tickets. By analyzing the shape features in the appearance image, such as generating color histograms, gray-level co-occurrence matrices, extracting lottery contours and determining the ratio of adjacent side lengths, etc., calculate the upper and lower limits of the weight detection range, so as to determine the weight detection range.
[0082] Then judge whether the weight value of each group of instant lottery tickets is within this corresponding weight detection range. If it is within the range, use this weight value to extract the lottery type discrimination features from the appearance image, such as determining the distribution constraints of color and texture features by weight matching a preset database, and then extracting color and texture discrimination features; At the same time, count the number of lottery tickets based on the appearance image. For example, after binarizing, filling gaps, and removing noise points from the appearance image, use a projection-based segmentation method to identify the gaps between adjacent lottery tickets to count the number.
[0083] If the weight value is not within the corresponding weight detection range, re-obtain the weight value of the corresponding group of instant lottery tickets, and repeat this process until the weight value of the latest obtained weight value is within the corresponding weight detection range, and then extract the lottery type discrimination features and count the number of lottery tickets according to the above method. For example, if the weight value of a certain group of lottery tickets measured for the first time is not within the calculated weight detection range, measure it again until a weight value that meets the range is obtained, and then perform subsequent operations based on this weight value. This step ensures the accuracy and effectiveness of the data and lays a foundation for accurately identifying the lottery type and counting the number.
[0084] S3: Generate a type discrimination feature vector for each group of instant lottery tickets based on the lottery type discrimination features, the number of lottery tickets, and the weight value of each group of instant lottery tickets, and determine the actual type of each group of instant lottery tickets based on the type discrimination feature vector of each group of instant lottery tickets and perform sorting processing based on the robotic arm. Integrate the lottery type discrimination features, the counted number of lottery tickets, and the obtained weight value of each group of instant lottery tickets to generate a type discrimination feature vector for each group of instant lottery tickets. This vector comprehensively represents the features of each group of lottery tickets.
[0085] Next, by calculating the similarity between the type discrimination feature vector of each group of instant lottery tickets and the type discrimination feature vector of the preset lottery type, the actual type of each group of instant lottery tickets is determined. If the maximum similarity exceeds the preset similarity, the preset lottery type corresponding to the maximum similarity is regarded as the actual type; if it does not exceed, and the appearance damage degree does not exceed the preset threshold, the feature vector is re-extracted to determine the type, and if the appearance damage degree exceeds the preset threshold, an appearance damage prompt is issued.
[0086] Finally, based on the determined actual type of each group of instant lottery tickets, the sorting path is determined, and the robotic arm sorts each group of instant lottery tickets according to the sorting path, completing the automatic classification of lottery tickets. For example, after determining that a certain group of lottery tickets is of the first prize type, the robotic arm transports the group of lottery tickets to the corresponding storage location according to the preset sorting path for the first prize lottery tickets. This step realizes the complete process from lottery feature analysis to actual sorting, achieving the automatic operation of instant lottery ticket sorting.
[0087] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the present invention and its equivalent technologies, the present invention also intends to include these changes and modifications.
Claims
1. A lottery ticket sorting device based on visual recognition and weight sensing, characterized in that: include: The appearance acquisition and weight sensing module is used to acquire the appearance image of each group of instant lottery tickets conveyed by the belt, and at the same time, acquire the weight value of each group of instant lottery tickets; A weight correction and appearance feature auxiliary extraction module, used to determine the weight detection range based on the appearance image of each group of instant lottery tickets, and determine whether the weight value of each group of instant lottery tickets is within the corresponding weight detection range. If so, the lottery type distinguishing features are extracted from the appearance image of each group of instant lottery tickets based on the weight value of each group of instant lottery tickets, and the number of lottery tickets in each group of instant lottery tickets is counted based on the appearance image of each group of instant lottery tickets. Otherwise, the weight value of the corresponding group of instant lottery tickets is re-acquired until the weight value of the corresponding group of instant lottery tickets that is newly acquired is within the corresponding weight detection range, then the lottery type distinguishing features are extracted from the appearance image of the corresponding group of instant lottery tickets based on the weight value of the corresponding group of instant lottery tickets that is newly acquired, and the number of lottery tickets in each group of instant lottery tickets is counted based on the appearance image of the corresponding group of instant lottery tickets; The feature vector generation and lottery ticket sorting module is used to generate a type distinguishing feature vector for each group of instant lottery tickets based on the lottery ticket type distinguishing features, the number of lottery tickets and the weight value of each group of instant lottery tickets, determine the actual type of each group of instant lottery tickets based on the type distinguishing feature vector of each group of instant lottery tickets, and perform sorting processing based on a robotic arm.
2. The instant lottery ticket sorting device based on visual recognition and weight sensing according to claim 1 is characterized in that: Appearance acquisition and weight sensing module, including: The belt transmission speed adjustment submodule is used to detect in real time whether the lottery ticket enters the visual recognition area and the weight sensing area based on the photoelectric sensor arranged at the front end of the visual recognition area and the weight sensing area, and if so, reduce the belt transmission speed to a preset transmission speed value; A high-speed image acquisition submodule, for acquiring an appearance image of each group of instant lottery tickets conveyed by the belt based on a camera arranged above the belt in the visual recognition area; The dynamic weight sensing submodule is used to obtain the weight value of each group of instant lottery tickets conveyed by the belt based on the weight sensor arranged in the weight sensing area.
3. The instant lottery ticket sorting device based on visual recognition and weight sensing according to claim 1 is characterized in that: Weight correction and appearance feature auxiliary extraction module, including: A weight detection range acquisition submodule is used to determine the weight detection range based on the shape features in the appearance image of each group of instant lottery tickets; A first weight determination submodule, for determining that the weight value of each group of instant lottery tickets is within a corresponding weight detection range, and then treating the weight value of the corresponding group of instant lottery tickets as the actual weight value of the corresponding group of instant lottery tickets; The second weight determination submodule is used for re-obtaining the weight value of the corresponding group of instant lottery tickets when it is determined that the weight value of each group of instant lottery tickets is not within the corresponding weight detection range, until the weight value of the corresponding group of instant lottery tickets obtained the latest is within the corresponding weight detection range, then the weight value of the corresponding group of instant lottery tickets obtained the latest is used as the actual weight value of the corresponding group of instant lottery tickets; The type distinguishing feature auxiliary extraction submodule is used to count the number of lottery tickets in the corresponding group of instant lottery tickets based on the actual weight value and appearance image of each group of instant lottery tickets, and to extract lottery type distinguishing features from the appearance image of the corresponding group of instant lottery tickets.
4. The instant lottery ticket sorting device based on visual recognition and weight sensing according to claim 3 is characterized in that: The weight detection range acquisition submodule includes: A color feature extraction unit, used to generate a color histogram and a grayscale co-occurrence matrix of the appearance image of each group of instant lottery tickets; A contour feature extraction unit is used to extract the contour of each group of instant lottery tickets from the appearance image, determine the length of each side of the contour of the lottery ticket, and generate a set of adjacent side length ratios of the contour of each group of instant lottery tickets based on the ratio of adjacent side lengths of the lottery ticket contour and the inverse of the ratio of adjacent side lengths; The weight detection range upper and lower limit calculation unit is used to calculate the weight detection range upper and lower limit values of each group of instant lottery tickets based on the color histogram and grayscale co-occurrence matrix of the appearance image of each group of instant lottery tickets and the set of adjacent edge length ratios of the contours: The weight detection range determination unit is used to determine the weight detection range based on the upper and lower limits of the weight detection range.
5. The instant lottery ticket sorting device based on visual recognition and weight sensing according to claim 4 is characterized in that: The upper and lower limits calculation unit of the weight detection range calculates the upper and lower limits of the weight detection range of each group of instant lottery tickets based on the color histogram and grayscale co-occurrence matrix of the appearance image of each group of instant lottery tickets and the set of adjacent edge length ratios of the contours, including: ; ; In the formula, The upper limit of the weight detection range for a single set of instant lottery tickets. is the mapping function of the upper limit of the weight detection range, The lower limit of the weight detection range for a single set of instant lottery tickets. is the mapping function of the lower limit of the weight detection range, is the total number of color values in the color histogram of the appearance image of a single set of lottery tickets, is the height of the appearance image of a single set of instant lottery tickets, is the width of the appearance image of a single set of instant lottery tickets, is the Dirac function, when hour, , otherwise 0, The color histogram of the appearance image of a single set of lottery tickets at position The color value at is a collection of all color values within the preset color value range. is the number of gray levels in the gray-level co-occurrence matrix of a single set of lottery appearance images, is the gray level co-occurrence matrix of the appearance image of a single set of instant lottery tickets. Line The elements of the column, is the total number of elements in the set of contour adjacent side length ratios, is the first in the set of contour adjacent side length ratios elements.
6. The instant lottery ticket sorting device based on visual recognition and weight sensing according to claim 3 is characterized in that: The type distinguishing feature auxiliary extraction submodule includes: A lottery ticket quantity counting unit, used for counting the number of lottery tickets of a corresponding group of instant lottery tickets based on the appearance image of each group of instant lottery tickets; A single lottery ticket weight counting unit, used to determine the weight of a single lottery ticket of a corresponding group of instant lottery tickets based on the actual weight value and the number of lottery tickets of the corresponding group of instant lottery tickets; A color distinguishing feature extraction unit is used to match a corresponding weight interval in a preset database based on the weight of a single lottery ticket of each group of instant lottery tickets, and extract a lottery ticket type color distinguishing feature from an appearance image of a corresponding group of instant lottery tickets based on a color feature distribution constraint pre-matched in the corresponding weight interval; A texture distinguishing feature extraction unit is used to match a corresponding weight interval in a preset database based on the weight of a single lottery ticket of each group of instant lottery tickets, and extract a lottery ticket type texture distinguishing feature from an appearance image of the corresponding group of instant lottery tickets based on a texture feature distribution constraint pre-matched in the corresponding weight interval; Among them, the lottery type distinguishing features include lottery type color distinguishing features and lottery type texture distinguishing features.
7. The instant lottery ticket sorting device based on visual recognition and weight sensing according to claim 6, characterized in that: Lottery quantity statistics unit, including: An image processing subunit is used to perform binarization processing, gap filling and noise point removal on the appearance image of each group of instant lottery tickets to obtain a processed appearance image; The gap segmentation subunit is used to identify adjacent lottery gaps in the processed appearance image by a projection-based segmentation method, and count the number of lottery tickets of the corresponding group of instant lottery tickets based on the adjacent lottery gaps in the processed appearance image.
8. The instant lottery ticket sorting device based on visual recognition and weight sensing according to claim 1, characterized in that: Feature vector generation and lottery ticket sorting module, including: A distinguishing feature vector generating submodule, used for generating a type distinguishing feature vector of each group of instant lottery tickets based on the lottery ticket type distinguishing features of each group of instant lottery tickets and the number and weight value of the lottery tickets; A lottery type determination submodule, used to determine the actual type of each group of instant lottery tickets based on the type distinguishing feature vector of each group of instant lottery tickets; The sorting control submodule is used to determine the sorting path of each group of instant lottery tickets based on the actual type of each group of instant lottery tickets, and to perform sorting control on each group of instant lottery tickets based on the corresponding sorting path.
9. The instant lottery ticket sorting device based on visual recognition and weight sensing according to claim 8, characterized in that: The lottery type determination submodule includes: A feature similarity calculation unit, used to calculate the similarity between the type distinguishing feature vector of each group of instant lottery tickets and the type distinguishing feature vector of each preset lottery type; A first type determination unit, configured to, if the maximum similarity exceeds a preset similarity, regard the preset lottery type corresponding to the maximum similarity as the actual type of the corresponding group of instant lottery tickets; A damage degree assessment unit, configured to assess the damage degree of the appearance images of the corresponding group of instant lottery tickets based on the appearance damage assessment model if the maximum similarity does not exceed a preset similarity, so as to obtain the appearance damage degree of the corresponding group of instant lottery tickets; The second type determination unit is used for re-extracting the type distinguishing feature vector of the corresponding group of instant lottery tickets if the degree of damage to the appearance of the corresponding group of instant lottery tickets does not exceed a preset damage threshold, until the similarity between the newly obtained type distinguishing feature vector and the type distinguishing feature vector of at least one preset lottery type exceeds a preset similarity, and then taking the preset lottery type corresponding to the maximum similarity as the actual type of the corresponding group of instant lottery tickets; The damage prompting unit is used to issue an appearance damage prompt if the appearance damage degree of the corresponding group of instant lottery tickets exceeds a preset damage degree threshold.
10. The method of the instant lottery ticket sorting device based on visual recognition and weight sensing according to any one of claims 1 to 9, characterized in that: include: S1: Obtaining the appearance image of each group of instant lottery tickets conveyed by the belt, and at the same time, obtaining the weight value of each group of instant lottery tickets; S2: Determine a weight detection range based on the appearance image of each group of instant lottery tickets, and judge whether the weight value of each group of instant lottery tickets is within the corresponding weight detection range. If so, extract the lottery type distinguishing features from the appearance image of each group of instant lottery tickets based on the weight value of each group of instant lottery tickets, and count the number of lottery tickets in each group of instant lottery tickets based on the appearance image of each group of instant lottery tickets. Otherwise, re-acquire the weight value of the corresponding group of instant lottery tickets until the latest weight value of the corresponding group of instant lottery tickets is within the corresponding weight detection range, then extract the lottery type distinguishing features from the appearance image of the corresponding group of instant lottery tickets based on the latest weight value of the corresponding group of instant lottery tickets, and count the number of lottery tickets in each group of instant lottery tickets based on the appearance image of the corresponding group of instant lottery tickets; S3: Generate a type distinguishing feature vector for each group of instant lottery tickets based on the lottery ticket type distinguishing features, the number of lottery tickets and the weight value of each group of instant lottery tickets, determine the actual type of each group of instant lottery tickets based on the type distinguishing feature vector of each group of instant lottery tickets and perform sorting processing based on a robotic arm.