Character extraction method and system for power transmission and transformation project document

By combining the image preprocessing, noise detection and classification, table detection and area positioning, character segmentation and recognition of power transmission and transformation engineering documents, the problem of poor character extraction in the prior art is solved, and character extraction with higher reliability and accuracy is achieved.

CN120299057APending Publication Date: 2025-07-11STATE GRID HUNAN ELECTRIC POWER COMPANY LIMITED +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510393457.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

Existing image noise reduction schemes and text extraction schemes perform poorly in power transmission and transformation engineering documents, resulting in poor reliability and accuracy of character extraction.

Method used

Character extraction is performed using image preprocessing, noise detection and classification, table detection and area positioning, character segmentation and recognition, and a combination of Bayesian networks and recursive neural networks, including grayscale, binarization, noise classification and noise reduction, table detection, character area positioning, tilt correction and segmentation, local binary pattern recognition, and character association and replacement.

Benefits of technology

It has achieved the reliability and accuracy of character extraction of power transmission and transformation engineering documents, especially character positioning, segmentation, recognition and replacement in table parts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120299057A_ABST
    Figure CN120299057A_ABST
Patent Text Reader

Abstract

The invention discloses a character extraction method for a power transmission and transformation project document. The method comprises the following steps: acquiring data information of a target power transmission and transformation project document and preprocessing the data information to obtain a binary image of the target power transmission and transformation project document; noise detection, noise classification and noise reduction processing are carried out; carrying out character region positioning on the target power transmission and transformation project document; segmenting and extracting characters; character recognition is carried out based on a local binary pattern; and carrying out association and replacement of characters and completing character extraction of the target power transmission and transformation project document. The invention also discloses a system for realizing the character extraction method for the power transmission and transformation project document. According to the method, the image of the target power transmission and transformation project document is processed and extracted, and particularly the characters of the table part in the document are positioned, segmented, identified and replaced, so that the character extraction of the power transmission and transformation project document is realized, the reliability is higher, and the accuracy is better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of electrical automation, and particularly relates to a character extraction method and system for power transmission and transformation project documents. Background Art

[0002] With the development of economic technology and the improvement of people's living standards, electric energy has become an essential secondary energy source in people's production and life, bringing endless convenience to people's production and life. Therefore, ensuring the stable and reliable supply of electric energy has become one of the most important tasks of the power system.

[0003] In the field of power transmission and transformation projects, the management of power transmission and transformation project documents is an important guarantee for ensuring project quality and operation and maintenance efficiency. At present, with the acceleration of the digitalization process, the power system is also actively carrying out the electronic work of power transmission and transformation project documents. In the electronic work of power transmission and transformation project documents, it is of great significance to extract the characters of power transmission and transformation project documents.

[0004] However, in the specific process of text extraction, due to the existence of a large amount of image noise in power transmission and transformation project documents and the extremely high professionalism of the documents, the currently commonly used image noise reduction schemes and text extraction schemes perform unsatisfactorily in the character extraction process of power transmission and transformation project documents, and their reliability and accuracy are relatively poor. Summary of the Invention

[0005] One of the purposes of the present invention is to provide a character extraction method for power transmission and transformation project documents with high reliability and good accuracy.

[0006] Another purpose of the present invention is to provide a system for implementing the character extraction method for power transmission and transformation project documents.

[0007] The character extraction method for power transmission and transformation project documents provided by the present invention includes the following steps:

[0008] S1. Obtain the data information of the target power transmission and transformation project document;

[0009] S2. Perform image preprocessing on the data information obtained in step S1 to obtain a binary image of the target power transmission and transformation project document;

[0010] S3. Perform noise detection, noise classification, and noise reduction processing according to the binary image obtained in step S2;

[0011] S4. Perform character region positioning of the target power transmission and transformation project document based on table detection, region cell judgment, table row and column relationship judgment, and Sobel algorithm according to the data information obtained in step S3;

[0012] S5. Based on the character regions obtained by positioning, perform character segmentation and extraction based on skew correction operations and character segmentation operations;

[0013] S6. Based on the obtained character segmentation and extraction results, perform character recognition based on local binary patterns;

[0014] S7. Based on the results of character recognition, perform character association and replacement based on Bayesian networks and recurrent neural networks, and complete character extraction of the target power transmission and transformation project document.

[0015] The image preprocessing of the data information obtained in step S1 described in step S2 to obtain a binary image of the target power transmission and transformation project document specifically includes the following steps:

[0016] Perform grayscale processing on the data information obtained in step S1 to obtain a grayscale image of the target power transmission and transformation project document;

[0017] Perform binarization processing on the obtained grayscale image to obtain a binary image of the target power transmission and transformation project document.

[0018] The noise detection, noise classification, and noise reduction processing performed on the binary image obtained in step S2 described in step S3 specifically include the following steps:

[0019] Adopt a noise detection algorithm based on connected component analysis to identify noise regions in the binary image;

[0020] According to the recognition results, classify the noise; the classification results include dot noise, line noise, and block noise;

[0021] Perform corresponding noise reduction processing for the noise classification results: for dot noise, adopt a median filtering algorithm for noise reduction; for line noise, adopt a morphological filtering algorithm for noise reduction; for block noise, adopt an algorithm based on image inpainting for noise reduction.

[0022] The character region positioning of the target power transmission and transformation project document based on table detection, region cell judgment, table row-column relationship judgment, and Sobel algorithm for the data information obtained in step S3 described in step S4 specifically includes the following steps:

[0023] For the data information obtained in step S3, adopt a character region positioning algorithm based on projection analysis to determine the region where characters are located in the image;

[0024] For the table region, adopt the following steps for character region positioning:

[0025] S4.1. Table detection preprocessing:

[0026] Perform grayscale processing and binarization processing on the table area;

[0027] Adopt the horizontal direction operator G of the following Sobel operator x Perform a convolution operation on the binary image to obtain a horizontal edge map, and perform denoising through erosion and dilation operations to extract horizontal lines:

[0028]

[0029] In the formula, α is the set horizontal parameterized weight value; A is the binary image; β is the horizontal local feature fusion weight; LocalContrast(A) is the local contrast of the binary image;

[0030] Adopt the vertical direction operator G of the following Sobel operator y Perform a convolution operation on the binary image to obtain a vertical edge map, and perform denoising through erosion and dilation operations to extract vertical lines:

[0031]

[0032] In the formula, γ is the set vertical parameterized weight value; δ is the vertical local feature fusion weight; LocalNoise(A) is the noise level of the binary image;

[0033] For each pixel point in the binary image, take the area within a set range around the pixel point, multiply it element by element with the Sobel kernel and sum to obtain the gradient value of the pixel point, and calculate the edge intensity value;

[0034] Perform a logical AND operation on the extracted horizontal lines and vertical lines to generate a mask for the table area; perform a logical OR operation on the extracted horizontal lines and vertical lines to obtain the intersection of the horizontal lines and vertical lines, thereby obtaining the table contour;

[0035] Perform intersection detection on the mask image of the table area to determine the boundaries of the cells of the table and achieve table segmentation;

[0036] S4.2. Region cell judgment:

[0037] Based on the segmented table, perform area and number of points of the region: If the area is less than the set value, it is determined that the corresponding region does not belong to the table; if the number of points is less than the set value, it is determined that the corresponding region is an incomplete table;

[0038] Analyze the inclusion relationship of the regions to identify nested cells;

[0039] S4.3. Table row-column relationship judgment:

[0040] Sort the filtered cell range by the ordinate to determine the number of rows in the table: Regions with the same ordinate and consecutive after sorting are determined to be cells belonging to the same row;

[0041] Sort the cell range of the same row by the abscissa to determine the number of columns in the table: Regions with the same abscissa and consecutive after sorting are determined to be cells belonging to the same column;

[0042] Extract the coordinate information of all cells according to the recognized row-column relationship;

[0043] S4.4. Cell repositioning based on the Sobel operator:

[0044] Text region extraction: Cut each cell to extract the text region inside the cell; Through binarization processing, ensure the clarity of the text region;

[0045] Edge detection: Perform Sobel operator edge detection on the extracted text region image to identify the boundary of the text region;

[0046] Contour screening: Calculate the aspect ratio of the contour area, and screen out the text regions that meet the single-semantic electrical phrase;

[0047] Region segmentation: Analyze the minimum bounding rectangle of the contour to obtain the text box;

[0048] Text separation: Separate the electrical phrases of several semantics in the cell to achieve text positioning.

[0049] According to the character region obtained by positioning in step S5, based on the tilt correction operation and character segmentation operation, perform character segmentation and extraction, specifically including the following steps:

[0050] Tilt correction: Use the image analysis algorithm to determine the tilt angle of the character; Based on the affine transformation algorithm, correct the tilted character;

[0051] Character segmentation: Use the following formula for character segmentation:

[0052] I n+1 =δ D (∈D(I n )∩M)

[0053] In the formula, I n+1 is the character obtained in the (n + 1)-th iteration process; δ D () is the morphological dilation operation using the structuring element D; ∈D() represents the morphological erosion operation using the structuring element D; M is the marker image; D is the structuring element for morphological operations.

[0054] According to the obtained character segmentation and extraction results in step S6, character recognition is performed based on local binary patterns, which specifically includes the following steps:

[0055] Adopt a character feature matching algorithm improved based on local binary patterns to perform feature matching on the obtained character segmentation and extraction results;

[0056] The character feature matching algorithm improved based on local binary patterns is specifically to calculate the feature matching value using the following formula:

[0057]

[0058] In the formula, M is the feature matching value; n is the number of sampling points in the horizontal direction of the neighborhood window centered on the current pixel point (x i , y i ); m is the number of sampling points in the vertical direction of the neighborhood window centered on the current pixel point (x i , y i ); w ij is the weight coefficient matrix; I(x i , y i ) represents the pixel value of the image at the pixel point (x i , y i ); (x i +c j , y i +d j ) represents the offset coordinates of the j-th sampling point in the neighborhood relative to the pixel point (x i , y i ); s(x) is the sign function, and s(x)=1 when x≥0, s(x)=0 when x<0;

[0059] Complete character recognition according to the obtained feature matching value.

[0060] According to the results of character recognition in step S7, based on the Bayesian network and the recurrent neural network, perform character association and replacement, and complete the character extraction of the target power transmission and transformation project document, which specifically includes the following steps:

[0061] Adopt a pre-trained combined model based on the improved Bayesian network and the recurrent neural network to perform character association and replacement;

[0062] Use the following formula to obtain the intermediate probability P(X n |X1,...,X n-1 ):

[0063]

[0064] In the formula, X nDenotes the character node to be predicted currently, corresponding to a certain character in the professional corpus data. During the character association process, it is the target character for which the model needs to determine the specific value; |X1,...,X n-1 Denotes the existing character sequence, and these characters are important bases for the model when predicting X n . These characters may form a word or a short phrase, and there is an inherent connection between them and X n in terms of semantics and grammar; Pa(X i ) denotes the set of parent nodes of node X i . In the Bayesian network structure, the parent nodes determine the probability distribution of the child nodes. For the character node X i , its parent nodes may be other characters that directly affect its occurrence probability at the semantic or syntactic level; P(X i |Pa(X i )) denotes the conditional probability of the character node X i occurring under the condition of the given set of parent nodes Pa(X i ). This probability reflects the dependence relationship between the character node X i and its parent nodes; is the product of the conditional probabilities of each character node from X1 to X n-1 . Through the multiplication operation, the mutual dependence relationship between the existing character sequences is comprehensively considered; X' n denotes all possible characters in the character set, is the summation operation for all possible values of X' n . The purpose is to ensure that the intermediate probability P(X n |X1,...,X n-1 ) calculated by the formula has a value range between 0 and 1;

[0065] Based on the obtained P(X n |X1,...,X n-1 ), character association and replacement are performed to complete the character extraction of the target power transmission and transformation project document.

[0066] The present invention also provides a system for implementing the character extraction method for power transmission and transformation project documents, including a data acquisition module, an image processing module, a noise processing module, a region localization module, a character segmentation module, a character recognition module, and a character extraction module; the data acquisition module, the image processing module, the noise processing module, the region localization module, the character segmentation module, the character recognition module, and the character extraction module are connected in series in sequence; the data acquisition module is used to acquire the data information of the target power transmission and transformation project document and upload the data information to the image processing module; the image processing module is used to perform image preprocessing on the acquired data information according to the received data information to obtain the binary image of the target power transmission and transformation project document and upload the data information to the noise processing module; the noise processing module is used to perform noise detection, noise classification, and noise reduction processing according to the received data information and the obtained binary image and upload the data information to the region localization module; the region localization module is used to perform character region localization on the target power transmission and transformation project document based on table detection, region cell judgment, table row-column relationship judgment, and Sobel algorithm according to the received data information and upload the data information to the character segmentation module; the character segmentation module is used to perform segmentation and extraction of characters based on skew correction operation and character segmentation operation according to the received data information and the located character region and upload the data information to the character recognition module; the character recognition module is used to perform character recognition based on local binary pattern according to the received data information and the obtained character segmentation and extraction results and upload the data information to the character extraction module; the character extraction module is used to perform association and replacement of characters based on Bayesian network and recurrent neural network according to the received data information and the character recognition results and complete the character extraction of the target power transmission and transformation project document.

[0067] The character extraction method and system for power transmission and transformation project documents provided by the present invention process and extract the image of the target power transmission and transformation project document, and particularly locate, segment, recognize, and replace the characters in the table part of the document, which not only realizes the character extraction of power transmission and transformation project documents, but also has higher reliability and better accuracy. Brief Description of the Drawings

[0068] Figure 1 It is a schematic flowchart of the method of the present invention.

[0069] Figure 2 It is a schematic diagram of the functional modules of the system of the present invention. Detailed Embodiment

[0070] As Figure 1 shown is a schematic flowchart of the method of the present invention: The character extraction method for power transmission and transformation project documents disclosed by the present invention includes the following steps:

[0071] S1. Obtain the data information of the target power transmission and transformation project documents;

[0072] S2. Perform image preprocessing on the data information obtained in step S1 to obtain a binary image of the target power transmission and transformation project documents; specifically, it includes the following steps:

[0073] Perform grayscale processing on the data information obtained in step S1 to obtain a grayscale image of the target power transmission and transformation project documents;

[0074] Perform binarization processing on the obtained grayscale image to obtain a binary image of the target power transmission and transformation project documents;

[0075] S3. According to the binary image obtained in step S2, perform noise detection, noise classification, and noise reduction processing; specifically, it includes the following steps:

[0076] Adopt a noise detection algorithm based on connected component analysis to identify the noise areas in the binary image;

[0077] Classify the noise according to the recognition results; the classification results include dot noise, line noise, and block noise;

[0078] For the classification results of the noise, perform corresponding noise reduction processing: for dot noise, adopt a median filtering algorithm for noise reduction; for line noise, adopt a morphological filtering algorithm for noise reduction; for block noise, adopt an algorithm based on image inpainting for noise reduction;

[0079] S4. According to the data information obtained in step S3, based on table detection, regional cell judgment, table row-column relationship judgment, and Sobel algorithm, perform character region localization of the target power transmission and transformation project documents; specifically, it includes the following steps:

[0080] For the data information obtained in step S3, adopt a character region localization algorithm based on projection analysis to determine the region where the characters are located in the image;

[0081] For the table region, adopt the following steps to perform character region localization:

[0082] S4.1. Table detection preprocessing:

[0083] Perform grayscale processing and binarization processing on the table region (perform binarization processing on the grayscale image to convert the image into a form with black background and white characters; then, through color inversion operation, make the subsequent edge detection and cell segmentation more efficient);

[0084] Adopt the following horizontal direction operator G of the Sobel operator x Perform convolution operation on the binary image to obtain a horizontal edge map, and perform denoising through erosion and dilation operations, and extract horizontal lines:

[0085]

[0086] where α is the set horizontal parametric weight value; A is a binary image; β is the horizontal local feature fusion weight; LocalContrast(A) is the local contrast of the binary image; among them, the left and right columns of the horizontal direction operator G x have larger weights and are used to detect vertical edges (such as transitions from dark to bright);

[0087] Use the vertical direction operator G of the following Sobel operator y Perform a convolution operation on the binary image to obtain a vertical edge map, and perform denoising through erosion and dilation operations to extract vertical lines:

[0088]

[0089] where γ is the set vertical parametric weight value; δ is the vertical local feature fusion weight; LocalNoise(A) is the noise level of the binary image; among them, the upper and lower rows of the vertical direction operator G y have larger weights and are used to detect horizontal edges (such as transitions from bright to dark);

[0090] For each pixel point in the binary image, take the area within a set range around the pixel point, multiply it element by element with the Sobel kernel and sum to obtain the gradient value of the pixel point, and calculate the edge intensity value;

[0091] Perform a logical AND operation on the extracted horizontal lines and vertical lines to generate a mask for the table area; perform a logical OR operation on the extracted horizontal lines and vertical lines to obtain the intersection of the horizontal lines and vertical lines, thereby obtaining the table contour;

[0092] Perform intersection detection on the mask image of the table area to determine the boundaries of the table cells and achieve table segmentation;

[0093] S4.2. Region cell judgment:

[0094] According to the segmented table, perform area and point count of the region: if the area is less than the set value, it is determined that the corresponding region does not belong to the table, and if the number of points is less than the set value, it is determined that the corresponding region is an incomplete table;

[0095] Analyze the inclusion relationship of the regions to identify nested cells;

[0096] S4.3. Table row-column relationship judgment:

[0097] Sort the filtered cell range by the ordinate to determine the number of rows in the table: Areas with the same ordinate and consecutive after sorting are determined to be cells belonging to the same row;

[0098] Sort the cell range of the same row by the abscissa to determine the number of columns in the table: Areas with the same abscissa and consecutive after sorting are determined to be cells belonging to the same column;

[0099] Extract the coordinate information of all cells according to the recognized row-column relationship;

[0100] S4.4. Cell repositioning based on the Sobel operator:

[0101] Text area extraction: Cut each cell to extract the text area inside the cell; Through binarization processing, ensure the clarity of the text area;

[0102] Edge detection: Perform Sobel operator edge detection on the extracted text area image to identify the boundary of the text area; The Sobel operator effectively identifies the boundary of the text area by calculating the image gradient;

[0103] Contour screening: Calculate the aspect ratio of the contour area, and screen out the text areas that meet the single-semantic electrical phrase; Contours with smaller areas are recognized as miscellaneous lines, while contours with appropriate aspect ratios and areas are retained;

[0104] Region segmentation: Analyze the minimum bounding rectangle of the contour to obtain the text box;

[0105] Text separation: Separate the electrical phrases of several semantics in the cell to achieve text positioning;

[0106] S5. Based on the located character regions, perform character segmentation and extraction based on the tilt correction operation and character segmentation operation; The specific steps are as follows:

[0107] Tilt correction: Use an image analysis algorithm to determine the tilt angle of the character; Based on the affine transformation algorithm, correct the tilted character;

[0108] Character segmentation: Perform character segmentation using the following formula:

[0109] I n+1 =δ D (∈D(I n )∩M)

[0110] where I n+1 is the character obtained in the (n + 1)-th iteration process; δ D() is the morphological dilation operation using the structural element D; ∈D() represents the morphological erosion operation using the structural element D; M is the marker image; D is the structural element for morphological operations;

[0111] Through the above equations, continuously iterating, I n will gradually converge to an image that only contains the character part and is clearly segmented;

[0112] S6. Based on the obtained character segmentation and extraction results, character recognition is performed based on local binary patterns; specifically, it includes the following steps:

[0113] Adopt a character feature matching algorithm improved based on local binary patterns to perform feature matching on the obtained character segmentation and extraction results;

[0114] The character feature matching algorithm improved based on local binary patterns is specifically to calculate the feature matching value using the following equation:

[0115]

[0116] In the formula, M is the feature matching value; n is the number of sampling points in the horizontal direction of the neighborhood window centered on the current pixel point (x i , y i ); m is the number of sampling points in the vertical direction of the neighborhood window centered on the current pixel point (x i , y i ); w ij is the weight coefficient matrix; I(x i , y i ) represents the pixel value of the image at the pixel point (x i , y i ); (x i + c j , y i + d j ) represents the offset coordinates of the jth sampling point in the neighborhood relative to the pixel point (x i , y i ); s(x) is the sign function, and s(x) = 1 when x ≥ 0, s(x) = 0 when x < 0; Through this solution, the model can more carefully capture the local texture changes of the character image, compare the features of the character image with the character feature templates in the model's memory, and then use complex algorithms to calculate the similarity to determine the category of each character;

[0117] Based on the obtained feature matching value, complete the character recognition;

[0118] S7. Based on the results of character recognition, perform character association and replacement based on the Bayesian network and the recurrent neural network, and complete the character extraction of the target power transmission and transformation project document; specifically, it includes the following steps:

[0119] Use a pre-trained combined model based on an improved Bayesian network and a recurrent neural network to perform character association and replacement;

[0120] Use the following formula to obtain the intermediate probability P(X n |X1,...,X n-1 ):

[0121]

[0122] In the formula, X n represents the character node to be predicted currently, corresponding to a certain character in the professional corpus data. During the character association process, it is the target character for which the model needs to determine the specific value; |X1,...,X n-1 represents the existing character sequence. These characters are important bases for the model to predict X n . These characters may form a word or a short sentence, and there is an internal connection between them and X n semantically and grammatically; Pa(X i ) represents the set of parent nodes of node X i . In the Bayesian network structure, the parent nodes determine the probability distribution of the child nodes. For the character node X i , its parent nodes may be other characters that directly affect its occurrence probability at the semantic or grammatical level; P(X i |Pa(X i )) represents the conditional probability of the character node X i appearing under the condition of the given set of parent nodes Pa(X i ). This probability reflects the dependence relationship between the character node X i and its parent nodes; is the product of the conditional probabilities of each character node from X1 to X n-1 . Through the product operation, the mutual dependence relationship between the existing character sequences is comprehensively considered; X' n represents all possible characters in the character set, is the sum operation for all possible values of X' n . The purpose is to ensure that the value range of the intermediate probability P(X n |X1,...,X n-1 ) calculated by the formula is between 0 and 1;

[0123] According to the obtained P(X n |X1,...,X n-1 ), perform character association and replacement, so as to complete the character extraction of the target power transmission and transformation project document.

[0124] This solution is based on the probability inference framework of Bayesian networks and combines the advantages of recurrent neural networks in processing sequence data. It can effectively mine features such as complex semantic associations, syntactic structures, and common usage patterns among characters in a professional field. Through this improved combined model, the model can better learn the dependency relationships among characters, thereby having the ability to deeply understand and process the character recognition results.

[0125] As Figure 2 shown in the schematic diagram of the functional modules of the system of the present invention: The system for implementing the character extraction method for power transmission and transformation engineering documents disclosed in the present invention includes a data acquisition module, an image processing module, a noise processing module, a region positioning module, a character segmentation module, a character recognition module, and a character extraction module. The data acquisition module, the image processing module, the noise processing module, the region positioning module, the character segmentation module, the character recognition module, and the character extraction module are connected in series in sequence. The data acquisition module is used to acquire the data information of the target power transmission and transformation engineering document and upload the data information to the image processing module. The image processing module is used to perform image preprocessing on the acquired data information according to the received data information to obtain the binary image of the target power transmission and transformation engineering document and upload the data information to the noise processing module. The noise processing module is used to perform noise detection, noise classification, and noise reduction processing according to the received data information and the obtained binary image and upload the data information to the region positioning module. The region positioning module is used to perform character region positioning on the target power transmission and transformation engineering document based on table detection, region cell judgment, table row and column relationship judgment, and the Sobel algorithm according to the received data information and the obtained data information and upload the data information to the character segmentation module. The character segmentation module is used to perform character segmentation and extraction based on skew correction operation and character segmentation operation according to the received data information and the located character region and upload the data information to the character recognition module. The character recognition module is used to perform character recognition based on local binary patterns according to the received data information and the obtained character segmentation and extraction results and upload the data information to the character extraction module. The character extraction module is used to perform character association and replacement based on Bayesian networks and recurrent neural networks according to the received data information and the character recognition results and complete the character extraction of the target power transmission and transformation engineering document.

Claims

1. A character extraction method for power transmission and transformation project documents, comprising the following steps: S1. Obtain the data information of the target power transmission and transformation project document; S2. Perform image preprocessing on the data information obtained in step S1 to obtain a binary image of the target power transmission and transformation project document; S3. According to the binary image obtained in step S2, perform noise detection, noise classification, and noise reduction processing; S4. According to the data information obtained in step S3, based on table detection, regional cell judgment, table row-column relationship judgment, and Sobel algorithm, perform character region localization of the target power transmission and transformation project document; S5. According to the located character region, based on tilt correction operation and character segmentation operation, perform character segmentation and extraction; S6. According to the obtained character segmentation and extraction results, perform character recognition based on local binary pattern; S7. According to the character recognition result, based on Bayesian network and recurrent neural network, perform character association and replacement, and complete the character extraction of the target power transmission and transformation project document.

2. The character extraction method for power transmission and transformation project documents according to claim 1, wherein The step S2 of performing image preprocessing on the data information obtained in step S1 to obtain a binary image of the target power transmission and transformation project document specifically includes the following steps: Perform grayscale processing on the data information obtained in step S1 to obtain a grayscale image of the target power transmission and transformation project document; Perform binarization processing on the obtained grayscale image to obtain a binary image of the target power transmission and transformation project document.

3. The character extraction method for power transmission and transformation project documents according to claim 2, characterized in that The step S3 of performing noise detection, noise classification, and noise reduction processing according to the binary image obtained in step S2 specifically includes the following steps: Adopt a noise detection algorithm based on connected component analysis to identify the noise region in the binary image; According to the recognition result, classify the noise; the classification results include dot noise, line noise, and block noise; Perform corresponding noise reduction processing for the noise classification results: for dot noise, adopt a median filtering algorithm for noise reduction; for line noise, adopt a morphological filtering algorithm for noise reduction; for block noise, adopt an algorithm based on image inpainting for noise reduction.

4. The character extraction method for power transmission and transformation project documents according to claim 3, characterized in that The step S4 of performing character region localization of the target power transmission and transformation project document according to the data information obtained in step S3, based on table detection, regional cell judgment, table row-column relationship judgment, and Sobel algorithm, specifically includes the following steps: For the data information obtained in step S3, adopt a character region localization algorithm based on projection analysis to determine the region where the characters are located in the image; For the table region, adopt the following steps to perform character region localization: S4.

1. Table detection preprocessing: Perform grayscale processing and binarization processing on the table region; The horizontal direction operator G of the Sobel operator is as follows x Perform a convolution operation on the binary image to obtain a horizontal edge map, and perform denoising through erosion and dilation operations to extract horizontal lines: Where α is the set horizontal parameterized weight value; A is the binary image; β is the horizontal local feature fusion weight; LocalContrast(A) is the local contrast of the binary image; The vertical direction operator G of the Sobel operator is as follows y Perform a convolution operation on the binary image to obtain a vertical edge map, and perform denoising through erosion and dilation operations to extract vertical lines: Where γ is the set vertical parameterized weight value; δ is the vertical local feature fusion weight; LocalNoise(A) is the noise level of the binary image; For each pixel point in the binary image, take the area within a set range around the pixel point, multiply it element by element with the Sobel kernel and sum the results to obtain the gradient value of the pixel point, and calculate the edge intensity value; Perform a logical AND operation on the extracted horizontal lines and vertical lines to generate a mask for the table area; perform a logical OR operation on the extracted horizontal lines and vertical lines to obtain the intersection of the horizontal lines and vertical lines, thereby obtaining the table contour; Perform intersection detection on the masked image of the table area to determine the boundaries of the cells of the table and achieve the segmentation of the table; S4.

2. Region cell judgment: Based on the segmented table, calculate the area and number of points of the region: if the area is less than the set value, it is determined that the corresponding region does not belong to the table, and if the number of points is less than the set value, it is determined that the corresponding region is an incomplete table; Analyze the inclusion relationship of the regions to identify nested cells; S4.

3. Table row-column relationship judgment: Sort the filtered cell regions according to the ordinate to determine the number of rows of the table: regions with the same ordinate and consecutive after sorting are determined to be cells belonging to the same row; Sort the cell regions in the same row according to the abscissa to determine the number of columns of the table: regions with the same abscissa and consecutive after sorting are determined to be cells belonging to the same column; Extract the coordinate information of all cells according to the identified row-column relationship; S4.

4. Cell repositioning based on the Sobel operator: Text region extraction: Cut each cell to extract the text region within the cell; Through binarization processing, ensure the clarity of the text region; Edge detection: Perform Sobel operator edge detection on the extracted text region image to identify the boundary of the text region; Contour screening: Calculate the aspect ratio of the contour area and screen the text regions that meet the single-semantic electrical phrase; Region segmentation: Analyze the minimum bounding rectangle of the contour to obtain the text box; Text separation: Separate the electrical phrases of several semantics in the cell to achieve text positioning.

5. The character extraction method for power transmission and transformation project documents according to claim 4, characterized in that According to the character region obtained by positioning described in step S5, based on the tilt correction operation and character segmentation operation, perform character segmentation and extraction, specifically including the following steps: Tilt correction: Use an image analysis algorithm to determine the tilt angle of the character; based on the affine transformation algorithm, correct the tilted character; Character segmentation: Use the following formula for character segmentation: I n+1 = δ D (∈ D(I n ) ∩ M) where I n+1 is the character obtained in the (n + 1)-th iteration process; δ D () represents the morphological dilation operation using the structuring element D; ∈D() represents the morphological erosion operation using the structuring element D; M is the marker image; D is the structuring element used for morphological operations.

6. The character extraction method for power transmission and transformation project documents according to claim 5, wherein According to the character segmentation and extraction results obtained in step S6, perform character recognition based on the local binary pattern, specifically including the following steps: Use a character feature matching algorithm improved based on the local binary pattern to perform feature matching on the obtained character segmentation and extraction results; The character feature matching algorithm improved based on the local binary pattern is specifically to calculate the feature matching value using the following formula: where M is the feature matching value; n is the number of sampling points in the horizontal direction of the neighborhood window centered on the current pixel point (x i , y i ); m is the number of sampling points in the vertical direction of the neighborhood window centered on the current pixel point (x i , y i ); w ij is the weight coefficient matrix; I(x i , y i ) represents the pixel value of the image at the pixel point (x i , y i ); (x i + c j , y i + d j ) represents the offset coordinates of the j-th sampling point in the neighborhood relative to the pixel point (x i , y i ); s(x) is the sign function, and s(x) = 1 when x ≥ 0, s(x) = 0 when x < 0; Complete character recognition according to the obtained feature matching value.

7. The character extraction method for power transmission and transformation project documents according to claim 6, characterized in that According to the results of character recognition described in step S7, based on the Bayesian network and the recurrent neural network, perform character association and replacement, and complete the character extraction of the target power transmission and transformation project document, specifically including the following steps: Use a pre-trained combined model based on an improved Bayesian network and a recurrent neural network to perform character association and replacement; The intermediate probability P(X n | X1,..., X n-1 ) is obtained using the following formula: where X n represents the character node to be predicted currently, corresponding to a certain character in the professional corpus data. During the character association process, it is the target character for which the model needs to determine the specific value; |X1,...,X n-1 represents the existing character sequence, and these characters are important bases for the model to predict X n . These characters may form a word or a short phrase, and they have an internal connection with X n semantically and grammatically; Pa(X i ) represents the set of parent nodes of node X i . In the Bayesian network structure, the parent nodes determine the probability distribution of the child nodes. For the character node X i , its parent nodes may be other characters that directly affect its occurrence probability at the semantic or grammatical level; P(X i |Pa(X i )) represents the conditional probability of the character node X i occurring under the condition of the given set of parent nodes Pa(X i ). This probability reflects the dependence relationship between the character node X i and its parent nodes; is the product of the conditional probabilities of each character node from X1 to X n-1 . Through the product operation, the mutual dependence relationship between the existing character sequences is comprehensively considered; X' n represents all possible characters in the character set, is the sum operation on all possible values of X' n . The purpose is to ensure that the value range of the intermediate probability P(X n |X1,...,X n-1 ) calculated by the formula is between 0 and 1; According to the obtained P(X n |X1,...,X n-1 ), character association and replacement are performed to complete the character extraction of the target power transmission and transformation project document.

8. A system for implementing the character extraction method for power transmission and transformation project documents as described in any one of claims 1 to 7, characterized in that It includes a data acquisition module, an image processing module, a noise processing module, a region localization module, a character segmentation module, a character recognition module, and a character extraction module; the data acquisition module, the image processing module, the noise processing module, the region localization module, the character segmentation module, the character recognition module, and the character extraction module are connected in series in sequence; the data acquisition module is used to acquire the data information of the target power transmission and transformation project document and upload the data information to the image processing module; The image processing module is used to perform image preprocessing on the acquired data information according to the received data information to obtain a binary image of the target power transmission and transformation project document, and upload the data information to the noise processing module; The noise processing module is used to perform noise detection, noise classification, and noise reduction processing according to the received data information and the obtained binary image, and upload the data information to the region localization module; The region localization module is used to perform character region localization of the target power transmission and transformation project document based on table detection, region cell judgment, table row and column relationship judgment, and the Sobel algorithm according to the received data information and the obtained data information, and upload the data information to the character segmentation module; The character segmentation module is used to perform character segmentation and extraction based on skew correction operation and character segmentation operation according to the received data information and the located character region, and upload the data information to the character recognition module; The character recognition module is used to perform character recognition based on local binary pattern according to the received data information and the obtained character segmentation and extraction results, and upload the data information to the character extraction module; The character extraction module is used to perform character association and replacement based on the Bayesian network and the recurrent neural network according to the received data information and the character recognition result, and complete the character extraction of the target power transmission and transformation project document.

Citation Information

Cited By

  • Newspaper complex format structured identification method and system based on multi-modal large model

    CN121366424A