OCR text recognition method applied to dictionary pen
By adjusting the exposure intensity and database matching method in the dictionary pen, the problem of unsatisfactory handwritten character recognition efficiency and effect is solved, and the character recognition efficiency and accuracy of the dictionary pen are improved.
Patent Information
- Application Number
- CN202310800506.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2043-07-03
AI Technical Summary
When using existing dictionary pens to recognize handwritten text, due to the different neatness, clarity, and fluency of handwriting of different people, the recognition effect and efficiency are not ideal, and the recognition method cannot be effectively adjusted to improve the recognition efficiency and effect.
By obtaining the target image during the initial sliding period of the dictionary pen during a single sliding process, preprocessing is performed to adjust the exposure intensity, and the recognition method is determined based on the fitting parameters of the text outline and the dictionary database and exclusive database, and an exclusive database is constructed to improve recognition efficiency and Effect.
By adjusting the exposure intensity and database matching method, the efficiency and effect of the dictionary pen on text recognition in the subsequent sliding period are improved, ensuring accurate recognition of text outlines and reducing recognition time.
Smart Images

Figure CN116758551B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an OCR text recognition method applied to a dictionary pen. Background Art
[0002] OCR text recognition is a text recognition method based on computer vision technology. It uses image processing technology to convert text images into computer-readable text formats, thereby realizing text recognition and input. The core technologies of OCR text recognition include image preprocessing, feature extraction, character recognition and result verification. Through the synergy of these links, the dictionary pen can realize efficient and accurate OCR text recognition functions, providing users with a better learning and query experience.
[0003] The Chinese patent publication number: CN113642584A, discloses the following content, which discloses a text recognition method, which relates to the field of artificial intelligence technology, specifically the field of computer vision and deep learning technology, and can be applied to scenarios such as optical character recognition (OCR). The specific implementation scheme is: obtaining multiple image sequences obtained by continuous scanning of documents; performing image splicing based on multiple image sequences to obtain corresponding multiple continuous splicing image frames, wherein there are overlapping areas between two continuous splicing image frames; performing text recognition based on multiple continuous splicing image frames to obtain corresponding multiple recognition results; and performing deduplication processing on multiple recognition results based on the overlapping areas between two continuous splicing image frames in multiple continuous splicing image frames to obtain text recognition results for the document.
[0004] However, the prior art still has the following problems:
[0005] In the prior art, when using a dictionary pen to scan handwritten text, the recognition effect and efficiency of the dictionary pen for some text are not ideal due to the differences in neatness, clarity, fluency, etc. of handwritten text from different people. The existing dictionary pen does not take the above factors into consideration, and automatically adjusts the way of recognizing text based on different handwritten text to improve the text recognition efficiency and effect of the dictionary pen. Summary of the invention
[0006] In order to solve the problem that in the process of scanning handwritten text using a dictionary pen, the recognition effect and efficiency of some texts by the dictionary pen are not ideal due to the differences in the neatness, clarity, fluency, etc. of handwritten texts of different people, the present invention provides an OCR text recognition method applied to the dictionary pen, which includes:
[0007] Step S1, obtaining a first target image captured in an initial sliding period during a single sliding of the dictionary pen, wherein the initial sliding period is the duration from a starting sliding point sliding for a preset time during a single sliding of the dictionary pen;
[0008] Step S2, performing preprocessing based on the first target image, including obtaining an average brightness value in the first target image, determining whether to adjust the exposure intensity of the exposure unit on the dictionary pen based on the size of the average brightness value, and obtaining fitting parameters of each character outline with a plurality of dictionary databases and a plurality of exclusive databases, and determining the dictionary database and exclusive database matched by the first target image based on the average fitting parameters, wherein the average brightness value is the average brightness of each pixel in the first target image;
[0009] Step S3, based on the matching results of the first target image determined in step S2 with the dictionary database and the exclusive database, determining a recognition method for the character outline in the second target image collected in the subsequent sliding period during the single sliding process of the dictionary pen, including:
[0010] Under a first preset condition, each character outline is fitted with sample data of an optimal dictionary database matched with the first target image to determine the text content represented by each character outline;
[0011] Under the second preset condition, each character outline is fitted with sample data in a plurality of selected dictionary databases to determine the character content represented by each character outline;
[0012] Under the third preset condition, each character outline is fitted with sample data in the optimal exclusive database that matches the first target image, and the text content represented by each character outline is determined;
[0013] The first preset condition is that the first target image matches any dictionary database;
[0014] The second preset condition is that the first target image does not match any of the dictionary databases and any of the dedicated databases;
[0015] The third preset condition is that the first target image does not match any dictionary database, and the first target image matches any exclusive database;
[0016] Step S4, obtaining the recognition rate of completing all the character contour recognition in step S3, and determining whether to build a dedicated database based on the recognition rate.
[0017] Furthermore, in the step S2, it is determined whether to adjust the exposure intensity of the exposure unit on the dictionary pen based on the size of the average brightness value, wherein:
[0018] The average brightness value is compared with a preset first brightness contrast threshold and a preset second brightness contrast threshold,
[0019] Under the first brightness comparison result or the second brightness comparison result, it is determined that the exposure intensity of the exposure unit on the dictionary pen needs to be adjusted;
[0020] The first brightness contrast result is that the average brightness value is less than the preset first brightness contrast threshold, and the second brightness contrast result is that the average brightness value is greater than or equal to the preset second brightness contrast threshold.
[0021] Furthermore, in the step S2, the exposure intensity of the exposure unit is adjusted according to the comparison result, wherein:
[0022] Under the first brightness condition, the exposure intensity of the exposure unit is increased, and the increase amount is a preset exposure intensity adjustment parameter;
[0023] Under the second brightness condition, reducing the exposure intensity of the exposure unit by a preset exposure intensity adjustment parameter;
[0024] Among them, the first brightness condition is that the contrast result is a first brightness contrast result, and the second brightness condition is that the contrast result is a second brightness contrast result.
[0025] Furthermore, in step S2, the fitting parameters of the character contour, the dictionary database and the exclusive database are determined, wherein:
[0026] The character outline is compared with the sample data in the dictionary database or the exclusive database, and the maximum degree of fit among several degrees of fit between the character outline and the sample data is determined. The maximum degree of fit is determined as the fitting parameter between the character outline and the dictionary database or the exclusive database. Each of the dictionary databases stores sample data belonging to different font types, and the sample data is the character outline stored in the dictionary database or the exclusive database.
[0027] Further, in step S2, it is determined whether the first target image matches the dictionary database or the dedicated database based on the average fitting parameter, wherein:
[0028] The average fitting parameter is the average of the fitting parameters of each character contour of the first target image and a single dictionary database or a single exclusive database, and the average fitting parameter is compared with a preset fitting comparison threshold.
[0029] If the comparison result satisfies a preset fitting condition, determining that the first target image matches the dictionary database or the exclusive database;
[0030] Among them, the preset fitting condition is that the average fitting parameter is greater than or equal to the preset fitting comparison threshold.
[0031] Furthermore, in step S3, several selected dictionary databases are determined, wherein:
[0032] The order of the average fitting parameters of the first target image and each dictionary database is determined, and a preset number of dictionary databases are screened out one by one in descending order.
[0033] Furthermore, in step S3, an optimal dictionary database and an optimal exclusive database matching the first target image are determined, wherein:
[0034] Determine the ranking of the average fitting parameters of the first target image and the matched dictionary database, and determine the dictionary database corresponding to the maximum average fitting parameter as the optimal dictionary database;
[0035] The ranking of the average fitting parameters of the first target image and the matched exclusive database is determined, and the exclusive database corresponding to the maximum average fitting parameter is determined as the optimal exclusive database.
[0036] Furthermore, in step S3, the text content represented by the text outline is determined, wherein:
[0037] Calculate the degree of fit between the text contour and the sample data in the dictionary database or / and the exclusive database, obtain the ranking of each degree of fit, determine the sample data corresponding to the maximum degree of fit, and determine the text content associated with the sample data as the text content represented by the text contour.
[0038] Furthermore, in step S4, it is determined whether to construct a dedicated database based on the recognition rate, wherein:
[0039] Comparing the recognition rate with a preset rate comparison threshold,
[0040] Under the preset rate comparison conditions, it is determined to build an exclusive database;
[0041] The preset rate comparison condition is that the recognition rate is less than the preset rate comparison threshold, and the recognition rate is the ratio of the number of character contours to the time required to complete the recognition of all character contours.
[0042] Furthermore, in step S4, a dedicated database is constructed, wherein:
[0043] The construction of the exclusive database includes: establishing a new exclusive database, extracting the outlines of characters in the first target image and the second target image, and establishing an association relationship between each of the character outlines and the corresponding character content and storing them in the newly established exclusive database.
[0044] Compared with the prior art, the present invention obtains the first target image captured in the initial sliding period during a single sliding process of the dictionary pen, determines whether to adjust the exposure intensity of the exposure unit on the dictionary pen based on the average brightness value in the first target image, and determines the dictionary database and the exclusive database matched with the first target image based on the average fitting parameters of each character contour and several dictionary databases and several exclusive databases, so as to determine the recognition method of the character contour in the second target image captured in the subsequent sliding period during the single sliding process of the dictionary pen, fits each character contour with the sample data in the database determined by the first target image, determines the text content represented by each character contour, and determines whether to build an exclusive database based on the recognition rate of completing the recognition of all character contours, thereby improving the text recognition efficiency and effect of the dictionary pen.
[0045] In particular, in the present invention, the exposure intensity of the exposure unit on the dictionary pen is adjusted based on the size of the average brightness value in the first target image. If the average brightness value of the first target image is too large, it will cause image reflection; if the average brightness value of the first target image is too small, it will cause the image to be dark. Both image reflection and darkness will cause the dictionary pen to be unable to accurately identify the text content represented by the text outline in the first target image. In actual situations, when the average brightness value of the first target image captured by the dictionary pen is too large, the exposure intensity of the exposure unit should be reduced to avoid overexposure; when the average brightness value of the first target image captured by the dictionary pen is too small, the exposure intensity of the exposure unit should be increased to increase the brightness of the image. By adjusting the exposure intensity of the exposure unit on the dictionary pen based on the size of the average brightness value in the first target image, the effect of the second target image captured by the dictionary pen in the subsequent sliding period is improved.
[0046] In particular, in the present invention, the dictionary database and the exclusive database matched by the first target image are determined based on the average fitting parameter. The fitting parameter is represented by the maximum fitting degree between the text contour in the first target image and the sample data in the dictionary database and the exclusive database, which characterizes the degree of fitting between the text contour and the dictionary database and the exclusive database. In actual situations, if the average fitting parameter of each text contour in the first target image and the sample data in the dictionary database and the exclusive database is larger, it indicates that the degree of fitting between the first target image and the dictionary database and the exclusive database is higher. If the average fitting parameter is greater than a preset fitting comparison threshold, it can be determined that the first target image matches the dictionary database and the exclusive database. Therefore, based on the fitting parameter, the dictionary database and the exclusive database matched by the first target image can be reliably determined, which facilitates the subsequent use of corresponding text contour recognition methods for different matching results between the first target image and the dictionary database and the exclusive database, thereby improving the recognition efficiency and effect of the dictionary pen on the text contour in the second target image collected in the subsequent sliding period.
[0047] In particular, in the present invention, based on the determined matching results of the first target image with the dictionary database and the exclusive database, a recognition method for the character contours in the second target image collected in the subsequent sliding period during a single sliding process of the dictionary pen is determined. Under a first preset condition that the first target image matches any dictionary database, sample data in the dictionary database corresponding to the maximum average fitting parameter between the first target image and each dictionary database is fitted with each character contour in the second target image. Under a second preset condition that the first target image does not match each dictionary database, a preset number of character contours are selected in sequence according to the average fitting parameters of the first target image and each dictionary database from high to low. Dictionary database, fit the sample data in several selected dictionary databases with the contours of each character in the second target image, under the third preset condition that the first target image does not match any dictionary database and the first target image matches any exclusive database, fit the sample data in the exclusive database corresponding to the maximum average fitting parameter of the first target image and each exclusive database with the contours of each character in the second target image to determine the text content represented by each character contour, that is, select the sample data in the dictionary database or exclusive database with the highest degree of matching with the first target image to fit the character contour in the second target image, thereby improving the text recognition efficiency and effect of the dictionary pen.
[0048] In particular, in the present invention, whether to build an exclusive database is determined based on the recognition rate of completing the recognition of all text contours. In actual situations, if the degree of fit between each text contour and the sample data in the dictionary database and the exclusive database is low, then the recognition rate of fitting each text contour with the sample data in the dictionary database and the exclusive database to identify each text contour is low, which will result in a longer time to complete the recognition of all text contours, reducing the efficiency of the dictionary pen in text contour recognition. A new exclusive database is established for special text contours with a low recognition rate, further improving the exclusive database in the dictionary pen, and subsequently fitting the text contour that is closer to this text contour with the sample data in the established exclusive database, thereby improving the efficiency and effect of text recognition by the dictionary pen. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic diagram of the steps of an OCR text recognition method applied to a dictionary pen according to an embodiment of the invention;
[0050] Figure 2 The present invention is a flowchart of an OCR text recognition method applied to a dictionary pen according to an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0052] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0053] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.
[0054] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0055] See also Figure 1 as well as Figure 2 As shown, it is a schematic diagram of the steps of the OCR text recognition method applied to the dictionary pen and a flow chart of the OCR text recognition method applied to the dictionary pen according to an embodiment of the present invention. The OCR text recognition method applied to the dictionary pen of the present invention includes:
[0056] Step S1, obtaining a first target image captured in an initial sliding period during a single sliding of the dictionary pen, wherein the initial sliding period is the duration of a single sliding of the dictionary pen from a starting sliding point for a preset time t, t≤1.5s;
[0057] Step S2, performing preprocessing based on the first target image, including obtaining an average brightness value in the first target image, determining whether to adjust the exposure intensity of the exposure unit on the dictionary pen based on the size of the average brightness value, and obtaining fitting parameters of each character outline with a plurality of dictionary databases and a plurality of exclusive databases, and determining the dictionary database and exclusive database matched by the first target image based on the average fitting parameters, wherein the average brightness value is the average brightness of each pixel in the first target image;
[0058] Step S3, based on the matching results of the first target image determined in step S2 with the dictionary database and the exclusive database, determining a recognition method for the character outline in the second target image collected in the subsequent sliding period during the single sliding process of the dictionary pen, including:
[0059] Under a first preset condition, each character outline is fitted with sample data of an optimal dictionary database that matches the first target image, and the text content represented by each character outline is determined;
[0060] Under the second preset condition, each character outline is fitted with sample data in a plurality of selected dictionary databases to determine the character content represented by each character outline;
[0061] Under the third preset condition, each character outline is fitted with sample data in the optimal exclusive database that matches the first target image, and the text content represented by each character outline is determined;
[0062] The first preset condition is that the first target image matches any dictionary database;
[0063] The second preset condition is that the first target image does not match any dictionary database or any dedicated database;
[0064] The third preset condition is that the first target image does not match any dictionary database, and the first target image matches any exclusive database;
[0065] Step S4, obtaining the recognition rate of completing all the character contour recognition in step S3, and determining whether to build a dedicated database based on the recognition rate.
[0066] Specifically, in the present invention, based on the determined matching results of the first target image with the dictionary database and the exclusive database, a recognition method for the character contours in the second target image collected in the subsequent sliding period during a single sliding process of the dictionary pen is determined. Under a first preset condition that the first target image matches any dictionary database, sample data in the dictionary database corresponding to the maximum average fitting parameter between the first target image and each dictionary database is fitted with each character contour in the second target image. Under a second preset condition that the first target image does not match any dictionary database, a preset number of several average fitting parameters between the first target image and each dictionary database are sequentially screened out in descending order. The dry dictionary database is used to fit the sample data in several selected dictionary databases with the contours of each character in the second target image. Under the third preset condition that the first target image does not match any dictionary database and the first target image matches any exclusive database, the sample data in the exclusive database corresponding to the maximum average fitting parameter of the first target image and each exclusive database is fit with the contours of each character in the second target image to determine the text content represented by each character contour, that is, the sample data in the dictionary database or exclusive database with the highest degree of matching with the first target image is selected to fit the character contour in the second target image, thereby improving the text recognition efficiency and effect of the dictionary pen.
[0067] Specifically, the present invention does not limit the specific structure of the dictionary pen. The dictionary pen adopts a conventional form. Usually, the dictionary pen has a shooting device for scanning the target text and an exposure unit for providing exposure. The shooting device can be a camera, which only needs to be able to complete the function of shooting the target image. The exposure unit can be an LED lamp or other types of light sources for illuminating the scanned area to provide appropriate exposure conditions. It only needs to be able to illuminate the scanned area to provide exposure during the scanning process of the dictionary pen. All of these are existing technologies and will not be repeated here.
[0068] Specifically, the present invention does not limit the specific method of obtaining the average brightness value in the first target image. It can be achieved by setting an image processing module with a preset image processing algorithm in the dictionary pen. It only needs to be able to complete the function of obtaining the average brightness value in the first target image, and will not be repeated here.
[0069] Specifically, the present invention does not limit the specific implementation method of fitting the text contour in the target image with the sample data in the dictionary database and the exclusive database. It can be achieved by utilizing a template matching method to extract the text contours in the target image, the dictionary database and the exclusive database, and compare the text contours in the target image with the text contours in the dictionary database and the exclusive database. It only needs to complete the function of fitting the text contour in the target image with the sample data in the dictionary database and the exclusive database, and will not be elaborated on.
[0070] Specifically, the present invention does not limit the specific setting method of the dictionary database and the exclusive database. It can be to create the dictionary database and the exclusive database through appropriate DBMS software, and use the data import tool to insert the sample data to be stored into the dictionary database and the exclusive database. It only needs to complete the function of setting the dictionary database and the exclusive database. It is a prior art and will not be repeated here.
[0071] Specifically, the dictionary database and the exclusive database store text contours, and a correlation relationship between each text contour and the text content it represents is pre-established, so that the text content represented by the text contour obtained during the actual scanning process can be identified by subsequent comparison with the text contours in the dictionary database or the exclusive database.
[0072] Specifically, in step S2, it is determined whether to adjust the exposure intensity of the exposure unit on the dictionary pen based on the size of the average brightness value, wherein:
[0073] The average brightness value B is compared with the preset first brightness contrast threshold B1 and the second brightness contrast threshold B2, 0<B1<B2,
[0074] Under the first brightness comparison result or the second brightness comparison result, it is determined that the exposure intensity of the exposure unit on the dictionary pen needs to be adjusted;
[0075] The first brightness contrast result is that the average brightness value is less than the preset first brightness contrast threshold, and the second brightness contrast result is that the average brightness value is greater than or equal to the preset second brightness contrast threshold.
[0076] Specifically, in this embodiment, the preset first brightness contrast threshold B1 and the second brightness contrast threshold B2 are calculated based on the standard brightness value △B. The standard brightness value is measured in advance. In order to continuously change the exposure brightness of the exposure unit, the difference between the text outline and the boundary after the dictionary pen scanned image is grayed out is obtained, and the exposure brightness corresponding to the maximum difference is determined as the standard brightness value △B. In this embodiment, B1=α1△B, B2=α2△B is set, wherein α1 represents the first coefficient, α2 represents the second coefficient, 0.7≤α1≤0.9, 1.1≤α2≤1.3.
[0077] Specifically, in this embodiment, the first coefficient α1 and the second coefficient α2 should be within a reasonable range. In order to avoid inaccurate judgment on whether to adjust the exposure intensity of the exposure unit on the dictionary pen due to the coefficient being too large or too small, technical personnel in this field can select the values of the first coefficient α1 and the second coefficient α2 from the ranges [0.7, 0.9] and [1.1, 1.3] respectively.
[0078] Specifically, in step S2, the exposure intensity of the exposure unit is adjusted according to the comparison result, wherein:
[0079] Under the first brightness condition, the exposure intensity of the exposure unit is increased by a preset exposure intensity adjustment parameter d0;
[0080] Under the second brightness condition, the exposure intensity of the exposure unit is reduced by a preset exposure intensity adjustment parameter d0;
[0081] The first brightness condition is that the contrast result is a first brightness contrast result, the second brightness condition is that the contrast result is a second brightness contrast result, and d0>0.
[0082] Specifically, in this embodiment, the preset exposure intensity adjustment parameter d0 is calculated based on the exposure intensity D of the exposure unit before adjustment, and d0=α3D is set, wherein α3 represents the third coefficient, 0.2≤α3≤0.5.
[0083] Specifically, in this embodiment, in order to avoid the coefficient being too large and to be able to characterize the adjustment effect, those skilled in the art may select the value of the third coefficient α3 from the interval [0.2, 0.5].
[0084] Specifically, in the present invention, the exposure intensity of the exposure unit on the dictionary pen is adjusted based on the size of the average brightness value in the first target image. If the average brightness value of the first target image is too large, it will cause image reflection; if the average brightness value of the first target image is too small, it will cause the image to be dark. Both image reflection and darkness will cause the dictionary pen to be unable to accurately identify the text content represented by the text outline in the first target image. In actual situations, when the average brightness value of the first target image captured by the dictionary pen is too large, the exposure intensity of the exposure unit should be reduced to avoid overexposure; when the average brightness value of the first target image captured by the dictionary pen is too small, the exposure intensity of the exposure unit should be increased to increase the brightness of the image. By adjusting the exposure intensity of the exposure unit on the dictionary pen based on the size of the average brightness value in the first target image, the effect of the second target image captured by the dictionary pen in the subsequent sliding period is improved.
[0085] Specifically, in step S2, the fitting parameters of the character outline, the dictionary database and the exclusive database are determined, wherein:
[0086] The character outline is compared with the sample data in the dictionary database or the exclusive database, and the maximum degree of fit among several degrees of fit between the character outline and the sample data is determined. The maximum degree of fit is determined as the fitting parameter between the character outline and the dictionary database or the exclusive database. Each of the dictionary databases stores sample data belonging to different font types, and the sample data is the character outline stored in the dictionary database or the exclusive database.
[0087] Specifically, the present invention does not limit the specific calculation method for the fit between the character contour in the target image and the sample data. It can be calculated by calculating the Euclidean distance between each point on the shape of the character contour in the target image and the corresponding point of the character contour in the sample data. It only needs to complete the function of calculating the fit between the character contour in the target image and the sample data, and will not be repeated here.
[0088] Specifically, in step S2, it is determined whether the first target image matches the dictionary database or the dedicated database based on the average fitting parameter, wherein:
[0089] The average fitting parameter is the average fitting parameter △N of each character contour of the first target image and a single dictionary database or a single exclusive database. The average fitting parameter △N is compared with a preset fitting comparison threshold value N0, N0>0,
[0090] If the comparison result satisfies a preset fitting condition, determining that the first target image matches the dictionary database or the exclusive database;
[0091] The preset fitting condition is that the average fitting parameter ΔN is greater than or equal to the preset fitting comparison threshold.
[0092] Specifically, in this embodiment, the preset fitting comparison threshold value N0 is selected based on the standard fitting value Nc, and the standard fitting value is measured in advance in experiments, wherein a number of actual text contours and sample text contours with determined corresponding relationships are pre-selected to calculate the fitting degree, and the calculated average fitting degree is determined as the standard fitting degree value, and the fitting comparison threshold value N0 is set to be c×Nc, 0.5<c<0.9.
[0093] Specifically, in the present invention, the dictionary database and the exclusive database matched by the first target image are determined based on the average fitting parameter. The fitting parameter is represented by the maximum fitting degree between the text contour in the first target image and the sample data in the dictionary database and the exclusive database, which characterizes the degree of fitting between the text contour and the dictionary database and the exclusive database. In actual situations, if the average fitting parameter of each text contour in the first target image and the sample data in the dictionary database and the exclusive database is larger, it indicates that the degree of fitting between the first target image and the dictionary database and the exclusive database is higher. If the average fitting parameter is greater than a preset fitting comparison threshold, it can be determined that the first target image matches the dictionary database and the exclusive database. Therefore, based on the fitting parameter, the dictionary database and the exclusive database matched by the first target image can be reliably determined, which facilitates the subsequent use of corresponding text contour recognition methods for different matching results between the first target image and the dictionary database and the exclusive database, thereby improving the recognition efficiency and effect of the dictionary pen on the text contour in the second target image collected during the subsequent sliding period.
[0094] Specifically, in step S3, several selected dictionary databases are determined, wherein:
[0095] The order of the average fitting parameters of the first target image and each dictionary database is determined, and a preset number z0 of dictionary databases are selected one by one in descending order, where 3≤z0≤5.
[0096] Specifically, in this embodiment, the preset number z0 should be within a reasonable range. To avoid the situation where the number is too large or too small, resulting in inaccurate text content represented by each text contour determined under the second preset condition, technicians can select the value of the preset number z0 from the interval [3, 5], where the unit of the interval is pieces.
[0097] Specifically, in step S3, the optimal dictionary database and the optimal exclusive database matching the first target image are determined, wherein:
[0098] Determine the order of average fitting parameters of the first target image and the matched dictionary database, and determine the dictionary database corresponding to the maximum average fitting parameter as the optimal dictionary database;
[0099] The ranking of the average fitting parameters of the first target image and the matched exclusive database is determined, and the exclusive database corresponding to the maximum average fitting parameter is determined as the optimal exclusive database.
[0100] Specifically, in step S3, the text content represented by the text outline is determined, wherein:
[0101] Calculate the degree of fit between the text contour and the sample data in the dictionary database or / and the exclusive database, obtain the ranking of each degree of fit, determine the sample data corresponding to the maximum degree of fit, and determine the text content associated with the sample data as the text content represented by the text contour.
[0102] Specifically, in step S4, it is determined whether to construct a dedicated database based on the recognition rate, wherein:
[0103] The recognition rate V is compared with a preset rate comparison threshold V0, V0≤30 / s,
[0104] Under the preset rate comparison conditions, it is determined to build an exclusive database;
[0105] The preset rate comparison condition is that the recognition rate is less than the preset rate comparison threshold, and the recognition rate is the ratio of the number of character contours to the time required to complete the recognition of all character contours.
[0106] Specifically, in the present invention, whether to build an exclusive database is determined based on the recognition rate of completing the recognition of all text contours. In actual situations, if the degree of fit between each text contour and the sample data in the dictionary database and the exclusive database is low, then each text contour is fitted with the sample data in the dictionary database and the exclusive database to identify each text contour at a low recognition rate, which will result in a longer time to complete the recognition of all text contours, reducing the efficiency of the dictionary pen in text contour recognition. A new exclusive database is established for special text contours with a low recognition rate, further improving the exclusive database in the dictionary pen, and subsequently fitting the text contour that is closer to this text contour with the sample data in the established exclusive database, thereby improving the efficiency and effect of text recognition by the dictionary pen.
[0107] Specifically, in step S4, a dedicated database is constructed, wherein:
[0108] The construction of the exclusive database includes: establishing a new exclusive database, extracting the outlines of characters in the first target image and the second target image, and establishing an association relationship between each of the character outlines and the corresponding character content and storing them in the newly established exclusive database.
[0109] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. An OCR text recognition method applied to a dictionary pen, characterized in that: include: Step S1, obtaining a first target image captured in an initial sliding period during a single sliding of the dictionary pen, wherein the initial sliding period is the duration from a starting sliding point sliding for a preset time during a single sliding of the dictionary pen; Step S2, performing preprocessing based on the first target image, including obtaining an average brightness value in the first target image, determining whether to adjust the exposure intensity of the exposure unit on the dictionary pen based on the size of the average brightness value, and obtaining fitting parameters of each character outline with a plurality of dictionary databases and a plurality of exclusive databases, and determining the dictionary database and exclusive database matched by the first target image based on the average fitting parameters, wherein the average brightness value is the average brightness of each pixel in the first target image; Step S3, based on the matching results of the first target image determined in step S2 with the dictionary database and the exclusive database, determining a recognition method for the character outline in the second target image collected in the subsequent sliding period during the single sliding process of the dictionary pen, including: Under a first preset condition, each character outline is fitted with sample data of an optimal dictionary database that matches the first target image, and the text content represented by each character outline is determined; Under the second preset condition, each character outline is fitted with sample data in a plurality of selected dictionary databases to determine the character content represented by each character outline; Under the third preset condition, each character outline is fitted with sample data in the optimal exclusive database that matches the first target image, and the text content represented by each character outline is determined; The first preset condition is that the first target image matches any dictionary database; The second preset condition is that the first target image does not match any dictionary database or any dedicated database; The third preset condition is that the first target image does not match any dictionary database, and the first target image matches any exclusive database; Step S4, obtaining the recognition rate of completing all character outline recognition in step S3, and determining whether to build a dedicated database based on the recognition rate; In step S2, it is determined whether to adjust the exposure intensity of the exposure unit on the dictionary pen based on the size of the average brightness value, wherein: The average brightness value is compared with a preset first brightness contrast threshold and a second brightness contrast threshold, Under the first brightness comparison result or the second brightness comparison result, it is determined that the exposure intensity of the exposure unit on the dictionary pen needs to be adjusted; The first brightness contrast result is that the average brightness value is less than the preset first brightness contrast threshold, and the second brightness contrast result is that the average brightness value is greater than or equal to the preset second brightness contrast threshold; In the step S2, the exposure intensity of the exposure unit is adjusted according to the comparison result, wherein: Under the first brightness condition, the exposure intensity of the exposure unit is increased, and the increase amount is a preset exposure intensity adjustment parameter; Under the second brightness condition, reducing the exposure intensity of the exposure unit by a preset exposure intensity adjustment parameter; Wherein, the first brightness condition is that the comparison result is a first brightness comparison result, and the second brightness condition is that the comparison result is a second brightness comparison result; In step S4, it is determined whether to construct a dedicated database based on the recognition rate, wherein: Comparing the recognition rate with a preset rate comparison threshold, Under the preset rate comparison conditions, it is determined to build an exclusive database; The preset rate comparison condition is that the recognition rate is less than the preset rate comparison threshold, and the recognition rate is the ratio of the number of character contours to the time required to complete the recognition of all character contours; In step S4, a dedicated database is constructed, wherein: The construction of the exclusive database includes: establishing a new exclusive database, extracting the outlines of characters in the first target image and the second target image, and establishing an association relationship between each of the character outlines and the corresponding character content and storing them in the newly established exclusive database.
2. The OCR text recognition method applied to a dictionary pen according to claim 1, characterized in that: In step S2, the fitting parameters of the character contour, the dictionary database and the exclusive database are determined, wherein: The character outline is compared with the sample data in the dictionary database or the exclusive database, and the maximum degree of fit among several degrees of fit between the character outline and the sample data is determined. The maximum degree of fit is determined as the fitting parameter between the character outline and the dictionary database or the exclusive database. Each of the dictionary databases stores sample data belonging to different font types, and the sample data is the character outline stored in the dictionary database or the exclusive database.
3. The OCR text recognition method applied to a dictionary pen according to claim 2, characterized in that: In step S2, it is determined whether the first target image matches the dictionary database or the dedicated database based on the average fitting parameter, wherein: The average fitting parameter is the average of the fitting parameters of each character contour of the first target image and a single dictionary database or a single exclusive database, and the average fitting parameter is compared with a preset fitting comparison threshold. If the comparison result satisfies a preset fitting condition, determining that the first target image matches the dictionary database or the exclusive database; Among them, the preset fitting condition is that the average fitting parameter is greater than or equal to the preset fitting comparison threshold.
4. The OCR text recognition method for dictionary pen according to claim 1, characterized in that: In step S3, several selected dictionary databases are determined, wherein: The order of the average fitting parameters of the first target image and each dictionary database is determined, and a preset number of dictionary databases are screened out one by one in descending order.
5. The OCR text recognition method for dictionary pen according to claim 1, characterized in that: In step S3, the optimal dictionary database and the optimal exclusive database matching the first target image are determined, wherein: Determine the ranking of the average fitting parameters of the first target image and the matched dictionary database, and determine the dictionary database corresponding to the maximum average fitting parameter as the optimal dictionary database; The ranking of the average fitting parameters of the first target image and the matched exclusive database is determined, and the exclusive database corresponding to the maximum average fitting parameter is determined as the optimal exclusive database.
6. The OCR text recognition method applied to a dictionary pen according to claim 1, characterized in that: In step S3, the text content represented by the text outline is determined, wherein: Calculate the degree of fit between the text contour and the sample data in the dictionary database or / and the exclusive database, obtain the ranking of each degree of fit, determine the sample data corresponding to the maximum degree of fit, and determine the text content associated with the sample data as the text content represented by the text contour.
Citation Information
Patent Citations
Character recognition method and device, equipment, storage medium and intelligent dictionary pen
CN113642584A
Image acquisition method, electronic equipment and computer storage medium
CN114189634A
Topic conversion system based on big data cloud platform
CN116049461A
