Ticket issuing format verification method and system based on noise reduction processing
By using noise reduction processing and image analysis technology in lottery format verification, the shortcomings of traditional methods in character recognition and format verification are solved, and higher verification accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202510531001.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-04-25
AI Technical Summary
The traditional lottery ticket format verification method relies on static rules and simple logic, and cannot effectively process image data, resulting in limited accuracy of character recognition, easy to miss format errors, affecting the efficiency and accuracy of data processing.
The ticket issuing format verification method based on noise reduction processing is adopted. Through image brightness adjustment and noise reduction optimization processing, the boundary between the number and the date field is identified, each character is divided and independently processed, position verification and font style comparison are performed, and the final verification is made whether the ticket issuing time and validity period comply with the rules.
It improves the accuracy of character data extraction and the accuracy of position verification, ensures the consistency of font styles and the correctness of time information, reduces the risk of time conflicts, and significantly improves the accuracy and reliability of lottery ticket issuance format verification.
Smart Images

Figure CN120047951A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of format verification, and particularly to a ticket issuing format verification method and system based on noise reduction processing. Background Art
[0002] The technical field of format verification aims to ensure that data input or output conforms to predetermined standards and formats. The technology is usually applied in data input, file transfer, and data storage processes to prevent data errors and information damage. Format verification technology is widely used in various information processing systems, including application scenarios such as financial systems, data warehouses, and customer information management systems. By using preset rules and algorithms, format verification can automatically identify and correct format errors in data, improving the efficiency and accuracy of data processing.
[0003] Among them, the ticket issuing format verification method based on noise reduction processing is an application technology for lottery issuance and sales systems, aiming to ensure that the data format in the lottery ticket issuing process conforms to specific standards and specifications. This method ensures the validity and correctness of lottery tickets by automatically checking the formats of information such as lottery numbers, ticket issuing times, and amounts. Verification is crucial for protecting consumers' rights and interests, preventing fraud, and maintaining the overall trust in the lottery system. Using the ticket issuing format verification method based on noise reduction processing can greatly reduce human errors, improve ticket issuing efficiency and accuracy, and thus optimize the lottery sales and management processes.
[0004] Traditional verification methods rely on static rules and simple verification logics, lack in-depth analysis of image data, have limited accuracy in character recognition, and are prone to missing format errors. When traditional methods compare characters with templates, they mostly rely on fixed standards and cannot effectively handle fonts of different styles, resulting in unrecognizable situations, affecting the efficiency and accuracy of overall data processing. It reduces the reliability of the lottery system and restricts the modernization and automation processes of lottery management. Summary of the Invention
[0005] The purpose of the present invention is to solve the drawbacks existing in the prior art, and to propose a ticket issuing format verification method and system based on noise reduction processing. The technical solution is as follows:
[0006] On the one hand, a ticket issuing format verification method based on noise reduction processing is provided, including the following steps:
[0007] S1: Based on 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 boundaries of numbers and date fields through edge detection, segment and independently process each character, extract the image regions of each character, and obtain the character data extraction result;
[0009] S3: Based on the character data extraction result, compare it with the pre-stored lottery format template in the database, compare the actual positions of each character with the standard positions in the template, evaluate the character position deviation, and verify whether the character is within the error range to obtain the position verification result;
[0010] S4: Based on the position verification result and the character data extraction result, compare the image of each character with the corresponding character in the standard font library, analyze the consistency of the glyphs, and obtain the font style verification result;
[0011] S5: Based on the position verification result and the font style verification result, compare the ticket issuing time of the lottery with the ticket purchasing time recorded in the system, check whether there is a time conflict, and compare the ticket issuing time with the validity period of the lottery, analyze the time interval, and evaluate whether it meets the requirements of the lottery rules to obtain the lottery ticket issuing format verification result.
[0012] Optionally, the optimized lottery image data includes the 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 the font matching degree and a font style consistency mark, and the lottery ticket issuing format verification result includes the lottery format logical verification status and a correct lottery ticket issuing format identifier.
[0013] Optionally, the steps of performing image brightness adjustment, performing noise reduction optimization processing on the image, and adjusting the image contrast based on the lottery image data to obtain the optimized lottery image data are specifically as follows:
[0014] S101: Based on the lottery image data, perform image brightness adjustment, and adjust the image brightness to a preset range by adjusting the brightness value of each pixel to obtain the image data after brightness adjustment;
[0015] S102: Based on the image data after brightness adjustment, perform image noise reduction processing, smooth the image through a Gaussian filter, and eliminate the random noise interference in the image to obtain the noise reduction optimized image data;
[0016] S103: Based on the noise reduction optimized image data, adjust the image contrast, and highlight the edges of numbers and text by increasing the image brightness and darkness contrast to obtain the optimized lottery image data.
[0017] Optionally, based on the optimized lottery image data, through edge detection, identify the boundaries of numbers and date fields, segment and independently process each character, and extract the image region of each character. The specific steps for obtaining the character data extraction result are as follows:
[0018] S201: Based on the optimized lottery image data, through image analysis, evaluate the pixel gradient, identify the boundaries of numbers and date fields in the image, and obtain the boundary recognition result;
[0019] S202: Based on the boundary recognition result, identify each character and number, segment each character and number region, and isolate each character and number to obtain the character segmentation result;
[0020] S203: Based on the character segmentation result, perform independent image cropping processing on each character and number. By defining the bounding box of each character, perform cropping to extract the image region of each character and obtain the character data extraction result.
[0021] Optionally, based on the character data extraction result, compare it with the pre-stored lottery format template in the database, compare the actual position of each character with the standard position in the template, evaluate the character position deviation, and verify whether the character is within the error range. The specific steps for obtaining the position verification result are 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 character in the lottery format template in the database to obtain the current and standard character position data;
[0023] S302: Based on the current and standard character position data, calculate the position offset of each character to obtain the character offset evaluation result;
[0024] S303: Based on the character offset evaluation result, compare it with the preset offset preset, identify the characters with offset exceeding the set range, and record the character quantity and position information to obtain the position verification result.
[0025] Optionally, the formula for calculating the position offset of each character is:
[0026]
[0027] Where represents the position offset of the character, represents the actual abscissa of the current character in the image, represents the standard abscissa of the character in the database, represents the actual ordinate of the current character in the image, Represents the standard ordinate of characters in the database, and are the weight coefficients of the horizontal and vertical coordinates respectively.
[0028] Optionally, based on the position verification result and the character data extraction result, comparing the image of each character with the corresponding character in the standard font library, analyzing the consistency of the glyphs, and obtaining the font style verification result specifically includes the following steps:
[0029] S401: Based on the position verification result and the character data extraction result, analyze the ratio deviation between the current lottery image and the actual lottery size, scale the character image according to the ratio deviation, and adjust the character image to the actual size to obtain the scaled character image;
[0030] S402: Based on the scaled character image, compare it with the standard outline of the same font in the lottery format template, evaluate the matching degree of the character glyphs, and obtain the glyph matching degree analysis result;
[0031] S403: Based on the glyph matching degree analysis result, compare it with the preset matching degree threshold, mark the characters with a matching degree lower than the preset threshold, record the character position information, and obtain the font style verification result.
[0032] Optionally, the formula for evaluating the matching degree of the character glyphs is:
[0033]
[0034] where, represents the matching degree value of the character glyphs, represents the current character contour point and the standard contour point The distance between them is calculated by the Euclidean distance, is the weight coefficient of each corresponding point, represents the total number of contour points used in the comparison process, represents the contour point index.
[0035] Optionally, based on the position verification result and the font style verification result, compare the ticket issuing time of the lottery with the ticket purchasing time recorded in the system, check whether there is a time conflict, and compare the ticket issuing time with the expiration date of the lottery, analyze the time interval, and evaluate whether it meets the requirements of the lottery rules to obtain the lottery ticket issuing format verification result specifically includes the following steps:
[0036] S501: Based on the position verification result and the font style verification result, compare the ticket issuing time of the lottery with the ticket purchasing time recorded in the system, and check item by item whether the year, month, and day of the date match to obtain the date consistency check result;
[0037] S502: Based on the date consistency check result, analyze the logical relationship between the ticket issuing time and the ticket purchasing time, check for time conflicts, and determine whether the ticket date is earlier than the ticket purchasing time to obtain the time conflict verification result;
[0038] S503: Based on the time conflict verification result, analyze the ticket issuing time and the expiration date of the lottery, calculate the time interval between the ticket issuing time and the expiration date, and evaluate whether the time interval meets the requirements of the lottery rules to obtain the lottery ticket issuing format verification result.
[0039] On the other hand, a ticket issuing format verification system based on noise reduction processing is provided. The ticket issuing format verification system based on noise reduction processing is used to execute the above-mentioned ticket issuing format verification method based on noise reduction processing. The system includes:
[0040] The lottery ticket image processing module adjusts the image brightness based on the lottery ticket image data, performs noise reduction and optimization processing on the image, and adjusts the image contrast to obtain the optimized lottery ticket image data;
[0041] The character image extraction module divides and independently processes each character based on the optimized lottery ticket image data, extracts the image area of each character, and obtains the character data extraction result;
[0042] The character position analysis module compares the character data extraction result with the pre-stored lottery ticket format template in the database, compares the actual position of each character with the standard position in the template, evaluates the character position deviation, and verifies whether the character is within the error range to obtain the 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 the font style verification result;
[0044] The date consistency analysis module compares the ticket issuing time of the lottery with the ticket purchasing time recorded in the system based on the position verification result and the font style verification result, checks for time conflicts, and obtains the ticket issuing time analysis result;
[0045] The lottery ticket expiration date format analysis module compares the ticket issuing time with the expiration date of the lottery based on the ticket issuing time analysis result, analyzes the time interval, and evaluates whether it meets the requirements of the lottery rules to obtain the lottery ticket issuing format verification result.
[0046] The beneficial effects brought by the technical solution provided by the embodiments of the present invention at least include:
[0047] In the present invention, by independently splitting each character, the accuracy of character data extraction is improved, and it is compared with a pre-stored lottery format template. By verifying the position of each character, it is ensured that the actual position of the character meets the standard requirements, reducing verification errors caused by position deviation. By comparing the font styles, the morphological consistency of numbers and letters is ensured. Through the logical consistency check of the ticket issuing time and the ticket purchasing time, the correctness of the time information is ensured, reducing the risk of time conflicts, greatly improving the accuracy and reliability of lottery ticket issuing format verification, enhancing the overall trust of the lottery issuing and sales system, and effectively safeguarding the rights and interests of consumers and the 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 description in the embodiments.
[0049] Figure 1 It is a schematic flow chart of the method of the present invention;
[0050] Figure 2 It is a detailed flowchart of S1 of the present invention;
[0051] Figure 3 It is a detailed flowchart of S2 of the present invention;
[0052] Figure 4 It is a detailed flowchart of S3 of the present invention;
[0053] Figure 5 It is a detailed flowchart of S4 of the present invention;
[0054] Figure 6 It is a detailed flowchart of S5 of the present invention;
[0055] Figure 7 It is a system flowchart of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0056] The following describes the technical solutions in the present invention with reference to the drawings.
[0057] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "example" in the present invention should not be construed as more preferred or more advantageous than other embodiments or design solutions. Exactly, the use of the word "example" is intended to present concepts in a specific manner. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one of the two.
[0058] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, their intended meanings are the same. "Of", "corresponding", and "corresponding to" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, their intended meanings are the same.
[0059] In the embodiments of the present invention, sometimes subscripts such as W 1 may be written in a non-subscript form such as W1. When the difference between them is not emphasized, their intended meanings are the same.
[0060] To make the technical problems to be solved, technical solutions and advantages of the present invention clearer, the following will be described in detail with reference to the accompanying drawings and specific embodiments.
[0061] Embodiment
[0062] Please refer to Figure 1 , the present invention provides a ticket issuing format verification method based on noise reduction processing, including the following steps:
[0063] S1: Based on the lottery image data, adjust the image brightness, perform noise reduction and optimization processing on the image, adjust the image contrast, highlight the edges of numbers and characters, and obtain the optimized lottery image data;
[0064] S2: Based on the optimized lottery image data, through edge detection, identify the boundaries of numbers and date fields, isolate each character and number, perform segmentation and independent processing on each character, extract the image area of each character, and obtain the character data extraction result;
[0065] S3: Based on the character data extraction result, compare it with the pre-stored lottery format template in the database, compare the actual position of each character with the standard position in the template, evaluate the character position deviation, verify whether the character is within the error range, and obtain the position verification result;
[0066] S4: Based on the position verification result and the character data extraction result, compare it with the pre-stored lottery format template in the database, compare the image of each character with the corresponding character in the standard font library, analyze the consistency of the glyphs, and obtain the font style verification result;
[0067] S5: Based on the position verification result and the font style verification result, compare the ticket issuing time of the lottery with the ticket purchase time recorded in the system, verify the logical consistency, check whether there is a time conflict, and compare the ticket issuing time with the expiration date of the lottery, analyze the time interval, and evaluate whether it meets the requirements of the lottery rules to obtain the lottery ticket issuing format verification result.
[0068] The optimized lottery image data includes the 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 flag indicating whether the position is qualified. The font style verification result includes the font matching degree and a font style consistency flag. The lottery ticket printing format verification result includes the lottery format logical verification status and a correct identification of the lottery ticket printing format.
[0069] Please refer to Figure 2 , based on the lottery image data, perform image brightness adjustment, perform noise reduction optimization processing on the image, adjust the image contrast, and highlight the edges of numbers and text. The specific steps to obtain the optimized lottery image data are as follows:
[0070] S101: Based on the lottery image data, perform image brightness adjustment. By adjusting the brightness value of each pixel, adjust the image brightness to the preset range to obtain the image data after brightness adjustment;
[0071] Based on the lottery image data, scan and record the brightness information of each pixel value, then compare the deviation from the preset brightness range, analyze the required adjustment amount, and adjust the brightness value of each pixel to ensure that the brightness of each pixel does not exceed the set maximum brightness value and minimum brightness value after adjustment. The parameters involved in the adjustment operation include the brightness increase ratio, the maximum brightness limit, and the brightness balance point. The adjustment of the parameters is implemented through programming in the image processing software to ensure the uniform distribution of brightness and the true expression of colors during the adjustment process, and to avoid color deviation or brightness distortion introduced by the adjustment. Complete the brightness adjustment of the entire image to obtain the image data after brightness adjustment.
[0072] S102: Based on the image data after brightness adjustment, perform image noise reduction processing. Smooth the image through a Gaussian filter to eliminate random noise interference in the image and obtain the image data after noise reduction optimization;
[0073] Based on the image data after brightness adjustment, analyze and identify the types of noise in the image, usually including high-frequency noise and random noise, etc. Apply a Gaussian filter to filter the image data. The core parameters of the filter, such as the convolution kernel size and standard deviation, are optimized and set according to the image noise level. The parameters ensure that the image maintains edge information while effectively reducing noise points during the smoothing process. The influence on each pixel point during 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 and obtains the image data after noise reduction optimization.
[0074] S103: Based on the image data after noise reduction optimization, adjust the image contrast. By increasing the image brightness and darkness contrast, highlight the edges of numbers and text to obtain the optimized lottery image data.
[0075] Optimize the image data based on noise reduction, analyze the gray value distribution of the image data, determine the strategy and parameters for adjusting the contrast, including the contrast gain and contrast range, adjust the proportion of bright and dark pixels according to the gray histogram, and increase the dynamic range of the image data through an image processing algorithm. This process is implemented programmatically in an image processing software. The image after contrast adjustment is more vivid, and the edges of numbers and characters are more prominent due to the enhanced contrast. The adjustment makes important information such as numbers and characters in the image easier to identify. The lottery image data with optimized contrast highlights the key information, facilitating subsequent identification or processing. Please refer to Figure 3 , based on the optimized lottery image data, through edge detection, identify the boundaries of the number and date fields, isolate each character and number, segment and independently process each character, and extract the image region of each character. The steps for obtaining the character data extraction result are specifically as follows:
[0076] S201: Based on the optimized lottery image data, through image analysis, evaluate the pixel gradient, identify the boundaries of the numbers and date fields in the image, and obtain the boundary recognition result;
[0077] Based on the optimized lottery image data, calculate the gray value of each pixel in the image, and use the gradient calculation formula to obtain the gradient value of each pixel. Determine the change of the gradient by setting a threshold to identify the boundaries of the numbers and date fields. Determine the coordinates of the boundary points by comparing the gradient values of each pixel and the changes of its neighboring pixels. Apply edge detection techniques such as Canny edge detection to obtain a clearer boundary definition, and at the same time filter according to the characteristics of the image to ensure the accuracy of boundary recognition. The obtained boundary recognition result marks the positions of the number and date fields in the image.
[0078] S202: Based on the boundary recognition result, recognize each character and number, and segment each character and number region to isolate each character and number, and obtain the character segmentation result;
[0079] Based on the boundary recognition result, define the rectangular frames of the character and number regions, extract the pixel information of each region in the image. After region extraction, use the connected component analysis method to label adjacent pixels to identify independent character and number regions. Verify whether it is a valid character or number by counting the number of pixels and shape features in each region. According to the defined region frames, segment each character and number to obtain the character segmentation result, ensuring that each character and number is effectively isolated.
[0080] S203: Based on the character segmentation result, perform independent image cropping processing on each character and number. By defining the bounding box of each character, perform cropping to extract the image region of each character, and obtain the character data extraction result.
[0081] Based on the character segmentation result, extract the minimum bounding rectangle from the segmentation region of each character. The rectangle can precisely enclose the shape of the character. Use the image cropping function to crop each defined bounding box, extract the image region of the character. The cropping operation determines the upper left and lower right coordinates of each bounding box according to the image coordinate system, so as to accurately locate the position of the character in the image. After cropping, save the image region of each character as an independent image file to obtain the character data extraction result.
[0082] Please refer to Figure 4 , based on the character data extraction result, compare it with the pre-stored lottery format template in the database. Compare the actual position of each character with the standard position in the template, evaluate the character position deviation, and verify whether the character is within the error range. The specific steps to obtain 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 character in the lottery format template in the database to get the current and standard character position data;
[0084] Based on the character data extraction result, extract the position and size of each character in the image, including calculating the bounding box of each character to determine its exact coordinates in the image. Subsequently, obtain the lottery format template from the database. The template contains the standard character position data, which is usually stored in the form of relative coordinates, allowing for effective comparison with the extracted character positions to obtain the current and standard character position data.
[0085] S302: Based on the current and standard character position data, calculate the position offset of each character to obtain the character offset evaluation result;
[0086] The formula for calculating the position offset of each character is:
[0087]
[0088] Among them, represents the position offset of the character, represents the actual abscissa of the current character in the image, represents the standard abscissa of this character in the database, represents the actual ordinate of the current character in the image, represents the standard ordinate of this character in the database, and They are the weight coefficients of the horizontal and vertical coordinates respectively.
[0089] The formula is:
[0090]
[0091] Detailed parameter explanations and acquisition methods:
[0092] and : These represent the actual coordinates of the current character in the image, including the horizontal coordinate and the vertical coordinate . These data are usually automatically extracted from scanned lottery tickets or documents through image processing algorithms. For example, optical character recognition technology can be used to identify characters and determine their positions.
[0093] and : Represent the standard coordinates of the corresponding character in the database, including the horizontal coordinate and the vertical coordinate . The coordinates are predefined and are usually set according to historical data or lottery design specifications.
[0094] and : Are the weight coefficients of the horizontal and vertical coordinates, used to adjust the sensitivity of the coordinate axes according to specific application scenarios. In practical applications, these coefficients may need to be adjusted according to the layout characteristics of different lottery tickets and the requirements for recognition accuracy. Usually, these coefficients are obtained through experiments and optimization in the initial test stage of the algorithm to ensure the best offset evaluation performance.
[0095] Calculation example:
[0096] Set the following data and parameter settings: , , , , , .
[0097] Calculation process:
[0098]
[0099]
[0100]
[0101]
[0102]
[0103] Calculation result It indicates that the position offset of the current character is approximately 7.07 unit distances. This offset can be used to determine whether the character is within an acceptable error range. If the offset exceeds the preset threshold, it may be necessary to further check potential problems in the scanning or recognition process, or adjust the printing or design standards of the lottery ticket.
[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 character quantity and position information to obtain the position verification result.
[0105] Based on the character offset evaluation result, compare it with the preset offset range, compare each calculated character offset with the set maximum and minimum offset values, and through logical judgment, identify the characters that exceed the set range, record the quantity of the characters and their corresponding position information for subsequent review and processing, form the position verification result, and the result will provide a necessary basis for subsequent character correction or information extraction.
[0106] Please refer to Figure 5 , based on the position verification result and the character data extraction result, compare with the lottery ticket format template pre-stored in the database, compare the image of each character with the corresponding character in the standard font library, and analyze the consistency of the glyphs. The specific steps to obtain the font style verification result are as follows:
[0107] S401: Based on the position verification result and the character data extraction result, analyze the proportional deviation between the current lottery ticket image and the actual lottery ticket size, scale the character image according to the proportional deviation, and adjust the character image to the actual size to obtain the scaled character image;
[0108] Based on the position verification result and the character data extraction result, analyze the proportional deviation between the current lottery ticket image and the actual lottery ticket size, including measuring the ratio of the size of the extracted character image to the standard lottery ticket size, identifying the proportional deviation, scaling the character image according to the ratio, and the scaling operation is implemented by applying the corresponding image processing algorithm to ensure that the aspect ratio of each character remains unchanged, adjust it to the actual size, and obtain the scaled character image to ensure that it meets the actual lottery ticket size requirements.
[0109] S402: Based on the scaled character image, compare it with the standard outline of the same font in the lottery ticket format template, evaluate the matching degree of the character glyphs, and obtain the glyph matching degree analysis result;
[0110] The formula for evaluating the matching degree of the character glyphs is:
[0111]
[0112] Among them, The matching degree value representing the character glyph Indicates the current character contour point and the standard contour point The distance between them is calculated by the 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] Detailed explanation of parameters and acquisition methods
[0116] : The matching degree value representing the character glyph. This value is used to quantify the similarity between the character image and the standard contour. The closer the value is to 1, the higher the matching degree
[0117] : Indicates the current character contour point and the standard contour point The distance between them. This distance is usually calculated by the Euclidean distance. The formula is . Among them and are the coordinates of point , and are the coordinates of point
[0118] : The weight coefficient of each corresponding point, used to indicate the importance of point and point . 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] The total number of contour points (representing three corresponding feature points), , , , representing the distance between corresponding points, and the weight coefficient is , , .
[0123] Calculate the matching degree:
[0124]
[0125]
[0126]
[0127]
[0128]
[0129]
[0130] Calculation result , indicating that the matching degree between the character image and the standard contour is low because the value is far from 1, and the result indicates a large shape deviation.
[0131] S403: Based on the analysis result of the glyph matching degree, compare it with the preset matching degree threshold, mark the characters with a matching degree lower than the preset threshold, record the character position information, and obtain the font style verification result.
[0132] Based on the analysis result of the glyph matching degree, compare it with the preset matching degree threshold, including setting the minimum acceptance standard of the matching degree, then evaluate the matching degree of each character one by one, mark the characters with a matching degree lower than the preset threshold, record the position information of these characters for subsequent processing, form the font style verification result, and the result will provide a necessary basis for subsequent character adjustment or replacement.
[0133] Please refer to Figure 6 , based on the position verification result and the font style verification result, compare the ticket issuing time of the lottery with the ticket purchasing time recorded in the system, verify the logical consistency, check whether there is a time conflict, and compare the ticket issuing time with the expiration date of the lottery, analyze the time interval, and evaluate whether it meets the requirements of the lottery rules. The specific steps to obtain the lottery ticket issuing format verification result are as follows:
[0134] S501: Based on the position verification result and the font style verification result, compare the ticket issuing time of the lottery with the ticket purchasing time recorded in the system, check item by item whether the year, month, and day of the date match, and obtain the date consistency check result;
[0135] Based on the position verification result and the font style verification result, compare the ticket issuing time of the lottery with the ticket purchasing time recorded in the system, including checking item by item the year, month, day, hour, minute, and second of the date to ensure the complete consistency of the two in each time unit. During the comparison process, perform an exact match for each time unit, and record any mismatched items found to obtain the date consistency check result.
[0136] S502: Based on the date consistency check result, analyze the logical relationship between the ticket issuance time and the ticket purchase time, check for time conflicts, determine whether the ticket date is earlier than the ticket purchase time, and obtain the time conflict verification result.
[0137] Based on the date consistency check result, analyze the logical relationship between the ticket issuance time and the ticket purchase time, including checking whether the ticket issuance time is earlier than the ticket purchase time to determine whether there is a time conflict, perform time logical verification, and ensure the rationality and logical correctness of the ticket issuance time by comparing the timestamps of the two dates or directly comparing their respective year, month, day, hour, minute, and second values, confirm the time legality of the lottery ticket, avoid logical errors such as the ticket issuance time being earlier than the ticket purchase time, and obtain the time conflict verification result.
[0138] S503: Based on the time conflict verification result, analyze the ticket issuance time and the valid period of the lottery ticket, calculate the time interval between the ticket issuance time and the valid period, evaluate whether the time interval meets the requirements of the lottery rules, and obtain the lottery ticket issuance format verification result.
[0139] Based on the time conflict verification result, the system analyzes the ticket issuance time and the valid period of the lottery ticket, calculates the time interval between the ticket issuance time and the valid period, including comparing the ticket issuance time with the end time of the validity period, calculating the time difference between the two through timestamps, and making a reference according to the requirements of the lottery rules, such as the maximum duration from ticket issuance to expiration, and comparing it with the actually calculated time interval. If the time interval meets the rule requirements, confirm that the format of the lottery ticket is correct. If not, record the specific differences to ensure that the time attribute of the lottery ticket complies with all relevant regulations, obtain the lottery ticket issuance format verification result, and ensure that the ticket issuance time is within the valid period.
[0140] Please refer to Figure 7 , a ticket issuance format verification system based on noise reduction processing. The ticket issuance format verification system based on noise reduction processing is used to execute the above-mentioned ticket issuance format verification method based on noise reduction processing. The system includes:
[0141] The lottery ticket image processing module, based on the lottery ticket image data, adjusts the image brightness, performs noise reduction and optimization processing on the image, adjusts the image contrast, highlights the edges of numbers and text, and obtains the optimized lottery ticket image data.
[0142] The character image extraction module, based on the optimized lottery ticket image data, through edge detection, identifies the boundaries of numbers and date fields, isolates each character and number, performs segmentation and independent processing on each character, and extracts the image area of each character to obtain the character data extraction result.
[0143] Based on the character data extraction results, the character position analysis module compares with the pre-stored lottery format templates 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] Based on the position verification result and the character data extraction result, the character format analysis module compares with the pre-stored lottery format templates 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 result;
[0145] Based on the position verification result and the font style verification result, the date consistency analysis module compares the ticket issuing time of the lottery with the ticket purchasing time recorded in the system, verifies the logical consistency, checks whether there is a time conflict, and obtains the ticket issuing time analysis result;
[0146] Based on the ticket issuing time analysis result, the lottery validity period format analysis module compares the ticket issuing time with the validity period of the lottery, analyzes the time interval, evaluates whether it meets the requirements of the lottery rules, and obtains the lottery ticket issuing format verification result.
[0147] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope 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 is subjected to noise reduction optimization processing, and the image contrast is adjusted to obtain optimized lottery image data; Based on the optimized lottery image data, the boundary between the number and date fields is identified through edge detection, each character is segmented and processed independently, the image area of each character is extracted, and the character data extraction result is obtained; 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 whether it is 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 glyphs 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, the time interval is analyzed, and whether it meets the lottery rules requirements is evaluated to obtain the lottery ticket issuance format verification result.
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 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 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, the image brightness is adjusted, and the image brightness is adjusted to a preset range by adjusting the brightness value of each pixel to obtain the image data after the brightness adjustment; Based on the image data after brightness adjustment, image noise reduction processing is performed, and the image is smoothed by a Gaussian filter to eliminate random noise interference in the image, so as to obtain noise reduction 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 image light and dark contrast, thereby obtaining 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 specifically as follows: 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, thereby obtaining a boundary recognition result; 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, and the image area of each character is extracted by defining the boundary box of each character 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: 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 whether it is 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; Based on the current and standard character position data, the position offset of each character is calculated to obtain a character offset evaluation result; Based on the character offset evaluation result, it is compared with the preset offset preset, the characters whose offset exceeds the set range are identified, and the number of characters and position information are recorded to obtain the position verification result.
6. The ticket format verification method based on noise reduction processing according to claim 5 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.
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 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 font is analyzed to obtain the font style verification result. Specifically, the steps are as follows: Based on the position verification result and the character data extraction result, analyzing the ratio deviation between the current lottery image and the actual lottery size, scaling the character image according to the ratio deviation, adjusting the character image to the actual size, and obtaining a scaled character image; Based on the scaled character image, the character image is compared with the 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 degree analysis result; Based on the glyph matching analysis result, a comparison is made 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.
8. The ticket format verification method based on noise reduction processing according to claim 7 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.
9. 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 meets 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 by the system, and the year, month and day of the date are checked item by item to see whether they are consistent, and the date consistency check result is obtained; 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 the 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 lottery rules is evaluated to obtain the lottery ticket issuance format verification result.
10. 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 9, the system comprises: 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, and obtains 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 the 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 the 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 the 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, checks whether there is a time conflict, and obtains the ticket issuance time analysis result; The lottery ticket validity period format analysis module compares the ticket issuance time with the validity period of the lottery ticket based on the ticket issuance time analysis result, analyzes the time interval, evaluates whether it meets the lottery rules, and obtains the lottery ticket 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
Digital verification method and device based on optical character recognition, equipment and medium
CN116895074A
Invoice information positioning and interception system and method based on image recognition
CN119785369A
Financial data automatic extraction and articulation processing system and method
CN119831767A