Character coordinate determination method, device, equipment, and storage medium

Through text recognition, the character area in the image and the vertex coordinates of the target rectangle are obtained, and the principle of right-angle triangles and similar triangles is used to determine the character coordinates, which solves the problems of slow character coordinate determination and high performance consumption in the prior art, and achieves more efficient and accurate character coordinate determination.

CN115984858BActive Publication Date: 2025-05-23东莞市步步高教育软件有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211606073.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2025-05-23
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

In the prior art, when determining the coordinates of a single character in an image text, it is necessary to repeatedly identify each character area, resulting in slow speed and consuming server performance.

Method used

By obtaining the character image, text recognition is performed once to obtain the vertex coordinates of the character area and its target rectangle to which it belongs, and then construct a right-angle triangle and a similar triangle, and use the similar triangle principle to determine the coordinates of the single-character rectangle of each character.

Benefits of technology

It effectively reduces the number of character recognition times, improves the speed and accuracy of character coordinate determination, and reduces the consumption of server performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115984858B_ABST
    Figure CN115984858B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device, equipment, and storage medium for determining character coordinates; the method comprises: obtaining a character image, the character image comprising a plurality of characters; performing text recognition on the character image to obtain a character region corresponding to the plurality of characters, wherein a target rectangle to which the character region belongs is in a non-parallel state relative to a border of the character image; using the first side of the target rectangle parallel to the arrangement direction of the plurality of characters as the hypotenuse of the right triangle, constructing a plurality of right triangles; determining the coordinates of a single character rectangle to which each character of the plurality of characters belongs according to the vertex coordinates of each right triangle, the target rectangle, and the principle of similar triangles. In this way, the speed and accuracy of determining character coordinates can be improved, and the performance consumption of the server can be reduced.
Need to check novelty before this filing date? Find Prior Art

Claims

1. A method for determining character coordinates, It is characterized in that The method comprises: Acquire a character image, wherein the character image includes a plurality of characters; Performing text recognition on the character image to obtain character regions corresponding to the multiple characters, wherein a target rectangle to which the character region belongs is in a non-parallel state relative to a frame of the character image; Constructing two right triangles by using two first sides of the target rectangle parallel to the arrangement direction of the plurality of characters as the hypotenuses of the right triangles; According to the vertex coordinates of each right triangle, the target rectangle and the principle of similar triangles, the coordinates of the single-character rectangle to which each character of the multiple characters belongs are determined; wherein the single-character rectangle is obtained by dividing the target rectangle into units of characters in the target rectangle, each of the single-character rectangles includes a character, and the vertex of each single-character rectangle coincides with the first side of the target rectangle to which the character area belongs.

2. The method according to claim 1, It is characterized in that The method of constructing two right triangles by using two first sides of the target rectangle parallel to the arrangement direction of the plurality of characters as the hypotenuses of the right triangles comprises: Take each of the first sides of the target rectangle as a hypotenuse, take the two vertices of each of the first sides as starting points and two perpendicular lines extending in the direction of the border of the character image as right sides, construct a right triangle corresponding to each of the first sides, and obtain two right triangles, wherein each of the constructed right triangles does not overlap with the target rectangle.

3. The method according to claim 2, It is characterized in that The step of determining the coordinates of a single character rectangle to which each character of the plurality of characters belongs based on the vertex coordinates of each right triangle, the target rectangle, and the principle of similar triangles includes: Taking the vertex where each single-character rectangle coincides with the first side as a starting point, a perpendicular line is drawn to the reference right-angled sides of the two right-angled triangles to construct a plurality of similar triangles that are similar to the two right-angled triangles, wherein the reference right-angled side is any right-angled side in the right-angled triangle; The coordinates of the single-character rectangle to which each of the multiple characters belongs are determined according to the vertex coordinates of the two right triangles, the multiple similar triangles and the target rectangle.

4. The method according to claim 3, It is characterized in that The step of determining the coordinates of a single-character rectangle to which each character of the plurality of characters belongs according to the vertex coordinates of the two right triangles, the plurality of similar triangles, and the target rectangle comprises: For each similar triangle, a second proportion of the hypotenuse of each similar triangle to the first side is obtained by a preset first proportion, wherein the first proportion is a ratio of the length between two vertices of a rectangular frame of a single character that coincide with the first side to the entire first side; The coordinates of the single-character rectangle to which each of the multiple characters belongs are determined according to the second proportion, the reference right-angled sides of the two right-angled triangles, and the vertex coordinates of the target rectangle.

5. The method according to claim 4, It is characterized in that The step of determining the coordinates of a single-character rectangle to which each character of the plurality of characters belongs according to the second proportion, the first right-angled sides of the two right-angled triangles, and the vertex coordinates of the target rectangle includes: Determine the lengths of the reference right-angled sides of the two right-angled triangles according to the vertex coordinates of the target rectangle; Determine the length of a first right-angled side in a similar triangle constructed based on each character according to the second proportion and the length of the reference right-angled side, wherein the first right-angled side is parallel to the reference right-angled side; The coordinates of the single-character rectangle to which each of the multiple characters belongs are determined according to the length of the first right-angled side of the similar triangle constructed based on each character and the vertex coordinates of the target rectangle.

6. The method according to claim 5, It is characterized in that The step of determining the coordinates of the single-character rectangle to which each character of the plurality of characters belongs according to the length of the first right-angled side of the similar triangle constructed based on each character and the vertex coordinates of the target rectangle comprises: If the direction of the first right-angled side of the similar triangle constructed based on each character is consistent with the horizontal coordinate direction of the vertex coordinates of the target rectangle, then based on the horizontal coordinates of the vertex coordinates of the target rectangle and the length of the first right-angled side, determine the horizontal coordinate of the single-character rectangle to which the character belongs; And based on the ordinate of the vertex coordinates of the target rectangle and the length of the second right-angled side, the ordinate of the single-character rectangle to which the character belongs is determined, wherein the second right-angled side is another right-angled side in the similar triangle that is different from the first right-angled side.

7. The method according to claim 5, It is characterized in that The step of determining the coordinates of the single-character rectangle to which each character of the plurality of characters belongs according to the length of the first right-angled side of the similar triangle constructed based on each character and the vertex coordinates of the target rectangle comprises: If the direction of the first right-angled side in the similar triangle constructed based on each character is consistent with the direction of the ordinate of the vertex coordinates of the target rectangle, then based on the ordinate of the vertex coordinates of the target rectangle and the length of the first right-angled side, determine the ordinate of the single-character rectangle to which the character belongs; And based on the horizontal coordinates of the vertex coordinates of the target rectangle and the length of the second right-angled side, the horizontal coordinate of the single-character rectangle to which the character belongs is determined, and the second right-angled side is another right-angled side in the similar triangle that is different from the first right-angled side.

8. A device for determining character coordinates, It is characterized in that include: An acquisition module, used for acquiring a character image, wherein the character image includes a plurality of characters; A recognition module, configured to perform text recognition on the character image to obtain character regions corresponding to the plurality of characters, wherein a target rectangle to which the character region belongs is in a non-parallel state relative to a frame of the character image; A determination module is used to construct two right triangles with the two first sides in the target rectangle parallel to the arrangement direction of the multiple characters as the hypotenuses of the right triangles; the coordinates of the single-character rectangle to which each of the multiple characters belongs are determined according to the vertex coordinates of each of the right triangles, the target rectangle and the principle of similar triangles; wherein the single-character rectangles are obtained by dividing the target rectangle based on the characters in the target rectangle, each of the single-character rectangles includes a character, and the vertex of each of the single-character rectangles coincides with the first side of the target rectangle to which the character area belongs.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, It is characterized in that When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Image-based text recognition method, system and device and storage medium

    CN111476210A

  • Character selection method and device based on character recognition and terminal equipment

    CN113496226A