Accurate recognition method for dictionary pen regional content
By determining the line distribution of the scanned image in the dictionary pen, constructing and correcting the feature extraction area, the problem of interference from incomplete text outlines after scanning is solved, and the accuracy and effect of text recognition are improved.
Patent Information
- Application Number
- CN202310582681.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2043-05-23
AI Technical Summary
Existing dictionary pens easily extract incomplete text outlines after scanning, causing interference in semantic judgment results and affecting recognition accuracy.
By obtaining the standard lines in the scanned image, determine the line distribution, construct the feature extraction area, divide the sub-extraction area, correct the height of the sub-extraction area, and extract the adjusted text outline for recognition.
It improves the accuracy of the extraction area and the text recognition effect of the dictionary pen, reduces the interference of incomplete text outlines, and enhances the recognition accuracy.
Smart Images

Figure CN116704507B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of character recognition, and in particular to a method for accurately recognizing the content of a dictionary pen area. Background Art
[0002] A dictionary pen is a portable electronic device with functions such as text input, translation, learning assistance and note-taking, which can improve the user's learning effect and life convenience. Among them, the dictionary pen's precise recognition function is particularly important for improving work efficiency and accuracy.
[0003] Chinese Patent Publication No.: CN113392829A, discloses the following content. The embodiment of the application discloses a scanning processing method, device, dictionary pen and storage medium of a dictionary pen. The method includes: real-time acquisition of the scanning results recognized by the dictionary pen and the posture information of the dictionary pen collected by the posture detection device; according to the posture information, determining the holding state and movement state of the dictionary pen; according to the movement state, adjusting the order of the scanning results of the dictionary pen, and querying the scanning results after the order is adjusted; according to the holding state of the dictionary pen, rotating the query results and the scanning results after the order is adjusted by a preset angle, and displaying them on the display screen of the dictionary pen. The above technical means are adopted to solve the problem that the existing dictionary pen brings inconvenience to students when used, and improve the user experience.
[0004] However, the prior art still has the following problems:
[0005] In the prior art, after the dictionary pen scans, it is easy to extract the incomplete text contours for semantic judgment, without considering the precise positioning of the recognition area to reduce the extraction of residual text contours. Summary of the invention
[0006] In order to solve the problem in the prior art that the outline of incomplete characters is easily extracted after the dictionary pen scans and is added to the semantic judgment, which interferes with the semantic judgment result, the present invention provides a method for accurately identifying the regional content of the dictionary pen, which includes:
[0007] Step S1, obtaining a scanned image generated by the dictionary pen in a single scanning process, determining standard rows in the scanned image, and determining row distribution conditions of the scanned image based on the number of the standard rows, wherein the row distribution conditions include a first row distribution condition and a second row distribution condition;
[0008] Step S2, determining a construction method for constructing a feature extraction region in the scanned image based on the row distribution condition of the scanned image, wherein a first region construction method is adopted when the row distribution condition of the scanned image is determined to be a first row distribution condition, and a second region construction method is adopted when the row distribution condition of the scanned image is determined to be a second row distribution condition;
[0009] The first region is constructed by sequentially connecting the centers of the outlines of the characters in the standard row to generate a reference curve, and constructing a feature extraction region in the scanned image based on the reference curve;
[0010] The second region is constructed by sequentially connecting the centers of the outlines of the characters in the standard rows to generate a plurality of reference curves, constructing an optimal reference curve based on the relative positions of the plurality of reference curves, and constructing a feature extraction region in the scanned image based on the optimal reference curve;
[0011] The feature extraction area is an area in the scanned image used to extract the outline of the text;
[0012] Step S3, obtaining the feature extraction area, dividing the feature extraction area into a plurality of sub-extraction areas, determining whether the height of the sub-extraction area needs to be corrected based on the edge text contours in the sub-extraction area, and, when it is determined that the height of the sub-extraction area needs to be corrected, correcting the height of the sub-extraction area based on a selected value of an average height of each edge text contour, wherein the edge text contour is a text contour other than a text contour in a standard row in the scanned image;
[0013] Step S4, extracting the text contours in the adjusted sub-extraction areas for text recognition.
[0014] Furthermore, in step S1, a standard row in the scanned image is determined, wherein:
[0015] Identify whether there is a defective line in the scanned image, and if the ratio of the average height of any line of text contour to the average height of each line of text contour in the scanned image is less than a preset difference ratio, then determine that the line of text contour is a defective line;
[0016] If there are defective rows, the remaining rows other than the defective rows are determined as standard rows;
[0017] If no incomplete lines appear, it is determined that the outlines of each line of text in the scanned image are standard lines.
[0018] Furthermore, in step S1, the row distribution of the scanned image is determined based on the number of the standard rows, wherein:
[0019] Under the first quantity condition, determining that the row distribution condition of the scanned image is a first row distribution condition;
[0020] Under the second quantity condition, determining that the row distribution condition of the scanned image is a second row distribution condition;
[0021] The first quantity condition is that the number of the standard rows is one row, and the second quantity condition is that the number of the standard rows is greater than one row.
[0022] Furthermore, in the step S2, a feature extraction region is constructed in the scanned image based on the reference curve, wherein:
[0023] Taking the reference curve as the center line, a region with a width of a preset first width is constructed in the scanned image as a feature extraction region.
[0024] Furthermore, in step S2, an optimal reference curve is constructed based on the relative positions of multiple reference curves, and a feature extraction region is constructed in the scanned image based on the optimal reference curve, wherein:
[0025] The two outermost reference curves in the scanned image are obtained, and a number of straight lines perpendicular to the straight line direction of the bottom edge of the scanned image and with equal spacing are constructed in the scanned image, each of the straight lines and the two reference curves constitutes a number of straight line segments, and the midpoints of the straight line segments are connected to form an optimal reference curve. With the optimal reference curve as the center line, an area with a width of a preset second width is constructed in the scanned image as a feature extraction area, and the preset second width is greater than the preset first width.
[0026] Furthermore, in step S3, it is determined whether the height of the sub-extracted area needs to be corrected based on the edge text contour in the sub-extracted area, wherein:
[0027] Under a preset contour condition, determining that the height of the sub-extraction area needs to be corrected;
[0028] The preset contour condition is that there is an edge text contour in the sub-extraction area.
[0029] Furthermore, in the step S3, the selected value of the average height of the edge text contour is determined based on the distribution of the edge text contour in the sub-extracted area, wherein:
[0030] Determine the average height of the edge text contours in the sub-extraction area,
[0031] Under the first condition, the selected value for determining the average height of the edge text contour is the average height of the edge text contour in the sub-extraction area;
[0032] Under the second condition, the selected value for determining the average height of the edge text contour is twice the average height of the edge text contour in the sub-extraction area;
[0033] The first condition is that the edge text contour in the sub-extraction area is located at the upper side or the lower side of the sub-extraction area, and the second condition is that the edge text contour in the sub-extraction area is located at the upper side and the lower side of the sub-extraction area.
[0034] Furthermore, in step S3, the height of the sub-extracted area is corrected based on the selected value of the average height of each edge text contour, wherein:
[0035] Several correction methods are provided for correcting the height of the extraction area based on the selected value of the average height, and the correction amount for the height of the extraction area in each correction method is different.
[0036] Furthermore, in step S4, the character contours in the adjusted sub-extraction areas are extracted for character recognition, wherein:
[0037] Match the text contour in the adjusted sub-extraction area with the sample text contour stored in the database, determine the similarity between the text contour in the sub-extraction area and the sample text contour, and compare the similarity with a preset similarity comparison threshold.
[0038] Under a preset similarity condition, determining that the text content represented by the text contour in the extracted area is the text content represented by the sample text contour;
[0039] The preset similarity condition is that the similarity between the character contour in the extracted area and the sample character contour is greater than or equal to the similarity comparison threshold.
[0040] Furthermore, in the step S1, the process of the dictionary pen generating a scanned image includes converting the collected characters to be recognized into digital signals, and converting the digital signals into the scanned image.
[0041] Compared with the prior art, the present invention determines the standard rows in the scanned image generated by the dictionary pen, and determines the row distribution of the scanned image based on the number of standard rows. Under the first row distribution condition, the centers of the character contours in the standard rows are sequentially connected to generate a reference curve to construct a feature extraction area. Under the second row distribution condition, the feature extraction area is constructed based on an optimal reference curve constructed according to the relative positions of multiple reference curves generated by sequentially connecting the centers of the character contours in the standard rows. The feature extraction area is divided into a number of sub-extraction areas, and the height of the sub-extraction area is corrected based on the selected value of the average height of each edge character contour. The character contours in the sub-extraction areas after the adjustment are extracted for character recognition, thereby improving the accuracy of the dictionary pen in determining the extraction area and the effect of character recognition.
[0042] In particular, in the present invention, the row distribution status of the scanned image is determined based on the number of standard rows. In actual situations, during the word scanning process of the dictionary pen, due to the difference in the spacing between text lines, the standard rows in the scanned image may appear as one row or multiple rows. Therefore, the scanned image is divided into two different row distribution statuses according to the number of standard rows, which facilitates the subsequent corresponding processing under different row distribution statuses, thereby ensuring the accuracy of the dictionary pen's subsequent determination of the extraction area.
[0043] In particular, in the present invention, when it is determined that the row distribution condition of the scanned image is the first row distribution condition, the centers of the character contours in the standard row are connected in sequence to generate a reference curve, and a feature extraction area is constructed in the scanned image based on the reference curve. When it is determined that the row distribution condition of the scanned image is the second row distribution condition, the centers of the character contours in the standard rows are connected in sequence to generate multiple reference curves, and a feature extraction area is constructed in the scanned image based on the optimal reference curve constructed based on the relative positions of the multiple reference curves. In the first row distribution condition where the standard row is one row, the feature extraction area is constructed with the line connecting the centers of the character contours in the standard row as the center line. In the second row distribution condition where the standard row is multiple rows, the feature extraction area is constructed with the center line connecting the centers of the multiple rows of character contours as the center line, thereby ensuring that the standard row is always in the middle of the feature extraction area, thereby improving the effect of text recognition on the character contours in the feature extraction area.
[0044] In particular, in the present invention, the height of the feature extraction area constructed under the first row distribution condition is smaller than the height of the feature extraction area constructed under the second row distribution condition. In actual situations, under the first row distribution condition where the standard behavior has one row, it is only necessary to extract the text contour in this row for text recognition. Under the second row distribution condition where the standard behavior has multiple rows, it is necessary to perform text recognition on the text contours in multiple rows. The height of the feature extraction area is determined according to the number of rows of text contours to be recognized, thereby preventing the text contours in non-standard rows from entering the feature extraction area due to the height of the feature extraction area being too large, and preventing the text contours in standard rows from being incomplete due to the height of the feature extraction area being too small. By constructing feature extraction areas of different widths under different row distribution conditions, the effect of text recognition on the text contours in the feature area is improved.
[0045] In particular, in the present invention, the height of the sub-extraction area is corrected based on the selected value of the average height of each edge text contour. In actual situations, if there is an edge text contour in the sub-extraction area, it will interfere with the accurate recognition of the text contour in the standard row. Therefore, the height of the sub-extraction area is reduced to remove the edge text contour from the sub-extraction area. The larger the average height of the edge text contour, the greater the width reduction when the height of the sub-extraction area is reduced. Moreover, when the edge text contour is located on both sides of the sub-extraction area, the average height selected for correction should be twice the average height of the edge text contour. Therefore, the height of the sub-extraction area is corrected based on the average height of each edge text contour, thereby improving the effect of text recognition of the text contour in the standard row. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A schematic diagram of the steps of a method for accurately identifying the content of a dictionary pen region according to an embodiment of the invention;
[0047] Figure 2 This is a schematic diagram of the feature extraction region structure under the first row distribution condition of an embodiment of the invention;
[0048] Figure 3 It is a schematic diagram of the feature extraction region structure under the second row distribution condition of an embodiment of the invention;
[0049] In the figure, 1: feature extraction area, 2: reference curve, 3: optimal reference curve. DETAILED DESCRIPTION
[0050] 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.
[0051] 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.
[0052] 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.
[0053] 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.
[0054] See also Figure 1 , Figure 2 as well as Figure 3 As shown, it is a schematic diagram of the steps of the accurate identification method of the dictionary pen regional content of an embodiment of the present invention, a schematic diagram of the feature extraction regional structure under the first row distribution condition, and a schematic diagram of the feature extraction regional structure under the second row distribution condition. The accurate identification method of the dictionary pen regional content of the present invention includes:
[0055] Step S1, obtaining a scanned image generated by the dictionary pen in a single scanning process, determining standard rows in the scanned image, and determining row distribution conditions of the scanned image based on the number of the standard rows, wherein the row distribution conditions include a first row distribution condition and a second row distribution condition;
[0056] Step S2, determining a construction method for constructing a feature extraction region 1 in the scanned image based on the row distribution condition of the scanned image, wherein a first region construction method is adopted when the row distribution condition of the scanned image is determined to be a first row distribution condition, and a second region construction method is adopted when the row distribution condition of the scanned image is determined to be a second row distribution condition;
[0057] The first region is constructed by sequentially connecting the centers of the outlines of the characters in the standard row to generate a reference curve 2, and constructing a feature extraction region 1 in the scanned image based on the reference curve 2;
[0058] The second region is constructed by sequentially connecting the centers of the character contours in the standard rows to generate a plurality of reference curves 2, constructing an optimal reference curve 3 based on the relative positions of the plurality of reference curves 2, and constructing a feature extraction region 1 in the scanned image based on the optimal reference curve 3;
[0059] The feature extraction area 1 is an area in the scanned image used to extract the outline of the text;
[0060] Step S3, obtaining the feature extraction area 1, dividing the feature extraction area 1 into a plurality of sub-extraction areas, determining whether the height of the sub-extraction area needs to be corrected based on the edge text contours in the sub-extraction area, and, when it is determined that the height of the sub-extraction area needs to be corrected, correcting the height of the sub-extraction area based on the selected value of the average height of each edge text contour, wherein the edge text contour is the text contour in the scanned image other than the text contour in the standard line;
[0061] Step S4, extracting the text contours in the adjusted sub-extraction areas for text recognition.
[0062] Specifically, the present invention does not limit the specific method of obtaining the number of standard lines in the scanned image and the height of the text outline. It can be a pre-trained image processing algorithm that has the function of obtaining the number of standard lines in the scanned image and the height of the text outline, which will not be repeated here.
[0063] Specifically, in step S1, a standard row in the scanned image is determined, wherein:
[0064] Identify whether there is a defective line in the scanned image, and if the ratio of the average height of any line of text contour to the average height of each line of text contour in the scanned image is less than a preset difference ratio, then determine that the line of text contour is a defective line;
[0065] If there are defective rows, the remaining rows other than the defective rows are determined as standard rows;
[0066] If no incomplete lines appear, it is determined that the outlines of each line of text in the scanned image are standard lines.
[0067] Specifically, in step S1, the row distribution of the scanned image is determined based on the number of the standard rows, wherein:
[0068] Under the first quantity condition, determining that the row distribution condition of the scanned image is a first row distribution condition;
[0069] Under the second quantity condition, determining that the row distribution condition of the scanned image is a second row distribution condition;
[0070] The first quantity condition is that the number of the standard rows is one row, and the second quantity condition is that the number of the standard rows is greater than one row.
[0071] Specifically, in the present invention, the row distribution status of the scanned image is determined based on the number of standard rows. In actual situations, during the word scanning process of the dictionary pen, due to the difference in the spacing between text lines, the standard rows in the scanned image may appear as one row or multiple rows. Therefore, the scanned image is divided into two different row distribution statuses according to the number of standard rows, which facilitates the subsequent corresponding processing under different row distribution statuses, thereby ensuring the accuracy of the dictionary pen's subsequent determination of the extraction area.
[0072] For more details, please refer to Figure 2 As shown, in the step S2, a feature extraction region 1 is constructed in the scanned image based on the reference curve 2, wherein:
[0073] Taking the reference curve 2 as the center line, a region with a width of a preset first width B1 is constructed in the scanned image as a feature extraction region 1, where B1 is less than 1.5 cm.
[0074] For more details, please refer to Figure 3 As shown, in the step S2, an optimal reference curve 3 is constructed based on the relative positions of multiple reference curves 2, and a feature extraction region 1 is constructed in the scanned image based on the optimal reference curve 3, wherein:
[0075] Acquire the two outermost reference curves 2 in the scanned image, construct a number of straight lines perpendicular to the straight line direction of the bottom edge of the scanned image and with equal spacing in the scanned image, each of the straight lines and the two reference curves 2 constitutes a number of straight line segments, and connect the midpoints of each of the straight line segments to form an optimal reference curve 3. With the optimal reference curve 3 as the center line, construct an area with a width of a preset second width B2 in the scanned image as a feature extraction area 1, 3cm>B2>B1.
[0076] Specifically, in this embodiment, the preset first width B1 and the preset second width B2 should be within a reasonable range to avoid the width of the feature extraction area 1 being too large, causing the text contour in the non-target row to enter the feature extraction area 1, and the width being too small, causing the text contour in the target row to be incomplete. According to the technical personnel, the preset first width B1 and the preset second width B2 can be selected from the interval [1, 3], and the interval unit is centimeters.
[0077] Specifically, in the present invention, when it is determined that the row distribution condition of the scanned image is the first row distribution condition, the centers of each character contour in the standard row are connected in sequence to generate a reference curve 2, and a feature extraction area 1 is constructed in the scanned image based on the reference curve 2; when it is determined that the row distribution condition of the scanned image is the second row distribution condition, the centers of each character contour in each standard row are connected in sequence to generate multiple reference curves 2, and the feature extraction area 1 is constructed in the scanned image based on the optimal reference curve 3 constructed based on the relative positions of the multiple reference curves 2; in the first row distribution condition where the standard row is one row, the feature extraction area 1 is constructed with the line connecting the centers of each character contour in the standard row as the center line; in the second row distribution condition where the standard row is multiple rows, the feature extraction area 1 is constructed with the center line connecting the centers of multiple rows of character contours as the center line, thereby ensuring that the standard row is always in the middle position of the feature extraction area 1, thereby improving the effect of text recognition on the character contours in the feature extraction area 1.
[0078] Specifically, in the present invention, the width of the feature extraction area 1 constructed under the first row distribution condition is smaller than the width of the feature extraction area 1 constructed under the second row distribution condition. In actual situations, under the first row distribution condition where the standard behavior has one row, it is only necessary to extract the text contour in this row for text recognition. Under the second row distribution condition where the standard behavior has multiple rows, it is necessary to perform text recognition on the text contours in multiple rows. The width of the feature extraction area 1 is determined according to the number of rows of the text contours to be recognized, so as to avoid the text contours in non-standard rows entering the feature extraction area 1 due to the width of the feature extraction area 1 being too large, and to avoid the text contours in standard rows being incomplete due to the width of the feature extraction area 1 being too small. By constructing feature extraction areas 1 of different widths under different row distribution conditions, the effect of text recognition on the text contours in the feature area is improved.
[0079] Specifically, in step S3, it is determined whether the height of the sub-extracted area needs to be corrected based on the edge text contour in the sub-extracted area, wherein:
[0080] Under a preset contour condition, determining that the height of the sub-extraction area needs to be corrected;
[0081] The preset contour condition is that there is an edge text contour in the sub-extraction area.
[0082] Specifically, in step S3, the selected value of the average height of the edge text contour is determined based on the distribution of the edge text contour in the sub-extracted area, wherein:
[0083] Determine the average height of the edge text contours in the sub-extraction area,
[0084] Under the first condition, the selected value for determining the average height of the edge text contour is the average height of the edge text contour in the sub-extraction area;
[0085] Under the second condition, the selected value for determining the average height of the edge text contour is twice the average height of the edge text contour in the sub-extraction area;
[0086] The first condition is that the edge text contour in the sub-extraction area is located at the upper side or the lower side of the sub-extraction area, and the second condition is that the edge text contour in the sub-extraction area is located at the upper side and the lower side of the sub-extraction area.
[0087] Specifically, in step S3, the height of the sub-extracted area is corrected based on the selected value of the average height of each edge text contour, wherein:
[0088] Several correction methods are provided for correcting the height of the extraction area based on the selected value of the average height, and the correction amount for the height of the extraction area in each correction method is different;
[0089] Determine the selected value △H of the average height of each edge text contour in the sub-extraction area, compare the selected value △H of the average height with the preset first height comparison threshold △H1 and the second height comparison threshold △H2, 0<△H1<△H2,
[0090] Under the first height comparison condition, the current width of the sub-extraction area is corrected to the first width value B1 according to the preset first width correction parameter b1, and B1=Bi-b1 is set;
[0091] Under the second height contrast condition, the current width of the sub-extraction area is corrected to a second width value B2 according to a preset second width correction parameter b2, and B2=Bi-b2 is set;
[0092] Under the third height contrast condition, the current width of the sub-extraction area is corrected to a third width value B3 according to a preset third width correction parameter b3, and B3=Bi-b3 is set;
[0093] Among them, the first height contrast condition is △H≥△H2, the second height contrast condition is △H1≤△H<△H2, the third height contrast condition is △H<△H1, 1cm>b1>b2>b3, B1<B2<B3<3cm, Bi represents the current width of the sub-extraction area, i=1,2.
[0094] Specifically, in this embodiment, the first height contrast threshold △H1 and the second height contrast threshold △H2 are calculated based on the selected value △H0 of the average height of the edge text contour in the scanned image generated by multiple scans. Wherein, △H i represents the selected value of the average height of the edge text contour in the scanned image generated by the i-th scan, n represents the number of scans, i represents an integer greater than 0, and △H1 is set to 0.8△H0, △H2 to 1.2△H0.
[0095] Specifically, in this embodiment, those skilled in the art may set b1 to b3 within a limited range. When setting, the difference ratio F needs to be controlled within 0.3 to ensure that the difference is not too large while ensuring distinction. F is set to (bi+1-bi) / bi, where bi represents the i-th width correction parameter and bi+1 represents the i+1-th width correction parameter.
[0096] Specifically, the sub-extraction region is a feature extraction region segment after the feature extraction region is vertically divided.
[0097] Specifically, in the present invention, the height of the sub-extraction area is corrected based on the selected value of the average height of each edge text contour. In actual situations, if there is an edge text contour in the sub-extraction area, it will interfere with the accurate recognition of the text contour in the standard row. Therefore, the height of the sub-extraction area is reduced to remove the edge text contour from the sub-extraction area. The larger the average height of the edge text contour, the greater the width reduction when the height of the sub-extraction area is reduced. Moreover, when the edge text contour is located on both sides of the sub-extraction area, the average height selected for correction should be twice the average height of the edge text contour. Therefore, the height of the sub-extraction area is corrected based on the average height of each edge text contour, thereby improving the effect of text recognition of the text contour in the standard row.
[0098] Specifically, in step S4, the character outline in the adjusted sub-extraction area is extracted for character recognition, wherein:
[0099] The text contour in the adjusted sub-extraction area is matched with the sample text contour stored in the database, and the similarity R between the text contour in the sub-extraction area and the sample text contour is determined. The similarity R is compared with a preset similarity comparison threshold R0, and R0>0.
[0100] Under a preset similarity condition, determining that the text content represented by the text contour in the extracted area is the text content represented by the sample text contour;
[0101] The preset similarity condition is that R≥R0.
[0102] Specifically, in this embodiment, the similarity comparison threshold R0 should be within a reasonable range to avoid a threshold that is too large and unable to recognize the text content represented by the text contour in the sub-extraction area, and a threshold that is too small and leads to inaccurate recognition of the text content represented by the text contour in the sub-extraction area.
[0103] Specifically, the present invention does not limit the specific method of matching the text contour in the sub-extraction area with the sample text contour stored in the database. It can be by using a matching algorithm, such as template matching, feature matching, etc., to find the best matching sample text contour in the database. It only needs to be able to complete the function of finding the sample text contour corresponding to the text contour in the sub-extraction area in the database, and will not be elaborated.
[0104] Specifically, the present invention does not limit the specific calculation method of the similarity between the text contour in the sub-extraction area and the sample text contour. It can be determined by the Euclidean distance calculation method. The distance between the text contours is then converted into similarity. It only needs to be able to complete the function of calculating the similarity between the text contour in the sub-extraction area and the sample text contour. It is an existing mature technology and will not be repeated here.
[0105] Specifically, in step S1, the process of generating a scanned image by the dictionary pen includes converting the collected characters to be recognized into digital signals, and converting the digital signals into the scanned image.
[0106] 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. A method for accurately identifying the content of a dictionary pen region, characterized in that: include: Step S1, obtaining a scanned image generated by the dictionary pen in a single scanning process, determining standard rows in the scanned image, and determining row distribution conditions of the scanned image based on the number of the standard rows, wherein the row distribution conditions include a first row distribution condition and a second row distribution condition; Step S2, determining a construction method for constructing a feature extraction region in the scanned image based on the row distribution condition of the scanned image, wherein a first region construction method is adopted when the row distribution condition of the scanned image is determined to be a first row distribution condition, and a second region construction method is adopted when the row distribution condition of the scanned image is determined to be a second row distribution condition; the first row distribution condition is that the number of the standard rows is one row; The first region is constructed by sequentially connecting the centers of the outlines of the characters in the standard row to generate a reference curve, and constructing a feature extraction region in the scanned image based on the reference curve; The second region is constructed by sequentially connecting the centers of the outlines of the characters in the standard rows to generate a plurality of reference curves, constructing an optimal reference curve based on the relative positions of the plurality of reference curves, and constructing a feature extraction region in the scanned image based on the optimal reference curve; The feature extraction area is an area in the scanned image used to extract the outline of the text; Step S3, obtaining the feature extraction area, dividing the feature extraction area into a plurality of sub-extraction areas, determining whether the height of the sub-extraction area needs to be corrected based on the edge text contours in the sub-extraction area, and, when it is determined that the height of the sub-extraction area needs to be corrected, correcting the height of the sub-extraction area based on a selected value of an average height of each edge text contour, wherein the edge text contour is a text contour other than a text contour in a standard row in the scanned image; Step S4, extracting the outline of the text in the adjusted sub-extraction area to perform text recognition; In the step S2, a feature extraction region is constructed in the scanned image based on the reference curve, wherein: Taking the reference curve as the center line, constructing an area with a height of a preset first height in the scanned image as a feature extraction area; In step S2, an optimal reference curve is constructed based on the relative positions of multiple reference curves, and a feature extraction region is constructed in the scanned image based on the optimal reference curve, wherein: Acquire the two outermost reference curves in the scanned image, construct a number of straight lines in the scanned image that are perpendicular to the straight line direction where the bottom edge of the scanned image is located and are equally spaced, each of the straight lines and the two reference curves constitute a number of straight line segments, and connect the midpoints of each of the straight line segments to form an optimal reference curve. With the optimal reference curve as the center line, construct an area in the scanned image with a height of a preset second height as a feature extraction area, and the preset second height is greater than the preset first height.
2. The accurate identification method of dictionary pen area content according to claim 1 is characterized in that: In step S1, a standard line in the scanned image is determined, wherein: Identify whether there is a defective line in the scanned image, and if the ratio of the average height of any line of text contour to the average height of each line of text contour in the scanned image is less than a preset difference ratio, then determine that the line of text contour is a defective line; If there are defective rows, the remaining rows other than the defective rows are determined as standard rows; If no incomplete lines appear, it is determined that the outlines of each line of text in the scanned image are standard lines.
3. The accurate identification method of dictionary pen area content according to claim 2 is characterized in that: In the step S1, the row distribution of the scanned image is determined based on the number of the standard rows, wherein: Under the first quantity condition, determining that the row distribution condition of the scanned image is a first row distribution condition; Under the second quantity condition, determining that the row distribution condition of the scanned image is a second row distribution condition; The first quantity condition is that the number of the standard rows is one row, and the second quantity condition is that the number of the standard rows is greater than one row.
4. The method for accurately identifying the content of a dictionary pen region according to claim 3, characterized in that: In step S3, it is determined whether the height of the sub-extracted area needs to be corrected based on the edge text contour in the sub-extracted area, wherein: Under a preset contour condition, determining that the height of the sub-extraction area needs to be corrected; The preset contour condition is that there is an edge text contour in the sub-extraction area.
5. The method for accurately identifying the content of a dictionary pen region according to claim 4, characterized in that: In the step S3, the selected value of the average height of the edge text contour is determined based on the distribution of the edge text contour in the sub-extracted area, wherein: Determine the average height of the edge text contours in the sub-extraction area, Under the first condition, the selected value for determining the average height of the edge text contour is the average height of the edge text contour in the sub-extraction area; Under the second condition, the selected value for determining the average height of the edge text contour is twice the average height of the edge text contour in the sub-extraction area; The first condition is that the edge text contour in the sub-extraction area is located at the upper side or the lower side of the sub-extraction area, and the second condition is that the edge text contour in the sub-extraction area is located at the upper side and the lower side of the sub-extraction area.
6. The method for accurately identifying the content of a dictionary pen region according to claim 5, characterized in that: In step S3, the height of the sub-extracted area is corrected based on the selected value of the average height of each edge character contour, wherein: The selected value of the average height is compared with a preset height comparison threshold, and corresponding correction methods for correcting the height of the extracted area are set for different height comparison conditions, and the correction amount for the height of the extracted area in each correction method is different.
7. The method for accurately identifying the content of a dictionary pen region according to claim 1, characterized in that: In step S4, the character outline in the adjusted sub-extraction area is extracted for character recognition, wherein: Match the text contour in the adjusted sub-extraction area with the sample text contour stored in the database, determine the similarity between the text contour in the sub-extraction area and the sample text contour, and compare the similarity with a preset similarity comparison threshold. Under a preset similarity condition, determining that the text content represented by the text contour in the extracted area is the text content represented by the sample text contour; The preset similarity condition is that the similarity between the character contour in the extracted area and the sample character contour is greater than or equal to the similarity comparison threshold.
8. The method for accurately identifying the content of a dictionary pen region according to claim 1, characterized in that: In the step S1, the process of generating a scanned image by the dictionary pen includes converting the collected characters to be recognized into digital signals, and converting the digital signals into the scanned image.
Citation Information
Patent Citations
Scanning processing method and device of dictionary pen, dictionary pen and storage medium
CN113392829A
Scanning mode judgment method and judgment system of scanning pen, electronic equipment and readable storage medium
CN114419622A
Scanning image recognition method and device, electronic equipment and storage medium
CN115565189A
