Cable number identification method and device for electrical operation
By using HoloLens and color recognition technology in an electrical working environment, combined with affine transformation to identify and correct line number labels, the problems of low recognition accuracy and inconvenient operation in the prior art are solved, and efficient line number identification and wiring are achieved guide.
Patent Information
- Application Number
- CN202411208240.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing text recognition technology has low recognition accuracy in electrical working environments, which is difficult to meet complex environments and real-time needs, and is inconvenient to operate.
The mixed reality head-mounted display HoloLens combines color recognition and affine transformation technology to improve recognition accuracy by preprocessing image data, including grayscale, binarization, and edge detection.
It effectively improves the recognition accuracy of Tesseract in complex environments, simplifies operational processes, reduces deployment difficulty, and is suitable for most complex and real-time text recognition scenarios.
Smart Images

Figure CN119007212A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a cable line number recognition method and device for electrical operations, belonging to the technical field of text recognition. Background Art
[0002] The number of electrical equipment and cables is increasing day by day. Whether all kinds of cables are connected to the correct position is directly related to whether the electrical equipment can operate normally. At present, most of the industry completes the cable wiring tasks of electrical equipment based on paper process documents such as wiring diagrams, which is inefficient and has poor interactivity. In addition, the operator's attention needs to switch back and forth between the wiring drawings and wiring tasks, which is prone to safety hazards. In addition, paper process documents are not conducive to preservation and have poor intuitiveness, resulting in poor results for employee wiring and training. With the rapid development of random computer technology, text recognition methods generated by computer vision technology have quickly become popular and gradually become a hot research topic.
[0003] Existing technologies have proposed some text recognition solutions, such as Google's Tesseract and Baidu Smart Cloud, which mainly use computer vision to process and segment images and finally extract text information from images. At this stage, existing work has shown that automatic recognition of line numbers is an inevitable trend of future development, but in terms of current applications, related solutions still have the following problems: (1) Existing text recognition is mostly performed on static images, and there is little research on real-time wire number recognition in electrical operation environments with complex scenes, changing environments, and small wire number labels; (2) The recognition accuracy of mature OCR solutions in electrical operation environments is low and it is difficult to meet the requirements of electrical operations; (3) Existing research fails to take into account the operating habits and working environment of front-line workers, and the operation is not convenient enough. Summary of the invention
[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a cable line number recognition method and device for electrical operations, so as to realize cable line number recognition in an electrical operation environment and improve the accuracy of Tesseract in an electrical operation environment.
[0005] To achieve the above object, the present invention is implemented by adopting the following technical solutions: In a first aspect, the present invention provides a cable line number identification method for electrical operations, which is applicable to a data receiving end, and the method comprises: Receive cable line number image data from the electrical operation site and temporarily store the cable line number image data in the server; The recognition process is started through a preset trigger mechanism, the cable line number image data is pulled from the server, the text recognition algorithm is executed, and the recognition result is obtained; Based on the recognition result, wiring guidance for electrical work is provided.
[0006] Furthermore, the data receiving end adopts a mixed reality head-mounted display HoloLens.
[0007] Furthermore, the executing the text recognition algorithm and obtaining the recognition result includes: Reading line number identification parameters in a line number configuration file, wherein the line number identification parameters include a color identification threshold and a text tilt correction parameter; The color recognition threshold is used to identify the color of the cable number label from the image, and the cable number label is separated from the complex background. Then, the text positioning technology is applied to extract the text content. Detect the tilt angle of the extracted text content, compare the detected tilt angle with the obtained text tilt correction parameter, and apply affine transformation technology to correct the text to a horizontal state; The corrected text is recognized by an optical character recognition engine to obtain the text information on the line number label and output it as a recognition result.
[0008] Furthermore, the method also includes: before executing the text recognition algorithm, preprocessing the cable line number image data, including grayscale, binarization, and edge detection.
[0009] Furthermore, the preset trigger mechanism includes the voice command "recognition".
[0010] Furthermore, the line number configuration file includes the following parameters: the IP address and port of the server, key points of cable wiring, such as wiring end point, bundling requirements, etc., wiring path, minimum and maximum values of H, S and V components of the color of the line number label to be identified, and contour area filtering threshold.
[0011] Furthermore, after the cable number labels are separated from the complex background, the tiny interference points are filtered according to the area size. The calculation formula is as follows: ; Among them, if S threshold is the contour area filtering threshold, which is the minimum area set. S < S threshold When , it means that the current contour area is less than the area filtering threshold; F Indicates the filtering status. When the value is Y When , it means that the current contour needs to be filtered out. N , it means to keep the current outline.
[0012] Furthermore, the calculation formula of the affine transformation technology is as follows: ; in, s x , s y is the scaling factor, α is the rotation angle, x 0 , y 0 is the translation amount, a 0 , b 0 is the shear coefficient, ( x,y ) is the point before transformation, ( x', y' ) is the transformed point.
[0013] In a second aspect, the present invention provides a cable line number identification device for electrical operations, the device comprising: A receiving module, used for receiving cable line number image data from an electrical operation site, and temporarily storing the cable line number image data in a server; The recognition module is used to start the recognition process through a preset trigger mechanism, pull the cable line number image data from the server, execute the text recognition algorithm, and obtain the recognition result; The guidance module is used to provide wiring guidance for electrical work according to the recognition result.
[0014] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the aforementioned methods.
[0015] In a fourth aspect, the present invention provides a computer device, comprising: Memory, for storing computer programs / instructions; A processor is used to execute the computer program / instructions to implement the steps of any of the aforementioned methods.
[0016] In a fifth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which implements the steps of any one of the aforementioned methods when executed by a processor.
[0017] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention provides a cable line number recognition method and device for electrical operations, which uses a color recognition and positioning method to supplement and improve Tesseract. First, the line number label in the scene is positioned by color recognition, and then the influence of small areas of the same color are further eliminated by combining the idea of contour screening. Finally, the contour of the line number label is obtained, and the image is cropped according to the contour to separate the line number label from the image. (2) The present invention pre-processes the image by using the method of text positioning + affine transformation to obtain the tilt angle of the line number text in the image, and then transforms the text in the image to a horizontal state, thereby eliminating the decrease in recognition accuracy caused by the tilt of the text; (3) The method proposed in this invention effectively improves the recognition accuracy of Tesseract in complex environments; (4) The method of the present invention has high universality and can be applied to most complex scenarios that require real-time text recognition, such as cable assembly guidance. In addition, the method of the present invention liberates the operators to the greatest extent, using Hololens as a carrier for collecting images and guiding content display, and voice command control greatly simplifies the operation. There is no need to add an external camera for image collection, which reduces the difficulty of deployment. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flow chart of a cable line number identification method for electrical operations provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0019] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0020] Embodiment 1: This embodiment introduces a cable line number identification method for electrical operations, which is applicable to a data receiving end. The method includes: Receive cable line number image data from the electrical operation site and temporarily store the cable line number image data in the server; The recognition process is started through a preset trigger mechanism, the cable line number image data is pulled from the server, the text recognition algorithm is executed, and the recognition result is obtained; Based on the recognition result, wiring guidance for electrical work is provided.
[0021] The application process of the cable number identification method for electrical operations provided in this embodiment specifically involves the following steps: The cable line number identification method for electrical operations in an embodiment of the present invention uses Hololens to capture image data of the line number label in real time, processes the image data to achieve real-time identification of the line number, and then transmits the successfully identified line number to the Hololens helmet to guide the current cable wiring.
[0022] The cable line number identification method for electrical operations in an embodiment of the present invention uses a certain type of rail vehicle electrical system standardization training platform of CRRC as an experimental instrument, Hololens as a display device, and Dell workstation as an algorithm running platform to carry out this embodiment.
[0023] The specific operation process of the embodiment of the cable line number identification method for electrical operations is as follows: (1) Start the algorithm program and server: First, start the algorithm and server program on the workstation. The server is the key to transmitting images between the algorithm and Hololens and is the basis for successful recognition. (2) Obtaining line number labels: The operator uses the voice command "recognize" to control the Hololens to capture the line number labels. After the image is collected, it is uploaded to the server. (3) Image preprocessing: In order to better perform color and text positioning in the future, eliminate the influence of image noise, and reduce the amount of calculation, the image is preprocessed before color positioning.
[0024] 1) First, the image is grayed out, that is, the color image is converted into a grayscale image, and weighted average grayscale processing is used. Different weights are set for the three components of R, G, and B according to the sensitivity. The grayscale mathematical expression is shown in formula (1); (1); in Gary is the grayscale value, and R, G, and B are the red, green, and blue color component values of the image respectively.
[0025] 2) Then, in order to reduce the amount of calculation, highlight the outline of the desired target, and segment the foreground more effectively, the image is binarized based on the grayscale image, that is, the image pixels are converted into a binary image of 0 or 255, which only presents a black or white effect; 3) Morphological processing: In order to eliminate isolated points (holes) in the image and connect adjacent elements, the holes or small areas of the image are eliminated and the image is processed by dilation or erosion. In essence, it is a process of convolution on the image using a structural element (kernel); 4) Edge detection: In order to detect and save the highlighted image features, identify the points in the image where the brightness changes significantly, further remove irrelevant information based on morphological processing, retain the structural properties of the image, and perform edge contact on the image. The method of the present invention adopts the Canny edge detection algorithm, and the detection principle is as follows: 1. Gaussian blur: In order to generate better image quality and reduce the recognition of false edges, a two-dimensional Gaussian function is introduced G (x, y) The image is processed as shown in formula (2); (2); in is the standard deviation of the Gaussian filter function, which adjusts the smoothness of the image.
[0026] 2. Image gradient: In order to obtain the gradient information of the image, the Sobel operator is used to solve the image gradient amplitude G and gradient direction . Image gradient magnitude G and gradient direction The solution is shown in equations (3) and (4). (3); (4).
[0027] 3. Non-maximum suppression: In order to make the blurred boundaries clear and retain the maximum points of the image gradient change, it is necessary to suppress the maximum value of the image.
[0028] 4. Double threshold boundary tracking: In order to further eliminate pseudo edges and connect edges, and solve the edge stray response caused by noise and color changes, it is necessary to use double thresholds to remove some point areas or isolated points. That is, by setting the upper threshold T max and the lower threshold T min , and then compare the gradient amplitude of the pixel position with the upper and lower limits of the threshold to determine whether the current pixel is an edge pixel.
[0029] (4) Image content color positioning: Adjust the HSV color range according to the label color, then identify the color and locate the approximate position of the line number label in the image; then obtain its outline and corner points, and automatically crop the image based on the position information of the corner points to separate the foreground from the complex background; However, due to the complex electrical working environment, the external lighting changes have a great impact on Hololens, resulting in the presence of many tiny interference points of the same color in the captured scene images, which are easily affected by the above interference points during the color positioning process. Therefore, in order to eliminate the influence of tiny interference points on color positioning, the method of the present invention further incorporates the idea of contour area screening, first obtains the contours of all identified interference points, then calculates each contour and area, filters the tiny interference points according to the area size, and then eliminates the tiny interference points while retaining the positioning effect of the line number label.
[0030] The mathematical principle of the contour filtering performed by the method of the present invention is shown in formula (5).
[0031] (5); Among them, if S threshold is the contour area filtering threshold, which is the minimum area set. S < S threshold When , it means that the current contour area is less than the area filtering threshold;F Indicates the filtering status. When the value is Y When , it means that the current contour needs to be filtered out. N , it means to keep the current outline.
[0032] The method of the present invention can effectively eliminate the influence of subtle same-color points through a contour filtering method, thereby improving the effect and accuracy of final color positioning.
[0033] (5) Image text content positioning: After color positioning is completed, the algorithm will automatically crop the line number label from the image, remove the redundant background, and eliminate the influence of the complex background. Then, because the image is collected by Hololens in real time, it is impossible to ensure that the text in the image is in a horizontal state, but the inclination of the text has a great impact on the recognition success rate. To this end, the specific position of the text in the image is determined by text detection, and the text in the image is segmented into individual characters to determine the inclination angle of the text, and the affine transformation is used to transform the text in the image into a horizontal state to improve the recognition accuracy. The mathematical principle of affine transformation is shown in formula (6).
[0034] (6); in, s x , s y is the scaling factor, is the rotation angle, x 0 , y 0 is the translation amount, a 0 , b 0 Shear coefficient, ( x,y ) is the point before transformation, ( x', y' ) is the transformed point.
[0035] After affine transformation processing, the image text changes from tilted to parallel, which can effectively eliminate problems such as reduced recognition accuracy and success rate caused by text tilt.
[0036] (6) Tesseract recognition: After the secondary positioning is completed, Tesseract is used to recognize the characters in the image, and the recognized characters are compared and analyzed word by word with the existing line number data to obtain the results. The recognition results are transmitted to Hololens in real time, and Hololens provides wiring guidance to the user based on the results. The method of the present invention solves the problems of complex electrical operation environment and text tilt, realizes line number recognition in complex environments, and improves the recognition accuracy and success rate.
[0037] Embodiment 2: This embodiment provides a cable line number identification device for electrical operations, the device comprising: A receiving module, used for receiving cable line number image data from an electrical operation site, and temporarily storing the cable line number image data in a server; The recognition module is used to start the recognition process through a preset trigger mechanism, pull the cable line number image data from the server, execute the text recognition algorithm, and obtain the recognition result; The guidance module is used to provide wiring guidance for electrical work according to the recognition result.
[0038] The specific functional implementation of each of the above modules can be found in the relevant contents of the method in Example 1 and will not be elaborated here.
[0039] Embodiment 3, this embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods described in Embodiment 1 are implemented.
[0040] Embodiment 4: This embodiment provides a computer device, including: Memory, for storing computer programs / instructions; A processor, configured to execute the computer program / instructions to implement the steps of any one of the methods described in Example 1.
[0041] Embodiment 5: This embodiment provides a computer program product, including a computer program / instruction, which implements the steps of any method described in Embodiment 1 when executed by a processor.
[0042] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
[0043] It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, systems or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0044] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0045] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0046] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0047] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure rather than to limit its protection scope. Although the present disclosure has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that after reading the present disclosure, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the disclosed claims to be approved.
Claims
1. A cable line number identification method for electrical operations, It is characterized in that Applicable to a data receiving end, the method comprises: Receive cable line number image data from the electrical operation site and temporarily store the cable line number image data in the server; The recognition process is started through a preset trigger mechanism, the cable line number image data is pulled from the server, the text recognition algorithm is executed, and the recognition result is obtained; Based on the recognition result, wiring guidance for electrical work is provided.
2. The cable line number identification method for electrical operations according to claim 1, It is characterized in that The data receiving end adopts a mixed reality head-mounted display HoloLens.
3. The cable line number identification method for electrical operations according to claim 1, It is characterized in that The executing of the text recognition algorithm and obtaining the recognition result comprises: Reading line number identification parameters in a line number configuration file, wherein the line number identification parameters include a color identification threshold and a text tilt correction parameter; The color recognition threshold is used to identify the color of the cable number label from the image, and the cable number label is separated from the complex background. Then, the text positioning technology is applied to extract the text content. Detect the tilt angle of the extracted text content, compare the detected tilt angle with the obtained text tilt correction parameter, and apply affine transformation technology to correct the text to a horizontal state; The corrected text is recognized by an optical character recognition engine to obtain the text information on the line number label and output it as a recognition result.
4. The cable line number identification method for electrical operations according to claim 1, It is characterized in that The method further includes: before executing the text recognition algorithm, preprocessing the cable line number image data, including grayscale, binarization, and edge detection.
5. The cable line number identification method for electrical operations according to claim 1, It is characterized in that The preset trigger mechanism includes the voice command "recognition".
6. The cable line number identification method for electrical operations according to claim 3, It is characterized in that The line number configuration file includes the following parameters: the IP address and port of the server, key points of cable wiring, such as wiring end point, bundling requirements, wiring path, minimum and maximum values of H, S and V components of the color of the line number label to be identified, and contour area filtering threshold.
7. The cable line number identification method for electrical operations according to claim 1, It is characterized in that After stripping the cable number labels from the complex background, filter out the tiny interference points according to their area size. The calculation formula is as follows: ; Among them, if S threshold is the contour area filtering threshold, which is the minimum area set. S < S threshold When , it means that the current contour area is less than the area filtering threshold; F Indicates the filtering status. When the value is Y When , it means that the current contour needs to be filtered out. N , it means to keep the current outline.
8. The cable line number identification method for electrical operations according to claim 1, It is characterized in that The calculation formula of the affine transformation technology is as follows: ; in, s x , s y is the scaling factor, α is the rotation angle, x 0 , y 0 is the translation amount, a 0 , b 0 is the shear coefficient, ( x,y ) is the point before transformation, ( x', y' ) is the transformed point.
9. A cable number identification device for electrical operations, It is characterized in that The device comprises: A receiving module, used for receiving cable line number image data from an electrical operation site, and temporarily storing the cable line number image data in a server; The recognition module is used to start the recognition process through a preset trigger mechanism, pull the cable line number image data from the server, execute the text recognition algorithm, and obtain the recognition result; The guidance module is used to provide wiring guidance for electrical work according to the recognition result.
10. A computer-readable storage medium having a computer program stored thereon, Features: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Segmentation-free off-line handwritten Chinese character text recognition method
CN108509881A
Power distribution room field routing inspection method and system based on Hololens mixed reality technology
CN110246235A
Method and device for displaying screen cabinet information in power distribution room based on AR (Augmented Reality) equipment
CN114429595A
Wire grabbing point high-precision positioning method and system for hot-line work robot and storage medium
CN114782529A
Identification method, device and equipment for digital electrical meter
CN116030453A
