Character detection method and device, equipment and medium

By implementing a character detection method on an electronic device, a character combination area in the image is obtained, a single character area is detected and divided, and a pre-trained character classification network is used for classification processing, the problems of high cost and low efficiency of manual auditing methods are solved, and efficient and accurate character detection is achieved.

CN119649384APending Publication Date: 2025-03-18BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411692271.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the prior art, manual review methods are used to detect the problems of spelling errors in characters in pictures or design drafts, and there are problems of high labor costs, low accuracy and low efficiency.

Method used

A character detection method is provided, by obtaining the character combination area in the image to be processed, detecting and segmenting the single character area, and using a pre-trained character classification network to classify the characters of each single character area to determine the character category.

Benefits of technology

It reduces the cost of character detection, improves the accuracy and efficiency of character detection, and can accurately segment and identify characters in the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119649384A_ABST
    Figure CN119649384A_ABST
Patent Text Reader

Abstract

The invention relates to a character detection method and device, equipment and a medium. The method is applied to electronic equipment and comprises the steps that a to-be-processed image is acquired, the to-be-processed image comprises a character combination area, and the character combination area comprises a plurality of to-be-recognized characters; detecting single character regions corresponding to the plurality of characters from a character combination region contained in the to-be-processed image; segmenting each single character region in the character combination region to obtain characters in each single character region; a pre-trained character classification network is utilized to classify the characters in each single character area, the character category of each single character area is determined, the pre-trained character classification network comprises a first number of classification sub-networks, and the language category to which the characters belong comprises a second number of character categories; the first number is equal to the second number. Therefore, while the character detection cost is reduced, the accuracy and efficiency of character detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of character detection, and in particular to a character detection method, device, equipment and medium. Background Art

[0002] With the advancement of science and technology and the continuous improvement of user needs, more and more pictures or design drafts are displayed on applications for users to view. If there are spelling errors or inconsistent character fonts in the pictures or design drafts displayed on the application, it will affect the user's perception and experience.

[0003] In the related art, before these pictures or design drafts are put online, manual review is used to check whether there are spelling errors or inconsistent characters on the pictures or design drafts. However, the manual review method requires a lot of manpower costs and also has problems of low accuracy and low efficiency, which needs to be improved. Summary of the invention

[0004] In order to solve the above technical problems, the present disclosure provides a character detection method, device, equipment and medium.

[0005] In a first aspect, the present disclosure provides a character detection method, applied to an electronic device, the method comprising:

[0006] Acquire an image to be processed, wherein the image to be processed includes a character combination area, and the character combination area includes a plurality of characters to be recognized;

[0007] Detecting the single character regions corresponding to the plurality of characters respectively from the character combination region contained in the image to be processed;

[0008] Segment each single character region in the character combination region to obtain the characters in each single character region;

[0009] Using a pre-trained character classification network, the characters in each single-character area are classified to determine the character category of each single-character area, wherein the pre-trained character classification network includes a first number of classification sub-networks, the language category to which the character belongs includes a second number of character categories, and the first number is equal to the second number.

[0010] In a second aspect, the present disclosure provides a character detection device, which is configured in an electronic device, and the device includes:

[0011] An acquisition module, used for acquiring an image to be processed, wherein the image to be processed includes a character combination area, and the character combination area includes a plurality of characters to be recognized;

[0012] A detection module, used for detecting the single character regions corresponding to the plurality of characters respectively from the character combination region contained in the image to be processed;

[0013] A segmentation module, used for segmenting each single character area in the character combination area to obtain the characters in each single character area;

[0014] A category recognition module is used to utilize a pre-trained character classification network to classify the characters in each single-character area and determine the character category of each single-character area, wherein the pre-trained character classification network includes a first number of classification sub-networks, the language category to which the character belongs includes a second number of character categories, and the first number is equal to the second number.

[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the device comprising:

[0016] one or more processors;

[0017] a storage device for storing one or more programs,

[0018] When one or more programs are executed by one or more processors, the one or more processors implement the method provided in the first aspect.

[0019] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method provided in the first aspect is implemented.

[0020] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0021] A character detection method, device, equipment and medium of the disclosed embodiment are applied to electronic devices, and the method includes: obtaining an image to be processed, wherein the image to be processed includes a character combination area, and the character combination area includes multiple characters to be identified; detecting single character areas corresponding to multiple characters from the character combination area included in the image to be processed; segmenting each single character area in the character combination area to obtain the characters in each single character area; using a pre-trained character classification network to classify the characters in each single character area and determine the character category of each single character area, wherein the pre-trained character classification network includes a first number of classification subnetworks, and the language category to which the characters belong includes a second number of character categories, and the first number is equal to the second number. Thus, by detecting single character areas from the character combination area of ​​the image to be processed and performing character segmentation on the single character area, each character in the character combination area can be accurately segmented, and then the detected character category can be determined using the character classification network, thereby reducing the cost of character detection while also improving the accuracy and efficiency of character detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0024] Figure 1 A flowchart of a character detection method provided by an embodiment of the present disclosure;

[0025] Figure 2 A schematic diagram of the process of S110 provided in an embodiment of the present disclosure;

[0026] Figure 3 A schematic diagram of the process of S120 provided in an embodiment of the present disclosure;

[0027] Figure 4 A structural schematic diagram of a character detection device provided by an embodiment of the present disclosure;

[0028] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0031] In order to improve the accuracy and efficiency of character recognition, the following Figure 1 The character detection method provided in the embodiment of the present disclosure is described. In the embodiment of the present disclosure, the character detection method can be performed by an electronic device. The electronic device can include a device with communication functions such as a tablet computer, a desktop computer, a laptop computer, etc., and can also include a device simulated by a virtual machine or a simulator.

[0032] Figure 1 A flow chart of a character detection method provided by an embodiment of the present disclosure is shown.

[0033] like Figure 1 As shown, the character detection method may include the following steps.

[0034] S110, obtaining an image to be processed, wherein the image to be processed includes a character combination area, and the character combination area includes a plurality of characters to be recognized.

[0035] In this embodiment, before the pictures or design drafts of the application go online, the user uploads these pictures or design drafts to the electronic device, and the electronic device obtains the pictures or design drafts and directly uses the pictures or design drafts as the images to be processed, or, processes the pictures or design drafts to generate images to be processed, and performs character detection on the images to be processed to determine whether there are any spelling errors or character inconsistencies in the characters in the pictures or design drafts.

[0036] The image to be processed can be an image of any page on the application. For example, the image to be processed is the image of the member page and non-member page of the video playback application. These pages are frequently browsed by users. Therefore, it is necessary to detect whether there are spelling errors or inconsistent characters on these pages to improve the user's perception and experience.

[0037] The character combination area contained in the image to be processed is an area composed of multiple characters to be recognized, not just a single character.

[0038] S120 , detecting single character regions corresponding to a plurality of characters from the character combination region included in the image to be processed.

[0039] In this embodiment, the electronic device uses a specific character region detection method for each character combination region in the image to be processed, and detects the single character region corresponding to each character from the character combination region.

[0040] The single character area refers to an area containing only one character. For example, the character combination area contains multiple characters to be recognized, Happy, whose language category is the English character category, and the single character area includes the area corresponding to the character "H", the area corresponding to the character "a", the area corresponding to the character "p", and the area corresponding to the character "y".

[0041] In some embodiments, a pre-generated character region detection model is used to perform region segmentation processing on the character combination region contained in the processed image to determine the single character regions corresponding to the multiple characters. Specifically, the character region detection model includes a feature aggregation network and a segmentation network formed by multiple convolutional layers. The feature aggregation network is used to aggregate high-dimensional features in the processed image to obtain high-dimensional features, and the segmentation network is used to segment the high-dimensional features, so that the single character regions corresponding to the multiple characters are detected from the character combination region.

[0042] Optionally, the character region detection model includes but is not limited to a model that has learned a character region awareness algorithm (CRAFT) for text detection, and may also include a model that has learned other character region detection algorithms.

[0043] It is understandable that when training the character region detection model, the multi-character combination region in the sample image and each character in the multi-character combination region are annotated, and then the original network is iteratively trained using the sample image containing the multi-character combination region and each character in the multi-character combination region to obtain a trained character region detection model. Therefore, when training the character region detection model, the annotation is from the character combination region containing multiple characters (such as the word region of the English character category) to the character level, and the manual annotation cost is lower.

[0044] In this way, for each character combination area in the image to be processed, the single character area corresponding to each character in the character combination area is accurately detected through the area detection method. Since the character area detection model sets multiple convolutional layers, it is beneficial to retain the detail information in the image to be processed, thereby improving the detection accuracy of the single character area.

[0045] S130, segment each single character area in the character combination area, and obtain the characters in each single character area.

[0046] In this embodiment, for each single-character region in the character combination region, the electronic device continues to use the character segmentation algorithm to perform character segmentation to obtain the characters in each single-character region.

[0047] In some embodiments, a character segmentation model that has learned a character segmentation algorithm is used to process each single-character region in the character combination region to obtain the characters in each single-character region.

[0048] Optionally, the character segmentation model includes but is not limited to a model that has learned a watershed algorithm, and may also include a model that has learned other character segmentation algorithms.

[0049] In this way, the character segmentation algorithm is used to accurately segment characters from the single-character area, thereby improving the accuracy and stability of character segmentation.

[0050] S140. Use a pre-trained character classification network to classify the characters in each single-character area and determine the character category of each single-character area, wherein the pre-trained character classification network includes a first number of classification sub-networks, the language category to which the characters belong includes a second number of character categories, and the first number is equal to the second number.

[0051] In this embodiment, the electronic device inputs the characters in each single-character area into a pre-trained character classification network. Since the pre-trained character classification network has undergone a lot of training in advance and has learned the character features, such as the font features and font size features of different characters, the pre-trained character classification network compares the characters in each single-character area with pre-defined labels to determine the character category of each single-character area, which is helpful in clarifying whether there are character spelling errors or character inconsistencies in the image to be processed.

[0052] It can be understood that since the pre-trained character classification network contains a first number of classification sub-networks, the language category to which the character belongs contains a second number of character categories, and the first number is equal to the second number, the pre-trained character classification network can output the character category that conforms to the language category to which it belongs.

[0053] For example, the language category to which the characters belong is the English character category, and the first number and the second number are both 26.

[0054] Optionally, the pre-trained character classification network may be a deep convolutional neural network or a neural network model of other structures.

[0055] A character detection method according to an embodiment of the present disclosure is applied to an electronic device, and the method includes: obtaining an image to be processed, wherein the image to be processed includes a character combination area, and the character combination area includes multiple characters to be identified; detecting single character areas corresponding to multiple characters from the character combination area included in the image to be processed; segmenting each single character area in the character combination area to obtain the characters in each single character area; using a pre-trained character classification network to classify the characters in each single character area and determine the character category of each single character area, wherein the pre-trained character classification network includes a first number of classification subnetworks, and the language category to which the characters belong includes a second number of character categories, and the first number is equal to the second number. Thus, by detecting single character areas from the character combination area of ​​the image to be processed and performing character segmentation on the single character area, each character in the character combination area can be accurately segmented, and then the detected character category can be determined using the character classification network, thereby reducing the cost of character detection while also improving the accuracy and efficiency of character detection.

[0056] In some embodiments, after executing S140, the method further includes: using a pre-generated character statistical model to perform statistics on the same character in the image to be processed, and determining the number of times the same character in the image to be processed is used.

[0057] It is understandable that in many scenarios, there is still a need to count the number of times a character is used. If the statistics are performed manually, a lot of time will be invested and the cost will be high. In this embodiment, since the character statistical model has learned the statistical algorithm, by calling the pre-generated character statistical model, it is possible to count the same character in the image to be processed and determine the number of times the same character is used in the image to be processed.

[0058] In this way, when there is a need to count the number of times a character is used, a pre-generated character statistical model is called to automatically count the number of times the same character is used in the image to be processed, thereby improving statistical efficiency and accuracy.

[0059] In some embodiments, after executing S140, the method further includes: using a pre-trained large language model to perform error correction recognition on the character category of each single-character region, and determining whether there is a recognition error in the character category of each single-character region.

[0060] It is understandable that in many scenarios, there is a need to detect whether there are any recognition errors in the character category of each single-character area. In this case, the present embodiment uses a pre-trained large language model to perform error correction recognition on the character category of each single-character area, so as to quickly detect whether there are any spelling errors or character inconsistencies in the character category of each single-character area, thereby improving the accuracy of character detection.

[0061] In some embodiments, after executing S140, the method further includes: identifying the format of the character category of each single-character area; converting the format of the character category of each single-character area into a preset unified format; and aligning the character category of each single-character area according to the preset unified format.

[0062] It is understandable that in many scenarios, there is still a need to detect the format of the character category of each single-character area. The present embodiment uses a pre-trained large language model or format recognition algorithm to identify the format of the character category of each single-character area, and when the format of the character category of each single-character area is not uniform, the format of the character category of each single-character area is converted into a preset unified format, and then the character category of each single-character area is aligned according to the preset unified format.

[0063] Optionally, the format of the character category of each single-character area includes but is not limited to font format, font size format, glyph format, etc.

[0064] In this way, by identifying, converting and aligning the format of the character category of each single-character area, the detected character categories can be made more regular, which is beneficial to improving the user's viewing experience when these character categories are displayed on the image to be processed.

[0065] In another embodiment of the present disclosure, step S110 is refined.

[0066] Figure 2 A schematic diagram of the process of S110 provided in this embodiment is shown.

[0067] like Figure 2 As shown, the S110 may include the following steps.

[0068] S210: Acquire an original image.

[0069] The original image refers to a picture or design draft uploaded by a user to an electronic device. Optionally, the original image includes but is not limited to a low-light image, a low-resolution image, a low-contrast image, or other poor-quality image.

[0070] S220 , based on a preset adaptive curve, enhancing the original image to determine an image to be processed corresponding to the original image.

[0071] In this embodiment, the electronic device calls an image enhancement algorithm, which is pre-configured with a preset adaptive curve. The image data of the original image is adjusted through the adaptive curve to enhance the original image, and the enhanced image is directly used as the image to be processed, or the enhanced image is processed again to generate the image to be processed.

[0072] Optionally, the preset adaptive curve can adjust image features such as brightness, contrast, grayscale, texture, etc. of the original image, and the adjustment is performed specifically according to the actual scene.

[0073] Optionally, the image enhancement algorithm includes but is not limited to a zero-shot learning-based dehazing and contrast enhancement algorithm (Zero-shot Learning-based Dehazing and Contrast Enhancement, ZeroDCE), or other algorithms.

[0074] In this embodiment, the specific implementation method of S220 includes but is not limited to the following methods: based on a preset adaptive curve, the original image is enhanced to determine an initial enhanced image; using a pre-generated image enhancement network, the initial enhanced image is enhanced to obtain a target enhanced image, and the target enhanced image is used as the image to be processed corresponding to the original image.

[0075] Among them, the image enhancement network includes but is not limited to a deep learning model (DCE-Net) for single-channel speech enhancement. DCE-Net includes stacked convolutions and activation functions. The stacked convolutions can form a skip connection layer for reusing shallow features. The activation function is used to activate the reused shallow features, thereby outputting a target enhanced image with a value range in a specific range.

[0076] In this way, for an original image with poor image quality, the preset adaptive curve is used, or the preset adaptive curve and the image enhancement network are combined to perform enhancement processing on the original image, thereby obtaining an image to be processed with better image quality.

[0077] It is understandable that when the size of the original image is small, some pixels in the original image are blocked, which will result in poor quality of the original image. In this regard, after executing S210, this embodiment also includes: determining the four vertices and diagonal lines of the original image; taking each vertex as a starting point, extending a preset number of pixels along the diagonal line in a direction outside the original image to obtain four new vertices; connecting the four new vertices in sequence to obtain an enlarged image; accordingly, the specific steps of S220 include: based on a preset adaptive curve, enhancing the enlarged image to determine the image to be processed corresponding to the original image.

[0078] The preset number of pixel points may be a plurality of pixel points determined empirically, for example, the preset number of pixel points may be 5 pixel points, or may be other numbers of pixel points.

[0079] In other cases, after the enlarged image is enhanced using a preset adaptive curve, the enlarged image after the enhancement processing may be further enhanced using a pre-generated image brightness enhancement network to obtain an image to be processed corresponding to the original image.

[0080] In this way, the original image can be enlarged by expanding a preset number of pixels along the polygon at the four vertices of the original image. This method can disperse the overlapping pixels in the original image, thereby improving the image quality to a certain extent, which is beneficial to the accuracy of character detection.

[0081] In yet another embodiment of the present disclosure, step S120 is refined.

[0082] Figure 3 A schematic diagram of the process of S120 provided in an embodiment of the present disclosure is shown.

[0083] like Figure 3 As shown, the S120 may include the following steps.

[0084] S310, obtaining the positioning points of the minimum outer contour of each character from the character combination area, and reading the coordinate data of the positioning points, wherein the positioning points include the center point and corner points of the minimum outer contour of each character.

[0085] In this embodiment, the electronic device first determines the minimum outer contour of each character based on the shape of each character in the character combination area, and then obtains the center point and corner point of the minimum outer contour of each character as the positioning point of the minimum outer contour of each character. At the same time, the coordinate data of the positioning point is read to facilitate the use of the coordinate data of the center point and the coordinate data of the corner point of the minimum outer contour of each character to detect the single character area corresponding to each character in the character combination area.

[0086] S320, determining the single character areas corresponding to the multiple characters respectively according to the coordinate data of the center point of the minimum outer contour of each character and the coordinate data of the corner points of the minimum outer contour of each character.

[0087] It is understandable that the multiple characters included in the character combination area are not necessarily placed horizontally, and may be tilted, or the multiple characters included in the character combination area have a certain style, and it is not easy to detect the single character area corresponding to each character from this form of character combination area. In this embodiment, for a character combination area containing multiple characters of any form, the coordinate data of the center point of the minimum outer contour of each character and the coordinate data of the corner points of the minimum outer contour of each character can also accurately determine the single character areas corresponding to the multiple characters.

[0088] In this embodiment, the specific implementation method of S320 includes but is not limited to the following methods: determining the drawing size of the single-character area corresponding to each character based on the coordinate data of the center point of the minimum outer contour of each character and the coordinate data of the corner points of the minimum outer contour of each character; taking the center point of the minimum outer contour of the character as the area center, and generating the single-character area corresponding to the character according to the drawing size of the single-character area corresponding to the character.

[0089] Specifically, the electronic device first calculates the distance from the center point of the minimum outer contour of each character to each corner point based on the coordinate data of the center point of the minimum outer contour of each character and the coordinate data of the corner points of the minimum outer contour of each character, then selects the maximum distance from multiple distances as the drawing size of the single-character area corresponding to each character, and then draws the single-character area corresponding to the character with the center point of the minimum outer contour of the character as the area center according to the drawing size of the single-character area corresponding to the character.

[0090] The minimum outer contour of each character refers to the minimum outer bounding box of the character generated based on the shape of each character. For example, the minimum outer contour of the character "H" is the minimum outer bounding box generated based on the shape of the character "H", and the minimum outer contour of the character "a" is the minimum outer bounding box generated based on the shape of the character "a".

[0091] The single character area corresponding to each character can completely cover the fixed area of ​​each point on the character. Optionally, the single character area corresponding to each character includes but is not limited to a circular area, a rectangular area, a square area, and the like.

[0092] In this way, by obtaining the positioning point and coordinate data of the minimum outer contour of each character in the character combination area, the drawing size of the single character area corresponding to each character is determined, and then combined with the center point of the minimum outer contour of each character and the drawing size of the single character area corresponding to each character, the single character area corresponding to each character is accurately segmented from the character combination area.

[0093] In yet another embodiment of the present disclosure, step S130 is refined.

[0094] In some embodiments, the specific implementation method of S130 includes but is not limited to the following methods: reading the grayscale value of each pixel from the character combination area; segmenting the character combination area based on the pixel with the largest grayscale value or the pixel with the smallest grayscale value in the character combination area, and obtaining the initial segmentation area of ​​the character combination area, wherein at least one initial segmentation area includes at least two characters; segmenting each single character area in at least one initial segmentation area based on the coordinate data of each single character area in at least one initial segmentation area, and obtaining the characters in each single character area.

[0095] The initial segmentation area refers to the result obtained by preliminary segmentation of the character combination area, and at least one initial segmentation area includes at least two characters. For example, the character combination area includes the characters Happy. After grayscale segmentation, the initial segmentation area includes an area containing the character "H", an area containing the character "a", an area containing the character "pp", and an area containing the character "y". The initial segmentation area containing the character "pp" includes two characters. For this type of initial segmentation area, it is necessary to continue segmenting to obtain a single-character area containing "p".

[0096] Specifically, the electronic device adopts an algorithm such as a watershed algorithm to read the grayscale value of each pixel from the character combination area, and then finds the pixel with the largest or smallest grayscale value (i.e., the peak and valley points) from the character combination area. Next, the character combination area is segmented based on the peak and valley points to obtain an initial segmented area of ​​the character combination area. For an initial segmented area including at least two characters, the electronic device continues to segment each single character area in such initial segmented area according to the coordinate data of each single character area in such initial segmented area, thereby obtaining the characters in each single character area.

[0097] Therefore, firstly, based on the grayscale value of each pixel in the character combination area, the character combination area is roughly segmented to obtain an initial segmentation area containing at least two characters, and then based on the coordinate data of each single character area in the initial segmentation area, the initial segmentation area is finely segmented to obtain the characters in each single character area, thereby improving the accuracy and flexibility of character segmentation.

[0098] In other embodiments, after executing S120, the method further includes: determining the distance between adjacent single-character areas in the character combination area based on the coordinate data of adjacent single-character areas in the character combination area; accordingly, the specific implementation method of S130 includes but is not limited to the following method: determining the dividing point between adjacent single-character areas in the character combination area based on the coordinate data of each single-character area in the character combination area and the distance between adjacent single-character areas in the character combination area; using the dividing point, performing region segmentation on adjacent single-character areas in the character combination area to obtain the characters in each single-character area.

[0099] The segmentation points include but are not limited to the midpoint, one-third point, and one-quarter point between adjacent character regions.

[0100] Specifically, first, the electronic device can use the coordinate data of each single-character area in the character combination area as the coordinate data of the center point of each single-character area in the character combination area, and then calculate the distance between adjacent single-character areas in the character combination area based on the coordinate data of the center point of each single-character area in the character combination area, and then determine the dividing point between adjacent single-character areas in the character combination area based on the distance, and finally, perform region segmentation on adjacent single-character areas in the character combination area from the dividing point to obtain the characters in each single-character area.

[0101] In this way, the coordinate data of the adjacent single-character areas in the character combination area and the distances between the adjacent single-character areas in the character combination area are combined to perform area segmentation on the adjacent single-character areas in the character combination area, thereby improving the accuracy of character segmentation.

[0102] Figure 4 A schematic structural diagram of a character detection device provided by an embodiment of the present disclosure is shown.

[0103] like Figure 4 As shown, the character detection device 400 may include:

[0104] An acquisition module 410 is used to acquire an image to be processed, wherein the image to be processed includes a character combination area, and the character combination area includes a plurality of characters to be recognized;

[0105] A detection module 420, configured to detect, from the character combination area contained in the image to be processed, single character areas corresponding to the plurality of characters respectively;

[0106] A segmentation module 430, configured to segment each single character region in the character combination region to obtain characters in each single character region;

[0107] The category recognition module 440 is used to utilize a pre-trained character classification network to classify the characters in each single-character area and determine the character category of each single-character area, wherein the pre-trained character classification network includes a first number of classification sub-networks, the language category to which the character belongs includes a second number of character categories, and the first number is equal to the second number.

[0108] A character detection device according to an embodiment of the present disclosure is configured in an electronic device, and the device includes: obtaining an image to be processed, wherein the image to be processed includes a character combination area, and the character combination area includes multiple characters to be identified; detecting single character areas corresponding to multiple characters from the character combination area included in the image to be processed; segmenting each single character area in the character combination area to obtain the characters in each single character area; using a pre-trained character classification network to classify the characters in each single character area and determine the character category of each single character area, wherein the pre-trained character classification network includes a first number of classification subnetworks, and the language category to which the characters belong includes a second number of character categories, and the first number is equal to the second number. Thus, by detecting single character areas from the character combination area of ​​the image to be processed and performing character segmentation on the single character area, each character in the character combination area can be accurately segmented, and then the detected character category can be determined using the character classification network, thereby reducing the cost of character detection while also improving the accuracy and efficiency of character detection.

[0109] In some embodiments of the present disclosure, the detection module 420 includes:

[0110] A first acquisition unit, used to acquire the positioning points of the minimum outer contour of each character from the character combination area, and read the coordinate data of the positioning points, wherein the positioning points include the center point and the corner points of the minimum outer contour of each character;

[0111] The first determining unit is used to determine the single character areas corresponding to the multiple characters respectively according to the coordinate data of the center point of the minimum outer contour of each character and the coordinate data of the corner points of the minimum outer contour of each character.

[0112] In some embodiments of the present disclosure, the first determining unit is specifically configured to:

[0113] Determine the drawing size of the single character area corresponding to each character according to the coordinate data of the center point of the minimum outer contour of each character and the coordinate data of the corner points of the minimum outer contour of each character;

[0114] The single character area corresponding to the character is generated according to the drawing size of the single character area corresponding to the character, with the center point of the minimum outer contour of the character as the area center.

[0115] In some embodiments of the present disclosure, the segmentation module 430 includes:

[0116] A second acquisition unit, used for reading the gray value of each pixel in the character combination area;

[0117] A third acquisition unit is used to segment the character combination area based on the pixel point with the largest gray value or the pixel point with the smallest gray value in the character combination area to obtain the initial segmentation area of ​​the character combination area, wherein at least one of the initial segmentation areas includes at least two characters;

[0118] The fourth acquisition unit is used to segment each single character area in at least one of the initial segmentation areas based on the coordinate data of each single character area in at least one of the initial segmentation areas, and acquire the characters in each single character area.

[0119] In some embodiments of the present disclosure, the device further includes:

[0120] A distance determination module, for determining the distance between adjacent single-character regions in the character combination region based on coordinate data of adjacent single-character regions in the character combination region;

[0121] Accordingly, the detection module 420 includes:

[0122] A segmentation point determination unit, used for determining a segmentation point between adjacent single-character regions in the character combination region based on the coordinate data of each single-character region in the character combination region and the distance between adjacent single-character regions in the character combination region;

[0123] The segmentation unit is used to perform region segmentation on adjacent single-character regions in the character combination region by using the segmentation points to obtain the characters in each single-character region.

[0124] In some embodiments of the present disclosure, the acquisition module 410 includes:

[0125] A fifth acquisition unit, used for acquiring an original image;

[0126] The enhancement processing unit is used to perform enhancement processing on the original image based on a preset adaptive curve to determine an image to be processed corresponding to the original image.

[0127] In some embodiments of the present disclosure, the enhanced processing unit is specifically configured to:

[0128] Based on a preset adaptive curve, the original image is enhanced to determine an initial enhanced image;

[0129] The initial enhanced image is enhanced by using a pre-generated image enhancement network to obtain a target enhanced image, and the target enhanced image is used as an image to be processed corresponding to the original image.

[0130] In some embodiments of the present disclosure, the device further includes:

[0131] A vertex and diagonal line determination module, used for determining four vertices and diagonal lines of the original image;

[0132] A pixel expansion module, used to expand a preset number of pixels along the diagonal line in a direction outside the original image with each vertex as a starting point, to obtain four new vertices;

[0133] An image enlargement module, used for connecting the four new vertices in sequence to obtain an enlarged image;

[0134] Accordingly, the enhanced processing unit is specifically used for:

[0135] Based on the preset adaptive curve, the enlarged image is enhanced to determine an image to be processed corresponding to the original image.

[0136] In some embodiments of the present disclosure, the device further includes:

[0137] The error correction module is used to use a pre-trained large language model to perform error correction recognition on the character category of each single-character area to determine whether there is a recognition error in the character category of each single-character area.

[0138] In some embodiments of the present disclosure, the device further includes:

[0139] A format recognition module, used for recognizing the format of the character category of each single-character area;

[0140] A format unification module, used for converting the format of the character category of each single-character area into a preset unified format;

[0141] The character alignment module is used to align the character categories of each single-character area according to the preset unified format.

[0142] In some embodiments of the present disclosure, the language category to which the characters belong is an English character category, and the first number and the second number are both 26.

[0143] It should be noted that Figure 4 The character detection device 400 shown can perform Figures 1 to 3 The various steps in the method embodiment shown in the figure are implemented Figures 1 to 3 The various processes and effects in the method embodiment shown are not described in detail here.

[0144] Figure 5 The electronic device may include a tablet computer, a desktop computer, a notebook computer, or other devices with communication functions, or may include a device simulated by a virtual machine or a simulator.

[0145] like Figure 5 As shown, the electronic device may include a processor 501 and a memory 502 storing computer program instructions.

[0146] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0147] The memory 502 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 502 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 502 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 502 is a non-volatile solid-state memory. In a particular embodiment, the memory 502 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (Electrically Erasable Programmable ROM, EEPROM), an electrically rewritable ROM (EAROM) or a flash memory, or a combination of two or more of these.

[0148] The processor 501 reads and executes the computer program instructions stored in the memory 502 to perform the steps of the character detection method provided in the embodiment of the present disclosure.

[0149] In one example, the electronic device may further include a transceiver 503 and a bus 504. Figure 5 As shown, the processor 501, the memory 502 and the transceiver 503 are connected via a bus 504 and communicate with each other.

[0150] The bus 504 includes hardware, software, or both. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 504 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0151] The following is an embodiment of a computer-readable storage medium provided in an embodiment of the present disclosure. The computer-readable storage medium and the character detection method of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the computer-readable storage medium, reference can be made to the embodiment of the above-mentioned character detection method.

[0152] This embodiment provides a storage medium containing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to perform a character detection method. The method includes:

[0153] Acquire an image to be processed, wherein the image to be processed includes a character combination area, and the character combination area includes a plurality of characters to be recognized;

[0154] Detecting the single character regions corresponding to the plurality of characters respectively from the character combination region contained in the image to be processed;

[0155] Segment each single character region in the character combination region to obtain the characters in each single character region;

[0156] Using a pre-trained character classification network, the characters in each single-character area are classified to determine the character category of each single-character area, wherein the pre-trained character classification network includes a first number of classification sub-networks, the language category to which the character belongs includes a second number of character categories, and the first number is equal to the second number.

[0157] Of course, the storage medium containing computer executable instructions provided by the embodiment of the present disclosure is not limited to the above method operations, and the computer executable instructions can also execute related operations in the character detection method provided by any embodiment of the present disclosure.

[0158] Through the above description of the implementation methods, the technical personnel in the relevant field can clearly understand that the present disclosure can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer's floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions to enable a computer cloud platform (which can be a personal computer, a server, or a network cloud platform, etc.) to execute the character detection method provided by each embodiment of the present disclosure.

[0159] Note that the above are only preferred embodiments of the present disclosure and the technical principles used. Those skilled in the art will understand that the present disclosure is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present disclosure. Therefore, although the present disclosure is described in more detail through the above embodiments, the present disclosure is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present disclosure, and the scope of the present disclosure is determined by the scope of the appended claims.

Claims

1. A character detection method, characterized in that: Applied to electronic equipment, the method comprises: Acquire an image to be processed, wherein the image to be processed includes a character combination area, and the character combination area includes a plurality of characters to be recognized; Detecting the single character regions corresponding to the plurality of characters respectively from the character combination region contained in the image to be processed; Segment each single character region in the character combination region to obtain the characters in each single character region; Using a pre-trained character classification network, the characters in each single-character area are classified to determine the character category of each single-character area, wherein the pre-trained character classification network includes a first number of classification sub-networks, the language category to which the character belongs includes a second number of character categories, and the first number is equal to the second number.

2. The method according to claim 1, characterized in that The detecting, from the character combination area contained in the image to be processed, the single character areas corresponding to the multiple characters respectively comprises: Acquire the positioning points of the minimum outer contour of each character from the character combination area, and read the coordinate data of the positioning points, wherein the positioning points include the center point and the corner points of the minimum outer contour of each character; The single character areas corresponding to the multiple characters are determined according to the coordinate data of the center point of the minimum outer contour of each character and the coordinate data of the corner points of the minimum outer contour of each character.

3. The method according to claim 2, characterized in that Determining the single character areas corresponding to the plurality of characters respectively according to the coordinate data of the center point of the minimum outer contour of each character and the coordinate data of the corner points of the minimum outer contour of each character comprises: Determine the drawing size of the single character area corresponding to each character according to the coordinate data of the center point of the minimum outer contour of each character and the coordinate data of the corner points of the minimum outer contour of each character; The single character area corresponding to the character is generated according to the drawing size of the single character area corresponding to the character, with the center point of the minimum outer contour of the character as the area center.

4. The method according to claim 1, characterized in that: The step of segmenting each single character region in the character combination region to obtain characters in each single character region includes: Read the gray value of each pixel in the character combination area; Based on the pixel point with the largest gray value or the pixel point with the smallest gray value in the character combination area, the character combination area is segmented to obtain the initial segmented area of ​​the character combination area, wherein at least one of the initial segmented areas includes at least two characters; Based on the coordinate data of each single character region in at least one of the initial segmented regions, each single character region in at least one of the initial segmented regions is segmented to obtain the characters in each single character region.

5. The method according to claim 1, characterized in that After detecting the single character regions corresponding to the plurality of characters respectively from the character combination region contained in the image to be processed, the method further comprises: Determining the distance between adjacent single-character regions in the character combination region based on the coordinate data of adjacent single-character regions in the character combination region; Accordingly, segmenting each single character region in the character combination region to obtain the characters in each single character region includes: Determine a segmentation point between adjacent single-character regions in the character combination region based on coordinate data of each single-character region in the character combination region and a distance between adjacent single-character regions in the character combination region; The segmentation points are used to segment adjacent single-character regions in the character combination region to obtain the characters in each single-character region.

6. The method according to claim 1, characterized in that The step of obtaining the image to be processed comprises: Get the original image; Based on a preset adaptive curve, the original image is enhanced to determine an image to be processed corresponding to the original image.

7. The method according to claim 6, characterized in that The enhancing process is performed on the original image based on a preset adaptive curve to determine an image to be processed corresponding to the original image, including: Based on a preset adaptive curve, the original image is enhanced to determine an initial enhanced image; The initial enhanced image is enhanced by using a pre-generated image enhancement network to obtain a target enhanced image, and the target enhanced image is used as an image to be processed corresponding to the original image.

8. The method according to claim 6, characterized in that After acquiring the original image, the method further includes: Determine four vertices and a diagonal of the original image; Taking each vertex as a starting point, a preset number of pixels are extended along the diagonal line in a direction outside the original image to obtain four new vertices; Connect the four new vertices in sequence to obtain an enlarged image; Correspondingly, the enhancing process is performed on the original image based on the preset adaptive curve to determine the image to be processed corresponding to the original image, including: Based on the preset adaptive curve, the enlarged image is enhanced to determine an image to be processed corresponding to the original image.

9. The method according to claim 1, characterized in that: Also includes: The pre-trained large language model is used to perform error correction recognition on the character category of each single-character region to determine whether there is a recognition error in the character category of each single-character region.

10. The method according to claim 1, characterized in that Also includes: Identify the format of the character category of each single character area; Converting the character category format of each single-character region into a preset unified format; According to the preset unified format, the character categories of each single-character area are aligned.

11. The method according to any one of claims 1 to 10, characterized in that: The language category to which the characters belong is the English character category, and the first number and the second number are both 26.

12. A character detection device, characterized in that: Configured in an electronic device, the device comprises: An acquisition module, used for acquiring an image to be processed, wherein the image to be processed includes a character combination area, and the character combination area includes a plurality of characters to be recognized; A detection module, used for detecting the single character regions corresponding to the plurality of characters respectively from the character combination region contained in the image to be processed; A segmentation module, used for segmenting each single character area in the character combination area to obtain the characters in each single character area; A category recognition module is used to utilize a pre-trained character classification network to classify the characters in each single-character area and determine the character category of each single-character area, wherein the pre-trained character classification network includes a first number of classification sub-networks, the language category to which the character belongs includes a second number of character categories, and the first number is equal to the second number.

13. An electronic device, characterized in that: include: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the method described in any one of claims 1 to 11.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method according to any one of claims 1 to 11.

Citation Information

Cited By

  • Industrial character detection and recognition method and device based on YOLO framework and medium

    CN121505587A