CN110728280A - Travel license information extraction method based on color difference - Google Patents

Travel license information extraction method based on color difference Download PDF

Info

Publication number
CN110728280A
CN110728280A CN201910949386.3A CN201910949386A CN110728280A CN 110728280 A CN110728280 A CN 110728280A CN 201910949386 A CN201910949386 A CN 201910949386A CN 110728280 A CN110728280 A CN 110728280A
Authority
CN
China
Prior art keywords
image
difference
region
mask
license 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.)
Pending
Application number
CN201910949386.3A
Other languages
Chinese (zh)
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.)
Qingdao Contel Network Technology Co Ltd
Original Assignee
Qingdao Contel Network 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 Qingdao Contel Network Technology Co Ltd filed Critical Qingdao Contel Network Technology Co Ltd
Priority to CN201910949386.3A priority Critical patent/CN110728280A/en
Publication of CN110728280A publication Critical patent/CN110728280A/en
Pending legal-status Critical Current

Links

Images

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/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Character Input (AREA)

Abstract

The invention belongs to the technical field of image processing, and discloses a driving license information extraction method based on color difference, which comprises the following steps: s1, obtaining a difference image by solving the difference value of the G channel and the B channel of the input image in the RGB format; s2, performing morphological expansion operation on the difference image to fill the holes and noise points of the image; s3, determining a threshold value by utilizing the Otsu method, and then carrying out binarization operation on the image obtained in the step S2 to obtain a binary image of the character area; s4, searching for connected regions in the character region, counting the area of each connected region, and then removing a part of regions with smaller areas; and S5, extracting characters to obtain the driving license information. The invention has high running speed and high positioning precision, and can be widely applied to the traffic field.

Description

Travel license information extraction method based on color difference
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to a driving license information extraction method based on color difference.
Background
In recent years, with the development of information automation, a technology for automatically extracting and identifying information has attracted more and more attention, and the automatic identification of characters in a driving license is an example of practical application. The picture is used as an important information carrier, and the text information in the image is important content for understanding the whole image. Image content can be divided into two aspects: perceptual content and semantic content. The perception content comprises a plurality of attributes such as color, intensity, shape, texture and space-time variation of the color, the intensity, the shape and the texture; semantic content refers to objects, things, and their relationships. The research and application of low-level perception content in a series of images are reported, and semantic content (such as texts, human faces, vehicles, gestures and the like) in the images also attracts wide attention. Where text information attracts particular interest because: 1) the text is very useful for the image content of the bidding document; 2) the text is easier to extract relative to other semantic contents; 3) the text extraction has important application in aspects of image indexing, automatic recording, safety monitoring and the like based on key words; 4) the optical character recognition software is more mature.
The current image text recognition method can be summarized into the following four methods:
1) a text detection method based on edges. For the image which only has one line of characters and the direction of the character arrangement is horizontal or vertical, the characters are divided and distinguished by projecting in the horizontal or vertical direction and then utilizing the gaps among the characters and the projection of the characters. This method is simple and quick, but only applicable to simple situations.
2) A text detection method based on texture. And judging whether a pixel point or a pixel area belongs to characters or not by utilizing the judging texture characteristics. The method can better detect the characters in the complex background, but the algorithm has the defects of inaccurate positioning and higher algorithm complexity.
3) A text detection method based on regions. This method tries to detect the character as a single color region that satisfies a particular heuristic. The method has high processing speed and accurate positioning, but is only suitable for binary images and has limitation.
4) A learning-based text detection method. The method introduces a learning mechanism, firstly learns the network for detection through the selected samples, and then detects the characters by using the trained network prediction. On one hand, the method needs a large number of samples to train the network; on the other hand, the similarity between the training sample and the test sample affects the final recognition effect.
In summary, the current algorithm only utilizes partial information of the image, and fails to fully utilize the information of the image. Our driving license is written with black text on a green background. By using the difference of the background and the characters, the text content of the driving license can be effectively extracted.
Disclosure of Invention
In order to meet the actual requirements in the traffic field, the invention overcomes the defects in the prior art, and the technical problem to be solved is to provide a driving license information extraction method based on color difference so as to realize automatic extraction of text information on a driving license image and positioning of each character.
In order to solve the technical problems, the invention adopts the technical scheme that: a driving license information extraction method based on color difference comprises the following steps:
s1, obtaining a difference value image by solving a difference value of a G channel and a B channel of an input image in an RGB format, wherein the G channel represents a green channel, the B channel represents a blue channel, the size of the input image is H multiplied by W, H is the height of the image, W represents the width of the image, and mask (i, j) represents the difference value image;
s2, performing morphological expansion operation on the difference image to fill the holes and noise points of the image;
s3, determining a threshold value by utilizing the Otsu method, and then carrying out binarization operation on the image obtained in the step S2 to obtain a binary image of the character area;
s4, searching for connected regions in the character region, counting the area of each connected region, and then removing a part of regions with smaller areas, thereby eliminating the influence of noise regions;
and S5, extracting characters from the region obtained in the step S5 by a vertical projection method to obtain the driving license information.
In step S1, the calculation formula for obtaining the difference image by calculating the difference value between the G and B channels of the input image in RGB format is:
mask(i,j)=|G(i,j)-B(i,j)|,1≤i≤H,1≤j≤W;
wherein, (i, j) represents the pixel point coordinate of the image, G (i, j) represents the green channel value of the pixel point with the coordinate (i, j) on the image, and B (i, j) represents the blue channel value of the pixel point with the coordinate (i, j) on the image.
In step S2, the calculation formula for performing morphological dilation operation on the difference image is:
mask′(i,j)=Dilation(mask(i,j)),1≤i≤H,1≤j≤W;
wherein mask (i, j) represents a difference image; the scale represents the Dilation function, and the mask' (i, j) represents the image after the morphological Dilation operation.
In step S3, the calculation formula of the binarization operation is:
where mask "(i, j) represents a binary image, K represents a threshold, and mask' (i, j) represents an image after a morphological dilation operation.
In step S4, the specific method of removing the region with a small partial area is as follows: and finding the region with the largest area in each connected region, setting a threshold value according to the region with the largest area, and then removing the connected regions with the areas smaller than the threshold value.
In step S4, the threshold value is 10% of the area of the region having the largest area.
Compared with the prior art, the invention has the following beneficial effects: the invention obtains the difference value of the channels G and B of the image in RGB format, then fills the holes and the noise points by using morphological expansion, then obtains a binary image by using a threshold value, thereby obtaining the area of each character, and finally obtains a small area so as to remove the noise area. The method is used for extracting the driving license information, so that the running speed of the invention is high, and the character segmentation can be carried out in real time; the character area positioning precision of the invention is high, and the error rate of the character area is low.
Drawings
Fig. 1 is a schematic step diagram of a method for extracting license information based on color difference according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to specific embodiments and accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention; all other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a driving license information extraction method based on color difference, which comprises the following steps:
s1, obtaining a difference value image by solving the difference value of the G channel and the B channel of the input image in the RGB format, wherein the G channel represents a green channel, the B channel represents a blue channel, the size of the input image is H multiplied by W, H is the height of the image, W represents the width of the image, and mask (i, j) represents the difference value image.
In step S1, the calculation formula for obtaining the difference image by calculating the difference value between the G and B channels of the input image in RGB format is:
mask(i,j)=|G(i,j)-B(i,j)|,1≤i≤H,1≤j≤W; (1)
wherein, (i, j) represents the pixel point coordinate of the image, G (i, j) represents the green channel value of the pixel point with the coordinate (i, j) on the image, and B (i, j) represents the blue channel value of the pixel point with the coordinate (i, j) on the image.
And S2, performing morphological expansion operation on the difference image to fill in holes and noise points of the image.
In step S2, the calculation formula for performing morphological dilation operation on the difference image is:
mask′(i,j)=Dilation(mask(i,j)),1≤i≤H,1≤j≤W; (2)
wherein mask (i, j) represents a difference image; the scale represents the Dilation function, and the mask' (i, j) represents the image after the morphological Dilation operation.
And S3, determining a threshold value by utilizing the Otsu method, and then performing binarization operation on the image obtained in the step S2 to obtain a binary image of the character area.
In step S3, the tsu method is a conventional method in the field of image processing, and therefore is not described herein, and the calculation formula of the binarization operation is:
Figure BDA0002225091790000041
where mask "(i, j) represents a binary image, K represents a threshold, and mask' (i, j) represents an image after a morphological dilation operation.
S4, searching the connected regions in the character region, counting the area of each connected region, then finding the region with the largest area, and removing the region with the area less than 10% of the largest region, thereby eliminating the influence of the noise region. Wherein, the calculation formula of the area with the area less than 10% of the maximum area is:
mask″′=Remove(mask″); (4)
wherein Remove represents the removal function, and mask' ″ represents the image after the removal of the small region.
The searching method of the connected region of the image can be carried out by adopting the conventional technology in the field, and the errors caused by the noise region in the image to the subsequent character extraction can be removed by removing the smaller area of the region, so that the error rate is reduced.
And S5, extracting characters from the region obtained in the step S5 by a vertical projection method to obtain the driving license information.
According to the method, the difference value of the channels G and B of the image in the RGB format is firstly solved, then the morphological expansion is utilized to fill the cavity and the noise point, then the threshold value is utilized to solve the binary image, so that the region where each character is located is obtained, and finally the small-area region is removed so that the noise region is removed, so that the method is high in operation speed, capable of performing character segmentation in real time and high in character region positioning accuracy; the error rate of misinterpreting character regions is low.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (6)

1. A driving license information extraction method based on color difference is characterized by comprising the following steps:
s1, obtaining a difference value image by solving a difference value of a G channel and a B channel of an input image in an RGB format, wherein the G channel represents a green channel, the B channel represents a blue channel, the size of the input image is H multiplied by W, H is the height of the image, and W represents the width of the image;
s2, performing morphological expansion operation on the difference image to fill the holes and noise points of the image;
s3, determining a threshold value by utilizing the Otsu method, and then carrying out binarization operation on the image obtained in the step S2 to obtain a binary image of the character area;
s4, searching for connected regions in the character region, counting the area of each connected region, and then removing a part of regions with smaller areas, thereby eliminating the influence of noise regions;
and S5, extracting characters from the region obtained in the step S5 by a vertical projection method to obtain the driving license information.
2. The method for extracting driver license information based on color difference as claimed in claim 1, wherein in step S1, the calculation formula of the difference value image obtained by the difference value of the G and B channels of the input image in RGB format is:
mask(i,j)=|G(i,j)-B(i,j)|,1≤i≤H,1≤j≤W;
wherein, (i, j) represents the pixel coordinates of the image, G (i, j) represents the green channel value of the pixel with the coordinate (i, j) on the image, B (i, j) represents the blue channel value of the pixel with the coordinate (i, j) on the image, and mask (i, j) represents the difference image.
3. The method for extracting license information based on color difference as claimed in claim 1, wherein in step S2, the calculation formula for morphological dilation operation on difference image is:
mask′(i,j)=Dilation(mask(i,j)),1≤i≤H,1≤j≤W;
wherein mask (i, j) represents a difference image; the scale represents the Dilation function, and the mask' (i, j) represents the image after the morphological Dilation operation.
4. The method for extracting license information based on color difference as claimed in claim 1, wherein in step S3, the calculation formula of the binarization operation is:
where mask "(i, j) represents a binary image, K represents a threshold, and mask' (i, j) represents an image after a morphological dilation operation.
5. The method for extracting license information based on color difference as claimed in claim 1, wherein the specific method of removing the region with smaller partial area in step S4 is as follows:
and finding the region with the largest area in each connected region, setting a threshold value according to the region with the largest area, and then removing the connected regions with the areas smaller than the threshold value.
6. The method for extracting license information based on color difference according to claim 1, wherein in step S4, the threshold value is 10% of the area of the region with the largest area.
CN201910949386.3A 2019-10-08 2019-10-08 Travel license information extraction method based on color difference Pending CN110728280A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910949386.3A CN110728280A (en) 2019-10-08 2019-10-08 Travel license information extraction method based on color difference

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910949386.3A CN110728280A (en) 2019-10-08 2019-10-08 Travel license information extraction method based on color difference

Publications (1)

Publication Number Publication Date
CN110728280A true CN110728280A (en) 2020-01-24

Family

ID=69220807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910949386.3A Pending CN110728280A (en) 2019-10-08 2019-10-08 Travel license information extraction method based on color difference

Country Status (1)

Country Link
CN (1) CN110728280A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002017220A1 (en) * 2000-08-22 2002-02-28 Akira Kurematsu Method for extracting character area in image
CN101334836A (en) * 2008-07-30 2008-12-31 电子科技大学 License plate positioning method incorporating color, size and texture characteristic
CN102163284A (en) * 2011-04-11 2011-08-24 西安电子科技大学 Chinese environment-oriented complex scene text positioning method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002017220A1 (en) * 2000-08-22 2002-02-28 Akira Kurematsu Method for extracting character area in image
CN101334836A (en) * 2008-07-30 2008-12-31 电子科技大学 License plate positioning method incorporating color, size and texture characteristic
CN102163284A (en) * 2011-04-11 2011-08-24 西安电子科技大学 Chinese environment-oriented complex scene text positioning method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邢涛: "面向移动终端的车牌识别关键技术研究", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》 *

Similar Documents

Publication Publication Date Title
CN107133622B (en) Word segmentation method and device
CN107346420B (en) Character detection and positioning method in natural scene based on deep learning
WO2018103608A1 (en) Text detection method, device and storage medium
CN108121991B (en) Deep learning ship target detection method based on edge candidate region extraction
CN113158808B (en) Method, medium and equipment for Chinese ancient book character recognition, paragraph grouping and layout reconstruction
CN101122952A (en) Picture words detecting method
CN104361336A (en) Character recognition method for underwater video images
CN104182750A (en) Extremum connected domain based Chinese character detection method in natural scene image
CN103093228A (en) Chinese detection method in natural scene image based on connected domain
CN101122953A (en) Picture words segmentation method
CN111191611A (en) Deep learning-based traffic sign label identification method
CN113537227B (en) Structured text recognition method and system
CN106980857B (en) Chinese calligraphy segmentation and recognition method based on copybook
CN105303153A (en) Vehicle license plate identification method and apparatus
CN112418216A (en) Method for detecting characters in complex natural scene image
CN110705630A (en) Semi-supervised learning type target detection neural network training method, device and application
CN108764352A (en) Duplicate pages content detection algorithm and device
CN113095267B (en) Data extraction method of statistical chart, electronic device and storage medium
CN104598907A (en) Stroke width figure based method for extracting Chinese character data from image
CN112446259A (en) Image processing method, device, terminal and computer readable storage medium
CN109241975B (en) License plate character segmentation method based on character center point positioning
CN110633635A (en) ROI-based traffic sign board real-time detection method and system
CN107798355B (en) Automatic analysis and judgment method based on document image format
Gui et al. A fast caption detection method for low quality video images
CN105160300B (en) A kind of text abstracting method based on level-set segmentation

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200124

RJ01 Rejection of invention patent application after publication