CN112465731B - Steel seal character image preprocessing method - Google Patents

Steel seal character image preprocessing method Download PDF

Info

Publication number
CN112465731B
CN112465731B CN202011301246.4A CN202011301246A CN112465731B CN 112465731 B CN112465731 B CN 112465731B CN 202011301246 A CN202011301246 A CN 202011301246A CN 112465731 B CN112465731 B CN 112465731B
Authority
CN
China
Prior art keywords
image
value
gray
original
steel seal
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
CN202011301246.4A
Other languages
Chinese (zh)
Other versions
CN112465731A (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.)
Yi Si Si Hangzhou Technology Co ltd
Original Assignee
Isvision Hangzhou Technology 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 Isvision Hangzhou Technology Co Ltd filed Critical Isvision Hangzhou Technology Co Ltd
Priority to CN202011301246.4A priority Critical patent/CN112465731B/en
Publication of CN112465731A publication Critical patent/CN112465731A/en
Application granted granted Critical
Publication of CN112465731B publication Critical patent/CN112465731B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration by the use of histogram techniques
    • 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/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20004Adaptive image processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details

Abstract

The invention discloses a preprocessing method of a steel seal character image, which comprises the steps of firstly carrying out normalization processing on an acquired original gray level image and utilizing a processed image I1Mapping to 0-255 interval to obtain image I2(ii) a By means of I2Calculating K, and then utilizing the K value to perform enhancement processing on each image point (x, y) to obtain a gray value I '(x, y) of each point in the enhanced gray image I'; the method calculates the K value according to the gray level condition of the original image, can directly reflect the contrast condition of the original image, can self-adaptively adjust the enhancement mapping function when performing enhancement processing, and has obvious effect on the enhancement processing of the image; the contrast between the background and the target object is effectively improved.

Description

Steel seal character image preprocessing method
Technical Field
The invention relates to the field of image preprocessing, in particular to a method for preprocessing an image of a steel seal character.
Background
The image preprocessing can effectively improve the quality of an original image, and plays a key role in the accuracy of subsequent foreground segmentation and target identification, and a common image preprocessing method comprises the following steps: image filtering, denoising, enhancing and the like are particularly important for original images with poor contrast, the enhancement processing of the images is particularly important, the existing image enhancement method lacks self-adaptive adjustment of the images, when low-contrast images are processed, the images are easily segmented by mistake, in fact, the low-contrast images widely exist in the industrial detection process, wherein the typical low-contrast images are steel seal character images, steel seal coding characters (such as part codes and automobile VIN codes) are punched/engraved on the metal surface, the colors of the steel seal coding characters are the same as the colors of the metal surface, and only slight differences in gray level are often presented during imaging, namely: the gray level of the character part is lower, and the gray level of the metal surface is higher; the contrast of the two is not obvious; meanwhile, because the surface of the metal workpiece has high light reflection, the workpiece deforms during processing; the characters are easy to generate burr and carving depth differences, which can cause the contrast difference of character images on different workpieces, and at the moment, the quality of low-contrast images cannot be effectively improved by the conventional image preprocessing method.
Disclosure of Invention
Aiming at the problems, the invention urgently needs to provide a preprocessing method suitable for low-contrast images, and the technical scheme adopted by the invention is that the K value is calculated according to the gray level condition of the original image, the K value can directly reflect the contrast condition of the original image, and then the enhancement mapping function can be self-adaptively adjusted when enhancement processing is carried out, so that the enhancement processing effect on the image is obvious; the contrast between the background and the target object is effectively improved.
A preprocessing method for steel seal character images is used for carrying out normalization processing on collected original gray level images to obtain processed gray level images I1Gray value I of each point in1(x,y):
Figure BDA0002786970250000021
Wherein, I (x, y) represents the gray value of each image point (x, y) in the original gray image I; i ismax(x, y) represents a maximum gray value in the original gray image;
using the following formula, I1(x, y) is mapped to the interval of 0-255 to obtain an image I2Gray value I of each point in2(x,y):
I2(x,y)=I1(x,y)α×255
Wherein alpha is a preset value;
and (3) calculating: k is a/B, where a denotes the gray average of the original gray image I and B denotes the image I2The gray level mean value of (1);
and performing the following enhancement processing on each image point (x, y) by using the K value to obtain a gray value I '(x, y) of each point in the enhanced gray image I'):
Figure BDA0002786970250000022
wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0002786970250000023
the grayscale image I "is recorded as the pre-processed image.
In order to improve the efficiency, further, whether the original image needs to be enhanced or not can be judged in advance through a K value;
judging whether the K value is greater than 0.8, if so, directly recording the original gray image as a preprocessed image without enhancement processing; and if not, the original gray level image needs to be enhanced.
Further, local binarization processing is carried out on the preprocessed image.
In order to improve the calculation speed, further, before normalization processing is performed on the acquired original gray level image, the region of interest where the target to be recognized is located is selected according to the prior size of the target to be recognized in a pre-selection mode.
Further, alpha is more than 1 and less than 3.
According to the technical scheme, the K value is calculated according to the gray level condition of the original image, the contrast condition of the original image can be directly reflected, the enhancement mapping function can be adjusted in a self-adaptive mode when enhancement processing is carried out, enhancement in different degrees is carried out according to the self characteristics of the actually acquired original image, specifically, when the K value is close to 1, the contrast ratio of the image background and a target object is good at the moment, the K value is substituted into the enhancement mapping content, and the enhancement processing effect on the image is weak; if the K value is close to 0, the contrast ratio of the image background and the target object is poor, the K value is substituted into the enhancement function, and the enhancement processing effect on the image is obvious; the contrast between the background and the target object is effectively improved.
Drawings
FIG. 1 is an original partial image of a embossed character "A" and a processed image I ";
FIG. 2 is a comparison graph of the effect of the first steel character graph after image preprocessing by using a gamma transformation algorithm, a histogram equalization algorithm and the method of the present invention, and a binarization graph corresponding thereto;
FIG. 3 is a binarized image corresponding to an effect contrast image after image preprocessing is performed on a second steel seal character image by utilizing a gamma conversion algorithm, a histogram equalization algorithm and the method of the present invention, respectively;
FIG. 4 is a binarized image corresponding to an effect contrast image obtained by image preprocessing of a third embossed character image by using a gamma conversion algorithm, a histogram equalization algorithm and the method of the present invention, respectively.
Detailed Description
The technical solution of the present invention will be described in detail with reference to the specific embodiments.
A preprocessing method for steel seal character images is used for normalizing acquired original gray level images to obtain processed gray level images I1Gray value I of each point in1(x,y):
Figure BDA0002786970250000041
Wherein, I (x, y) represents the gray value of each image point (x, y) in the original gray image I; i ismax(x, y) represents a maximum gray value in the original gray image;
using the following formula, I1(x, y) is mapped to the interval of 0-255 to obtain an image I2Gray value I of each point in2(x,y):
I2(x,y)=I1(x,y)α×255
Wherein α is a preset value, α is more than 1 and less than 3, and in this embodiment, α takes a value of 1.7;
and (3) calculating: k is a/B, a represents the mean value of the gray levels of the original gray image I, B represents the image I2The gray level mean value of (1);
and performing the following enhancement processing on each image point (x, y) by using the K value to obtain a gray value I '(x, y) of each point in the enhanced gray image I'):
Figure BDA0002786970250000042
wherein the content of the first and second substances,
Figure BDA0002786970250000043
the grayscale image I "is recorded as the pre-processed image.
In order to improve efficiency, in this embodiment, it is determined in advance whether an original image needs to be enhanced through a K value, specifically:
judging whether the K value is greater than 0.8, if so, directly recording the original gray image as a preprocessed image without enhancement processing; and if not, the original gray level image needs to be enhanced.
In order to be more specific, the method further comprises the step of carrying out local binarization processing on the preprocessed image.
In order to improve the calculation speed, before normalization processing is carried out on the collected original gray level image, the region of interest where the target to be recognized is located is selected according to the prior size of the target to be recognized in a pre-selection mode.
Because the steel seal characters are standard characters, the characters are uniformly distributed in the selected area, and the values around the characters only comprise the gray value (close to 0) of the characters and the gray value (close to 255 after preprocessing) of the background, when the binaryzation operation is carried out, in order to accurately extract the character part, the binaryzation is carried out by comparing the gray average values of pixels and the surrounding area, so that the steel seal characters can be accurately extracted when the characters are thinner; when the size of the surrounding reference window is selected, due to the standard property of the steel seal characters, generally, a selection frame with the size same as that of the prior character is selected, and the region of interest where the character is located is extracted.
In this embodiment, as shown in fig. 1, the upper half (17 × 20) of the steel mark character "a" is cut out as the local original image I of the steel mark character, and the grayscale matrix of the grayscale value I (x, y) of each image point (x, y) is shown in the following table:
51 52 52 53 52 53 51 52 53 54 54 52 53 53 52 52 51
50 50 53 52 52 53 51 53 53 52 50 49 48 48 50 51 49
49 50 51 51 51 51 51 51 51 50 48 47 49 48 48 48 49
53 51 50 49 50 51 50 50 50 50 48 48 48 49 48 48 50
51 50 50 49 47 48 46 42 40 44 46 46 48 47 48 50 51
50 49 48 47 44 42 37 27 24 32 41 44 46 46 48 48 48
50 50 48 46 43 40 34 25 27 26 38 43 43 45 47 46 47
47 47 45 42 41 39 31 32 39 29 36 40 42 43 45 45 49
48 47 44 44 42 40 30 37 41 33 36 41 45 46 48 48 50
51 48 45 45 44 40 33 38 39 40 36 41 44 45 47 48 49
52 47 44 44 42 37 37 40 33 43 38 39 42 44 46 47 46
50 46 44 42 39 36 45 38 28 42 41 36 41 44 45 45 45
45 46 43 39 37 38 49 36 25 38 44 37 39 42 45 45 44
46 46 43 39 36 42 50 33 26 34 49 39 39 42 44 43 45
50 47 43 40 36 44 43 31 28 31 46 42 40 43 46 45 46
48 44 40 35 34 45 39 30 29 30 42 44 37 40 43 43 44
49 42 38 35 36 46 36 31 30 30 38 46 38 40 44 44 46
46 41 36 32 38 46 35 33 30 30 34 47 39 38 40 42 43
44 39 34 31 41 40 35 33 29 30 32 44 40 34 38 40 40
39 36 32 31 42 36 33 32 30 30 28 39 41 33 37 39 41
computing an image I2Gray value of each point I2The grayscale matrix of (x, y) is shown in the following table:
Figure BDA0002786970250000051
Figure BDA0002786970250000061
calculating K to be 0.44; using the K value to perform enhancement processing on each image point (x, y), and obtaining the gray value I "(x, y) of each point in the enhanced gray image I", wherein the gray matrix is shown in the following table:
136 138 138 141 138 141 136 138 141 144 144 138 141 141 138 138 136
134 134 141 138 138 141 136 141 141 138 134 130 128 128 134 136 130
130 134 136 136 136 136 136 136 136 134 128 126 130 128 128 128 130
141 136 134 130 134 136 134 134 134 134 128 128 128 130 128 128 134
136 134 134 130 126 128 123 114 109 119 123 123 128 126 128 134 136
134 130 128 126 119 114 103 82 76 92 112 119 123 123 128 128 128
134 134 128 123 116 109 96 78 82 80 105 116 116 121 126 123 126
126 126 121 114 112 107 90 92 107 86 100 109 114 116 121 121 130
128 126 119 119 114 109 88 103 112 94 100 112 121 123 128 128 134
136 128 121 121 119 109 94 105 107 109 100 112 119 121 126 128 130
138 126 119 119 114 103 103 109 94 116 105 107 114 119 123 126 123
134 123 119 114 107 100 121 105 83 114 112 100 112 119 121 121 121
121 123 116 107 103 105 130 100 78 105 119 103 107 114 121 121 119
123 123 116 107 100 114 134 94 80 96 130 107 107 114 119 116 121
134 126 116 109 100 119 116 90 83 90 123 114 109 116 123 121 123
128 119 109 98 96 121 107 88 86 88 114 119 103 109 116 116 119
130 114 105 98 100 123 100 90 88 88 105 123 105 109 119 119 123
123 112 100 92 105 123 98 94 88 88 96 126 107 105 109 114 116
119 107 96 90 112 109 98 94 86 88 92 119 109 96 105 109 109
107 100 92 90 114 100 94 92 88 88 83 107 112 94 103 107 112
in this embodiment, the existing methods are respectively adopted: the gamma transformation algorithm and the histogram equalization algorithm and the method of the invention carry out image preprocessing on the same original gray level image, and the effect comparison image and the corresponding binarization image thereof are shown in figures 2-4; as can be seen from the figure, for an original steel seal character image with poor contrast between the image background and a target object, a gamma conversion algorithm eliminates a large amount of noise, but character features are also eliminated, so that character disconnection and missing (the second row in the figure) after image binarization is caused, even the whole character is eliminated, and incomplete recognition is caused when subsequent character recognition is performed.
Although the histogram equalization algorithm retains more character features, noise in the image is obviously increased, and in the binarized image, the noise in the image background greatly affects the character part, thereby greatly interfering the character recognition accuracy.
According to the method, the contrast condition of the original image can be directly reflected by calculating the K value, so that the mapping function is adaptively adjusted and enhanced, enhancement in different degrees is carried out according to the self characteristics of the actually acquired original image, and the K value is substituted into the enhancement function to carry out enhancement processing on the image; after the original image is preprocessed, the contrast of the character part of the original image in the background is more obvious, noise can be effectively inhibited from being generated, the enhancement processing of foreground characters is realized, the outline of the processed characters is clear, and the disconnection can not be generated, after the processed image is binarized, the positions of the characters can be obviously judged, the character content can be obviously recognized, and the accuracy of character segmentation and recognition is ensured.

Claims (5)

1. A method for preprocessing a steel seal character image is characterized in thatNormalizing the collected original gray level image to obtain a processed gray level image I1Gray value I of each point in1(x,y):
Figure FDA0002786970240000011
Wherein, I (x, y) represents the gray value of each image point (x, y) in the original gray image I; i ismaxRepresenting a maximum gray value in the original gray image;
using the following formula, I1(x, y) is mapped to the interval of 0-255 to obtain an image I2Gray value I of each point in2(x,y):
I2(x,y)=I1(x,y)α×255
Wherein alpha is a preset value;
and (3) calculating: k is a/B, a represents the mean value of the gray levels of the original gray image I, B represents the image I2The gray level mean value of (1);
and performing the following enhancement processing on each image point (x, y) by using the K value to obtain a gray value I '(x, y) of each point in the enhanced gray image I'):
Figure FDA0002786970240000012
wherein the content of the first and second substances,
Figure FDA0002786970240000013
the grayscale image I "is recorded as the pre-processed image.
2. The method for preprocessing the steel seal character image as claimed in claim 1, characterized in that: whether the original image needs to be enhanced or not is judged in advance through a K value;
judging whether the K value is greater than 0.8, if so, directly recording the original gray level image as a preprocessed image without enhancement processing; and if not, the original gray level image needs to be enhanced.
3. The method for preprocessing the steel seal character image as claimed in claim 1 or 2, characterized in that: and carrying out local binarization processing on the preprocessed image.
4. The method for preprocessing the steel seal character image as claimed in claim 1 or 2, characterized in that: before normalization processing is carried out on the collected original gray level image, the region of interest where the target to be recognized is located is selected according to the prior size of the target to be recognized in a pre-selection mode.
5. The method for preprocessing the steel seal character image as claimed in claim 1 or 2, characterized in that: alpha is more than 1 and less than 3.
CN202011301246.4A 2020-11-19 2020-11-19 Steel seal character image preprocessing method Active CN112465731B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011301246.4A CN112465731B (en) 2020-11-19 2020-11-19 Steel seal character image preprocessing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011301246.4A CN112465731B (en) 2020-11-19 2020-11-19 Steel seal character image preprocessing method

Publications (2)

Publication Number Publication Date
CN112465731A CN112465731A (en) 2021-03-09
CN112465731B true CN112465731B (en) 2022-06-14

Family

ID=74837400

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011301246.4A Active CN112465731B (en) 2020-11-19 2020-11-19 Steel seal character image preprocessing method

Country Status (1)

Country Link
CN (1) CN112465731B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104616019A (en) * 2015-03-04 2015-05-13 国网山东省电力公司泰安供电公司 Identification method for electronic equipment signboard image
CN105181709A (en) * 2015-10-14 2015-12-23 中国计量学院 Combined multiple-light-source on-line detection device and method for appearance defects of brake pad
CN111598819A (en) * 2020-05-14 2020-08-28 易思维(杭州)科技有限公司 Self-adaptive image preprocessing method and application thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105184754B (en) * 2015-09-25 2018-03-06 深圳市华星光电技术有限公司 Method for enhancing picture contrast

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104616019A (en) * 2015-03-04 2015-05-13 国网山东省电力公司泰安供电公司 Identification method for electronic equipment signboard image
CN105181709A (en) * 2015-10-14 2015-12-23 中国计量学院 Combined multiple-light-source on-line detection device and method for appearance defects of brake pad
CN111598819A (en) * 2020-05-14 2020-08-28 易思维(杭州)科技有限公司 Self-adaptive image preprocessing method and application thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
车牌图像预处理研究;董玲娇;《机电工程》;20090620(第06期);全文 *

Also Published As

Publication number Publication date
CN112465731A (en) 2021-03-09

Similar Documents

Publication Publication Date Title
CN110008932B (en) Vehicle violation line-pressing detection method based on computer vision
CN112819772B (en) High-precision rapid pattern detection and recognition method
CN102156996B (en) Image edge detection method
CN107490582B (en) Assembly line workpiece detection system
CN105374015A (en) Binary method for low-quality document image based on local contract and estimation of stroke width
CN112001906B (en) Steel plate weld image detection method combined with non-maximum suppression
CN109886935A (en) A kind of road face foreign matter detecting method based on deep learning
CN115131359B (en) Method for detecting pitting defects on surface of metal workpiece
CN105741272A (en) Method for removing osmotic writing on back surface of document image
CN111738256A (en) Composite material CT image segmentation method based on improved watershed algorithm
CN116993731B (en) Shield tunneling machine tool bit defect detection method based on image
CN110687122A (en) Method and system for detecting surface cracks of ceramic tile
CN110348442B (en) Shipborne radar image offshore oil film identification method based on support vector machine
CN112465731B (en) Steel seal character image preprocessing method
CN108205678B (en) Nameplate character recognition processing method containing bright spot interference
CN113487563A (en) Photovoltaic module subfissure self-adaptive detection method based on EL image
CN116402816B (en) Physical examination CT image data management method and system
CN117058182A (en) Target detection frame optimization method for visual ranging
CN111353324A (en) Method for reading two-dimensional code of dot matrix in glass
CN110288536A (en) A kind of borehole image processing method based on improvement bilateral filtering
CN110889415B (en) Character segmentation method for imprinting serial numbers for surfaces with different reflectivities
CN115272362A (en) Method and device for segmenting effective area of digital pathology full-field image
CN114581901A (en) Method for extracting edges of ancient building wall contaminated inscription character images
CN108961290B (en) Adaptive image edge detection method based on Ratio operator of Otsu
CN105300998A (en) Paper defect detection method based on bit planes

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Room 495, building 3, 1197 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province 310051

Patentee after: Yi Si Si (Hangzhou) Technology Co.,Ltd.

Address before: Room 495, building 3, 1197 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province 310051

Patentee before: ISVISION (HANGZHOU) TECHNOLOGY Co.,Ltd.