Nothing Special   »   [go: up one dir, main page]

CN117037185B - Wire number recognition method and device based on optical character recognition technology - Google Patents

Wire number recognition method and device based on optical character recognition technology Download PDF

Info

Publication number
CN117037185B
CN117037185B CN202311302674.2A CN202311302674A CN117037185B CN 117037185 B CN117037185 B CN 117037185B CN 202311302674 A CN202311302674 A CN 202311302674A CN 117037185 B CN117037185 B CN 117037185B
Authority
CN
China
Prior art keywords
image
character
line number
locator
number information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311302674.2A
Other languages
Chinese (zh)
Other versions
CN117037185A (en
Inventor
王小龙
荀东升
荀楚翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Puchuan Control Equipment Co ltd
Original Assignee
Tianjin Puchuan Control Equipment Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Puchuan Control Equipment Co ltd filed Critical Tianjin Puchuan Control Equipment Co ltd
Priority to CN202311302674.2A priority Critical patent/CN117037185B/en
Publication of CN117037185A publication Critical patent/CN117037185A/en
Application granted granted Critical
Publication of CN117037185B publication Critical patent/CN117037185B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19173Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/1444Selective acquisition, locating or processing of specific regions, e.g. highlighted text, fiducial marks or predetermined fields
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/16Image preprocessing
    • G06V30/164Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/18Extraction of features or characteristics of the image
    • G06V30/1801Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/19007Matching; Proximity measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Character Input (AREA)

Abstract

The invention provides a wire number recognition method and device based on an optical character recognition technology, which relate to the technical field of image recognition and comprise the following steps: acquiring image data of a wire to be identified as an image to be identified; determining that the image to be identified contains line number information; accurately positioning the characters in the image to be recognized; dividing the character string, and identifying each character based on an optical character identification algorithm; sequentially integrating the character text information obtained by recognition to form complete line number information; and according to a hash table retrieval method, determining that the line number information is matched with the standard line number information, and outputting the line number information. The problem of the line body discernment in the regulator cubicle assembly process is solved, effectively reduces the dependence to ripe technology workman, improves assembly efficiency.

Description

Wire number recognition method and device based on optical character recognition technology
Technical Field
The invention relates to the technical field of image processing, in particular to a wire number identification method and device based on an optical character identification technology.
Background
In the prior art, the assembly process of the electrical cabinet is seriously operated by a skilled worker with abundant experience, because in the assembly process of the electrical cabinet, the correct identification of the wires is very important, otherwise incorrect connection and serious potential safety hazards may be caused. Common methods of distinguishing between different wires are color coding: the wires are usually coded in different colors to distinguish different electrical functions; identification tag: some wires are attached with identification tags, and the information of wire numbers, functions, wiring ports and the like is marked on the wires; an insulating sheath: different types of wires typically have insulating sheaths of different colors or materials; wire diameter size: the wire diameter of the electric wire is also an identification basis; wire rod mark: sometimes the information of the wire is printed directly on the insulating sheath; wiring drawing: in the assembly process of the electrical cabinet, corresponding wiring drawings are generally provided, and the positions, the connection modes and the functions of the electric wires are marked. All the methods need a great deal of experience for workers to master. Therefore, manufacturers and constructors typically provide detailed line identification and wiring drawings, and train operators to ensure that they can correctly identify and connect wires, which can result in serious yield constraints. Therefore, the identification method for identifying the wire number of the electric wire has great practical significance for solving the problem of wire body identification in the assembly process of the electric cabinet and reducing the dependence on mature technical workers.
Disclosure of Invention
The invention aims to at least solve one of the technical problems in the prior art or related technologies, and discloses a wire number identification method and device based on an optical character identification technology, which solve the problem of wire body identification in the assembly process of an electrical cabinet, effectively reduce the dependence on mature technical workers and improve the assembly efficiency.
The first aspect of the invention discloses a wire number identification method based on an optical character identification technology, which comprises the following steps: acquiring image data of a wire to be identified as an image to be identified; determining that the image to be identified contains line number information; accurately positioning characters in an image to be recognized; dividing the character string, and identifying each character based on an optical character identification algorithm; sequentially integrating the character text information obtained by recognition to form complete line number information; and according to the hash table retrieval method, determining that the line number information is matched with the standard line number information, and outputting the line number information.
According to the method for identifying the wire number of the wire based on the optical character identification technology disclosed by the invention, preferably, the method comprises the following steps of: storing the standard line number information into a hash table; the line number information is retrieved in a hash table.
According to the method for identifying the wire number of the wire based on the optical character identification technology disclosed by the invention, preferably, the method further comprises the following steps: if the line number information is not matched with the standard line number information, screening data with the character string length larger than that of the line number information from the standard line number information to obtain a fuzzy matching set; in the fuzzy matching set, a head-tail character string matching method is adopted, the head-tail character string is intercepted for a certain length, the head character string and the tail character string of the line number information are matched to the same set element, and then the line number information is determined to be matched.
According to the method for identifying the wire number of the wire based on the optical character identification technology disclosed by the invention, preferably, the method further comprises the following steps: if the matching cannot be completed in the fuzzy matching set, the LD algorithm is adopted to identify the line information.
According to the method for identifying the wire number of the wire based on the optical character identification technology disclosed by the invention, preferably, the method further comprises the following steps: and if the image to be identified does not contain the line number information, the image acquisition is carried out on the wire to be identified again.
According to the method for identifying the wire number of the wire based on the optical character identification technology disclosed by the invention, preferably, the step of determining that the image to be identified contains the wire number information comprises the following steps: acquiring a thumbnail of an image to be identified; gray processing is carried out on each pixel of the thumbnail; calculating the gray average value of the thumbnail; comparing the gray value of each pixel of the thumbnail with the gray average value, and marking as 1 if the gray value is larger than or equal to the gray average value and marking as 0 if the gray value is smaller than the gray average value, so as to obtain fingerprint data of the image to be identified; acquiring fingerprint data of the wireless number image by using the same method; and determining that the image to be identified contains line number information according to a comparison result of the fingerprint data of the image to be identified and the fingerprint data of the wireless number image.
According to the method for identifying the wire number of the wire based on the optical character identification technology disclosed by the invention, preferably, the method for accurately positioning the characters in the image to be identified comprises the following steps: performing image enhancement, denoising and graying treatment on the image to be identified to obtain an image to be positioned; the resolution of the locator template image is reduced, the pixels in the circles with the radius r and the center of the image are taken from the lower resolution locator template image, H pixels are arranged in total, H pixels are formed into an H-dimensional column vector according to a column-by-column connection method, the first column of an array b is put into the template with the step length delta theta, the rotated H pixels form a second column of b, the second column is sequentially rotated until 360 degrees are passed, an array b with the size of H× (2 pi/delta theta) is finally generated, the resolution of the image to be positioned is reduced, the pixels in the circles with the radius r are taken from top to bottom and from left to right in the bottle cap area, an H-dimensional vector a is generated by the same method at points (x, y) on the lower resolution image to be positioned, the vector a is related with the array b column by column, the correlation coefficient and the position information at the moment are recorded, a new a is generated, the steps of calculating the correlation coefficient are repeated until all pixel points in the image range are searched, and the positions of the correlation coefficient are ranked to be the largest, namely the position of the correlation coefficient; intercepting an image of a region where the locator is located, wherein the image size is 56 multiplied by 56, firstly carrying out binarization processing on the locator image by using an OTSU method, counting the number of black pixels in the locator binarization image at the moment, when the number of the binarized black pixels is within the range of 200 and 900, the binarization effect of the locator is best, if the number of the black pixels is not within the range of 200 and 900, carrying out binarization on the locator image again, counting the number of black pixels on the locator binarization image, so as to carry out expansion or corrosion processing on the locator image, when the number of the black pixels is greater than 580, carrying out expansion processing on the locator image, when the number of the black pixels is less than 500, adopting a horizontal projection method and a vertical projection method to find the boundary of the locator to remove redundant noise points, and adopting a Gauss-Laplace operator to carry out edge detection on the locator image; processing the locator edge detection image by contour tracking based on the 8 connected region, wherein the character image is arranged behind the locator; and intercepting the character image to finish character positioning.
According to the method for recognizing the wire number based on the optical character recognition technology disclosed by the invention, preferably, the character string is divided, and each character is recognized based on an optical character recognition algorithm, which specifically comprises the following steps: determining a character image according to a character positioning result, and median filtering the character image before character segmentation to weaken noise; intercepting an image area with a certain range from the left side of a character image, wherein a first character is contained in the image area, binarizing the area, denoising through subsequent projection to find the boundary of the character, and dividing the first character; then taking the right boundary of the first character as the left reference, intercepting a region with a certain range to the right and lower side, wherein the second character is contained in the region, binarizing and projecting the region to find the character boundary, dividing the second character, and dividing the characters in the character image in sequence by using the same method; normalizing the separated single characters to obtain characters with uniform sizes; extracting the characteristics, projection statistics characteristics and coarse grid characteristics of the single character, matching the characteristics of the single character with template characteristics in a character library, and identifying the character.
A second aspect of the present invention discloses a wire number recognition device based on an optical character recognition technology, comprising: the image acquisition component is used for shooting the wire to be identified to acquire an image to be identified; a memory for storing program instructions; a processor for invoking program instructions stored in a memory to implement a wire number identification method based on an optical character identification technique as described in any one of the above aspects; and the display component is used for displaying the line number identification result.
The beneficial effects of the invention at least comprise: the invention can accurately identify the wire numbers of wires with different colors and diameters, effectively segment the characters, ensure the accurate positioning of the characters, improve the accuracy and efficiency of line identification, and reduce the workload of manual identification.
Drawings
Fig. 1 shows a flow diagram of a wire number identification method based on optical character identification technology according to one embodiment of the invention.
Fig. 2 shows a flow chart of a wire number identification method based on an optical character identification technique according to a further embodiment of the invention.
Fig. 3 shows a schematic block diagram of a wire number identification device based on optical character recognition technology according to one embodiment of the invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways than as described herein, and therefore the present invention is not limited to the specific embodiments disclosed below.
As shown in fig. 1, the method for identifying the wire number of the wire based on the optical character identification technology disclosed by the invention comprises the following steps: s101, acquiring image data of a wire to be identified as an image to be identified; s102, determining that the image to be identified contains line number information; s103, accurately positioning characters in the image to be recognized; s104, segmenting the character string, and identifying each character based on an optical character identification algorithm; s105, sequentially integrating the character text information obtained by recognition to form complete line number information; s106, determining that the line number information is matched with the standard line number information according to the hash table retrieval method, and outputting the line number information.
According to the above embodiment, preferably, step S106 specifically includes: storing the standard line number information into a hash table; the line number information is retrieved in a hash table.
According to the above embodiment, preferably, further comprising: if the line number information is not matched with the standard line number information, screening data with the character string length larger than that of the line number information from the standard line number information to obtain a fuzzy matching set; in the fuzzy matching set, a head-tail character string matching method is adopted, the head-tail character string is intercepted for a certain length, the head character string and the tail character string of the line number information are matched to the same set element, and then the line number information is determined to be matched.
According to the above embodiment, preferably, further comprising: if the matching cannot be completed in the fuzzy matching set, the LD algorithm is adopted to identify the line information.
According to the above embodiment, preferably, further comprising: and if the image to be identified does not contain the line number information, the image acquisition is carried out on the wire to be identified again.
According to the above embodiment, preferably, step S102 specifically includes: acquiring a thumbnail of an image to be identified; gray processing is carried out on each pixel of the thumbnail; calculating the gray average value of the thumbnail; comparing the gray value of each pixel of the thumbnail with the gray average value, and marking as 1 if the gray value is larger than or equal to the gray average value and marking as 0 if the gray value is smaller than the gray average value, so as to obtain fingerprint data of the image to be identified; acquiring fingerprint data of the wireless number image by using the same method; and determining that the image to be identified contains line number information according to a comparison result of the fingerprint data of the image to be identified and the fingerprint data of the wireless number image.
According to the above embodiment, preferably, step S103 specifically includes: performing image enhancement, denoising and graying treatment on the image to be identified to obtain an image to be positioned; the resolution of the locator template image is reduced, the pixels in the circles with the radius r and the center of the image are taken from the lower resolution locator template image, H pixels are arranged in total, H pixels are formed into an H-dimensional column vector according to a column-by-column connection method, the first column of an array b is put into the template with the step length delta theta, the rotated H pixels form a second column of b, the second column is sequentially rotated until 360 degrees are passed, an array b with the size of H× (2 pi/delta theta) is finally generated, the resolution of the image to be positioned is reduced, the pixels in the circles with the radius r are taken from top to bottom and from left to right in the bottle cap area, an H-dimensional vector a is generated by the same method at points (x, y) on the lower resolution image to be positioned, the vector a is related with the array b column by column, the correlation coefficient and the position information at the moment are recorded, a new a is generated, the steps of calculating the correlation coefficient are repeated until all pixel points in the image range are searched, and the positions of the correlation coefficient are ranked to be the largest, namely the position of the correlation coefficient; intercepting an image of a region where the locator is located, wherein the image size is 56 multiplied by 56, firstly carrying out binarization processing on the locator image by using an OTSU method, counting the number of black pixels in the locator binarization image at the moment, when the number of the binarized black pixels is within the range of 200 and 900, the binarization effect of the locator is best, if the number of the black pixels is not within the range of 200 and 900, carrying out binarization on the locator image again, counting the number of black pixels on the locator binarization image, so as to carry out expansion or corrosion processing on the locator image, when the number of the black pixels is greater than 580, carrying out expansion processing on the locator image, when the number of the black pixels is less than 500, adopting a horizontal projection method and a vertical projection method to find the boundary of the locator to remove redundant noise points, and adopting a Gauss-Laplace operator to carry out edge detection on the locator image; processing the locator edge detection image by contour tracking based on the 8 connected region, wherein the character image is arranged behind the locator; and intercepting the character image to finish character positioning.
According to the above embodiment, preferably, step S104 specifically includes: determining a character image according to a character positioning result, and median filtering the character image before character segmentation to weaken noise; intercepting an image area with a certain range from the left side of a character image, wherein a first character is contained in the image area, binarizing the area, denoising through subsequent projection to find the boundary of the character, and dividing the first character; then taking the right boundary of the first character as the left reference, intercepting a region with a certain range to the right and lower side, wherein the second character is contained in the region, binarizing and projecting the region to find the character boundary, dividing the second character, and dividing the characters in the character image in sequence by using the same method; normalizing the separated single characters to obtain characters with uniform sizes; extracting the characteristics, projection statistics characteristics and coarse grid characteristics of the single character, matching the characteristics of the single character with template characteristics in a character library, and identifying the character.
As shown in fig. 2, another embodiment of the present invention discloses a specific implementation of a wire number identification method based on an optical character identification technology, which includes steps of image acquisition, wire number confirmation, image processing, data comparison, wire number data output, and the like, and the specific implementation process is as follows:
step 1, image acquisition
The camera or other image acquisition equipment is used for shooting or scanning the wire number, the wire number image is obtained, the resolution is 640 multiplied by 480, and different cameras can select proper resolution.
Step 2, whether the image acquisition contains a wire number
The acquired image may or may not have a wire number, fingerprint comparison is required to be performed on the acquired image in order to improve the recognition speed of the wire number, the acquired image of the wireless wire number is taken as a comparison image, and as long as the number of points of the acquired image, which are different from the fingerprint value of the comparison image, exceeds 5, the existence of the wire number is indicated, and the next image preprocessing can be performed to perform OCR recognition.
Step 2.1 downsizing
And acquiring a thumbnail of the acquired image by using an image method, namely a GetThumbinailimage method, and reducing the image to a size of 8 x 8, wherein the total number of the images is 64 pixels. The method has the effects of removing details of the image, retaining basic information such as structure, brightness and the like, and reducing picture differences caused by different sizes and proportions.
Step 2.2 graying of the image
Each pixel of the thumbnail is progress-gray-scale processed.
Step 2.3 calculating the gray average value
And summing the gray values of each pixel of the thumbnail, dividing the sum by the number of the pixels to obtain a gray average value.
Step 2.4 comparing the gray level of the pixels
The gray scale of each pixel is compared with the gray scale average value. Greater than or equal to the average, 1; less than the average, recorded as 0.
Step 2.5 calculating a fingerprint of the picture
The results of the previous comparison are combined together to form a 64-bit character, i.e., the fingerprint of the image. After the fingerprint is obtained, different pictures can be compared, if the values of the corresponding positions are not more than 5 different data, the two pictures are similar, and if the values are more than 10 different data, the two pictures are different.
Step 3, image preprocessing
Preprocessing the collected images with the wire numbers, including image enhancement, denoising, graying and other operations, so as to improve the accuracy of the subsequent character recognition. In the preprocessed image, each character area is accurately segmented by a character positioning algorithm, so that the OCR algorithm can identify each character independently.
Step 3.1 coarse positioning
The method comprises the steps of reducing the resolution of a locator template image, taking pixels in a circle with the center of the image and the radius r on the locator template image with low resolution, setting H pixels in total, forming an H-dimensional column vector by H pixels according to a column-by-column connection method, putting the H pixels into a first column of an array b, rotating the template by a step length delta theta, forming a second column of b by the rotated H pixels, sequentially rotating until 360 degrees are passed, finally generating an array b with the size of H× (2 pi/delta theta), reducing the resolution of an original wire image, searching from top to bottom in a bottle cap area from left to right, taking pixels in the circle with the radius r at points (x, y) on the wire image with low resolution, generating an H-dimensional vector a by the same method, recording the correlation coefficient and the position information at the moment, moving to the next position, generating a new a, repeating the steps of calculating the correlation coefficient until all the pixel points in the wire image range are searched, and the position of the correlation coefficient is the largest position identifier in the sequence.
Step 3.2 fine positioning
Intercepting an image of a region where the locator is located, which is obtained in the step 3.1, wherein the image size is 56 multiplied by 56, firstly carrying out binarization processing on the locator image by using an OTSU method, counting the number of black pixels in the locator binarized image at the moment, when the number of the binarized black pixels is within the range of [200,900], the binarization effect of the locator 'A' is best, if the number of the black pixels is not within the range, carrying out binarization on the locator image again, counting the number of black pixels on the locator binarized image, so as to carry out expansion or corrosion processing on the locator image, when the number of the black pixels is greater than 580, carrying out expansion processing on the locator image, and when the number of the black pixels is less than 500, adopting a horizontal projection method and a vertical projection method to find the boundary of the locator so as to remove redundant noise points, and adopting a Gauss-Laplace operator to carry out edge detection on the locator image; processing the locator edge detection image by contour tracking based on the 8 connected areas; the character image is just behind the locator, and the character image is intercepted, so that the character locating operation is completed.
Step 4, character segmentation and recognition
Step 4.1 character segmentation
Median filtering is carried out on a character image before character segmentation to weaken noise, a larger-range image area is intercepted from the left side of the character image, a first character is contained in the image area, the area is binarized, the boundary of the character is found through subsequent projection denoising, and the first character is segmented; then taking the right boundary of the first character as the left reference, intercepting a region with a larger range to the right and lower sides, wherein the second character is contained in the region, binarizing and projecting the region to find the character boundary, dividing the second character, and dividing the characters in the character image in sequence by using the same method; the segmented single characters are normalized, and the characters are all uniform in size.
Step 4.2 character recognition
Extracting the characteristics, projection statistics characteristics and coarse grid characteristics of the single character, matching the characteristics of the single character with template characteristics in a character library, and identifying the character. The character library includes, but is not limited to, a number template feature of 0 to 9, 26 uppercase english letter templates, 26 lowercase english letters, special symbols such as =, +, -, #, and #.
Step 4.3 line number integration
And sequentially integrating the character text information obtained by recognition to form complete wire number information.
Step 5, line number matching
The OCR recognized wire number may have few characters, characters or letter errors, and a completely correct wire number is required in a factory actual working environment.
Step 5.1 Hash Table retrieval
And storing the original wire number data into a hash table (hash table), searching the identified wire number in the hash table, and outputting the wire number if a key is found, which indicates that the wire number is completely identified.
Storing the original line number data into a hash table:
Hashtable ht=new Hashtable();
ht.add(“L24-X:2:2”, ” L24-X:2:2”); //ht.add(key,value)
ht.add(“L24-X:1:1”, ” L24-X:1:1”);
ht.add(“L24-X:4:2”, ” L24-X:4:2”);
look-up key in hash table
string key=” L24-X:2:2”;
If(ht.ContainsKey(key))
{
Find line number;// perfect match
}
Step 5.2 Length matching method
And if the length matching method is not found in the hash table, firstly screening keys with the ratio equal to or greater than the character length of the wire number from the hash table, reducing the search range, improving the recognition efficiency and the accuracy of the wire number, traversing the hash table, and storing the length equal to or greater than the recognition wire number into a set.
Step 5.3 line number head-tail character matching method
In the set, the head-tail character string can be intercepted for a certain length by adopting a head-tail character string matching method, and if the head character string and the tail character string are matched to the same set element, the explanation line number is matched.
Step 5.4 string similarity Algorithm (Levenshtein Distance)
In the above method, the LD algorithm is adopted if the wire number is not correctly matched.
For example: original wire number sourcestr= "L24-X: 2:2", identified wire number resultstr= "L24-X:22"
LD (sourceStr, resultStr) =0, no conversion, 100% recognition
LD (sourceStr, resultStr) =1, with conversion, 1 character difference
If the effective line number data for image acquisition is not found by the method, the image is acquired again.
As shown in fig. 3, a device for identifying a wire number of a wire based on an optical character recognition technology is also disclosed according to another embodiment of the present invention, including: the image acquisition component 301 is used for shooting a wire to be identified to acquire an image to be identified; a memory 302 for storing program instructions; a processor 303, configured to invoke program instructions stored in the memory to implement the method for identifying a wire number of a wire based on the optical character recognition technique according to any of the above embodiments, and a display component 304, configured to display a result of the wire number identification.
All or part of the steps in the various methods of the above embodiments may be performed by controlling related hardware by a program, which may be stored in a readable storage medium including Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), erasable programmable Read-Only Memory (ErasableProgrammable Read Only Memory, EPROM), one-time programmable Read-Only Memory (One-timeProgrammable Read-Only Memory, OTPROM), electrically erasable rewritable Read-Only Memory (EEPROM), compact disc Read-Only Memory (CD-ROM) or other optical disk Memory, magnetic disk Memory, tape Memory, or any other medium capable of being used for carrying or storing data.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. The method for identifying the wire number of the wire based on the optical character identification technology is characterized by comprising the following steps of:
acquiring image data of a wire to be identified as an image to be identified;
determining that the image to be identified contains line number information;
accurately positioning the characters in the image to be recognized;
dividing the character string, and identifying each character based on an optical character identification algorithm;
sequentially integrating the character text information obtained by recognition to form complete line number information;
the line number information is determined to be matched with the standard line number information according to a hash table retrieval method, and then the line number information is output;
if the line number information is not matched with the standard line number information, screening data with the character string length larger than that of the line number information from the standard line number information to obtain a fuzzy matching set;
in the fuzzy matching set, a head-tail character string matching method is adopted, the head-tail character string is intercepted for a certain length, and when the head character string and the tail character string of the line number information are matched to the same set element, the line number information is determined to be matched;
the step of determining that the image to be identified contains line number information specifically comprises the following steps:
acquiring a thumbnail of the image to be identified;
gray processing is carried out on each pixel of the thumbnail;
calculating the gray average value of the thumbnail;
comparing the gray value of each pixel of the thumbnail with the gray average value, and marking as 1 if the gray value is larger than or equal to the gray average value and 0 if the gray value is smaller than the gray average value, so as to obtain fingerprint data of the image to be identified;
acquiring fingerprint data of the wireless number image by using the same method;
and determining that the image to be identified contains line number information according to a comparison result of the fingerprint data of the image to be identified and the fingerprint data of the wireless number image.
2. The method for identifying a wire number based on an optical character recognition technique according to claim 1, wherein the step of hash table search specifically comprises:
storing the standard line number information into a hash table;
the line number information is retrieved in the hash table.
3. The method for identifying a wire number based on an optical character recognition technique according to claim 1, further comprising:
and if the matching cannot be completed in the fuzzy matching set, adopting an LD algorithm to identify the line number information.
4. The method for identifying a wire number based on an optical character recognition technique according to claim 1, further comprising:
and if the image to be identified does not contain line number information, carrying out image acquisition again on the wire to be identified.
5. The method for identifying a wire number based on an optical character recognition technology according to claim 1, wherein the step of precisely positioning the character in the image to be identified specifically comprises:
performing image enhancement, denoising and graying treatment on the image to be identified to obtain an image to be positioned;
the resolution of the locator template image is reduced, the pixels in the circle with the center of the image as the center and the radius r are taken from the locator template image with low resolution,
providing H pixels in total, forming an H-dimensional column vector by the H pixels according to a column-by-column connection method, placing the H pixels into a first column of an array b, rotating a template by a step length delta theta, forming a second column of the array b by the H pixels after rotation, sequentially rotating until 360 degrees are reached, finally generating an array b with H× (2 pi/delta theta) size,
the resolution of the image to be positioned is reduced, searching is performed from top to bottom and from left to right in the bottle cap area, pixels in a circle with the radius r are taken at points (x, y) on the image to be positioned with low resolution, an H-dimensional vector a is generated by the same method, the vector a is related with an array b row by row, the related coefficient and the position information at the moment are recorded, the image is moved to the next position to generate a new a, the step of calculating the related coefficient is repeated until all pixel points in the image range are searched, the related coefficients at all positions are ordered, and the position where the maximum related coefficient appears is the position of the locator;
intercepting an image of a region where the locator is located, wherein the image size is 56 multiplied by 56, firstly carrying out binarization processing on the locator image by using an OTSU method, counting the number of black pixels in the locator binarization image at the moment, when the number of the binarized black pixels is within the range of 200 and 900, the binarization effect of the locator is best, if the number of the black pixels is not within the range of 200 and 900, carrying out binarization on the locator image again, counting the number of black pixels on the locator binarization image, so as to carry out expansion or corrosion processing on the locator image, when the number of the black pixels is greater than 580, carrying out expansion processing on the locator image, when the number of the black pixels is less than 500, adopting a horizontal projection method and a vertical projection method to find the boundary of the locator to remove redundant noise points, and adopting a Gauss-Laplace operator to carry out edge detection on the locator image; processing the locator edge detection image by contour tracking based on the 8 connected region, wherein the character image is arranged behind the locator; and intercepting the character image to finish character positioning.
6. The method for recognizing a wire number based on an optical character recognition technology according to claim 1, wherein the step of dividing the character string and recognizing each character based on an optical character recognition algorithm comprises the steps of:
determining a character image according to a character positioning result, and median filtering the character image before character segmentation to weaken noise;
intercepting an image area with a certain range from the left side of a character image, wherein a first character is contained in the image area, binarizing the area, denoising through subsequent projection to find the boundary of the character, and dividing the first character; then taking the right boundary of the first character as the left reference, intercepting a region with a certain range to the right and lower side, wherein the second character is contained in the region, binarizing and projecting the region to find the character boundary, dividing the second character, and dividing the characters in the character image in sequence by using the same method; normalizing the separated single characters to obtain characters with uniform sizes;
extracting the characteristics, projection statistics characteristics and coarse grid characteristics of the single character, matching the characteristics of the single character with template characteristics in a character library, and identifying the character.
7. A wire number recognition device based on an optical character recognition technology, comprising:
the image acquisition component is used for shooting the wire to be identified to acquire an image to be identified;
a memory for storing program instructions;
a processor for invoking the program instructions stored in the memory to implement the optical character recognition technique-based wire number recognition method of any one of claims 1-5;
and the display component is used for displaying the line number identification result.
CN202311302674.2A 2023-10-10 2023-10-10 Wire number recognition method and device based on optical character recognition technology Active CN117037185B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311302674.2A CN117037185B (en) 2023-10-10 2023-10-10 Wire number recognition method and device based on optical character recognition technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311302674.2A CN117037185B (en) 2023-10-10 2023-10-10 Wire number recognition method and device based on optical character recognition technology

Publications (2)

Publication Number Publication Date
CN117037185A CN117037185A (en) 2023-11-10
CN117037185B true CN117037185B (en) 2024-01-12

Family

ID=88628566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311302674.2A Active CN117037185B (en) 2023-10-10 2023-10-10 Wire number recognition method and device based on optical character recognition technology

Country Status (1)

Country Link
CN (1) CN117037185B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117710985B (en) * 2023-12-18 2024-08-06 珠海凌烟阁芯片科技有限公司 Optical character recognition method and device and intelligent terminal

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102426649A (en) * 2011-10-13 2012-04-25 石家庄开发区冀科双实科技有限公司 Simple high-accuracy steel seal digital automatic identification method
CN102945368A (en) * 2012-10-17 2013-02-27 西安理工大学 Method for positioning and identifying laser character of beer bottle cap
CN104268512A (en) * 2014-09-17 2015-01-07 清华大学 Method and device for recognizing characters in image on basis of optical character recognition
CN104820827A (en) * 2015-04-28 2015-08-05 电子科技大学 Method for recognizing punctiform characters on surfaces of cables
CN110414524A (en) * 2019-07-29 2019-11-05 北京航空航天大学 A kind of character identification result reasoning error correction method of aviation cable coding
CN114550153A (en) * 2022-02-08 2022-05-27 国网河北省电力有限公司超高压分公司 Terminal block image detection and identification method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447437B (en) * 2015-02-13 2017-05-03 比亚迪股份有限公司 fingerprint identification method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102426649A (en) * 2011-10-13 2012-04-25 石家庄开发区冀科双实科技有限公司 Simple high-accuracy steel seal digital automatic identification method
CN102945368A (en) * 2012-10-17 2013-02-27 西安理工大学 Method for positioning and identifying laser character of beer bottle cap
CN104268512A (en) * 2014-09-17 2015-01-07 清华大学 Method and device for recognizing characters in image on basis of optical character recognition
CN104820827A (en) * 2015-04-28 2015-08-05 电子科技大学 Method for recognizing punctiform characters on surfaces of cables
CN110414524A (en) * 2019-07-29 2019-11-05 北京航空航天大学 A kind of character identification result reasoning error correction method of aviation cable coding
CN114550153A (en) * 2022-02-08 2022-05-27 国网河北省电力有限公司超高压分公司 Terminal block image detection and identification method

Also Published As

Publication number Publication date
CN117037185A (en) 2023-11-10

Similar Documents

Publication Publication Date Title
US5410611A (en) Method for identifying word bounding boxes in text
US5539841A (en) Method for comparing image sections to determine similarity therebetween
US4817171A (en) Pattern recognition system
EP0335696A2 (en) Pattern recognition apparatus
US5915039A (en) Method and means for extracting fixed-pitch characters on noisy images with complex background prior to character recognition
Shivakumara et al. An efficient edge based technique for text detection in video frames
CN117037185B (en) Wire number recognition method and device based on optical character recognition technology
US20130129216A1 (en) Text Detection Using Multi-Layer Connected Components With Histograms
JPH0772905B2 (en) How to recognize a symbol string
CN112149548B (en) CAD drawing intelligent input and identification method and device suitable for terminal row
Chidiac et al. A robust algorithm for text extraction from images
CN116524725B (en) Intelligent driving traffic sign image data identification system
CN116503848B (en) Intelligent license plate recognition method, device, equipment and storage medium
Karanje et al. Survey on text detection, segmentation and recognition from a natural scene images
CN110569831B (en) Feature matching method and system for power equipment nameplate
CN114549624B (en) Label identification method and device, electronic equipment, storage medium and label
CN110188751A (en) A kind of M310 nuclear power unit equipment label position image-recognizing method
CN114627463A (en) Non-contact power distribution data identification method based on machine identification
US20030123730A1 (en) Document recognition system and method using vertical line adjacency graphs
CN109409370B (en) Remote desktop character recognition method and device
JPH08212303A (en) Character discrimination device
JP2002245404A (en) Program and device for segmenting area
CN112163581B (en) License plate letter recognition method, system, device and storage medium
KR101437286B1 (en) Method and apparatus for identifying digital contents
CN118193652B (en) Asset type identification method for asset recovery management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant