Text detection methods, devices, electronic equipment, and storage media
By constructing and classifying detection boxes in text detection technology, extracting their texture and geometric features, and using these features for text detection, the problem of poor detection of curved shapes and long text lines in the prior art is solved, and a higher text detection accuracy is achieved.
Patent Information
- Application Number
- CN201911330293.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-20
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2040-06-15
AI Technical Summary
Existing regression-based text detection technology is difficult to accurately detect curved text and long text lines, especially under the influence of light and shadow occlusion, shooting angle, text art characters, deformation characters or incomplete characters, resulting in poor detection results.
By obtaining the image to be detected, a detection box corresponding to each text element is constructed, texture features and geometric features are extracted, and the correlation relationship between the detection boxes is obtained. The detection box is classified according to these features and correlation relationships, and the classification detection box is obtained, and finally text detection is performed on the image based on these detection boxes.
Improve the accuracy of text detection, better cover the curved text area, and avoid the problem of missing frames or incomplete predictions of long text lines during the detection process.
Smart Images

Figure CN111126389B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a text detection method, device, electronic equipment and storage medium. Background Art
[0002] Natural scene text detection has extremely important and widespread applications in real life, such as text retrieval, road sign recognition, and intelligent examination paper grading. However, due to various uncontrollable interference factors in natural scenes, such as light and shadow occlusion, shooting angle, foreign object occlusion, and some inherent properties of the text itself, such as artistic characters, deformed characters, or incomplete characters, natural scene text detection is still a very difficult task. However, with the development of artificial intelligence (AI) technology in recent years, natural scene text detection technology based on deep learning algorithms has also made great progress in performance.
[0003] At present, the more commonly used text detection technology is mainly "regression-based methods". However, in the process of research and practice of the existing technology, the inventors of the present invention found that the current regression-based method can only handle rectangular text lines. When the shape of the text is curved, its predicted detection box cannot accurately cover all text areas; in addition, for long text lines, once the aspect ratio of the text line is greater than the preset prediction threshold, there will be problems of frame loss or incomplete prediction. Therefore, the detection effect of the existing text detection scheme is not good. Summary of the invention
[0004] The embodiments of the present invention provide a text detection method, device, electronic device and storage medium, which can improve the accuracy of text detection.
[0005] An embodiment of the present invention provides a text detection method, comprising:
[0006] Acquire an image to be detected, wherein the image to be detected includes text to be detected, and the text to be detected includes multiple text elements;
[0007] Constructing a detection frame corresponding to each text element in the image to be detected;
[0008] Extract the texture features and geometric features of the area corresponding to each detection frame respectively, and obtain the correlation between the detection frames;
[0009] Classify the detection frame according to the association relationship, texture features and geometric features to obtain the classified detection frame;
[0010] Perform text detection on the image to be detected based on the classified detection box.
[0011] Accordingly, an embodiment of the present invention further provides a text detection device, comprising:
[0012] A first acquisition module is used to acquire an image to be detected, wherein the image to be detected includes text to be detected, and the text to be detected includes multiple text elements;
[0013] A construction module, used to construct a detection box corresponding to each text element in the image to be detected;
[0014] An extraction module is used to extract the texture features and geometric features of the area corresponding to each detection frame respectively;
[0015] The second acquisition module is used to obtain the association relationship between the detection frames;
[0016] The classification module is used to classify the detection frame according to the association relationship, texture features and geometric features to obtain the classified detection frame;
[0017] The detection module is used to perform text detection on the image to be detected based on the classified detection frame.
[0018] Optionally, in some embodiments of the present invention, the classification module includes:
[0019] A calculation unit, used to calculate a similarity function corresponding to each detection box according to the association relationship;
[0020] The classification unit is used to classify the detection frame based on texture features, geometric features and similarity functions to obtain a classified detection frame.
[0021] Optionally, in some embodiments of the present invention, the classification unit includes:
[0022] A construction subunit is used to construct a texture feature map corresponding to the image to be detected and a geometric feature map corresponding to the image to be detected according to the texture feature, the geometric feature and the similarity function;
[0023] The classification subunit is used to classify the detection frame based on the texture feature map and the geometric feature map to obtain a classified detection frame.
[0024] Optionally, in some embodiments of the present invention, the construction subunit is specifically used for:
[0025] Calculate the texture feature points corresponding to the image to be detected through texture features and similarity functions;
[0026] Constructing a texture feature map corresponding to the image to be detected based on the texture feature points;
[0027] Calculate the geometric feature points corresponding to the image to be detected through geometric features and similarity functions;
[0028] A geometric feature map corresponding to the image to be detected is constructed based on the geometric feature points.
[0029] Optionally, in some embodiments of the present invention, the classification subunit is specifically used for:
[0030] Fusing the texture feature map and the geometric feature map to obtain a fused feature map;
[0031] Predicting the category to which the detection frame belongs through the fused feature map;
[0032] The detection frame is classified based on the prediction result to obtain the classified detection frame.
[0033] Optionally, in some embodiments of the present invention, the detection module includes:
[0034] A determination unit, used for determining the classified detection boxes belonging to the same category as a homologous group;
[0035] A construction unit, used for constructing a text box for text detection according to the classified detection box in the homology group;
[0036] A detection unit is used to perform text detection on the image to be detected based on the text box.
[0037] Optionally, in some embodiments of the present invention, the construction unit is specifically used for:
[0038] Determine the center point corresponding to each classified detection box in the homology group;
[0039] Get the size of each classified detection box in the homology group;
[0040] Construct a text box for text detection based on the center point and size.
[0041] Optionally, in some embodiments of the present invention, an adjustment module is further included, wherein the adjustment module is used to adjust the edge of the text box to obtain an adjusted text box;
[0042] The detection module is specifically used to perform text detection on the image to be detected based on the adjusted text frame.
[0043] Optionally, in some embodiments of the present invention, the building block is specifically used for:
[0044] Performing semantic segmentation on the image to be detected to obtain target pixel points corresponding to each text element and pixel association information corresponding to each target pixel point;
[0045] Based on pixel association information and multiple target pixels, a detection box corresponding to each text element is constructed.
[0046] After acquiring an image to be detected, the embodiment of the present invention includes text to be detected, and the text to be detected includes multiple text elements, a detection frame corresponding to each text element is constructed in the image to be detected, and then, the texture features and geometric features of the area corresponding to each detection frame are extracted respectively, and the association relationship between the detection frames is obtained, and then, the detection frames are classified according to the association relationship, texture features and geometric features to obtain classified detection frames, and finally, text detection is performed on the image to be detected based on the classified detection frames. Therefore, the scheme can effectively improve the accuracy of text detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1a is a scene schematic diagram of a text detection method provided by an embodiment of the present invention;
[0049] Figure 1b is a flowchart of a text detection method provided by an embodiment of the present invention;
[0050] Figure 1c 8 is a schematic diagram of the 8-neighborhood of a target pixel in the text detection method provided by an embodiment of the present invention;
[0051] Figure 1d is a schematic diagram of constructing a baseline in a text detection method provided by an embodiment of the present invention;
[0052] Figure 1e is a schematic diagram of constructing a text box in the text detection method provided by an embodiment of the present invention;
[0053] Figure 1f is a schematic diagram of adjusting a text box in a text detection method provided by an embodiment of the present invention;
[0054] Figure 2a is another flowchart of the text detection method provided by an embodiment of the present invention;
[0055] Figure 2b is another scenario schematic diagram of the text detection method provided by an embodiment of the present invention;
[0056] Figure 2c to Figure 2e is another schematic diagram of constructing a text box in the text detection method provided by an embodiment of the present invention;
[0057] Figure 3ais a structural schematic diagram of a text detection device provided by an embodiment of the present invention;
[0058] Figure 3b is another structural schematic diagram of a text detection device provided by an embodiment of the present invention;
[0059] Figure 4 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0061] Embodiments of the present invention provide a text detection method, device, electronic device and storage medium.
[0062] The text detection device may be integrated into a terminal, which may include a mobile phone, a tablet computer or a personal computer (PC).
[0063] For example, see Figure 1a The text detection device is integrated on a mobile phone, and the mobile phone may include a camera and a display screen. For example, when a user takes a photo of a signboard through a camera, the mobile phone can obtain the image to be detected corresponding to the signboard through the camera, wherein the image to be detected includes the text content of the signboard (i.e., the text to be detected), and the text to be detected includes multiple text elements. Then, the mobile phone can perform semantic segmentation on the image to be detected, obtain the target pixel points corresponding to each text element and the pixel association information corresponding to each target pixel point, and construct a detection frame corresponding to each text element based on the pixel association information and the multiple target pixels. Then, the mobile phone can respectively extract the texture features and geometric features of the area corresponding to each detection frame, and obtain the association relationship between the detection frames. Finally, the mobile phone performs text detection on the image to be detected based on the classified detection frame, and the mobile phone can recognize the text to be detected in the image to be detected according to the detection result. For example, the mobile phone can recognize the road name on the signboard, etc.
[0064] Compared with the existing text detection scheme, the text detection scheme of the present invention can extract the texture features and geometric features of the area corresponding to each detection frame, and obtain the correlation between the detection frames. When the shape of the text is curved, the detection frames can be classified according to the correlation, texture features and geometric features. Then, text detection is performed on the image to be detected based on the classified detection frames to avoid the situation where the detection frame cannot accurately cover all text areas. In addition, for long text lines, since the present scheme constructs a detection frame corresponding to each text element in the image to be detected, it can avoid the problem of missing frames or incomplete predictions during the detection process. Therefore, the scheme can improve the accuracy of text detection.
[0065] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0066] A text detection method comprises: obtaining an image to be detected, constructing a detection frame corresponding to each text element in the image to be detected, respectively extracting texture features and geometric features of the area corresponding to each detection frame, and obtaining the association relationship between the detection frames, classifying the detection frames according to the association relationship, texture features and geometric features to obtain classified detection frames, and performing text detection on the image to be detected based on the classified detection frames.
[0067] See also Figure 1b , Figure 1b The following is a flow chart of a text detection method provided by an embodiment of the present invention. The specific flow of the text recognition method can be as follows:
[0068] 101. Obtain an image to be detected.
[0069] Among them, the image to be detected includes the text to be detected, and the text to be detected includes multiple text elements, wherein the text elements refer to various elements in the text to be detected, such as words and symbols, etc. The image to be detected can be pre-saved locally, or it can be obtained by accessing the network interface, or it can be obtained by real-time shooting with a camera, depending on the actual situation.
[0070] 102. Construct a detection box corresponding to each text element in the image to be detected.
[0071] For example, specifically, semantic segmentation can be performed on the image to be detected, and then, based on the semantic segmentation result, a detection box corresponding to each text element can be constructed in the image to be detected, wherein the semantic segmentation of the image is to perform pixel-level recognition and segmentation to obtain the category information and precise position information of the object in the image. It can be understood that in the embodiment of the present invention, semantic segmentation is performed on the image to be detected, and the pixel points corresponding to each text element to be detected, that is, the target pixel points, and the pixel association information corresponding to the target pixel points can be obtained. That is, optionally, in some embodiments, the step of "constructing a detection box corresponding to each text element in the image to be detected" can specifically include:
[0072] (11) Perform semantic segmentation on the image to be detected to obtain the target pixel points corresponding to each text element and the pixel association information corresponding to each target pixel point;
[0073] (12) Based on the pixel association information and multiple target pixels, a detection box corresponding to each text element is constructed.
[0074] Among them, pixel association information can be understood as pixel neighborhood information. In image processing, neighborhood refers to a set of pixels adjacent to a certain pixel, reflecting the spatial relationship between pixels. The pixel association information can be pixel 4 neighborhood information, pixel diagonal neighborhood information or pixel 8 neighborhood information. Pixel 8 neighborhood information can be considered as the information obtained by fusing pixel 4 neighborhood information with pixel diagonal neighborhood information. When a pixel point is located at the boundary of the image, it can be considered that some neighborhood points corresponding to the pixel point fall outside the image.
[0075] For example, the first classification sub-model in the preset text detection model can be used to classify the pixels of the image to be detected, so as to determine the pixels belonging to the text elements, that is, to obtain multiple target pixels. Then, the second classification sub-model in the preset text detection model is used to classify the multiple target pixels to obtain the classification confidence corresponding to each target pixel. Finally, according to the classification confidence, it can be determined whether the target pixel has a connection relationship with the 8-neighborhood. The 8-neighborhood refers to the upper neighborhood, the lower neighborhood, the left neighborhood, the right neighborhood and the diagonal neighborhood, such as Figure 1c As shown, the pixel association information corresponding to the target pixel point is then constructed based on these connection relationships.
[0076] Among them, the pixel prediction value refers to the probability that each pixel in the text feature image belongs to the area where the text to be detected is located, and the classification confidence refers to the probability that the target pixel belongs to the text to be detected. First, a convolutional neural network such as FPN (Feature Pyramid Network) feature pyramid network can be used, such as Figure 1dAs shown in the figure, feature extraction is performed on the image to be detected. The image to be detected first passes through a convolutional neural network composed of nine convolutional layers to output a feature map of 512 layers and a size of 32*32. Then, the feature map is input into the FPN. After three stages of upsampling, a text feature map of 32 layers and a size of 256*256 is finally output. Subsequently, the pixels in the text feature image are classified through the first classification sub-model in the preset text detection model to obtain the pixel prediction value corresponding to each pixel. Then, based on the pixel prediction value, multiple target pixels corresponding to the text to be detected are determined. Then, the multiple target pixels are classified through the second classification sub-model in the preset text detection model to obtain the classification confidence corresponding to each target pixel.
[0077] 103. Extract the texture features and geometric features of the area corresponding to each detection frame respectively, and obtain the correlation relationship between the detection frames.
[0078] For example, a convolutional neural network such as a FPN (Feature Pyramid Network) feature pyramid network can be used to extract the texture features of each detection frame and the geometric features of each detection frame, and the association relationship between the detection frames can be obtained, and the association relationship can be the relative position relationship between the detection frames.
[0079] 104. Classify the detection frame according to the association relationship, texture feature and geometric feature to obtain the classified detection frame.
[0080] After obtaining the texture features and geometric features of the detection frame, the category to which each detection frame belongs can be predicted by using the association relationship between the detection frames, wherein the similarity function corresponding to each detection frame can be calculated according to the association relationship, and then the detection frame is classified according to the texture features, the geometric features and the similarity function to obtain the classified detection frame, that is, optionally, in some embodiments, the step of "classifying the detection frame according to the association relationship, the texture features and the geometric features to obtain the classified detection frame" can specifically include:
[0081] (21) Calculate the similarity function corresponding to each detection box based on the association relationship;
[0082] (22) The detection frame is classified based on texture features, geometric features and similarity functions to obtain the classified detection frame.
[0083] For example, the similarity function corresponding to each detection frame can be calculated according to the association relationship, and then the detection frame is classified based on the texture feature, the geometric feature and the similarity function using a preset graph convolutional neural network to obtain the classified detection frame. It should be noted that in an embodiment of the present invention, the similarity function may include a cosine similarity function, a Gaussian similarity function and / or a string similarity function. Preferably, in some embodiments, the similarity function includes a cosine similarity function, a Gaussian similarity function and a string similarity function, that is, based on the texture feature, the geometric feature and the similarity function, the detection frame is classified using a preset graph convolutional neural network to obtain The classified detection frame may specifically include: based on texture features, geometric features, cosine similarity function, Gaussian similarity function and string similarity function, a preset graph convolutional neural network is used to classify the detection frame to obtain the classified detection frame. That is to say, in the scheme for classifying the detection frame in the present invention, not only the texture features corresponding to the detection frame and the geometric features corresponding to the detection frame need to be considered, but also the similarities of each detection frame in each dimension such as cosine similarity, similarity on Gaussian distribution and similarity between strings need to be considered. Therefore, the accuracy of detection frame classification can be improved, which is convenient for subsequent text detection of the image to be detected based on the detection frame.
[0084] Further, a texture feature map corresponding to the image to be detected and a geometric feature map corresponding to the image to be detected can be constructed by a preset graph convolutional neural network according to the texture features, geometric features and similarity functions, and then the detection frame is classified based on the texture feature map and the geometric feature map to obtain a classified detection frame. That is, in some embodiments, the step of "classifying the detection frame based on the texture features, geometric features and similarity functions to obtain a classified detection frame" can specifically include:
[0085] (41) constructing a texture feature map corresponding to the image to be detected and a geometric feature map corresponding to the image to be detected respectively according to the texture features, the geometric features and the similarity function;
[0086] (42) The detection frame is classified based on the texture feature map and the geometric feature map to obtain the classified detection frame.
[0087] For example, after calculating the similarity function corresponding to each detection frame, the texture feature points corresponding to the image to be detected can be calculated using the texture features and the similarity function. Then, a texture feature map corresponding to the image to be detected is constructed based on the texture feature points. Specifically, the following formula can be used for calculation:
[0088] G 1 = K (g i ,g j ), i,j ∈{1,2,...,N}
[0089] Its representation texture feature map G 1 It is equal to the sum of the product of the texture feature of the i-th detection area and the similarity function K and the product of the texture feature of the j-th detection area and the similarity function K. It should be noted that the similarity function K= β 1 K 1 + β 2 K 2 + β 3 K 3 , where K 1 , K 2 and K 3 Respectively represent the cosine similarity function, Gaussian similarity function and string similarity function, β 1 , β 2 as well as β 3 Both represent weight coefficients, which satisfy β 1 +β 2 +β 3 = 1. It can be set according to the actual situation. Similarly, after calculating the similarity function corresponding to each detection frame, the geometric feature points corresponding to the image to be detected can be calculated by the geometric features and similarity function. Then, the texture feature map corresponding to the image to be detected is constructed based on the geometric feature points. It can be calculated by the following formula:
[0090] G 2 = K (h i ,h j ), i,j ∈{1,2,..., N}
[0091] Its representation geometric feature graph G 2 is equal to the sum of the product of the geometric features of the i-th detection area and the similarity function K and the product of the geometric features of the j-th detection area and the similarity function K. That is, in some embodiments, the step of “classifying the detection frame based on the texture feature map and the geometric feature map to obtain a classified detection frame” may specifically include:
[0092] (51) Calculating the texture feature points corresponding to the image to be detected through texture features and similarity functions;
[0093] (52) constructing a texture feature map corresponding to the image to be detected based on the texture feature points;
[0094] (53) Calculating the geometric feature points corresponding to the image to be detected through geometric features and similarity functions;
[0095] (54) Construct a geometric feature map corresponding to the image to be detected based on the geometric feature points.
[0096] After obtaining the texture feature map and the geometric feature map, the preset graph convolutional neural network can still be used to process the texture feature map and the geometric feature map respectively, wherein one layer of the preset graph convolutional neural network can be defined as Z=ReLu( LayerNorm (GXW))+X, G is the texture feature map or geometric feature map mentioned above, X is the texture feature set of the area corresponding to each detection box or the geometric feature set of the area corresponding to each detection box, W is the weight matrix, ReLu is a nonlinear layer, LayerNorm represents layer normalization, and optionally, in some embodiments, a graph convolutional neural network with 3 convolution layers can be used to process the texture feature map and the geometric feature map respectively. Finally, the output of the texture feature map and the output of the geometric feature map are concatenated in the channel dimension, and then the concatenated feature map is processed through a convolution layer, and finally, the probability that the detection area I belongs to the same category as other detection areas is obtained, and then each detection area is classified based on the detection result to obtain a classified detection frame.
[0097] Optionally, in some embodiments, when the probability is greater than a preset threshold, it can be determined that the two detection areas belong to the same category. For example, the preset threshold is 80%, the probability that detection area I and detection area A belong to the same category is 50%, the probability that detection area I and detection area B belong to the same category is 90%, and the probability that detection area I and detection area C belong to the same category is 35%. It can be determined that detection area I and detection area B belong to the same category. It should be noted that the category can be a text line, a phrase or a sentence, which is specifically set according to the actual situation. That is, the step of "classifying the detection frame based on the texture feature map and the geometric feature map to obtain the classified detection frame" can specifically include:
[0098] (61) Fusing the texture feature map and the geometric feature map to obtain a fused feature map;
[0099] (62) Predict the category of the detection box through the fused feature map;
[0100] (63) The detection frame is classified based on the prediction result to obtain a classified detection frame.
[0101] It should be noted that the graph convolutional neural network may be pre-established, that is, in some embodiments, it may further include:
[0102] (71) collecting an image sample including a plurality of sample detection frames, wherein the sample detection frames include a plurality of text element samples annotated with true values of their categories;
[0103] (72) Input the image sample into the basic graph convolutional network to obtain the category prediction value of the sample detection box belonging to each category;
[0104] (73) Based on the true category value and the predicted category value, the basic graph convolutional network is converged to obtain the graph convolutional neural network.
[0105] Convolution layer: mainly used for feature extraction of input images (such as training samples or images to be recognized), wherein the convolution kernel size can be determined according to the actual application. For example, the convolution kernel sizes from the first convolution layer to the fourth convolution layer can be (7, 7), (5, 5), (3, 3), (3, 3) respectively; optionally, in order to reduce the complexity of calculation and improve the calculation efficiency, in this embodiment, the convolution kernel sizes of the four convolution layers can be set to (3, 3), the activation function all adopts "Relu (rectified linear unit)", and the padding (padding refers to the space between the element border and the element content defined by the attribute) mode is set to "same". The "same" padding mode can be simply understood as filling the edge with 0, and the number of 0s on the left (top) is the same as or one less than the number of 0s on the right (bottom). Optionally, the convolutional layers can be directly connected to each other to speed up the network convergence. In order to further reduce the amount of calculation, downsampling (pooling) operations can be performed in all layers from the second to the fourth convolutional layers or in any 1 to 2 layers. The downsampling operation is basically the same as the convolution operation, except that the downsampled convolution kernel only takes the maximum value (max pooling) or the average value (average pooling) of the corresponding position. For the convenience of description, in the embodiments of the present invention, downsampling operations are performed in the second convolutional layer and the third convolutional layer, and the downsampling operation is specifically max pooling. For example, the downsampling operation is described.
[0106] It should be noted that, for the convenience of description, in the embodiment of the present invention, the layer where the activation function is located and the downsampling layer (also called the pooling layer) are both included in the convolution layer. It should be understood that the structure can also be considered to include the convolution layer, the layer where the activation function is located, the downsampling layer (i.e., the pooling layer) and the fully connected layer. Of course, it can also include an input layer for inputting data and an output layer for outputting data, which will not be repeated here.
[0107] Fully connected layer: It can map the learned features to the sample label space. It mainly plays the role of "classifier" in the entire convolutional neural network. Each node of the fully connected layer is connected to all nodes output by the previous layer (such as the downsampling layer in the convolutional layer). Among them, a node in the fully connected layer is called a neuron in the fully connected layer. The number of neurons in the fully connected layer can be determined according to the needs of the actual application. For example, in this text detection model, the number of neurons in the fully connected layer can be set to 512, or 128, etc. Similar to the convolutional layer, in the fully connected layer, nonlinear factors can be added by adding activation functions. For example, the activation function sigmoid (S-type function) can be added.
[0108] For example, specifically, image samples can be collected through multiple channels, and the image samples include multiple sample detection frames, each sample detection frame includes multiple text element samples marked with the true value of the category to which they belong. Then, the image samples are input into the basic graph convolutional network, and the category to which the sample detection frame belongs is predicted based on the texture features and geometric features of the area of each sample detection frame and the correlation between the sample detection frames, so as to obtain the category prediction values of the sample detection frames belonging to each category. Finally, the basic graph convolutional network is converged based on the true value of the category and the category prediction value to obtain the graph convolutional neural network.
[0109] 105. Perform text detection on the image to be detected based on the classified detection frame.
[0110] For example, a text box for text detection may be constructed based on the classified detection box, and then text detection may be performed on the image to be detected based on the constructed text box. For example, it may be detected that the image to be detected includes two text lines, one of which includes five characters, and the other includes three characters. That is, in some embodiments, the step of "performing text detection on the image to be detected based on the classified detection box" may specifically include:
[0111] (81) The classified detection boxes belonging to the same category are identified as a homologous group;
[0112] (82) constructing a text box for text detection based on the classified detection box in the homology group;
[0113] (83) Perform text detection on the image to be detected based on the text box.
[0114] Specifically, after determining the homologous group, the center point corresponding to each classified detection box in the homologous group can be determined, and then the size corresponding to each classified detection box can be obtained, such as the length of the classified detection box and the width of the classified detection box. Finally, a text box for text detection can be constructed based on the center point and the size. That is, in some embodiments, the step of "constructing a text box for text detection according to the classified detection box in the homologous group" can specifically include:
[0115] (91) Determine the center point corresponding to each classified detection box in the homology group;
[0116] (92) Obtain the size of each classified detection box in the homology group;
[0117] (93) Construct a text box for text detection based on the center point and size.
[0118] For example, first, determine the center point corresponding to each classified detection frame in the homology group, and then, according to the arrangement of the classified detection frames in the image to be detected, connect the center points corresponding to each classified detection frame in turn to obtain the baseline, such as Figure 1d As shown, at the same time, the height value corresponding to the classified detection frame within the preset range of the center point is obtained, for example, the height values corresponding to the five classified detection frames around the center point are obtained, and then all the obtained height values are summed and averaged to obtain the reference height, and then a text box for text detection is constructed based on the center point and the size. For example, the length corresponding to the constructed baseline is 5 cm, and the reference height is 3 cm. The baseline is translated upward by 3 cm and the baseline is translated downward by 3 cm in a direction perpendicular to the baseline to obtain a text box for text detection. It should be noted that since the baseline is constructed based on the center point corresponding to each classified detection frame, the classified detection frames corresponding to the first and last endpoints of the baseline cannot be covered by the text box. Therefore, the first and last endpoints of the baseline need to be translated to both sides respectively, and the translation distance is equal to the distance of the reference height. The distance between the two translated endpoints is used as the length corresponding to the text box. At this time, the length of the text box is 16 cm and the height is 6 cm. Figure 1e shown.
[0119] It should be noted that since the baseline is not necessarily a straight line segment, the constructed text box is not necessarily a rectangular box, which is not convenient for subsequent text detection and text recognition. Therefore, optionally, in some embodiments, after the step of "constructing a text box for text detection based on the center point and size", it may also specifically include: adjusting the edge of the text box to obtain an adjusted text box.
[0120] The step of “performing text detection on the image to be detected based on the text box” may specifically include: performing text detection on the image to be detected based on the adjusted text box.
[0121] Specifically, the edge of the obtained text box can be smoothed using a thin plate spline interpolation method, and the shape of the text box can be adjusted to a rectangle to facilitate subsequent text detection and text recognition, such as Figure 1f shown.
[0122] In the embodiment of the present invention, after obtaining an image to be detected, the image to be detected includes text to be detected, and the text to be detected includes multiple text elements. A detection frame corresponding to each text element is constructed in the image to be detected, and then, the texture features and geometric features of the area corresponding to each detection frame are extracted respectively, and the correlation between the detection frames is obtained. Then, the detection frame is classified according to the correlation, texture features and geometric features to obtain the classified detection frame. Finally, the text detection is performed on the image to be detected based on the classified detection frame. Compared with the existing text detection scheme, the text detection scheme of the present invention can extract the texture features and geometric features of the area corresponding to each detection frame, and obtain the correlation between the detection frames. When the shape of the text is a curve, the detection frame can be classified according to the correlation, texture features and geometric features. Then, the text detection is performed on the image to be detected based on the classified detection frame, so as to avoid the situation that the detection frame cannot accurately cover all text areas. In addition, for long text lines, since the scheme constructs the detection frame corresponding to each text element in the image to be detected, the problem of missing frames or incomplete prediction can be avoided during the detection process. Therefore, the scheme can improve the accuracy of text detection.
[0123] The method described in the embodiment will be further described in detail below with examples.
[0124] In this embodiment, the text detection device is specifically integrated in a terminal as an example for description.
[0125] See also Figure 2a , a text detection method, the specific process can be as follows:
[0126] 201. The terminal obtains an image to be detected.
[0127] Among them, the image to be detected includes the text to be detected, and the text to be detected includes multiple text elements, wherein the text elements refer to various elements in the text to be detected, such as words and symbols, etc. The image to be detected can be pre-saved locally, or it can be obtained by accessing the network interface, or it can be obtained by real-time shooting with a camera, depending on the actual situation.
[0128] 202. The terminal constructs a detection box corresponding to each text element in the image to be detected.
[0129] For example, specifically, after the terminal performs semantic segmentation on the image to be detected, the terminal constructs a detection box corresponding to each text element in the image to be detected based on the semantic segmentation result.
[0130] 203. The terminal extracts texture features and geometric features of the area corresponding to each detection frame, and obtains the correlation relationship between the detection frames.
[0131] For example, the terminal can extract the texture features of each detection frame and the geometric features of each detection frame respectively through a convolutional neural network such as an FPN (Feature Pyramid Network) feature pyramid network, and can obtain the association relationship between the detection frames, which can be the relative position relationship between the detection frames.
[0132] 204. The terminal classifies the detection frame according to the association relationship, texture features, and geometric features to obtain a classified detection frame.
[0133] For example, specifically, the terminal can calculate the similarity function corresponding to each detection frame according to the association relationship, and then classify the detection frame based on the texture feature, geometric feature and similarity function using a preset graph convolutional neural network to obtain a classified detection frame.
[0134] Preferably, in some embodiments, the similarity function includes a cosine similarity function, a Gaussian similarity function and a string similarity function, that is, the terminal classifies the detection frame based on the texture feature, the geometric feature and the similarity function using a preset graph convolutional neural network to obtain the classified detection frame, which can specifically include: classifying the detection frame based on the texture feature, the geometric feature, the cosine similarity function, the Gaussian similarity function and the string similarity function using a preset graph convolutional neural network to obtain the classified detection frame, that is, in the scheme for classifying the detection frame in the present invention, not only the texture feature corresponding to the detection frame and the geometric feature corresponding to the detection frame need to be considered, but also the similarity of each detection frame in each dimension such as cosine similarity, similarity on Gaussian distribution and similarity between strings need to be considered, thereby improving the accuracy of the detection frame classification and facilitating the subsequent text detection of the image to be detected based on the detection frame.
[0135] 205. The terminal performs text detection on the image to be detected based on the classified detection frame.
[0136] For example, specifically, the terminal can construct a text box for text detection based on the classified detection box, and then perform text detection on the image to be detected according to the constructed text box. Optionally, in some embodiments, the terminal can determine the classified detection boxes belonging to the same category as a homologous group, and then the terminal determines the center point corresponding to each classified detection box in the homologous group. Then, the size corresponding to each classified detection box can be obtained, such as the length of the classified detection box and the width of the classified detection box. Finally, a text box for text detection can be constructed based on the center point and the size.
[0137] In order to facilitate the understanding of the text detection method provided in the embodiment of the present invention, the scene of detecting road signs is taken as an example for further explanation. Figure 2b , wherein the text detection device is integrated in the terminal. The terminal shoots the road sign through the camera. After obtaining the image of the road sign (i.e., the scene image), the feature extraction of the scene image can be performed to obtain the feature image corresponding to the scene image (i.e., the image to be detected). Then, the terminal constructs the detection frame corresponding to each text element in the image to be detected, such as Figure 2c As shown, the terminal then extracts the texture features and geometric features of the area corresponding to each detection frame, and classifies the detection frames based on the preset graph convolutional neural network and the similarity function corresponding to each detection frame to obtain the classified detection frames, such as Figure 2d As shown, the terminal then adjusts the edge of the classified detection frame, such as Figure 2e As shown, finally, the terminal performs text detection on the image to be detected based on the adjusted detection frame. After the terminal of the embodiment of the present invention obtains the image to be detected, the image to be detected includes the text to be detected, and the text to be detected includes multiple text elements. The terminal constructs a detection frame corresponding to each text element in the image to be detected, and then the terminal extracts the texture features and geometric features of the area corresponding to each detection frame respectively, and obtains the association relationship between the detection frames. Then, the terminal classifies the detection frames according to the association relationship, texture features and geometric features to obtain the classified detection frames. Finally, the terminal performs text detection on the image to be detected based on the classified detection frames. Compared with the existing text detection scheme, the terminal of the present invention can extract the texture features and geometric features of the area corresponding to each detection frame, and obtain the correlation between the detection frames. When the shape of the text is curved, the detection frames can be classified according to the correlation, texture features and geometric features. Then, text detection is performed on the image to be detected based on the classified detection frames to avoid the situation where the detection frame cannot accurately cover all text areas. In addition, for long text lines, since the present scheme constructs a detection frame corresponding to each text element in the image to be detected, it can avoid the problem of frame loss or incomplete prediction during the detection process. Therefore, the scheme can improve the accuracy of text detection.
[0138] In order to better implement the text detection method of the embodiment of the present invention, the embodiment of the present invention also provides a text detection device based on the above (hereinafter referred to as the detection device). The meanings of the terms are the same as those in the above text detection method, and the specific implementation details can refer to the description in the method embodiment.
[0139] See also Figure 3a , Figure 3a The structural diagram of the text detection device provided by the embodiment of the present invention, wherein the detection device may include a first acquisition module 301, a construction module 302, an extraction module 303, a second acquisition module 304, a classification module 305 and a detection module 306, which may be specifically as follows:
[0140] The first acquisition module 301 is used to acquire an image to be detected.
[0141] The image to be detected includes text to be detected, and the text to be detected includes multiple text elements, wherein text elements refer to various elements in the text to be detected, such as words and symbols, etc. The image to be detected can be obtained by the first acquisition module 301 by accessing the network interface.
[0142] The construction module 302 is used to construct a detection box corresponding to each text element in the image to be detected.
[0143] For example, specifically, the construction module 302 may perform semantic segmentation on the image to be detected, and then construct a detection box corresponding to each text element in the image to be detected based on the semantic segmentation result.
[0144] Optionally, in some embodiments, the construction module 302 is specifically used to: perform semantic segmentation on the image to be detected, obtain the target pixel points corresponding to each text element and the pixel association information corresponding to each target pixel point, and construct a detection box corresponding to each text element based on the pixel association information and multiple target pixels.
[0145] The extraction module 303 is used to extract the texture features and geometric features of the area corresponding to each detection frame.
[0146] For example, the extraction module 303 can extract the texture features of each detection frame and the geometric features of each detection frame respectively through a convolutional neural network such as a FPN (Feature Pyramid Network) feature pyramid network.
[0147] The second acquisition module 304 is used to acquire the association relationship between each detection frame.
[0148] The classification module 305 is used to classify the detection frame according to the association relationship, texture features and geometric features to obtain a classified detection frame.
[0149] For example, specifically, the classification module 305 can use the correlation relationship between each detection frame to predict the category to which each detection frame belongs, wherein the similarity function corresponding to each detection frame can be calculated based on the correlation relationship, and then the detection frame can be classified according to the texture feature, geometric feature and similarity function to obtain the classified detection frame.
[0150] Optionally, in some embodiments, the classification module 305 may specifically include:
[0151] A calculation unit, used to calculate a similarity function corresponding to each detection box according to the association relationship;
[0152] The classification unit is used to classify the detection frame based on texture features, geometric features and similarity functions to obtain a classified detection frame.
[0153] Optionally, in some embodiments, the classification unit may specifically include:
[0154] A construction subunit is used to construct a texture feature map corresponding to the image to be detected and a geometric feature map corresponding to the image to be detected according to the texture feature, the geometric feature and the similarity function;
[0155] The classification subunit is used to classify the detection frame based on the texture feature map and the geometric feature map to obtain a classified detection frame.
[0156] Optionally, in some embodiments, the construction subunit can be specifically used to: calculate texture feature points corresponding to the image to be detected through texture features and similarity functions, construct a texture feature map corresponding to the image to be detected based on the texture feature points, calculate geometric feature points corresponding to the image to be detected through geometric features and similarity functions, and construct a geometric feature map corresponding to the image to be detected based on the geometric feature points.
[0157] Optionally, in some embodiments, the classification subunit is specifically used to: fuse the texture feature map and the geometric feature map to obtain a fused feature map, predict the category to which the detection frame belongs through the fused feature map, classify the detection frame based on the prediction result, and obtain a classified detection frame.
[0158] Detection module 306, used to perform text detection on the image to be detected based on the classified detection frame
[0159] For example, specifically, the detection module 306 may construct a text box for text detection based on the classified detection box, and then perform text detection on the image to be detected according to the constructed text box.
[0160] Optionally, in some embodiments, the detection module may specifically include:
[0161] A determination unit, used for determining the classified detection boxes belonging to the same category as a homologous group;
[0162] A construction unit, used for constructing a text box for text detection according to the classified detection box in the homology group;
[0163] The detection unit is used to perform text detection on the image to be detected based on the text box.
[0164] Optionally, in some embodiments, the construction unit is specifically used to: determine the center point corresponding to each classified detection box in the homologous group, obtain the size corresponding to each classified detection box in the homologous group, and construct a text box for text detection based on the center point and the size.
[0165] Optionally, in some embodiments, see Figure 3b , and further includes an adjustment module 307, which is used to adjust the edge of the text box to obtain an adjusted text box. The detection module 306 is specifically used to: perform text detection on the image to be detected based on the adjusted text box.
[0166] In the embodiment of the present invention, after the first acquisition module 301 acquires the image to be detected, the image to be detected includes the text to be detected, and the text to be detected includes multiple text elements. The construction module 302 constructs a detection frame corresponding to each text element in the image to be detected. Then, the extraction module 303 extracts the texture features and geometric features of the area corresponding to each detection frame respectively, and the second acquisition module 304 can obtain the association relationship between the detection frames. Then, the classification module 305 classifies the detection frames according to the association relationship, texture features and geometric features to obtain the classified detection frames. Finally, the detection module 306 performs text detection on the image to be detected based on the classified detection frames. Compared with the existing text detection scheme, in the text detection device of the present invention, the extraction module 303 can extract the texture features and geometric features of the area corresponding to each detection frame, and the second acquisition module 304 can obtain the association relationship between the detection frames. When the shape of the text is curved, the classification module 305 can classify the detection frames according to the association relationship, texture features and geometric features. Then, the detection module 306 performs text detection on the image to be detected based on the classified detection frames to avoid the situation where the detection frame cannot accurately cover all text areas. In addition, for long text lines, since this scheme constructs a detection frame corresponding to each text element in the image to be detected, it can avoid the problem of missing frames or incomplete predictions during the detection process. Therefore, this scheme can improve the accuracy of text detection.
[0167] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, it shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present invention, specifically:
[0168] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0169] The processor 401 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0170] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0171] The electronic device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 403 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0172] The electronic device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0173] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:
[0174] Get the image to be detected, build a detection frame corresponding to each text element in the image to be detected, extract the texture features and geometric features of the area corresponding to each detection frame, and obtain the association between the detection frames. Classify the detection frames according to the association, texture features and geometric features to obtain classified detection frames, and perform text detection on the image to be detected based on the classified detection frames.
[0175] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0176] In the embodiment of the present invention, after obtaining an image to be detected, the image to be detected includes text to be detected, and the text to be detected includes multiple text elements. A detection frame corresponding to each text element is constructed in the image to be detected, and then, the texture features and geometric features of the area corresponding to each detection frame are extracted respectively, and the correlation between the detection frames is obtained. Then, the detection frame is classified according to the correlation, texture features and geometric features to obtain the classified detection frame. Finally, the text detection is performed on the image to be detected based on the classified detection frame. Compared with the existing text detection scheme, the text detection scheme of the present invention can extract the texture features and geometric features of the area corresponding to each detection frame, and obtain the correlation between the detection frames. When the shape of the text is a curve, the detection frame can be classified according to the correlation, texture features and geometric features. Then, the text detection is performed on the image to be detected based on the classified detection frame, so as to avoid the situation that the detection frame cannot accurately cover all text areas. In addition, for long text lines, since the scheme constructs the detection frame corresponding to each text element in the image to be detected, the problem of missing frames or incomplete prediction can be avoided during the detection process. Therefore, the scheme can improve the accuracy of text detection.
[0177] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0178] To this end, an embodiment of the present invention provides a storage medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any text detection method provided in the embodiment of the present invention. For example, the instructions can execute the following steps:
[0179] Get the image to be detected, build a detection frame corresponding to each text element in the image to be detected, extract the texture features and geometric features of the area corresponding to each detection frame, and obtain the association between the detection frames. Classify the detection frames according to the association, texture features and geometric features to obtain classified detection frames, and perform text detection on the image to be detected based on the classified detection frames.
[0180] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0181] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0182] Since the instructions stored in the storage medium can execute the steps in any text detection method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any text detection method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0183] The above is a detailed introduction to a text detection method, device, electronic device and storage medium provided in an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A text detection method, characterized in that: include: Acquire an image to be detected, wherein the image to be detected includes text to be detected, and the text to be detected includes multiple text elements; Constructing a detection frame corresponding to each text element in the image to be detected; Extracting texture features and geometric features of the area corresponding to each detection frame respectively, and obtaining the correlation relationship between the detection frames; the correlation relationship is the positional relationship between the detection frames; Calculating a similarity function corresponding to each detection frame according to the association relationship; the similarity function includes a cosine similarity function, a Gaussian similarity function and a string similarity function; Classify the detection frame based on texture features, geometric features and similarity functions to obtain the classified detection frame; Determine the classified detection frames belonging to the same category as a homologous group; construct text frames for text detection based on the classified detection frames in the homologous group; Performing text detection on the image to be detected based on the text box; The step of constructing a text box for text detection based on the classified detection box in the homology group includes: Determine the center point corresponding to each classified detection frame in the homology group, and connect the center points corresponding to each classified detection frame in sequence according to the order of the classified detection frames in the image to be detected to obtain a baseline; Obtain a height value corresponding to the classified detection frame within the preset range of the center point, and obtain a reference height according to the height value; Along a direction perpendicular to the baseline, the baseline is translated upward by a distance consistent with the baseline height, the baseline is translated downward by a distance consistent with the baseline height, and the first two endpoints of the baseline are translated to both sides by distances consistent with the baseline height, so as to construct a text box for text detection.
2. The method according to claim 1, characterized in that The detection frame is classified based on texture features, geometric features and similarity functions to obtain a classified detection frame, including: According to the texture features, geometric features and similarity function, a texture feature map corresponding to the image to be detected and a geometric feature map corresponding to the image to be detected are respectively constructed; The detection frame is classified based on the texture feature map and the geometric feature map to obtain a classified detection frame.
3. The method according to claim 2, characterized in that The method of constructing a texture feature map corresponding to the image to be detected and a geometric feature map corresponding to the image to be detected respectively according to the texture feature, the geometric feature and the similarity function comprises: Calculate the texture feature points corresponding to the image to be detected through texture features and similarity functions; Constructing a texture feature map corresponding to the image to be detected based on the texture feature points; Calculate the geometric feature points corresponding to the image to be detected through geometric features and similarity functions; A geometric feature map corresponding to the image to be detected is constructed based on the geometric feature points.
4. The method according to claim 2, characterized in that: The classifying the detection frame based on the texture feature map and the geometric feature map to obtain the classified detection frame includes: Fusing the texture feature map and the geometric feature map to obtain a fused feature map; Predicting the category to which the detection frame belongs through the fused feature map; The detection frame is classified based on the prediction result to obtain the classified detection frame.
5. The method according to claim 1, characterized in that The step of constructing a text box for text detection according to the classified detection box in the homology group includes: Determine the center point corresponding to each classified detection box in the homology group; Get the size of each classified detection box in the homology group; Construct a text box for text detection based on the center point and size.
6. The method according to claim 5, characterized in that After constructing a text box for text detection based on the center point and the size, the method further includes: Adjusting the edge of the text box to obtain an adjusted text box; The performing text detection on the image to be detected based on the text box includes: performing text detection on the image to be detected based on the adjusted text box.
7. The method according to any one of claims 1 to 6, characterized in that: The step of constructing a detection frame corresponding to each text element in the image to be detected includes: Performing semantic segmentation on the image to be detected to obtain target pixel points corresponding to each text element and pixel association information corresponding to each target pixel point; Based on pixel association information and multiple target pixels, a detection box corresponding to each text element is constructed.
8. A text detection device, characterized in that: include: A first acquisition module is used to acquire an image to be detected, wherein the image to be detected includes text to be detected, and the text to be detected includes multiple text elements; A construction module, used to construct a detection box corresponding to each text element in the image to be detected; An extraction module is used to extract the texture features and geometric features of the area corresponding to each detection frame respectively; A second acquisition module is used to acquire the association relationship between the detection frames; the association relationship is the position relationship between the detection frames; The classification module is used to classify the detection frame according to the association relationship, texture features and geometric features to obtain the classified detection frame; A detection module, used to perform text detection on the image to be detected based on the classified detection frame; Wherein, the classification module includes: A calculation unit, used to calculate a similarity function corresponding to each detection frame according to the association relationship; the similarity function includes a cosine similarity function, a Gaussian similarity function and a string similarity function; A classification unit is used to classify the detection frame based on texture features, geometric features and similarity functions to obtain a classified detection frame; The detection module is specifically used to determine the classified detection frames belonging to the same category as a homologous group; construct a text frame for text detection based on the classified detection frames in the homologous group; and perform text detection on the image to be detected based on the text frame; The detection module is specifically used to determine the center point corresponding to each classified detection frame in the homology group, and connect the center points corresponding to each classified detection frame in sequence according to the order of the classified detection frames in the image to be detected to obtain a baseline; obtain the height value corresponding to the classified detection frame within a preset range of the center point, and obtain the baseline height according to the height value; along a direction perpendicular to the baseline, translate the baseline upward by a distance consistent with the baseline height, translate the baseline downward by a distance consistent with the baseline height, and translate the first two endpoints of the baseline to both sides by distances consistent with the baseline height, so as to construct a text box for text detection.
9. The device according to claim 8, characterized in that The taxonomic units include: A construction subunit is used to construct a texture feature map corresponding to the image to be detected and a geometric feature map corresponding to the image to be detected according to the texture feature, the geometric feature and the similarity function; The classification subunit is used to classify the detection frame based on the texture feature map and the geometric feature map to obtain a classified detection frame.
10. The device according to claim 9, characterized in that The construction subunit is specifically used for: Calculate the texture feature points corresponding to the image to be detected through texture features and similarity functions; Constructing a texture feature map corresponding to the image to be detected based on the texture feature points; Calculate the geometric feature points corresponding to the image to be detected through geometric features and similarity functions; A geometric feature map corresponding to the image to be detected is constructed based on the geometric feature points.
11. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the text detection method according to any one of claims 1 to 7 are implemented.
12. A computer-readable storage medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, the steps of the text detection method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Text detection method and device and text information extraction method and system
CN104182722A
A method and apparatus for image retrieval
CN109033308A