A ticket format verification method and system based on noise reduction processing

By performing noise reduction processing and edge detection on the lottery image, and combining the template to compare character positions and font styles, the problem of inaccurate character recognition in traditional methods is solved, the accuracy and reliability of lottery issue format verification is improved, and the system's trust is enhanced.

CN120047951BActive Publication Date: 2025-08-15BEIJING ZHONGTI JUN COLOR INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510531001.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-15
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

The traditional lottery ticket issuance format verification method lacks in-depth image data analysis, and the character recognition accuracy is insufficient, resulting in format errors and omissions, affecting data processing efficiency and accuracy, and reducing the reliability of the lottery system.

Method used

Through the method based on noise reduction processing, image brightness adjustment and contrast optimization are performed, segmented characters are detected at the edge, and character positions and font styles are compared with pre-stored templates to verify the consistency of time and ensure that the issuance format complies with the rules.

Benefits of technology

It improves the accuracy of character data extraction, reduces the risk of position deviation and time conflict, improves the accuracy and reliability of lottery ticket issuance format verification, and enhances the trust of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047951B_ABST
    Figure CN120047951B_ABST
Patent Text Reader

Abstract

The present invention provides a ticket format verification method and system based on noise reduction processing, relating to the technical field of format verification. The method comprises the following steps: adjusting the image brightness based on lottery image data, performing noise reduction optimization processing on the image, adjusting the image contrast, and obtaining optimized lottery image data. In the present invention, the accuracy of character data extraction is improved by independently segmenting each character, and the data is compared with a pre-stored lottery format template. By verifying the position of each character, the actual position of the character is ensured to meet the standard requirements, reducing verification errors caused by position deviations. By comparing font styles, the morphological consistency of numbers and letters is ensured. The logical consistency of the ticket issuance time and the ticket purchase time is checked to ensure the correctness of the time information, reduce the risk of time conflicts, and significantly improve the accuracy and reliability of lottery ticket format verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of format verification technology, and in particular to a ticket format verification method and system based on noise reduction processing. Background Art

[0002] The field of format validation technology aims to ensure that data input or output conforms to predetermined standards and formats. This technology is typically applied during data input, file transfer, and data storage to prevent data errors and information corruption. Format validation technology is widely used in various information processing systems, including financial systems, data warehouses, and customer information management systems. By using pre-defined rules and algorithms, format validation can automatically identify and correct formatting errors in data, improving the efficiency and accuracy of data processing.

[0003] Among them, the ticket format verification method based on noise reduction is an applied technology for lottery issuance and sales systems. It aims to ensure that the data format during the lottery ticket issuance process conforms to specific standards and specifications. This method automatically checks the format of information such as lottery numbers, issuance time, and amount to ensure the validity and accuracy of lottery tickets. Verification is crucial for protecting consumer rights, preventing fraud, and maintaining overall trust in the lottery system. Using this ticket format verification method based on noise reduction can significantly reduce human error, improve ticket issuance efficiency and accuracy, and thus optimize lottery sales and management processes.

[0004] Traditional verification methods rely on static rules and simple verification logic, lacking in-depth analysis of image data. This limits the accuracy of character recognition and can easily lead to missed formatting errors. Traditional methods often rely on fixed standards when comparing characters to templates, making them ineffective at handling diverse font styles. This can lead to unrecognized characters, impacting the efficiency and accuracy of overall data processing. This reduces the reliability of lottery systems and hinders the modernization and automation of lottery management. Summary of the Invention

[0005] The purpose of the present invention is to solve the shortcomings of the existing technology and propose a ticket format verification method and system based on noise reduction processing. The technical solution is as follows:

[0006] In one aspect, a method for verifying a ticket format based on noise reduction processing is provided, comprising the following steps:

[0007] S1: Based on the lottery image data, adjust the image brightness, perform noise reduction optimization processing on the image, and adjust the image contrast to obtain optimized lottery image data;

[0008] S2: Based on the optimized lottery image data, identify the boundary between the number and date fields through edge detection, segment and independently process each character, extract the image area of each character, and obtain a character data extraction result;

[0009] S3: Based on the character data extraction result, the character data is compared with the lottery format template pre-stored in the database, the actual position of each character is compared with the standard position in the template, the character position deviation is evaluated, and the character is verified to be within the error range, thereby obtaining a position verification result;

[0010] S4: Based on the position verification result and the character data extraction result, the image of each character is compared with the corresponding character in the standard font library, the consistency of the font is analyzed, and the font style verification result is obtained;

[0011] S5: Based on the position verification result and the font style verification result, the lottery ticket issuance time is compared with the ticket purchase time recorded in the system to check whether there is a time conflict, and the ticket issuance time is compared with the validity period of the lottery ticket, and the time interval is analyzed to evaluate whether it complies with the lottery rules and requirements, thereby obtaining the lottery ticket issuance format verification result.

[0012] Optionally, the optimized lottery image data includes adjusted image brightness value and contrast value, the character data extraction result includes independent digital character images, date character images and text character images, the position verification result includes character position deviation data and a mark indicating whether the position is qualified, the font style verification result includes font matching degree and font style consistency mark, and the lottery ticket format verification result includes lottery format logic verification status and lottery ticket format correctness mark.

[0013] Optionally, based on the lottery image data, the steps of adjusting the image brightness, performing noise reduction optimization processing on the image, and adjusting the image contrast to obtain optimized lottery image data are specifically as follows:

[0014] S101: performing image brightness adjustment based on the lottery image data, adjusting the brightness value of each pixel to adjust the image brightness to a preset range, and obtaining image data after brightness adjustment;

[0015] S102: performing image noise reduction processing based on the brightness-adjusted image data, smoothing the image using a Gaussian filter to eliminate random noise interference in the image, and obtaining noise-reduced optimized image data;

[0016] S103: Based on the noise reduction and optimization image data, the image contrast is adjusted to highlight the edges of numbers and text by increasing the light and dark contrast of the image, thereby obtaining optimized lottery image data.

[0017] Optionally, based on the optimized lottery image data, edge detection is performed to identify the boundary between the number and date fields, each character is segmented and processed independently, and the image area of each character is extracted to obtain the character data extraction result. Specifically, the steps are:

[0018] S201: Based on the optimized lottery image data, evaluating pixel gradients through image analysis, identifying boundaries between number and date fields in the image, and obtaining boundary recognition results;

[0019] S202: Based on the boundary recognition result, each character and number is recognized, and each character and number area is segmented to isolate each character and number to obtain a character segmentation result;

[0020] S203: Based on the character segmentation result, each character and number is subjected to independent image cropping processing, and the image area of each character is extracted by defining a bounding box of each character to obtain a character data extraction result.

[0021] Optionally, based on the character data extraction result, the character data is compared with a lottery format template pre-stored in a database, the actual position of each character is compared with the standard position in the template, the character position deviation is evaluated, and it is verified whether the character is within the error range. The steps of obtaining the position verification result are specifically as follows:

[0022] S301: Based on the character data extraction result, extract the position and size of each character in the image, and obtain the standard position data of the corresponding characters of the lottery format template in the database to obtain the current and standard character position data;

[0023] S302: Calculating the position offset of each character based on the current and standard character position data to obtain a character offset evaluation result;

[0024] S303: Based on the character offset evaluation result, compare it with the preset offset preset, identify the characters whose offset exceeds the set range, and record the number of characters and position information to obtain a position verification result.

[0025] Optionally, the formula for calculating the position offset of each character is:

[0026]

[0027] in, Indicates the position offset of the character. Represents the actual horizontal coordinate of the current character in the image, Represents the standard horizontal coordinate of the character in the database, Represents the actual vertical coordinate of the current character in the image, Represents the standard vertical coordinate of the character in the database, and are the weight coefficients of the horizontal and vertical axes respectively.

[0028] Optionally, based on the position verification result and the character data extraction result, the image of each character is compared with the corresponding character in the standard font library, and the consistency of the glyphs is analyzed to obtain the font style verification result. Specifically, the step is as follows:

[0029] S401: Analyzing the proportional deviation between the current lottery ticket image and the actual lottery ticket size based on the position verification result and the character data extraction result, scaling the character image according to the proportional deviation, and adjusting the character image to the actual size to obtain a scaled character image;

[0030] S402: comparing the scaled character image with a standard outline of the same font in the lottery format template to evaluate the matching degree of the character glyphs and obtain a glyph matching analysis result;

[0031] S403: Based on the glyph matching analysis result, the result is compared with a preset matching threshold, characters with matching degrees lower than the preset threshold are marked, character position information is recorded, and a font style verification result is obtained.

[0032] Optionally, the formula for evaluating the matching degree of the character glyphs is:

[0033]

[0034] in, Represents the matching value of the character glyph, Indicates the current character outline point With standard contour points The distance between them is calculated by Euclidean distance. is the weight coefficient of each corresponding point, Indicates the total number of contour points used in the comparison process, Indicates the contour point index.

[0035] Optionally, based on the position verification result and the font style verification result, the lottery ticket issuance time is compared with the ticket purchase time recorded in the system to check whether there is a time conflict, and the ticket issuance time is compared with the validity period of the lottery ticket to analyze the time interval and evaluate whether it complies with lottery rules. The steps of obtaining the lottery ticket issuance format verification result are specifically as follows:

[0036] S501: Based on the position verification result and the font style verification result, the lottery ticket issuance time is compared with the ticket purchase time recorded by the system, and the year, month, and day of the date are checked item by item to see if they are consistent, thereby obtaining a date consistency check result;

[0037] S502: Based on the date consistency check result, the logical relationship between the ticket issuance time and the ticket purchase time is analyzed to check whether there is a time conflict, and whether the ticket date is earlier than the ticket purchase time, thereby obtaining a time conflict verification result;

[0038] S503: Based on the time conflict verification result, the ticket issuance time and the validity period of the lottery are analyzed, the time interval between the ticket issuance time and the validity period is calculated, and whether the time interval meets the lottery rules is evaluated to obtain the lottery ticket issuance format verification result.

[0039] On the other hand, a ticket format verification system based on noise reduction processing is provided. The ticket format verification system based on noise reduction processing is used to perform the above-mentioned ticket format verification method based on noise reduction processing. The system includes:

[0040] The lottery image processing module adjusts the image brightness, performs noise reduction optimization processing on the image, and adjusts the image contrast based on the lottery image data to obtain optimized lottery image data;

[0041] The character image extraction module segments and independently processes each character based on the optimized lottery image data, extracts the image area of each character, and obtains a character data extraction result;

[0042] The character position analysis module compares the character data extraction result with the lottery format template pre-stored in the database, compares the actual position of each character with the standard position in the template, evaluates the character position deviation, verifies whether the character is within the error range, and obtains a position verification result;

[0043] The character format analysis module compares the image of each character with the corresponding character in the standard font library based on the position verification result and the character data extraction result, analyzes the consistency of the glyphs, and obtains a font style verification result;

[0044] The date consistency analysis module compares the lottery ticket issuance time with the ticket purchase time recorded by the system based on the position verification result and the font style verification result to check whether there is a time conflict and obtain the ticket issuance time analysis result;

[0045] The lottery validity period format analysis module compares the ticket issuance time with the validity period of the lottery based on the ticket issuance time analysis result, analyzes the time interval, evaluates whether it meets the lottery rules, and obtains the lottery issuance format verification result.

[0046] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0047] In the present invention, by independently segmenting each character, the accuracy of character data extraction is improved, and the data is compared with a pre-stored lottery format template. By verifying the position of each character, the actual position of the character is ensured to meet the standard requirements, and the verification error caused by position deviation is reduced. By comparing the font styles, the morphological consistency of numbers and letters is ensured. The logical consistency of the ticket issuance time and the ticket purchase time is checked to ensure the correctness of the time information, reduce the risk of time conflict, greatly improve the accuracy and reliability of the lottery ticket issuance format verification, enhance the overall trust of the lottery issuance and sales system, and effectively safeguard the rights and interests of consumers and market order. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments.

[0049] Figure 1 Schematic diagram of the method flow of the present invention;

[0050] Figure 2 This is a detailed flow chart of S1 of the present invention;

[0051] Figure 3 This is a detailed flow chart of S2 of the present invention;

[0052] Figure 4 This is a detailed flow chart of S3 of the present invention;

[0053] Figure 5 This is a detailed flow chart of S4 of the present invention;

[0054] Figure 6 This is a detailed flow chart of S5 of the present invention;

[0055] Figure 7 It is a system flow chart of the present invention. DETAILED DESCRIPTION

[0056] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0057] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as an "exemplary" in the present invention should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner. Furthermore, in the embodiments of the present invention, "and / or" can mean both or either of the two.

[0058] In the embodiments of the present invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same. The terms "of," "corresponding," and "corresponding" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same.

[0059] In the embodiments of the present invention, sometimes a subscript such as W1 may be written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are the same.

[0060] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0061] Example

[0062] See also Figure 1 The present invention provides a ticket format verification method based on noise reduction processing, comprising the following steps:

[0063] S1: Based on the lottery image data, adjust the image brightness, perform noise reduction optimization processing on the image, adjust the image contrast, highlight the edges of numbers and text, and obtain optimized lottery image data;

[0064] S2: Based on the optimized lottery image data, edge detection is used to identify the boundaries between the number and date fields, isolate each character and number, segment and process each character independently, extract the image area of each character, and obtain the character data extraction result;

[0065] S3: Based on the character data extraction results, the data is compared with the lottery format template stored in the database. The actual position of each character is compared with the standard position in the template, the character position deviation is evaluated, and the character is verified to be within the error range to obtain the position verification result;

[0066] S4: Based on the position verification results and character data extraction results, the results are compared with the lottery format templates pre-stored in the database, and the image of each character is compared with the corresponding character in the standard font library to analyze the consistency of the glyphs and obtain the font style verification results;

[0067] S5: Based on the position verification results and font style verification results, compare the lottery ticket issuance time with the ticket purchase time recorded in the system to verify the logical consistency and check whether there is a time conflict. Compare the ticket issuance time with the lottery ticket validity period, analyze the time interval, evaluate whether it complies with the lottery rules, and obtain the lottery ticket issuance format verification result.

[0068] The optimized lottery image data includes the adjusted image brightness value and contrast value; the character data extraction results include independent digital character images, date character images, and text character images; the position verification results include character position deviation data and a mark indicating whether the position is qualified; the font style verification results include font matching and font style consistency marks; the lottery ticket format verification results include the lottery format logic verification status and the lottery ticket format correctness mark.

[0069] See also Figure 2 Based on the lottery image data, the steps of adjusting the image brightness, performing noise reduction optimization processing on the image, adjusting the image contrast, and highlighting the edges of numbers and text to obtain the optimized lottery image data are as follows:

[0070] S101: performing image brightness adjustment based on the lottery image data, adjusting the brightness value of each pixel to adjust the image brightness to a preset range, and obtaining image data after brightness adjustment;

[0071] Based on lottery image data, the brightness information of each pixel value is scanned and recorded, and then the deviation from the preset brightness range is compared. The required adjustment amount is analyzed, and the brightness value of each pixel is adjusted to ensure that the brightness of each pixel does not exceed the set maximum and minimum brightness values after adjustment. The parameters involved in the adjustment operation include the brightness increase ratio, the maximum brightness limit, and the brightness balance point. The parameter adjustment is implemented in the image processing software through programming to ensure the uniform distribution of brightness and the true expression of color during the adjustment process, avoid color deviation or brightness distortion introduced by the adjustment, complete the brightness adjustment of the entire image, and obtain the image data after brightness adjustment.

[0072] S102: performing image noise reduction processing based on the brightness-adjusted image data, smoothing the image using a Gaussian filter to eliminate random noise interference in the image, and obtaining noise-reduced optimized image data;

[0073] Based on the image data after brightness adjustment, the noise type in the image is analyzed and identified, which usually includes high-frequency noise and random noise. A Gaussian filter is applied to the image data for filtering. The core parameters of the filter, such as the convolution kernel size and standard deviation, are optimized according to the image noise level. The parameters ensure that the image maintains edge information while effectively reducing noise during the smoothing process. The impact on each pixel in the filtering process is calculated to ensure the clarity and overall visual effect of the processed image. The image data after Gaussian filtering reduces noise while maintaining the clarity of image details, resulting in noise-reduced and optimized image data.

[0074] S103: Based on the noise reduction optimization of the image data, the image contrast is adjusted to highlight the edges of numbers and text by increasing the contrast between light and dark in the image, thereby obtaining optimized lottery image data.

[0075] Based on noise reduction and optimization of image data, the grayscale value distribution of the image data is analyzed to determine the contrast adjustment strategy and parameters, including contrast gain and contrast range. The ratio of light and dark pixels is adjusted according to the grayscale histogram. The dynamic range of the image data is increased through image processing algorithms. This process is implemented through programming in image processing software. The image after contrast adjustment is more vivid, and the edges of numbers and text are more prominent due to the enhanced contrast. The adjustment makes important information in the image, such as numbers and text, easier to identify. The resulting contrast-optimized lottery image data highlights key information, facilitating subsequent recognition or processing. Figure 3 Based on the optimized lottery image data, edge detection is used to identify the boundary between the number and date fields, isolate each character and number, segment and process each character independently, extract the image area of each character, and obtain the character data extraction results. The specific steps are as follows:

[0076] S201: Based on the optimized lottery image data, pixel gradients are evaluated through image analysis to identify the boundaries of the number and date fields in the image and obtain a boundary recognition result;

[0077] Based on the optimized lottery image data, the grayscale value of each pixel in the image is calculated, and the gradient calculation formula is used to obtain the gradient value of each pixel. The gradient change is judged by setting a threshold, and the boundaries of the number and date fields are identified. The coordinates of the boundary points are determined by comparing the gradient value of each pixel and the changes in its neighboring pixels. Edge detection techniques such as Canny edge detection are applied to obtain a clearer boundary definition. At the same time, filtering is performed according to the characteristics of the image to ensure the accuracy of boundary recognition. The obtained boundary recognition results identify the positions of the number and date fields in the image.

[0078] S202: Based on the boundary recognition result, each character and number is recognized, and each character and number area is segmented to isolate each character and number to obtain a character segmentation result;

[0079] Based on the boundary recognition results, rectangular frames of character and number areas are defined, and pixel information of each area in the image is extracted. After area extraction, the connected domain analysis method is used to mark adjacent pixels to identify independent character and number areas. By counting the number of pixels and shape features in each area, it is verified to be a valid character or number. According to the defined area frame, each character and number is segmented to obtain the character segmentation result, ensuring that each character and number is effectively isolated.

[0080] S203: Based on the character segmentation result, each character and number is subjected to independent image cropping processing. By defining the bounding box of each character, cropping is performed to extract the image area of each character to obtain the character data extraction result.

[0081] Based on the character segmentation results, the minimum circumscribed rectangular box is extracted from the segmented area of each character. The rectangular box can accurately surround the shape of the character. The image cropping function is used to crop each defined bounding box to extract the image area of the character. The cropping operation determines the coordinates of the upper left and lower right corners of each bounding box based on the image coordinate system, thereby accurately locating the position of the character in the image. After cropping is completed, the image area of each character is saved as an independent image file to obtain the character data extraction result.

[0082] See also Figure 4 Based on the character data extraction results, the results are compared with the lottery format templates stored in the database. The actual position of each character is compared with the standard position in the template, the character position deviation is evaluated, and the character is verified to be within the error range. The specific steps for obtaining the position verification result are as follows:

[0083] S301: Based on the character data extraction result, extract the position and size of each character in the image, and obtain the standard position data of the corresponding characters in the lottery format template in the database to obtain the current and standard character position data;

[0084] Based on the character data extraction results, the position and size of each character in the image are extracted, including calculating the bounding box of each character to determine its exact coordinates in the image. Then, the lottery format template is obtained from the database. The template contains standard character position data. The data is usually stored in the form of relative coordinates, allowing effective comparison with the extracted character position to obtain the current and standard character position data.

[0085] S302: Calculate the position offset of each character based on the current and standard character position data to obtain a character offset evaluation result;

[0086] The formula for calculating the position offset of each character is:

[0087]

[0088] in, Indicates the position offset of the character. Represents the actual horizontal coordinate of the current character in the image, Represents the standard horizontal coordinate of the character in the database, Represents the actual vertical coordinate of the current character in the image, Represents the standard vertical coordinate of the character in the database, and are the weight coefficients of the horizontal and vertical axes respectively.

[0089] The formula is:

[0090]

[0091] Parameter details and how to obtain them:

[0092] and :These represent the actual coordinates of the current character in the image, including the horizontal coordinate and the vertical axis This data is typically automatically extracted from scanned lottery tickets or documents using image processing algorithms. For example, optical character recognition technology can be used to identify characters and determine their position.

[0093] and : represents the standard coordinates of the corresponding character in the database, including the horizontal coordinate and the vertical axis The coordinates are predefined, usually based on historical data or lottery design specifications.

[0094] and : These are weight coefficients for the horizontal and vertical axes, used to adjust the sensitivity of the coordinate axes based on the specific application scenario. In practice, these coefficients may need to be adjusted based on the layout characteristics and recognition accuracy requirements of different lottery tickets. Typically, these coefficients are obtained through experimentation and optimization during the initial testing phase of the algorithm to ensure optimal offset estimation performance.

[0095] Calculation example:

[0096] Set the following data and parameter settings: , , , , , .

[0097] Calculation process:

[0098]

[0099]

[0100]

[0101]

[0102]

[0103] Calculation results , indicating that the current character position is offset by approximately 7.07 units. This offset can be used to determine whether the character is within an acceptable error range. If the offset exceeds a preset threshold, further investigation of potential issues in the scanning or recognition process or adjustments to the lottery ticket printing or design standards may be necessary.

[0104] S303: Based on the character offset evaluation result, compare it with the preset offset preset, identify the characters whose offset exceeds the set range, and record the number of characters and position information to obtain the position verification result.

[0105] Based on the character offset evaluation results, they are compared with the preset offset range, and the calculated offset of each character is compared with the set maximum and minimum offset values. Through logical judgment, characters that exceed the set range are identified, and the number of characters and their corresponding position information are recorded for subsequent review and processing to form a position verification result. The result will provide the necessary basis for subsequent character correction or information extraction.

[0106] See also Figure 5 Based on the position verification results and character data extraction results, the results are compared with the lottery format templates stored in the database, and the image of each character is compared with the corresponding character in the standard font library to analyze the consistency of the glyphs. The specific steps to obtain the font style verification results are as follows:

[0107] S401: Based on the position verification result and the character data extraction result, analyzing the ratio deviation between the current lottery ticket image and the actual lottery ticket size, scaling the character image according to the ratio deviation, adjusting the character image to the actual size, and obtaining a scaled character image;

[0108] Based on the position verification results and character data extraction results, the proportional deviation between the current lottery image and the actual lottery size is analyzed, including measuring the ratio of the extracted character image size to the standard lottery size, identifying the proportional deviation, and scaling the character image according to the ratio. The scaling operation is achieved by applying the corresponding image processing algorithm to ensure that the aspect ratio of each character remains unchanged and is adjusted to the actual size to obtain the scaled character image to ensure that it meets the actual lottery size requirements.

[0109] S402: comparing the scaled character image with a standard outline of the same font in the lottery format template to evaluate the matching degree of the character glyphs and obtain a glyph matching analysis result;

[0110] The formula for evaluating the matching of character glyphs is:

[0111]

[0112] in, Represents the matching value of the character glyph, Indicates the current character outline point With standard contour points The distance between them is calculated by Euclidean distance. is the weight coefficient of each corresponding point, Indicates the total number of contour points used in the comparison process, Indicates the contour point index.

[0113] The formula is:

[0114]

[0115] Parameter details and how to obtain them:

[0116] : Represents the matching value of the character glyph. This value is used to quantify the similarity between the character image and the standard outline. The closer the value is to 1, the higher the matching degree.

[0117] : Indicates the current character contour point With standard contour points The distance between them is usually calculated using the Euclidean distance, which is: .in, and for point The coordinates of and for point 's coordinates.

[0118] : The weight coefficient of each corresponding point, used to represent the point with dot The coefficient can be preset according to the structural characteristics of the character.

[0119] : The total number of contour points used in the comparison process. This value is determined by the number of sampling points of the character image and the standard contour.

[0120] Calculation example:

[0121] The following data and parameter settings are set:

[0122] Total number of contour points (representing three corresponding feature points), , , , represents the distance between corresponding points, and the weight coefficient is , , .

[0123] Calculate the matching degree:

[0124]

[0125]

[0126]

[0127]

[0128]

[0129]

[0130] Calculation results , indicating that the character image has a low match with the standard contour, because the value is far away from 1, the result suggests that there is a large shape deviation.

[0131] S403: Based on the font matching analysis result, the result is compared with a preset matching threshold, characters whose matching degree is lower than the preset threshold are marked, character position information is recorded, and a font style verification result is obtained.

[0132] Based on the glyph matching analysis results, they are compared with the preset matching threshold, including setting the minimum acceptance standard for matching. Then, the matching of each character is evaluated one by one, and those characters with matching degrees lower than the preset threshold are marked. The position information of these characters is recorded for subsequent processing to form the font style verification results. The results will provide the necessary basis for subsequent character adjustment or replacement.

[0133] See also Figure 6 Based on the position verification results and font style verification results, the lottery ticket issuance time is compared with the purchase time recorded in the system to verify the logical consistency and check whether there is a time conflict. The ticket issuance time is compared with the lottery ticket validity period, the time interval is analyzed, and whether it meets the lottery rules requirements is evaluated. The specific steps to obtain the lottery ticket issuance format verification result are as follows:

[0134] S501: Based on the position verification results and the font style verification results, the lottery ticket issuance time is compared with the ticket purchase time recorded in the system, and the year, month, and day of the date are checked item by item to see if they are consistent, thereby obtaining a date consistency check result;

[0135] Based on the position verification results and font style verification results, the lottery ticket issuance time is compared with the purchase time recorded by the system, including checking the year, month, day, hour, minute and second of the date item by item to ensure complete consistency between the two in each time unit. During the comparison process, each time unit is accurately matched. If any mismatch is found, it will be recorded to obtain the date consistency check result.

[0136] S502: Based on the date consistency check result, the logical relationship between the ticket issuance time and the ticket purchase time is analyzed to check whether there is a time conflict. The ticket date is determined to be earlier than the ticket purchase time, and a time conflict verification result is obtained.

[0137] Based on the date consistency check results, the logical relationship between the ticket issuance time and the ticket purchase time is analyzed, including checking whether the ticket issuance time is earlier than the ticket purchase time to determine whether there is a time conflict, and performing time logic verification. By comparing the timestamps of the two dates or directly comparing their respective year, month, day, hour, minute, and second values, the rationality and logical correctness of the ticket issuance time are ensured, the time legitimacy of the lottery is confirmed, and logical errors are avoided. For example, the ticket issuance time is earlier than the ticket purchase time, and the time conflict verification result is obtained.

[0138] S503: Based on the time conflict verification result, the ticket issuance time and the validity period of the lottery are analyzed, the time interval between the ticket issuance time and the validity period is calculated, and whether the time interval meets the lottery rules is evaluated to obtain the lottery ticket issuance format verification result.

[0139] Based on the time conflict verification results, the system analyzes the ticket issuance time and the validity period of the lottery, and calculates the time interval between the ticket issuance time and the validity period, including comparing the ticket issuance time with the end time of the validity period, calculating the time difference between the two through the timestamp, and referring to the lottery rules. For example, the maximum time from the issuance of the lottery to its expiration is compared with the actual calculated time interval. If the time interval meets the requirements of the rules, the format of the lottery is confirmed to be correct. If it does not meet the requirements, the specific differences are recorded to ensure that the time attributes of the lottery comply with all relevant regulations, and the lottery issuance format verification results are obtained to ensure that the ticket issuance time is within the validity period.

[0140] See also Figure 7 A ticket format verification system based on noise reduction processing is provided. The ticket format verification system based on noise reduction processing is used to execute the above-mentioned ticket format verification method based on noise reduction processing. The system includes:

[0141] The lottery image processing module adjusts the image brightness based on the lottery image data, performs noise reduction optimization processing on the image, adjusts the image contrast, highlights the edges of numbers and text, and obtains optimized lottery image data;

[0142] The character image extraction module uses edge detection based on the optimized lottery image data to identify the boundaries between the number and date fields, isolate each character and number, segment and process each character independently, extract the image area of each character, and obtain the character data extraction results;

[0143] The character position analysis module compares the character data extraction results with the lottery format templates pre-stored in the database, compares the actual position of each character with the standard position in the template, evaluates the character position deviation, verifies whether the character is within the error range, and obtains the position verification result;

[0144] The character format analysis module compares the position verification results and character data extraction results with the lottery format templates pre-stored in the database, compares the image of each character with the corresponding character in the standard font library, analyzes the consistency of the glyphs, and obtains the font style verification results;

[0145] The date consistency analysis module compares the lottery ticket issuance time with the system-recorded ticket purchase time based on the position verification results and font style verification results, verifies the logical consistency, checks whether there is a time conflict, and obtains the ticket issuance time analysis result;

[0146] The lottery validity period format analysis module compares the ticket issuance time with the lottery validity period based on the ticket issuance time analysis results, analyzes the time interval, evaluates whether it meets the lottery rules requirements, and obtains the lottery ticket issuance format verification result.

[0147] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A ticket format verification method based on noise reduction processing, characterized in that: The following steps are involved: Based on the lottery image data, the image brightness is adjusted, the image noise is optimized, and the image contrast is adjusted to obtain the optimized lottery image data; Based on the optimized lottery image data, edge detection is performed to identify the boundary between the number and date fields, each character is segmented and processed independently, and the image area of each character is extracted to obtain a character data extraction result; Based on the character data extraction result, the data is compared with the lottery format template pre-stored in the database, the actual position of each character is compared with the standard position in the template, the character position deviation is evaluated, and the character is verified to be within the error range to obtain a position verification result; Based on the position verification result and the character data extraction result, the image of each character is compared with the corresponding character in the standard font library, the consistency of the glyph is analyzed, and the font style verification result is obtained; Based on the position verification result and the font style verification result, the lottery ticket issuance time is compared with the ticket purchase time recorded in the system to check whether there is a time conflict, and the ticket issuance time is compared with the validity period of the lottery ticket, and the time interval is analyzed to evaluate whether it complies with the lottery rules and requirements, thereby obtaining the lottery ticket issuance format verification result; Based on the character data extraction results, the data is compared with the lottery format template stored in the database, the actual position of each character is compared with the standard position in the template, the character position deviation is evaluated, and the character is verified to be within the error range. The steps of obtaining the position verification result are specifically as follows: Based on the character data extraction result, extract the position and size of each character in the image, and obtain the standard position data of the characters corresponding to the lottery format template in the database to obtain the current and standard character position data; Calculating the position offset of each character based on the current and standard character position data to obtain a character offset evaluation result; Based on the character offset evaluation result, the character offset is compared with the preset offset preset, the characters whose offset exceeds the set range are identified, and the number and position information of the characters are recorded to obtain a position verification result; Based on the position verification result and the character data extraction result, the image of each character is compared with the corresponding character in the standard font library, and the consistency of the glyph is analyzed to obtain the font style verification result. Specifically, the steps are as follows: Analyzing the proportional deviation between the current lottery ticket image and the actual lottery ticket size based on the position verification result and the character data extraction result, scaling the character image according to the proportional deviation, and adjusting the character image to the actual size to obtain a scaled character image; Comparing the scaled character image with a standard outline of the same font in a lottery format template to evaluate the matching of the character glyphs and obtain a glyph matching analysis result; Based on the glyph matching analysis result, the result is compared with a preset matching threshold, characters with matching degrees lower than the preset threshold are marked, character position information is recorded, and a font style verification result is obtained.

2. The ticket format verification method based on noise reduction processing according to claim 1 is characterized in that: The optimized lottery image data includes the adjusted image brightness value and contrast value, the character data extraction result includes independent numeric character images, date character images and text character images, the position verification result includes character position deviation data and a mark indicating whether the position is qualified, the font style verification result includes a font matching degree and a font style consistency mark, and the lottery ticket format verification result includes a lottery format logic verification status and a lottery ticket format correctness mark.

3. The ticket format verification method based on noise reduction processing according to claim 1 is characterized in that: Based on the lottery image data, the steps of adjusting the image brightness, performing noise reduction optimization processing on the image, and adjusting the image contrast to obtain the optimized lottery image data are as follows: Based on the lottery image data, image brightness is adjusted, by adjusting the brightness value of each pixel to adjust the image brightness to a preset range, thereby obtaining brightness-adjusted image data; Performing image noise reduction processing based on the brightness-adjusted image data, smoothing the image using a Gaussian filter to eliminate random noise interference in the image, and obtaining noise-reduced optimized image data; Based on the noise reduction and optimization image data, the image contrast is adjusted, and the edges of numbers and text are highlighted by increasing the light and dark contrast of the image to obtain optimized lottery image data.

4. The ticket format verification method based on noise reduction processing according to claim 1 is characterized in that: Based on the optimized lottery image data, the steps of identifying the boundary between the number and date fields through edge detection, segmenting and independently processing each character, extracting the image area of each character, and obtaining the character data extraction result are as follows: Based on the optimized lottery image data, pixel gradients are evaluated through image analysis to identify boundaries between number and date fields in the image and obtain boundary recognition results; Based on the boundary recognition result, each character and number is recognized, and each character and number area is segmented to isolate each character and number to obtain a character segmentation result; Based on the character segmentation result, each character and number is subjected to independent image cropping processing. By defining the bounding box of each character, cropping is performed, and the image area of each character is extracted to obtain the character data extraction result.

5. The ticket format verification method based on noise reduction processing according to claim 1 is characterized in that: The formula for calculating the position offset of each character is: ; in, Indicates the position offset of the character. Represents the actual horizontal coordinate of the current character in the image, Represents the standard horizontal coordinate of the character in the database, Represents the actual vertical coordinate of the current character in the image, Represents the standard vertical coordinate of the character in the database, and are the weight coefficients of the horizontal and vertical axes respectively.

6. The ticket format verification method based on noise reduction processing according to claim 5 is characterized in that: The formula for evaluating the matching degree of character glyphs is: ; in, Represents the matching value of the character glyph, Indicates the current character outline point With standard contour points The distance between them is calculated by Euclidean distance. is the weight coefficient of each corresponding point, Indicates the total number of contour points used in the comparison process, Indicates the contour point index.

7. The ticket format verification method based on noise reduction processing according to claim 1 is characterized in that: Based on the position verification result and the font style verification result, the lottery ticket issuance time is compared with the ticket purchase time recorded in the system to check whether there is a time conflict, and the ticket issuance time is compared with the validity period of the lottery ticket to analyze the time interval and evaluate whether it complies with the lottery rules. The steps of obtaining the lottery ticket issuance format verification result are specifically as follows: Based on the position verification result and the font style verification result, the lottery ticket issuance time is compared with the ticket purchase time recorded in the system, and the year, month, and day of the date are checked item by item to see if they are consistent, thereby obtaining a date consistency check result; Based on the date consistency check result, the logical relationship between the ticket issuance time and the ticket purchase time is analyzed to check whether there is a time conflict, and whether the ticket date is earlier than the ticket purchase time to obtain a time conflict verification result; Based on the time conflict verification result, the ticket issuance time and the validity period of the lottery are analyzed, the time interval between the ticket issuance time and the validity period is calculated, and whether the time interval meets the requirements of the lottery rules is evaluated to obtain the lottery ticket issuance format verification result.

8. A ticket format verification system based on noise reduction processing, characterized in that: According to the ticket format verification method based on noise reduction processing according to any one of claims 1 to 7, the system comprises: The lottery image processing module adjusts the image brightness, performs noise reduction optimization processing on the image, and adjusts the image contrast based on the lottery image data to obtain optimized lottery image data; The character image extraction module segments and independently processes each character based on the optimized lottery image data, extracts the image area of each character, and obtains a character data extraction result; The character position analysis module compares the character data extraction result with the lottery format template pre-stored in the database, compares the actual position of each character with the standard position in the template, evaluates the character position deviation, verifies whether the character is within the error range, and obtains a position verification result; The character format analysis module compares the image of each character with the corresponding character in the standard font library based on the position verification result and the character data extraction result, analyzes the consistency of the glyphs, and obtains a font style verification result; The date consistency analysis module compares the lottery ticket issuance time with the ticket purchase time recorded by the system based on the position verification result and the font style verification result to check whether there is a time conflict and obtain the ticket issuance time analysis result; The lottery validity period format analysis module compares the ticket issuance time with the validity period of the lottery based on the ticket issuance time analysis result, analyzes the time interval, evaluates whether it meets the lottery rules, and obtains the lottery issuance format verification result.

Citation Information

Patent Citations

  • Digital image processing system applied to bill image character recognition and method

    CN104112128A

  • System and method for verifying invoice printing number code

    CN113095318A