Bent text recognition method, device, equipment, storage medium and program product
By acquiring the original image of the curved text, determining the center line and text boundary for correction, the problem of the inability to recognize curved text in the existing technology is solved, and highly accurate curved text recognition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DEEP VISION (GUANGDONG) ARTIFICIAL INTELLIGENCE RESEARCH CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies cannot effectively recognize curved text, especially curved text in scenarios such as circular dashboards, curved trademarks, CAPTCHAs, and handwritten signatures.
By acquiring the original image of the curved text, determining the text mask and the text image, determining the center line and text boundary based on the text mask, performing correction processing to convert the curved text image into a standard text image, and inputting it into a text recognition model for recognition.
It improves the accuracy of curved text recognition, and can effectively identify the character content and confidence level in curved text.
Smart Images

Figure CN122157269A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for recognizing curved text. Background Technology
[0002] Curved text refers to text in which characters are not arranged in horizontal or vertical straight lines, but rather in curved shapes such as arcs, S-shapes, or waves. It is commonly found in circular dashboards, curved trademarks, CAPTCHAs, handwritten signatures, and industrial logos.
[0003] Most existing technologies are designed for recognizing regular, standard text, which cannot be adapted to recognizing curved text. Therefore, there is an urgent need for a method that can recognize curved text. Summary of the Invention
[0004] Therefore, it is necessary to provide a curved text recognition method, apparatus, computer device, computer-readable storage medium, and computer program product that can recognize curved text in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for recognizing curved text, including:
[0006] Obtain an original image containing at least one curved text, and determine a text mask and text image of at least one curved text based on the original image;
[0007] The center line of at least one curved text is determined based on the text mask, and the text boundary of at least one curved text is determined based on the center line;
[0008] The text image is corrected based on the center line and text boundary to obtain a standard text image, which is then input into the text recognition model to obtain the curved text recognition result.
[0009] In one embodiment, determining the centerline of at least one curved text based on a text mask includes: determining a single-pixel skeleton based on the text mask using a thinning iterative algorithm; determining a candidate centerline based on the single-pixel skeleton and performing equal arc length resampling on the candidate centerline to obtain a processed candidate centerline; and determining the centerline based on the end tangent direction of the processed candidate centerline.
[0010] In one embodiment, determining a candidate centerline based on a single-pixel skeleton includes: constructing an undirected adjacency graph based on the single-pixel skeleton and obtaining the degree of the nodes in the undirected adjacency graph; constructing an endpoint set based on the degree and searching from the endpoint set to determine the farthest endpoint; determining the farthest endpoint pair based on the farthest endpoint and determining the longest connected path connecting the farthest endpoint pair as the candidate centerline.
[0011] In one embodiment, the candidate centerline is subjected to equal arc length resampling to obtain the processed candidate centerline, including: obtaining the total arc length of the broken line corresponding to the candidate centerline; performing interpolation sampling on the candidate centerline based on the total arc length of the broken line and preset sampling parameters to obtain a resampling point sequence uniformly distributed along the arc length direction; and determining the processed candidate centerline based on the resampling point sequence.
[0012] In one embodiment, determining the centerline based on the end tangent direction of the processed candidate centerline includes: determining a head point sequence and a tail point sequence based on the processed candidate centerline; determining a head tangent direction vector based on the head point sequence and a tail tangent direction vector based on the tail point sequence; determining the head end extension endpoint based on the head tangent direction vector and the tail end extension endpoint based on the tail tangent direction vector; and determining the centerline based on the processed candidate centerline, the head end extension endpoint, and the tail end extension endpoint.
[0013] In one embodiment, the text image is corrected based on the center line and text boundary to obtain a standard text image, including: determining an effective correction area from the text image based on the center line and text boundary; obtaining the total arc length of the center line and constructing a coordinate mapping relationship based on the total arc length and preset size parameters; and remapping the effective correction area based on the coordinate mapping relationship to obtain a standard text image.
[0014] Secondly, this application also provides a curved text recognition device, comprising:
[0015] An acquisition module is used to acquire an original image containing at least one curved text, and to determine a text mask and text image of at least one curved text based on the original image;
[0016] A determination module is used to determine the center line of at least one curved text based on a text mask, and to determine the text boundary of at least one curved text based on the center line;
[0017] The execution module is used to correct the text image based on the center line and text boundary to obtain a standard text image, and then input the standard text image into the text recognition model to obtain the curved text recognition result.
[0018] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the embodiments of the first aspect above.
[0019] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the embodiments of the first aspect above.
[0020] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the embodiments of the first aspect above.
[0021] The aforementioned curved text recognition method, apparatus, computer device, computer-readable storage medium, and computer program product first acquire an original image containing at least one curved text, and determine a text mask and text image of at least one curved text based on the original image. Then, the center line of at least one curved text is determined based on the text mask, and the text boundary of at least one curved text is determined based on the center line. The text image is then corrected based on the center line and text boundary to obtain a standard text image, which is then input into a text recognition model to obtain the curved text recognition result. The curved text recognition method provided in this application first corrects the curved text image to a standard text image before inputting it into the text recognition model for recognition, which can effectively improve the accuracy of the curved text recognition result. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating a curved text recognition method in one embodiment;
[0024] Figure 2 A flowchart illustrating a method for determining the centerline of at least one curved text in one embodiment;
[0025] Figure 3 This is a flowchart illustrating a method for determining a candidate centerline in one embodiment;
[0026] Figure 4 This is a flowchart illustrating a method for obtaining processed candidate centerlines in one embodiment;
[0027] Figure 5 This is a flowchart illustrating a method for determining a centerline in one embodiment;
[0028] Figure 6This is a flowchart illustrating a method for obtaining a standard text image in one embodiment;
[0029] Figure 7 This is a flowchart illustrating a curved text recognition method in another embodiment;
[0030] Figure 8 This is a schematic diagram of the original image in one embodiment;
[0031] Figure 9 This is a schematic diagram of a standard text image in one embodiment;
[0032] Figure 10 This is a structural block diagram of a curved text recognition device in one embodiment;
[0033] Figure 11 This is an internal structural diagram of a computer device in one embodiment;
[0034] Figure 12 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0036] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0037] Curved text refers to text in which characters are not arranged in horizontal or vertical straight lines, but rather in curved shapes such as arcs, S-shapes, or waves. It is commonly found in circular dashboards, curved trademarks, CAPTCHAs, handwritten signatures, and industrial logos.
[0038] Most existing technologies are designed for recognizing regular, standard text, which cannot be adapted to recognizing curved text. Therefore, there is an urgent need for a method that can recognize curved text.
[0039] In view of this, this application provides a curved text recognition method. First, an original image containing at least one curved text is acquired. Then, a text mask and text image for at least one curved text are determined based on the original image. Next, the center line of at least one curved text is determined based on the text mask, and the text boundary of at least one curved text is determined based on the center line. Finally, the text image is corrected based on the center line and text boundary to obtain a standard text image. This standard text image is then input into a text recognition model to obtain the curved text recognition result. The curved text recognition method provided in this application, by first correcting the curved text image to a standard text image before inputting it into the text recognition model, can effectively improve the accuracy of the curved text recognition result.
[0040] The curved text recognition method provided in this application can be executed by a computer device, which can be a terminal or a server.
[0041] In one exemplary embodiment, such as Figure 1 As shown, a method for recognizing curved text is provided, which includes the following steps:
[0042] Step 101: Obtain the original image containing at least one curved text, and determine the text mask and text image of at least one curved text based on the original image.
[0043] Optionally, curved text refers to text in which characters are arranged in a non-linear form, such as arcs, waves, or curved zigzags. Curved text is found in practical applications such as posters, trademarks, packaging, and outdoor signage. The original image can be an RGB color image, a grayscale image, etc.
[0044] A text mask is a mask used to characterize the pixel attribution of a curved text region. For example, a text mask can be a binary mask or a probabilistic mask of the same size as the curved text region, or it can be a binary mask or a probabilistic mask of the same size as the original image. In a binary mask, pixels belonging to the text region are foreground values, and pixels not belonging to the text region are background values. In a probabilistic mask, each pixel value is a confidence value indicating that the pixel belongs to the text region. The text image can be a partial image of the original image containing only a single curved text.
[0045] In some exemplary embodiments, a computer device may acquire an original image containing at least one curved text and determine a text mask and a text image of at least one curved text based on the original image.
[0046] Specifically, the computer device can first determine the text mask and text bounding box of at least one curved text based on the original image. For example, the computer device can perform text detection and segmentation processing on the original image based on a deep learning detection model or segmentation model to obtain the text mask and text bounding box corresponding to each curved text.
[0047] The deep learning detection and segmentation models can be DB (Differentiable Binarization) series models, Mask R-CNN (Mask Region-based Convolutional Neural Network) models, PSENet (Progressive Scale Expansion Network) models, and instance segmentation networks with mask heads (such as an instance segmentation network with mask heads based on Faster R-CNN). Text bounding boxes can be axis-aligned rectangles, rotated rectangles, or irregular quadrilaterals.
[0048] Furthermore, after obtaining the text bounding box, the computer device can further crop the corresponding local image region from the original image based on the text bounding box to obtain a text image that corresponds one-to-one with each curved text.
[0049] Step 102: Determine the center line of at least one curved text based on the text mask, and determine the text boundary of at least one curved text based on the center line.
[0050] Optionally, the center line can be a curve (a sequence of broken line points) used to describe the geometric principal direction of the text lines of curved text. It is usually located near the central axis of the text and can reflect the overall direction of the curved text.
[0051] Optionally, the text boundary may include an upper boundary and a lower boundary. For example, the upper and lower boundaries are aligned with the direction of the center line to define the effective vertical range of the curved text.
[0052] In some exemplary embodiments, after determining a text mask and a text image of at least one curved text based on an original image, the computer device may determine the center line of at least one curved text based on the text mask.
[0053] Specifically, the computer device can first perform preprocessing operations on the text mask, and then determine the center line of at least one curved text based on the preprocessed text mask.
[0054] Furthermore, after determining the center line of at least one curved text based on a text mask, the computer device can determine the text boundary of at least one curved text based on the center line.
[0055] Specifically, the computer device can first extract the outer contour of the text mask, select the outer contour with the largest area as the contour polygon of the text region, and then determine the text boundary of at least one curved text based on the contour polygon and the center line.
[0056] Step 103: Correct the text image based on the center line and text boundary to obtain a standard text image, and input the standard text image into the text recognition model to obtain the curved text recognition result.
[0057] Optionally, a standard text image refers to an image where the text follows a straight line. For example, a standard text image can be a text image where the text is arranged in a straight line, without bending distortion, and is of regular size.
[0058] Text recognition models can be deep learning models applicable to standard text recognition. Examples include CRNN (Convolutional Recurrent Neural Network) models, SAR (Sequence Averaging and Reconstruction) models, ASTER models, and text recognition models based on the Transformer architecture.
[0059] The results of curved text recognition can include the complete character content corresponding to the curved text, as well as the recognition confidence score of each character and the corresponding coordinates of the character in the original image. The recognition confidence score can range from 0 to 1; the closer the value is to 1, the more reliable the recognition result for that character.
[0060] In some exemplary embodiments, a computer device may perform correction processing on a text image based on a center line and text boundaries to obtain a standard text image.
[0061] Specifically, computer equipment can remap text images based on center lines and text boundaries to obtain standard text images.
[0062] Furthermore, after obtaining a standard text image, the computer device can input the standard text image into a text recognition model to obtain curved text recognition results.
[0063] Specifically, computer equipment can first perform preprocessing on standard text images, such as image enhancement, noise reduction, and super-resolution, and then input them into the text recognition model to obtain the curved text recognition results.
[0064] The aforementioned curved text recognition method first acquires an original image containing at least one curved text, and then determines a text mask and text image for at least one curved text based on the original image. Next, it determines the centerline of at least one curved text based on the text mask, and the text boundary of at least one curved text based on the centerline. Finally, it performs a correction process on the text image based on the centerline and text boundary to obtain a standard text image, which is then input into a text recognition model to obtain the curved text recognition result. The curved text recognition method provided in this application first corrects the curved text image to a standard text image before inputting it into the text recognition model for recognition, which can effectively improve the accuracy of the curved text recognition result.
[0065] In an optional embodiment of this application, the computer device may preprocess the text mask after obtaining it.
[0066] Specifically, the computer device can first perform single-channel processing on the text mask. For example, if the text mask is in multi-channel form, it can be converted into a grayscale single-channel image. Then, the text mask can be binarized. For example, the computer device can perform binarization on the text mask through threshold segmentation to obtain a binary image with a pixel value of 0 / 255. The threshold used can be Otsu's automatic threshold or a fixed threshold. Next, ROI clipping is performed, that is, the local text mask is clipped with the text bounding box as the region of interest. Finally, scale normalization is performed, that is, the local text mask is scaled proportionally to a preset maximum side length, for example, the maximum side length can be 256 pixels.
[0067] In one exemplary embodiment, such as Figure 2 As shown, determining the center line of at least one curved text based on a text mask includes the following steps:
[0068] Step 201: Based on the refinement iterative algorithm, determine the single-pixel skeleton according to the text mask.
[0069] Optionally, thinning iterative algorithms can be used to shrink a binary region into a single-pixel wide center structure that preserves its topological structure. These algorithms can include Zhang-Suen thinning, Guo-Hall thinning, morphological skeleton methods, distance transform centerline methods, etc.
[0070] In some exemplary embodiments, the computer device may determine a single-pixel skeleton based on a text mask using a refinement iterative algorithm.
[0071] Specifically, taking the Zhang-Suen thinning algorithm as an example, while maintaining the connectivity of the text region in the text mask, the text boundary pixels are iteratively deleted until the algorithm converges, and finally a skeleton structure with a width of one pixel is obtained.
[0072] During the execution of the Zhang-Suen thinning algorithm, a foreground pixel p1 in the binary text mask is used as the center, and its 8 neighboring pixels are defined as p2, p3, p4, p5, p6, p7, p8, and p9 in a clockwise direction. The thinning iteration process of this algorithm includes two sub-iteration stages. In each sub-iteration stage, if the foreground pixel p1 simultaneously meets the following basic conditions, it is marked as a pixel to be deleted:
[0073] 1. Determine the sum of pixel values from p2 to p9 in the 8-neighborhood, B(p1), where 2 ≤ B(p1) ≤ 6;
[0074] 2. Traverse the 8 neighboring pixels p2 to p9 of the foreground pixel p1 in a clockwise direction, and count the number of times the pixel value changes from 0 to 1 during the traversal, A(p1) = 1.
[0075] Based on this, two sub-iteration stages each add specific constraints. Only when the foreground pixel (p1) satisfies both the basic conditions and the additional constraints of the corresponding sub-iteration will it be marked as to be deleted.
[0076] Additional constraints for sub-iteration 1: p2·p4·p6=0 and p4·p6·p8=0;
[0077] Additional constraints for sub-iteration 2: p2·p4·p8=0 and p2·p6·p8=0.
[0078] Step 202: Determine the candidate center line based on the single pixel skeleton, and perform equal arc length resampling processing on the candidate center line to obtain the processed candidate center line.
[0079] Optionally, equal arc length resampling refers to sampling evenly along the arc length of the curve, so that the distance between adjacent sampling points is as consistent as possible.
[0080] In some exemplary embodiments, after determining a single-pixel skeleton based on a text mask using a refinement iterative algorithm, the computer device can determine a candidate centerline based on the single-pixel skeleton.
[0081] Specifically, computer equipment can optimize the single-pixel skeleton and then determine the candidate center line based on the optimized single-pixel skeleton.
[0082] Furthermore, after determining the candidate center line based on the single-pixel skeleton, the computer device can perform equal arc length resampling processing on the candidate center line to obtain the processed candidate center line.
[0083] Specifically, the computer equipment can first obtain the total arc length of the broken line corresponding to the candidate center line, and then determine the processed candidate center line based on the total arc length of the broken line and the candidate center line.
[0084] Step 203: Determine the center line based on the end tangent direction of the processed candidate center line.
[0085] Optionally, the tangent direction refers to the direction vector of the curve at a certain point.
[0086] In some exemplary embodiments, after obtaining the processed candidate centerline, the computer device can determine the centerline based on the end tangent direction of the processed candidate centerline.
[0087] Specifically, the end tangent direction of the processed candidate centerline includes the head tangent direction and the tail tangent direction. The computer device can determine the centerline based on the head tangent direction and the tail tangent direction.
[0088] In one exemplary embodiment, such as Figure 3 As shown, determining the candidate centerline based on the single-pixel skeleton includes the following steps:
[0089] Step 301: Construct an undirected adjacency graph based on a single-pixel skeleton and obtain the degree of the nodes in the undirected adjacency graph.
[0090] Optionally, an undirected adjacency graph refers to a graph structure consisting of nodes and undirected edges, where edges only represent the adjacency relationship between nodes and have no direction.
[0091] A node is a basic unit abstracted from the pixel unit of a single-pixel skeleton. Degree refers to the number of undirected edges connecting each node in an undirected adjacency graph, and can be used to characterize node connectivity.
[0092] In some exemplary embodiments, a computer device may construct an undirected adjacency graph based on a single-pixel skeleton.
[0093] Specifically, the computer device can abstract each skeleton pixel in the single-pixel skeleton as an independent node in an undirected adjacency graph, and then construct undirected edges for the nodes corresponding to adjacent skeleton pixels according to the 8-adjacency rule. That is, if two skeleton pixels are adjacent to each other within the 8-neighborhood, an undirected edge is established for the two nodes corresponding to these two skeleton pixels, until the construction of undirected edges for all adjacent nodes is completed, forming an undirected adjacency graph that matches the shape of the single-pixel skeleton.
[0094] Furthermore, after constructing an undirected adjacency graph based on a single-pixel skeleton, the computer device can obtain the degree of the nodes in the undirected adjacency graph.
[0095] Specifically, computer equipment can traverse and count the connection relationships of each node in an undirected adjacency graph, calculate the total number of undirected edges connected to each node, and determine the degree of the corresponding node based on this number.
[0096] Step 302: Construct an endpoint set based on degrees and search from the endpoint set to determine the farthest endpoint.
[0097] In some exemplary embodiments, after obtaining the degree of a node in an undirected adjacency graph, a computer device can construct an endpoint set based on the degree and search from the endpoint set to determine the farthest endpoint.
[0098] Specifically, the computer device can filter out nodes with a degree of 1 from all nodes in an undirected adjacency graph. These nodes are connected to only one other node and correspond to the end pixels of a single-pixel skeleton. All the filtered nodes with a degree of 1 are integrated to construct an endpoint set.
[0099] Furthermore, arbitrarily select a node from the set of endpoints as the initial starting point, perform a breadth-first search on the undirected adjacency graph, traverse all reachable nodes in the graph and calculate the path distance from the initial starting point to each node, select the node with the farthest path distance and determine it as the first farthest endpoint.
[0100] Step 303: Determine the farthest endpoint pair based on the farthest endpoint, and determine the longest connected path connecting the farthest endpoint pair as the candidate centerline.
[0101] In some exemplary embodiments, after determining the farthest endpoint, the computer device may determine the farthest endpoint pair based on the farthest endpoint and determine the longest connected path connecting the farthest endpoint pair as a candidate centerline.
[0102] Specifically, the computer device can take the determined farthest endpoint as the new starting point, perform a second breadth-first search on the undirected adjacency graph, traverse all reachable nodes in the graph and calculate the path distance to each node, select the node with the farthest path distance as the second farthest endpoint, and these two farthest endpoints can constitute the farthest endpoint pair of the undirected adjacency graph.
[0103] Furthermore, based on the predecessor array recorded during the second breadth-first search, a reverse backtracking is performed from the second farthest endpoint to the first farthest endpoint to reconstruct the complete connected path from the first farthest endpoint to the second farthest endpoint. This path is the longest connected path connecting the farthest endpoint pairs in the undirected adjacency graph.
[0104] In optional embodiments of this application, the computer device may also determine the longest connected path based on Dijkstra's / longest simple path approximation, minimum spanning tree diameter, shortest path based on endpoint pairs, and methods combining connected component cleaning and branch pruning.
[0105] In one exemplary embodiment, such as Figure 4 As shown, the candidate centerline is resampled using equal arc lengths to obtain the processed candidate centerline, including the following steps:
[0106] Step 401: Obtain the total arc length of the broken line corresponding to the candidate center line.
[0107] In some exemplary embodiments, the computer device can obtain the total arc length of the polygonal line corresponding to the candidate centerline.
[0108] Specifically, the computer equipment can first extract the discrete point sequence of the candidate center line, and label them as P1, P2, ..., Pn in the original order of the point sequence (n is the number of points of the candidate center line), and calculate the Euclidean distance Li = (xi+1-xi) for each pair of adjacent points Pi and Pi+1 (1≤i≤n-1). 2 +(yi+1-yi) 2 , where xi and yi are the x and y coordinates of point Pi, and the Euclidean distances of all adjacent points are summed to obtain the total arc length of the polygonal line corresponding to the candidate centerline.
[0109] Step 402: Based on the total arc length of the polyline and the preset sampling parameters, interpolate the candidate centerline to obtain a sequence of resampled points that are uniformly distributed along the arc length direction.
[0110] Optionally, preset sampling parameters may include a fixed number of sampling points, a fixed arc length interval, etc.
[0111] In some exemplary embodiments, after obtaining the total arc length of the polyline, the computer device can perform interpolation sampling on the candidate center line based on the total arc length and preset sampling parameters to obtain a sequence of resampled points uniformly distributed along the arc length direction.
[0112] Specifically, the computer device can first call the preset sampling parameters. If the fixed sampling point mode is selected, the standard arc length interval d=L is calculated based on the total arc length of the polyline. total / (N-1), where N is the preset fixed number of sampling points; if the fixed arc length interval mode is selected, the preset fixed arc length interval is directly used as the standard arc length interval; then, starting from the starting point of the candidate center line, the arc length is accumulated sequentially along its curve direction. When the accumulated arc length reaches the standard arc length interval, the coordinates of the sampling point at that position are determined by linear interpolation. This process is repeated until the total arc length of the broken line of the entire candidate center line is traversed; finally, all sampling points selected according to the standard arc length interval are arranged in the order of the curve direction to form a resampling point sequence that is evenly distributed along the arc length direction.
[0113] Step 403: Determine the processed candidate centerline based on the resampling point sequence.
[0114] In some exemplary embodiments, after obtaining the resampled point sequence, the computer device can determine the processed candidate centerline based on the resampled point sequence.
[0115] Specifically, the computer equipment can first perform one-dimensional Gaussian convolution smoothing on the resampled point sequence, that is, perform one-dimensional Gaussian convolution on the set of horizontal and vertical coordinates of the resampled point sequence respectively. The window radius of the Gaussian convolution can be adjusted according to... Calculate, where, This is a rounding up operation. The standard deviation of the Gaussian kernel can be obtained by mapping the smoothing control parameters, and σ is limited to a reasonable range, such as [0.5, 5.0]. To address the issue of sudden changes in direction at the ends of the centerline, a larger Gaussian smoothing intensity is preferred to make the curvature change at the ends of the centerline more continuous, avoiding approximately 45-degree bends and ensuring the stability of the subsequent endpoint tangent direction estimation. Then, the horizontal and vertical coordinates after Gaussian smoothing are recombined to obtain a smoothed resampled point sequence. Finally, the smoothed resampled point sequence is connected sequentially according to the curve direction to form a continuous curve, thereby obtaining the processed candidate centerline.
[0116] In an optional embodiment of this application, the computer device can perform validity verification on the smoothed resampling point sequence, remove abnormal points caused by the smoothing process, and ensure the connectivity and direction consistency of the point sequence to obtain a candidate centerline that meets the requirements. The centerline has uniform point distribution, smooth curve, and continuous end curvature, which can effectively suppress jagged edges and discrete noise, and can make the endpoint of the centerline stably extend to the mask contour boundary along the tangential direction.
[0117] In optional embodiments of this application, in addition to Gaussian smoothing, the computer device may also employ Savitzky-Golay filtering, B-spline / Bezier fitting, curvature constraint smoothing, Kalman filtering, etc.
[0118] In one exemplary embodiment, such as Figure 5 As shown, determining the centerline based on the end tangent direction of the processed candidate centerline includes the following steps:
[0119] Step 501: Determine the head point sequence and tail point sequence based on the processed candidate centerline.
[0120] The head point sequence refers to a sequence of consecutive sampling points selected from the starting endpoint of the processed candidate centerline. The tail point sequence refers to a sequence of consecutive sampling points selected from the ending endpoint (tail) of the processed candidate centerline.
[0121] In some exemplary embodiments, after obtaining the processed candidate centerline, the computer device can determine the head point sequence and the tail point sequence based on the processed candidate centerline.
[0122] Specifically, the computer device can first obtain the complete resampling point sequence of the processed candidate centerline, and label them as Q1, Q2, ..., Qm according to the curve direction, where m is the total number of smoothed resampling points, Q1 is the starting endpoint, and Qm is the ending endpoint; then, select continuous sampling points from the head and tail according to a preset number to obtain the head point sequence and the tail point sequence. The preset selection number can be 3, 4, 5, etc.
[0123] Step 502: Determine the head tangent direction vector based on the head point sequence, and determine the tail tangent direction vector based on the tail point sequence.
[0124] Optionally, the head tangent direction vector refers to the direction vector obtained based on the head point sequence fitting, representing the direction of the extended candidate centerline in the head after processing. The tail tangent direction vector refers to the direction vector obtained based on the tail point sequence fitting, representing the direction of the extended candidate centerline in the tail after processing.
[0125] In some exemplary embodiments, after determining the head point sequence and the tail point sequence, the computer device can determine the head tangent direction vector based on the head point sequence and the tail tangent direction vector based on the tail point sequence.
[0126] Specifically, the computer equipment can employ a linear fitting algorithm to fit straight lines to the head point sequence and the tail point sequence, respectively, to obtain the head fitting line and the tail fitting line. The direction of the head fitting line is consistent with the extension trend of the head of the processed candidate centerline, and the direction of the tail fitting line is consistent with the extension trend of the tail of the processed candidate centerline. Subsequently, based on the direction of the fitting lines, the head tangent direction vector and the tail tangent direction vector are calculated, and the vector directions are consistent with the natural extension direction of the centerline. Since the processed candidate centerline has undergone Gaussian smoothing and the end curvature is continuous, the tangent direction vector obtained based on the continuous point sequence fitting has higher stability, effectively avoiding the tangent estimation deviation caused by the end bend.
[0127] Step 503: Determine the outer endpoint of the head end based on the head tangent direction vector, and determine the outer endpoint of the tail end based on the tail tangent direction vector.
[0128] Optionally, the head-end extension endpoint refers to the last point extending outward from the starting endpoint of the processed candidate centerline along the opposite direction of the head tangent vector, ultimately falling within the foreground of the text mask. The tail-end extension endpoint refers to the last point extending outward from the ending endpoint of the processed candidate centerline along the tail tangent vector, ultimately falling within the foreground of the text mask.
[0129] In some exemplary embodiments, after determining the head end extension endpoint and the tail end extension endpoint, the computer device may determine the head end extension endpoint based on the head tangent direction vector and the tail end extension endpoint based on the tail tangent direction vector.
[0130] Specifically, for the head-end extension endpoint, the computer device can take the starting endpoint of the processed candidate center line as the extension starting point and gradually advance along the opposite direction of the head tangent direction vector to generate extension points. The spacing of each extension point can be set to be consistent with the resampling step size. After generating each extension point, it is determined in real time whether the extension point exceeds the boundary, that is, whether it exceeds the range of the text mask or the original text image, or whether it falls in the background area of the text mask. If the extension point exceeds the boundary or falls in the background area, the extension is stopped immediately, and the last extension point that is still in the foreground of the text mask before stopping the extension is determined as the head-end extension endpoint. If the extension point is always in the foreground and does not exceed the boundary, the extension continues until the boundary of the text mask and then stops and the head-end extension endpoint is determined.
[0131] For the tail extension endpoint, the computer device can take the termination endpoint of the processed candidate center line as the extension starting point and gradually advance along the tail tangent direction vector to generate extension points. The spacing of each extension point can be set to be consistent with the resampling step size. After generating each extension point, it is determined in real time whether the extension point exceeds the boundary, that is, whether it exceeds the range of the text mask or the original text image, or whether it falls in the background area of the text mask. If the extension point exceeds the boundary or falls in the background area, the extension is stopped immediately, and the last extension point that is still in the foreground of the text mask before stopping the extension is determined as the tail extension endpoint. If the extension point is always in the foreground and does not exceed the boundary, the extension continues until the boundary of the text mask and then stops and the tail extension endpoint is determined.
[0132] Step 504: Determine the centerline based on the processed candidate centerline, the head end extension endpoint, and the tail end extension endpoint.
[0133] In some exemplary embodiments, after determining the head end extension endpoint and the tail end extension endpoint, the computer device can determine the centerline based on the processed candidate centerline, the head end extension endpoint, and the tail end extension endpoint.
[0134] Specifically, the computer equipment can first perform sequential calibration on the head-end extension endpoints, the processed candidate centerline point sequence, and the tail-end extension endpoints to ensure that the spliced curve has a consistent direction. That is, the head-end extension endpoints are spliced before the starting endpoint of the processed candidate centerline, and the tail-end extension endpoints are spliced after the ending endpoint of the processed candidate centerline. Then, the spliced point sequence is smoothed to eliminate any minor abrupt changes in direction that may occur at the splicing point, ensuring that the centerline is continuous, smooth, and has a consistent curvature. Finally, the validity of the spliced and smoothed point sequence is verified to confirm that it completely covers the foreground area of the text mask, with no out-of-bounds points or background points. Ultimately, the curve corresponding to the spliced and smoothed point sequence is determined as the centerline of the curved text.
[0135] In one exemplary embodiment, a computer device may determine the text boundary of at least one curved text based on a centerline.
[0136] Specifically, the computer device can first extract the outer contour of the text mask and select the outer contour with the largest area as the contour polygon of the text region. The point sequence of this contour polygon can be a dense contour point or an approximate polygonal form. Next, the resampled point sequence of the center line is extracted and labeled as {c}. i For sampling points at different positions in the sampling point sequence, a differentiated method is used to calculate the normalized tangent direction vector t. i For the intermediate point, the symmetric difference method can be used, with the formula ti = normalize(c i+1 -c i-1 For the start endpoint c0 and the end endpoint cn-1 One-sided difference method can be used, with the formula t0 = normalize(c1 - c0), t n-1 =normalize(c n-1 -c n-2 Then, based on the perpendicular relationship between the tangent and the normal, the normal direction vector n corresponding to each sampling point is calculated. i = (-ti, y, ti, x), where ti, y and ti, x are the ordinate and abscissa components of the tangent direction vector ti, respectively; subsequently, resampling is performed at each centerline point c. i Starting from the vector n, along its normal direction. i The parametric equation is constructed as Li(t) = c i +t·n i For a straight line, traverse each edge of the polygonal outline and calculate the intersection points of the line with each edge. From all intersection points, select the points with a distance c in the direction t>0. i The nearest intersection point pipos and the distance c in the t<0 direction i The nearest intersection point, pinig, forms the initial upper and lower boundary point pairs. To reduce edge noise, the initial point pairs are subjected to inward shrinkage, with the shrinkage formula being pitop = pipos - δn. i pibottom=pineg+δn i Where δ is a configurable inward shrinkage distance of 1-3 pixels. If the shrunken boundary point falls outside the outline polygon, then this point is compared with the corresponding center point c. i Perform several binary backtracking operations until returning to the inside of the contour to ensure the validity of the boundary points; finally, connect the contracted upper boundary points pitop and lower boundary points pibottom corresponding to all centerline resampling points in sequence according to the curvature of the centerline to form upper and lower boundaries that are consistent with the direction of the centerline and can accurately define the effective vertical range of the curved text.
[0137] In an optional embodiment of this application, the computer device may also advance stepwise along the tangential direction and combine mask boundary detection, or use distance transformation gradient / boundary normal estimation for adaptive extension.
[0138] In one exemplary embodiment, such as Figure 6 As shown, the text image is corrected based on the center line and text boundaries to obtain a standard text image, including the following steps:
[0139] Step 601: Determine the effective correction area from the text image based on the center line and text boundaries.
[0140] In some exemplary embodiments, after obtaining the center line and upper and lower boundaries of the curved text, the computer device can determine an effective correction area from the text image based on the center line and text boundaries.
[0141] Specifically, the computer device can use the established centerline as the central axis, and combine the upper and lower boundaries that are consistent with the direction of the centerline to determine the closed area enclosed by the upper boundary, the lower boundary, and the boundary connecting segments at both ends as the initial correction area. Subsequently, the initial correction area is contour-checked to remove any isolated background pixels that may exist in the area, ensuring that the area only contains the foreground pixels of the curved text. Finally, the closed area after verification is determined as the effective correction area of the text image.
[0142] Step 602: Obtain the total arc length of the centerline and construct a coordinate mapping relationship based on the total arc length and preset size parameters.
[0143] In some exemplary embodiments, after determining the effective correction area, the computer device can obtain the total arc length of the centerline and construct a coordinate mapping relationship based on the total arc length and preset size parameters.
[0144] Specifically, the computer device can first acquire the resampled point sequence of the center line, calculate and obtain the total arc length S of the center line, and simultaneously calculate the cumulative arc length s of the center line point sequence, with the cumulative arc length ranging from s ∈ [0, S]. Then, it calls preset size parameters to determine the size of the target unfolded image as H × W, where the height H is a fixed value used to adapt to the input height of the text recognition model, and the width W can be determined according to the total arc length or set according to a fixed scaling factor. Next, for each target pixel column x ∈ [0, W-1] in the standard text image, it calculates its corresponding arc length position u = (x + 0.5) · WS, and finds the center line segment where u is located through binary search or table lookup. Linear interpolation is performed on the upper and lower boundary points corresponding to this segment to obtain the upper boundary point T(u) and lower boundary point B(u) corresponding to the arc length position; then, for each pixel row y∈[0,H-1] under the target pixel column, the interpolation coefficient a=H-1y is calculated, and the original text image coordinates P(u,a)=T(u)+a·(B(u)-T(u)) are obtained by interpolation sampling between the upper and lower boundary points; finally, the original image coordinates P(u,a) corresponding to all target pixel coordinates (x,y) are written into the mapping tables mapX and mapY respectively, thus completing the construction of the pixel-level coordinate mapping relationship between the original pixel coordinates of the effective correction area and the target pixel coordinates of the standard text image.
[0145] Step 603: Remap the effective correction area based on the coordinate mapping relationship to obtain a standard text image.
[0146] In some exemplary embodiments, after the computer device has established the coordinate mapping relationship, it can remap the effective correction area based on the coordinate mapping relationship to obtain a standard text image.
[0147] Specifically, the computer device can first call a coordinate mapping relationship to perform a remap operation on the effective correction area of the text image. During the remap process, a bicubic interpolation algorithm is used to interpolate the pixel values of the original image coordinates P(u, a) to ensure the texture clarity of the standard text image. At the same time, the image boundary is processed by reflection filling to avoid boundary pixel distortion. Then, according to the correspondence of the mapping table, the pixel values corresponding to the original image coordinates P(u, a) in the effective correction area are mapped one by one to the target pixel coordinates (x, y) of the standard text image. All target pixel columns x and pixel rows y of the standard text image are traversed to complete the remap transformation of the entire area. Finally, a horizontal strip image with characters arranged in a straight line along the horizontal direction and a size of H×W is obtained. This image is the standard text image.
[0148] In optional embodiments of this application, the computer device can also obtain standard text images based on algorithms such as segmented quadrilateral perspective stitching, thin plate spline deformation, and mesh-based local affine transformation.
[0149] In one exemplary embodiment, such as Figure 7 As shown, another method for recognizing curved text is provided, which includes the following steps:
[0150] Step 701: Obtain the original image containing at least one curved text, and determine the text mask and text image of at least one curved text based on the original image; determine the single-pixel skeleton based on the text mask using a thinning iterative algorithm.
[0151] Step 702: Construct an undirected adjacency graph based on a single-pixel skeleton and obtain the degree of the nodes in the undirected adjacency graph; construct an endpoint set based on the degree and search from the endpoint set to determine the farthest endpoint; determine the farthest endpoint pair based on the farthest endpoint and determine the longest connected path connecting the farthest endpoint pair as the candidate centerline;
[0152] Step 703: Obtain the total arc length of the polygonal line corresponding to the candidate centerline; based on the total arc length of the polygonal line and the preset sampling parameters, perform interpolation sampling on the candidate centerline to obtain a resampled point sequence uniformly distributed along the arc length direction; determine the processed candidate centerline based on the resampled point sequence.
[0153] Step 704: Determine the head point sequence and tail point sequence based on the processed candidate centerline; determine the head tangent direction vector based on the head point sequence, and determine the tail tangent direction vector based on the tail point sequence; determine the head end extension endpoint based on the head tangent direction vector, and determine the tail end extension endpoint based on the tail tangent direction vector; determine the centerline based on the processed candidate centerline, head end extension endpoint, and tail end extension endpoint.
[0154] Step 705: Determine the text boundary of at least one curved text based on the center line; determine the effective correction area from the text image based on the center line and the text boundary; obtain the total arc length of the center line, and construct a coordinate mapping relationship based on the total arc length and preset size parameters; perform remapping processing on the effective correction area based on the coordinate mapping relationship to obtain a standard text image; input the standard text image into the text recognition model to obtain the curved text recognition result.
[0155] In some exemplary embodiments, such as Figure 8 As shown, Figure 8 The original image containing curved text is shown, along with the text bounding box and center line. Figure 9 This involves using the curved text recognition method provided in this application to... Figure 8 The standard text image is obtained by correcting the original image.
[0156] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0157] Based on the same inventive concept, this application also provides a curved text recognition device for implementing the curved text recognition method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more curved text recognition device embodiments provided below can be found in the limitations of the curved text recognition method described above, and will not be repeated here.
[0158] In one exemplary embodiment, such as Figure 10 As shown, a curved text recognition device 1000 is provided, including: an acquisition module 1001, a determination module 1002, and an execution module 1003, wherein:
[0159] The acquisition module 1001 is used to acquire an original image containing at least one curved text, and to determine a text mask and text image of at least one curved text based on the original image;
[0160] The determining module 1002 is used to determine the center line of at least one curved text based on a text mask, and to determine the text boundary of at least one curved text based on the center line;
[0161] The execution module 1003 is used to perform correction processing on the text image based on the center line and text boundary to obtain a standard text image, and input the standard text image into the text recognition model to obtain the curved text recognition result.
[0162] In one embodiment, the determining module 1002 is specifically used to determine a single-pixel skeleton based on a text mask using a thinning iterative algorithm; determine a candidate centerline based on the single-pixel skeleton; perform equal arc length resampling processing on the candidate centerline to obtain the processed candidate centerline; and determine the centerline based on the end tangent direction of the processed candidate centerline.
[0163] In one embodiment, the determining module 1002 is specifically used to construct an undirected adjacency graph based on a single-pixel skeleton and obtain the degree of the nodes in the undirected adjacency graph; construct an endpoint set based on the degree and search from the endpoint set to determine the farthest endpoint; determine the farthest endpoint pair based on the farthest endpoint and determine the longest connected path connecting the farthest endpoint pair as a candidate centerline.
[0164] In one embodiment, the determining module 1002 is specifically used to obtain the total arc length of the broken line corresponding to the candidate center line; based on the total arc length of the broken line and the preset sampling parameters, the candidate center line is interpolated and sampled to obtain a sequence of resampled points uniformly distributed along the arc length direction; and the processed candidate center line is determined according to the resampled point sequence.
[0165] In one embodiment, the determining module 1002 is specifically used to determine the head point sequence and the tail point sequence based on the processed candidate centerline; determine the head tangent direction vector based on the head point sequence, and determine the tail tangent direction vector based on the tail point sequence; determine the head end extension endpoint based on the head tangent direction vector, and determine the tail end extension endpoint based on the tail tangent direction vector; and determine the centerline based on the processed candidate centerline, the head end extension endpoint, and the tail end extension endpoint.
[0166] In one embodiment, the execution module 1003 is specifically used to determine the effective correction area from the text image based on the center line and the text boundary; obtain the total arc length of the center line, and construct a coordinate mapping relationship based on the total arc length and preset size parameters; and perform remapping processing on the effective correction area based on the coordinate mapping relationship to obtain a standard text image.
[0167] Each module in the aforementioned curved text recognition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0168] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 11 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When executed by the processor, the computer program implements a curved text recognition method.
[0169] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a curved text recognition method.
[0170] Those skilled in the art will understand that Figure 11 and Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0171] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the above embodiments.
[0172] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the above embodiments.
[0173] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the method described in any of the above embodiments.
[0174] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0175] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0176] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for recognizing curved text, characterized in that, The method includes: Obtain an original image containing at least one curved text, and determine a text mask and text image of the at least one curved text based on the original image; The center line of the at least one curved text is determined based on the text mask, and the text boundary of the at least one curved text is determined based on the center line; The text image is corrected based on the center line and the text boundary to obtain a standard text image, and the standard text image is then input into a text recognition model to obtain curved text recognition results.
2. The method according to claim 1, characterized in that, Determining the center line of the at least one curved text based on the text mask includes: Based on the refinement iterative algorithm, the single-pixel skeleton is determined according to the text mask; Candidate center lines are determined based on the single-pixel skeleton, and the candidate center lines are subjected to equal arc length resampling processing to obtain the processed candidate center lines. The centerline is determined based on the end tangent direction of the processed candidate centerline.
3. The method according to claim 2, characterized in that, The step of determining the candidate centerline based on the single-pixel skeleton includes: An undirected adjacency graph is constructed based on the single-pixel skeleton, and the degree of the nodes in the undirected adjacency graph is obtained. An endpoint set is constructed based on the degree, and a search is performed from the endpoint set to determine the farthest endpoint; The farthest endpoint pair is determined based on the farthest endpoint, and the longest connected path connecting the farthest endpoint pair is determined as the candidate centerline.
4. The method according to claim 2, characterized in that, The step of performing equal-arc-length resampling on the candidate centerline to obtain the processed candidate centerline includes: Obtain the total arc length of the polygonal line corresponding to the candidate centerline; Based on the total arc length of the broken line and the preset sampling parameters, interpolation sampling is performed on the candidate center line to obtain a sequence of resampled points uniformly distributed along the arc length direction; The processed candidate centerline is determined based on the resampling point sequence.
5. The method according to claim 2, characterized in that, Determining the centerline based on the end tangent direction of the processed candidate centerline includes: The head point sequence and tail point sequence are determined based on the processed candidate centerline. The head tangent direction vector is determined based on the head point sequence, and the tail tangent direction vector is determined based on the tail point sequence. The head end extension endpoint is determined based on the head tangent direction vector, and the tail end extension endpoint is determined based on the tail tangent direction vector. The centerline is determined based on the processed candidate centerline, the head end extension endpoint, and the tail end extension endpoint.
6. The method according to any one of claims 1 to 5, characterized in that, The step of correcting the text image based on the center line and the text boundary to obtain a standard text image includes: Based on the center line and the text boundary, an effective correction area is determined from the text image; Obtain the total arc length of the centerline, and construct a coordinate mapping relationship based on the total arc length and preset size parameters; The effective correction area is remapped based on the coordinate mapping relationship to obtain the standard text image.
7. A curved text recognition device, characterized in that, The device includes: An acquisition module is used to acquire an original image containing at least one curved text, and to determine a text mask and a text image of the at least one curved text based on the original image; A determining module is configured to determine the center line of the at least one curved text based on the text mask, and to determine the text boundary of the at least one curved text based on the center line; The execution module is used to perform correction processing on the text image based on the center line and the text boundary to obtain a standard text image, and input the standard text image into the text recognition model to obtain the curved text recognition result.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.