Method and system for content recognition based on digital color images

By analyzing the connected component features of digital color grayscale images, the membership degree of the winning numbers is obtained and targeted stretching processing is performed, which solves the problem of low recognition efficiency of winning numbers in paper-based digital color images and improves recognition accuracy.

CN119851286BActive Publication Date: 2025-12-16WUHAN LINGLANG TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510027904.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-12-16
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency and error-proneness when identifying lottery numbers in paper-based digital color images, especially due to inconsistent image quality and complex information processing, which makes it difficult to identify the lottery numbers.

Method used

By analyzing the connected components in digital grayscale images, we obtain the black salience, the same-line height consistency, and the shape feature value. We then combine these features to obtain the membership degree of the winning numbers and perform targeted contrast stretching to highlight the winning numbers and reduce the interference of other information.

Benefits of technology

It improves the recognition accuracy of winning numbers in digital lottery images, reduces the impact of other lottery information on winning number recognition, and achieves more efficient and accurate automatic recognition of winning numbers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119851286B_ABST
    Figure CN119851286B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image recognition, in particular to a content recognition method and system based on a digital color image, which comprises the following steps: acquiring a digital color image and converting the digital color image into a digital color gray image; acquiring each connected domain in the digital color gray image; acquiring the black highlight degree of each connected domain by the distribution of the gray value of the pixel points in each connected domain; acquiring the same-line height consistency degree of each connected domain; acquiring the shape feature value of each connected domain by analyzing the degree of the shape of each connected domain being close to a rectangle and the position distribution range of the pixel points in each connected domain in the set direction; further obtaining the lottery number membership degree of each connected domain; acquiring the contrast stretching result of each pixel point in the digital color gray image; and acquiring the lottery number of the digital color image by the contrast stretching result. The application aims to improve the recognition accuracy of the lottery number in the digital color image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image recognition, in particular to a content recognition method and system based on digital color images. BACKGROUND

[0002] Currently popular digital color, such as color ball and big lottery, etc. digital lottery, are all paper lottery, which need to be manually compared with the winning situation, low efficiency and easy to make mistakes, the prior art automatically checks the winning situation by recognizing the content of the photographed digital color image, but due to the paper version of the digital color is not easy to save, easy to wrinkle, folding and bending phenomenon, combined with the difference of the shooting device, resulting in the quality of the digital color image is not the same, and further affect the identification of the winning number in the digital color image, therefore, the image information in the digital color image needs to be enhanced.

[0003] The traditional image enhancement algorithm based on contrast stretching usually uniformly stretches the contrast of all pixel points in the whole image, but for the digital color image containing complex information, such as the period number, station number, serial number, winning number and anti-counterfeit code of the lottery information in the digital color image, the uniform contrast stretching processing may cause the local feature loss of the winning number information, and increase the interference of the remaining lottery information to the winning number information identification, and further cause the difficulty in identifying the winning number. SUMMARY

[0004] In view of the above, it is necessary to provide a content recognition method and system based on digital color images, which improves the recognition accuracy of the winning number in the digital color image compared with the traditional content recognition method of the digital color image:

[0005] In the first aspect, the embodiments of the present application provide a content recognition method based on digital color images, which comprises the following steps:

[0006] Obtain a digital color image and convert it into a digital color gray image;

[0007] Obtain each connected domain in the digital color gray image by analyzing the gray distribution of all pixel points in the digital color gray image;

[0008] Obtain the black highlight degree of each connected domain by the distribution of the gray value of the pixel points in each connected domain;

[0009] Obtain each same-row connected domain of each connected domain by analyzing the similarity degree of the coordinates of the pixel points in each connected domain and all other connected domains in a set direction; obtain the same-row height consistency degree of each connected domain by analyzing the difference of the position distribution range of the pixel points in each connected domain and its same-row connected domains in the set direction;

[0010] The shape feature value of each connected domain is obtained by analyzing the degree to which the shape of each connected domain is close to a rectangle and the position distribution range of the pixel points in the connected domain in the set direction;

[0011] The winning number membership degree of each connected domain is obtained by comprehensively analyzing the black highlight, the same row height consistency and the shape feature value;

[0012] When the pixel point is located in the connected domain in the digital color gray image, the contrast stretching result of the pixel point is obtained by the winning number membership degree of the connected domain where the pixel point is located; and the winning number of the digital color image is obtained by the contrast stretching result.

[0013] In one embodiment, the connected domain obtaining process is as follows:

[0014] The threshold segmentation algorithm is used to obtain the segmentation threshold of the gray value of all pixel points in the digital color gray image, and the pixel points less than the segmentation threshold in the digital color gray image are regarded as the lottery information pixel points.

[0015] The edge detection operator is used to extract the edge image of the digital color gray image, and the connected domain extraction is performed on all the lottery information pixel points in the edge image to obtain each connected domain in the digital color gray image.

[0016] In one embodiment, the black highlight obtaining process is as follows: the mean value of the gray value of all pixel points in each connected domain is calculated, and the black highlight is inversely proportional to the mean value.

[0017] In one embodiment, the same row connected domain obtaining process is as follows:

[0018] The mean value of the coordinates of all pixel points in each connected domain in the set direction is calculated, which is denoted as the coordinate mean value;

[0019] The difference between the coordinate mean value of any connected domain and the coordinate mean value of the remaining connected domains is calculated, which is denoted as the coordinate difference;

[0020] The coordinate differences are arranged in ascending order, and the connected domains corresponding to the first pre-set number of coordinate differences are regarded as the same row connected domains of the any connected domain.

[0021] In one embodiment, the same row height consistency obtaining process is as follows:

[0022] The range of the distribution is reflected by the range of the coordinates of all pixel points in each connected domain in the set direction;

[0023] The difference between the range of each connected domain and the range of the same row connected domain of each connected domain is calculated, which is denoted as the height difference;

[0024] The same-row height consistency is inversely proportional to the height difference.

[0025] In one embodiment, the shape feature value is a ratio of rectangularity of each connected domain to the range.

[0026] In one embodiment, the process of obtaining the winning number membership degree is:

[0027] The product of the black prominence and the same-row height consistency is calculated.

[0028] The winning number membership degree is proportional to the product and inversely proportional to the shape feature value.

[0029] In one embodiment, the expression of the contrast stretching result is:

[0030] wherein, represents the contrast stretching result of pixel point a in the digital color gray image; a represents a pixel point in the digital color gray image; round() represents a rounding function; norm() represents a normalization function; represents the winning number membership degree of the connected domain in which pixel point a is located; AN represents a set composed of pixel points in all connected domains in the digital color gray image; g represents a preset non-negative integer used for controlling the contrast stretching result of pixel point a.

[0031] In one embodiment, the method for obtaining the winning number of the digital color image is:

[0032] The gray value of each pixel point in each connected domain in the digital color gray image is replaced by the contrast stretching result to obtain a digital color gray enhanced image.

[0033] A threshold segmentation algorithm is used to obtain a foreground image in the digital color gray enhanced image, an optical character recognition technology is used to recognize the digital content in the foreground image, and the recognized digital content is taken as the winning number of the digital color image.

[0034] In a second aspect, the embodiments of the present application further provide a content recognition system based on a digital color image, which comprises a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of the content recognition method based on the digital color image as described above when executing the computer program.

[0035] The present application has at least the following beneficial effects:

[0036] The present application obtains black highlight degree by analyzing the gray scale distribution of the digital color lottery number and the remaining lottery information in the digital color gray scale image, reflects the possibility that the characters corresponding to each connected domain belong to the lottery number, anti-fake mark or purchase amount, and can reduce the influence of the remaining information in the digital color image except the lottery number, anti-fake mark and purchase amount on the recognition accuracy of the subsequent lottery number; the characters in the same row in the digital color image are recognized through the coordinates of the pixel points in each connected domain in the set direction, and the difference in height of the characters in the same row is analyzed to obtain the same row height consistency degree, which reflects the possibility that the characters corresponding to each connected domain belong to the purchase amount or the internal characters of the two-dimensional code, and can reduce the influence of the purchase amount and the internal characters of the two-dimensional code in the digital color image on the recognition accuracy of the subsequent lottery number; the shape feature value is obtained by analyzing the shape and height of each connected domain, which reflects the possibility that the characters corresponding to each connected domain are anti-fake codes, and can reduce the influence of the anti-fake codes on the recognition accuracy of the subsequent lottery number;

[0037] Further, the lottery number membership degree is obtained by comprehensively considering the black highlight degree, the same row height consistency degree and the shape feature value, which fully considers the difference between the lottery number and the remaining lottery information, can more accurately locate the lottery number in the digital color image, and then based on the lottery number membership degree, the pixel points in the digital color gray scale image are subjected to appropriate contrast stretching processing, which can more effectively highlight the lottery number and reduce the visual impact of the remaining lottery information, thereby improving the recognition accuracy of the lottery number in the digital color image. BRIEF DESCRIPTION OF DRAWINGS

[0038] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0039] Figure 1 The step flow chart of the content recognition method based on the digital color image provided by an embodiment of the present application is shown in the figure;

[0040] Figure 2 The acquisition flowchart of the same row connected domain is shown in the figure;

[0041] Figure 3 The acquisition flowchart of the same row height consistency degree is shown in the figure;

[0042] Figure 4 The acquisition flowchart of the contrast stretching result is shown in the figure. DETAILED DESCRIPTION

[0043] In the description of the embodiments of the present application, the words "exemplary", "or", "for example" are used to mean serving as an example, instance, or illustration, and not to imply any preference or superiority. In fact, the use of "exemplary", "or", "for example" is intended to present concepts in a concrete manner.

[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. It is understood that unless specifically stated otherwise, "or" as used herein is intended to mean either or both of the listed alternatives.

[0045] In addition, it should be pointed out that the terms "first", "second" in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0046] The specific scheme of the content recognition method and system based on digital color images provided by the present application will be described in detail below in combination with the accompanying drawings.

[0047] Please refer to Figure 1 which shows the step flowchart of the content recognition method based on digital color images provided by an embodiment of the present application, which comprises the following steps:

[0048] Step 1, obtaining a digital color image and converting it into a digital color gray image.

[0049] Under sufficient light conditions, a CCD camera is used to take a picture directly above the digital color, obtaining a digital color image. The digital color image is converted into a digital color gray image, and a filtering algorithm is used to perform denoising processing on the digital color gray image, so as to reduce the influence of noise generated in the process of taking pictures on the subsequent recognition of the winning numbers in the digital color image. The conversion of the gray image is a known technology, and will not be described here.

[0050] In this embodiment, a bilateral filtering algorithm is used to perform denoising processing on the digital color gray image. As other implementation manners, on the basis of being able to realize the denoising processing on the digital color gray image, the implementer can use other existing technologies to perform denoising processing on the digital color gray image, such as a median filtering algorithm, a Gaussian filtering algorithm, etc., and the present application does not make special limitations.

[0051] Step 2, obtaining each connected domain in the digital color gray image by analyzing the gray scale distribution of all pixel points in the digital color gray image.

[0052] Since the digital color image obtained by shooting can contain some background information that is not a lottery ticket, the lottery ticket information in the digital color image, such as the text, numbers, and anti-counterfeit codes of the lottery ticket, is black, and has a smaller gray value than the background in the digital color image.

[0053] Based on the above analysis, in order to improve the recognition accuracy of the winning numbers in the subsequent digital color image, the gray values of all pixel points in the digital color gray image are taken as the input of the threshold segmentation algorithm, and the segmentation threshold is output. The pixel points in the digital color gray image with a gray value less than the segmentation threshold are taken as the lottery information pixel points, which are used to represent the pixel points corresponding to the lottery information such as the text, numbers, and anti-counterfeit codes of the lottery ticket in the digital color image.

[0054] In this embodiment, the Otsu threshold segmentation algorithm is used to obtain the segmentation threshold. The Otsu threshold segmentation algorithm is a known technology, and will not be described again. As other embodiments, on the basis of being able to obtain the segmentation threshold, the implementer can use other existing technologies to obtain the segmentation threshold, such as global threshold segmentation, iterative threshold segmentation, etc., which are not specially limited by the present application.

[0055] The edge image of the digital color gray image is extracted using an edge detection operator, and all the lottery information pixel points in the edge image are extracted to obtain each connected domain in the digital color gray image. Each connected domain corresponds to an image region, and an image region contains all pixel points constituting a character (such as Chinese characters, numbers, and symbols). The extraction of the connected domain is a known technology, and will not be described again.

[0056] In this embodiment, the Roberts operator is used to extract the edge image of the digital color gray image. The Roberts operator is a known technology, and will not be described again. As other embodiments, on the basis of being able to extract the edge image of the digital color gray image, the implementer can use other existing technologies to extract the edge image of the digital color gray image, such as the Prewitt operator, the Sobel operator, etc., which are not specially limited by the present application.

[0057] Step 3, the black highlight degree of each connected domain is obtained by the distribution of the gray values of the pixel points in each connected domain.

[0058] Generally, the winning numbers, anti-counterfeit marks, and purchase amounts in the digital color image are the most important information in the lottery ticket, and usually use darker black characters than the rest of the information in the lottery ticket to highlight these important information, so that the purchaser can observe and verify.

[0059] Based on the above analysis, taking the nth connected domain in the digital color gray image as an example, the mean value of the gray values of all pixel points in the nth connected domain is calculated, and the reciprocal of the sum of the mean value and a preset value α greater than 0 is taken as the black highlighting degree of the nth connected domain, which is used to represent the black highlighting degree of the character corresponding to the nth connected domain. Wherein, the purpose of adding α is to avoid the denominator being 0, and the value of α is preset by human, which can be set by the implementer, and the value of α in this embodiment is 0.01.

[0060] Step 4, by analyzing the similarity of the coordinates of the pixel points in each connected domain and the remaining all connected domains in the set direction, the same row connected domains of each connected domain are obtained; by analyzing the difference of the position distribution range of the pixel points in each connected domain and its same row connected domains in the set direction, the same row height consistency of each connected domain is obtained.

[0061] Since the printing standard of digital color is to print clear and complete characters and uniform ink color, in the printing process, the characters in the same row usually maintain consistent height and format, and there is a certain interval between the adjacent two rows of characters to ensure the standardization and readability of the lottery information, but the purchase amount in the digital color usually adopts a larger font size to highlight, so that the purchase amount and the remaining text information in the same row have a large difference in character height; and a two-dimensional code may appear in the digital color, and the shapes of the characters inside the two-dimensional code are diverse, so that the characters inside the two-dimensional code and the remaining characters in the same row have a large difference in height.

[0062] In this embodiment, the placement direction of the digital color image is 90 degrees.

[0063] Based on the above analysis, in order to reduce the influence of the purchase amount and the two-dimensional code on the recognition accuracy of the winning numbers in the digital color image, still taking the nth connected domain as an example, the mean value of the vertical coordinates of all pixel points in the nth connected domain is recorded as the coordinate mean value, which is used to represent the row position of the character corresponding to the nth connected domain in the digital color; the range of the vertical coordinates of all pixel points in the nth connected domain is calculated, which is used to represent the height value of the character corresponding to the nth connected domain in the digital color. Wherein, the vertical coordinate is only one embodiment of the present application, which needs to be determined according to the placement direction of the digital color image, and the placement direction of the digital color image can be set by the implementer.

[0064] Further, the difference between the coordinate mean value of the nth connected domain and the remaining connected domains in the digital color gray image is calculated, which is recorded as the coordinate difference, and the coordinate difference is arranged in ascending order, and the connected domains corresponding to the first preset number of coordinate differences are taken as the same row connected domains of the nth connected domain, which is used to represent the characters in the same row as the character corresponding to the nth connected domain in the digital color gray image. The flowchart of obtaining the same row connected domain is shown in Figure 2 .

[0065] In this embodiment, the difference between the mean values of the coordinates is the absolute value of the difference. Alternatively, other calculation methods can be used to measure the difference between the mean values of the coordinates, such as a ratio, a square of the difference, etc. The present application does not make special limitations.

[0066] In this embodiment, the preset number of values is 8. The preset number of values can be set by the implementer according to the actual situation. The present application does not make special limitations.

[0067] Further, the difference between the range differences between the nth connected domain and each of the connected domains in the same row is calculated and denoted as a height difference. The average of all the height differences is calculated. The reciprocal of the sum of the average and a preset constant μ greater than 0 is used as the height consistency degree of the nth connected domain in the same row, which is used to represent the consistency degree of the character corresponding to the nth connected domain and the other characters in the same row in the digital color grayscale image in height. The greater the value of the height consistency degree in the same row, the greater the consistency degree. The purpose of adding μ is to avoid a denominator of 0. The value of μ is preset by a human being and can be set by the implementer. In this embodiment, the value of μ is 0.01. The acquisition process of the height consistency degree in the same row is shown in FIG. 8. Figure 3

[0068] In this embodiment, the difference between the ranges is the absolute value of the difference. Alternatively, other calculation methods can be used to measure the difference between the ranges, such as a ratio, a square of the difference, etc. The present application does not make special limitations.

[0069] In step 5, the shape feature value of each connected domain is obtained by analyzing the degree to which the shape of each connected domain is close to a rectangle and the position distribution range of the pixel points in the connected domain in the set direction.

[0070] Generally, the anti-fake code in the digital color is a regular rectangle, and the height of the character corresponding to the anti-fake code is less than the height of the character corresponding to the winning number in the digital color.

[0071] Based on the above analysis, in order to reduce the influence of the anti-fake code on the recognition accuracy of the winning number in the digital color image, the ratio of the rectangular degree of the nth connected domain to the range is used as the shape feature value of the nth connected domain, which is used to represent the possibility that the character corresponding to the nth connected domain belongs to the anti-fake code. The greater the shape feature value, the greater the possibility that the character corresponding to the nth connected domain has the anti-fake code feature. The calculation of the rectangular degree is a known technology, which will not be described herein.

[0072] ​Step 6, the black highlight, the same row height consistency and the shape feature value are comprehensively analyzed to obtain the lottery number membership of each connected domain.

[0073] Further, the lottery number membership of the nth connected domain is obtained based on the black highlight, the same row height consistency and the shape feature value of the nth connected domain, which is used to represent the possibility that the character corresponding to the nth connected domain belongs to the lottery number, and the expression is:

[0074] In the formula, the lottery number membership of the nth connected domain is represented by The black highlight of the nth connected domain is represented by The same row height consistency of the nth connected domain is represented by The shape feature value of the nth connected domain is represented by

[0075] It should be noted that in the digital color gray image, the greater the black highlight of the character corresponding to the nth connected domain, i.e. The greater the black highlight of the character corresponding to the nth connected domain, the less likely it is to belong to the remaining information in the digital color gray image except the lottery number, the anti-fake mark and the purchase amount; the greater the height consistency of the character corresponding to the nth connected domain and the remaining characters in the same row, i.e. The greater the height consistency of the character corresponding to the nth connected domain and the remaining characters in the same row, the less likely it is to belong to the purchase amount and the characters inside the two-dimensional code; the less the character corresponding to the nth connected domain has the characteristics of the anti-fake code, i.e. The less the character corresponding to the nth connected domain has the characteristics of the anti-fake code, the less likely it is to belong to the anti-fake code; and The greater the lottery number membership of the character corresponding to the nth connected domain in the digital color gray image, i.e. The greater the lottery number membership of the character corresponding to the nth connected domain in the digital color gray image.

[0076] According to the same method of obtaining the lottery number membership of the nth connected domain, the lottery number membership of the remaining connected domains in the digital color gray image is obtained.

[0077] Step 7, when the pixel point is located in the connected domain in the digital color gray image, the contrast stretching result of the pixel point is obtained through the lottery number membership of the connected domain where the pixel point is located, otherwise, the contrast stretching result of the pixel point is obtained according to the preset rule; and the lottery number of the digital color image is obtained through the contrast stretching result.

[0078] ​The judgment of whether each pixel point in the digital color gray image exists in the connected domain is based on the judgment result to obtain the contrast stretching result of each pixel point in the digital color gray image, which is used to represent the gray value of each pixel point in the enhanced digital color gray image, and the expression is:

[0079] In the formula, The contrast stretching result of pixel point a in the digital color gray image is represented; a represents the pixel point in the digital color gray image; round() represents the rounding function; norm() represents the normalization function; The lottery number membership degree of the connected domain in which pixel point a is located is represented; AN represents the set composed of all pixel points in the connected domain in the digital color gray image; g represents a preset non-negative integer used to control the contrast stretching result of pixel point a, and the value of g is 255.

[0080] In this embodiment, the Min-Max normalization method is used to normalize the lottery number membership degree. As other implementation manners, on the basis of realizing the normalization of the lottery number membership degree, the implementer can use other existing technologies to normalize the lottery number membership degree, such as the decimal scaling normalization method, the Sigmoid function, etc., which is not specially limited in this application.

[0081] It should be noted that: if the pixel point a is located in the background area of the non-lottery information in the digital color image, the gray value of the pixel point a is large, and the gray value of the pixel point a is not processed; if the pixel point a is located in the lottery information area in the digital color image, that is, , and the possibility that the character corresponding to the pixel point a belongs to the lottery number in the digital color gray image is larger, that is, larger, in order to improve the identification probability of the lottery number information corresponding to the pixel point a, the gray value of the pixel point a in the enhanced digital color gray image should be smaller, that is, the contrast stretching result of the pixel point a should be smaller, so as to enhance the gray difference between the characters corresponding to the remaining information and the lottery number. The acquisition process diagram of the contrast stretching result is shown in Figure 4 .

[0082] According to the same acquisition method of the contrast stretching result of the pixel point a, the contrast stretching results of the remaining pixel points located in the connected domain in the digital color gray image are obtained. The gray values of the pixel points in each connected domain in the digital color gray image are replaced by the contrast stretching results, and the digital color gray enhanced image is obtained.

[0083] The threshold segmentation algorithm is used to obtain the foreground image in the digital color gray enhanced image, and the optical character recognition technology is used to recognize the digital content in the foreground image, and the recognized digital content is used as the lottery number of the digital color image.

[0084] In this embodiment, the foreground image is obtained by using the Otsu threshold segmentation algorithm. As other implementation manners, on the basis of obtaining the foreground image, the implementer can obtain the foreground image by using other prior art, such as global threshold segmentation, iterative threshold segmentation, and the like, and the present application does not make special limitation.

[0085] Based on the same inventive concept as the above method, the embodiment of the present application also provides a content recognition system based on a digital color image, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of the method in any one of the above content recognition methods based on a digital color image when executing the computer program.

[0086] In summary, the present application obtains the black highlight degree by analyzing the gray scale distribution of the winning numbers and the remaining lottery information in the digital color gray scale image, reflects the possibility that the characters corresponding to each connected domain belong to the winning numbers, the anti-fake mark or the purchase amount, and can reduce the influence of the remaining information in the digital color image except the winning numbers, the anti-fake mark and the purchase amount on the recognition accuracy of the subsequent winning numbers; the characters in the same row in the digital color image are identified by the coordinates of the pixel points in each connected domain in the set direction, and the difference in height of the characters in the same row is analyzed to obtain the same row height consistency, which reflects the possibility that the characters corresponding to each connected domain belong to the purchase amount or the internal characters of the two-dimensional code, and can reduce the influence of the purchase amount and the internal characters of the two-dimensional code in the digital color image on the recognition accuracy of the subsequent winning numbers; the shape feature value is obtained by analyzing the shape and height of each connected domain, which reflects the possibility that the characters corresponding to each connected domain are anti-fake codes, and can reduce the influence of the anti-fake codes on the recognition accuracy of the subsequent winning numbers.

[0087] Further, the winning number membership degree is obtained by comprehensively considering the black highlight degree, the same row height consistency and the shape feature value, which fully considers the difference between the winning numbers and the remaining lottery information, can more accurately locate the winning numbers in the digital color image, and then based on the winning number membership degree, the pixel points in the digital color gray scale image are subjected to appropriate contrast stretching processing, which can more effectively highlight the winning numbers and reduce the visual impact of the remaining lottery information, thereby improving the recognition accuracy of the winning numbers in the digital color image.

[0088] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0089] It is apparent that a person skilled in the art can make a variety of modifications to the application described herein without departing from the spirit and scope of the application. Therefore, the described embodiments are to be considered in all respects as illustrative and not restrictive.

Claims

1. A content recognition method based on digital color images, characterized in that, The method includes the following steps: Acquire a digital color image and convert it to a digital color grayscale image; By analyzing the grayscale distribution of all pixels in a digital color grayscale image, the connected components in the digital color grayscale image are obtained. The black prominence of each connected component is obtained by analyzing the distribution of grayscale values ​​of pixels within each connected component. By analyzing the similarity of the coordinates of pixels in each connected component with those in all other connected components in a set direction, the connected components in each same row of each connected component are obtained; by analyzing the difference in the position distribution range of pixels in each connected component and its connected components in the set direction, the height consistency of each connected component in the same row is obtained. By analyzing the degree to which the shape of each connected region is close to a rectangle, and the positional distribution range of the pixels in each connected region in the set direction, the shape feature value of each connected region is obtained. By comprehensively analyzing the black prominence, the same-line height consistency, and the shape feature value, the membership degree of the winning numbers in each connected region is obtained; When a pixel is located within a connected component in a digital color grayscale image, the contrast stretching result of the pixel is obtained by using the membership degree of the winning number in the connected component where the pixel is located; the winning number of the digital color image is obtained by using the contrast stretching result. The expression for the contrast stretching result is: G a =round(g-norm(P) a ()×g),a∈AN; where G a This represents the contrast stretching result of pixel 'a' in a digital color grayscale image; 'a' represents the pixel in the digital color grayscale image; 'round()' represents the rounding function; 'norm()' represents the normalization function; P a AN represents the membership degree of the connected component containing pixel a; g represents the set of all pixels in the connected components of the digital grayscale image; g represents the preset non-negative integer used to control the contrast stretching result of pixel a.

2. The content recognition method based on digital color images as described in claim 1, characterized in that, The process of obtaining the connected components is as follows: A threshold segmentation algorithm is used to obtain the segmentation threshold of the grayscale value of all pixels in the digital color grayscale image. Pixels in the digital color grayscale image that are less than the segmentation threshold are regarded as lottery information pixels. An edge detection operator is used to extract the edge image of a digital color grayscale image. Connected components are extracted from all lottery information pixels in the edge image to obtain each connected component in the digital color grayscale image.

3. The content recognition method based on digital color images as described in claim 1, characterized in that, The process of obtaining the black highlight is as follows: calculate the mean gray value of all pixels in each connected region, and the black highlight is inversely proportional to the mean value.

4. The content recognition method based on digital color images as described in claim 1, characterized in that, The process of obtaining the connected components in the same row is as follows: Calculate the mean value of the coordinates of all pixels in each connected component along the set direction, and denot it as the coordinate mean. Calculate the difference between the mean coordinates of any connected component and the other connected components, and denote it as the coordinate difference; Arrange the coordinate differences in ascending order, and take the connected components corresponding to the first preset number of coordinate differences as the connected components of each connected component in the same row.

5. The content recognition method based on digital color images as described in claim 1, characterized in that, The process for obtaining the peer high consistency is as follows: Calculate the range of coordinates of all pixels in each connected region along the set direction; the distribution range is reflected by the range. Calculate the difference in the range between each connected component and each of its adjacent connected components, and denote it as the height difference; The similarity in height among peers is inversely proportional to the difference in height.

6. The content recognition method based on digital color images as described in claim 5, characterized in that, The shape feature value is the ratio of the rectangularity of each connected region to the range.

7. The content recognition method based on digital color images as described in claim 1, characterized in that, The process of obtaining the membership degree of the winning numbers is as follows: Calculate the product of the black highlight and the parallel height consistency; The membership degree of the winning numbers is directly proportional to the product and inversely proportional to the shape feature value.

8. The content recognition method based on digital color images as described in claim 1, characterized in that, The method for obtaining the winning numbers of the digital color image is as follows: The grayscale values ​​of pixels in each connected region of a digital color grayscale image are replaced with the contrast stretching results to obtain a digital color grayscale enhanced image. A threshold segmentation algorithm is used to obtain the foreground image in the digital color grayscale enhancement image. Optical character recognition technology is used to identify the digital content in the foreground image, and the identified digital content is used as the winning number of the digital color image.

9. A content recognition system based on digital color images, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the content recognition method based on digital color images as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Floating grinding head control method based on machine vision

    CN115272376A

  • Cattle carcass spine area rapid extraction method based on computer vision

    CN116883328A