CN107704858A - A kind of detection algorithm of license plate sloped angle - Google Patents

A kind of detection algorithm of license plate sloped angle Download PDF

Info

Publication number
CN107704858A
CN107704858A CN201711051233.4A CN201711051233A CN107704858A CN 107704858 A CN107704858 A CN 107704858A CN 201711051233 A CN201711051233 A CN 201711051233A CN 107704858 A CN107704858 A CN 107704858A
Authority
CN
China
Prior art keywords
max
matrix
angle
license plate
edge
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
CN201711051233.4A
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.)
SHANGHAI FOCUS VISION SECURITY TECHNOLOGY Co Ltd
Original Assignee
SHANGHAI FOCUS VISION SECURITY 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 SHANGHAI FOCUS VISION SECURITY TECHNOLOGY Co Ltd filed Critical SHANGHAI FOCUS VISION SECURITY TECHNOLOGY Co Ltd
Priority to CN201711051233.4A priority Critical patent/CN107704858A/en
Publication of CN107704858A publication Critical patent/CN107704858A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/63Scene text, e.g. street names
    • 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/48Extraction of image or video features by mapping characteristic values of the pattern into a parameter space, e.g. Hough transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/625License plates

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a kind of detection algorithm of license plate sloped angle, comprise the following steps:Input original image matrix binaryzation Tb[W, H];Handle to obtain horizontal edge matrix T by edge algorithmse[W, H], if edge, Te[x, y]=1;Otherwise Te[x, y]=0;The vertical coordinate ρ in polar coordinate system θ ρ is sought according to the high H of the wide W of imageMAX, ρMAX 2=W2+H2;Generation conversion ballot matrix T [ρMAX, θMAX], θMAXTake 90 °;By T [ρMAX, θMAX] in all elements set to 0;For horizontal edge matrix TeEach element in [W, H], if Te[x, y]==1, from θMAXTo θMAXCalculate ρ values ρ=y*sin (θ)+x*cos (θ), ballot matrix T [ρ, θ]=T [ρ, θ]+1;It is inclined angle to take the θ in ballot matrix T [ρ, θ] corresponding to ρ element maximums.The present invention improves the accuracy of angle of inclination detection, and detection error lifts calculating speed, be not only applicable to car plate within ± 1 °, can more be used in OCR and daily image editing software.

Description

A kind of detection algorithm of license plate sloped angle
Technical field
The present invention relates to field of license plate recognition, specifically a kind of detection algorithm of license plate sloped angle.
Background technology
License Plate refers to rapidly find out the position where car plate in piece image, typically passes through coarse positioning and fine positioning The method that is combined is realized.One good algorithm of locating license plate of vehicle, it should be respectively provided with necessarily to tilting car plate and non-inclined car plate Robustness.For non-inclined car plate, existing many ripe methods realize fine positioning, and for inclined car plate, due to Existing correlation technique can not be directly used, the fine positioning of car plate can not be realized.The unique method for solving the problem is exactly thick After positioning, inclination car plate is corrected to non-inclined car plate, then carries out fine positioning again.
For common license plate sloped mode because the setting angle difference of video camera is divided into two classes, one kind is horizontal vertical direction Tilt simultaneously as shown in Figure 1.The shear that another kind is vertically oriented tilts, as shown in Figure 2.The Recognition Algorithm of License Plate of main flow at present Usual procedure has:Car plate detection coarse positioning, Slant Rectify, Character segmentation, character recognition etc., its Slant Rectify is to two after it Individual step serves vital effect, and appropriate sloped correcting method can effectively reduce different by shooting angle and make word Deformation caused by symbol, therefore the discrimination of car plate can be significantly improved and reduce false drop rate.But to enter line tilt correction and first have to The detection at angle of inclination is carried out, could be rotated picture to offset the inclination in shooting process according to this angle.In the past Decades in, people have invented many methods to solve the tilt problem of character, wherein most popular surely belong to Hough transform, But its detection accuracy is low, error is larger.
The content of the invention
It is an object of the invention to provide a kind of detection algorithm of license plate sloped angle, to solve to carry in above-mentioned background technology The problem of going out.
To achieve the above object, the present invention provides following technical scheme:
A kind of detection algorithm of license plate sloped angle, comprises the following steps:
1) original image matrix binaryzation T is inputtedb[W, H];
2) handle to obtain horizontal edge matrix T by edge algorithmse[W, H], if edge, Te[x, y]=1;Otherwise Te [x, y]=0;
3) the vertical coordinate ρ in polar coordinate system θ-ρ is sought according to the high H of the wide W of imageMAX, ρMAX 2=W2+H2
4) generation conversion ballot matrix T [ρMAX, θMAX], θMAXTake 90 °;
5) by T [ρMAX, θMAX] in all elements set to 0;
6) for horizontal edge matrix TeEach element in [W, H], if Te[x, y]==1, from-θMAXTo θMAXMeter Calculate ρ values ρ=y*sin (θ)+x*cos (θ), ballot matrix T [ρ, θ]=T [ρ, θ]+1;
7) it is inclined angle to take the θ in ballot matrix T [ρ, θ] corresponding to ρ element maximums.
As the further scheme of the present invention:In step 6), y*sin (θ)+x*cos (θ) makes integer table, and θ's is incremented by 1°。
As the further scheme of the present invention:Corrected when detecting that horizontal tilt angle is θ with shear, specific steps As described below:
A. known image width is W, then the maximum displacement of vertical direction is:offvmax=W*tan (θ);
B. because triangle etc. compares, it is pixel level coordinate to calculate each column vertical shift j:offv=(W-j) * offvmax/ W;
C. shear amount is subtracted by column, obtains the row coordinate after each column is corrected:inew=i-offvj.
Compared with prior art, the beneficial effects of the invention are as follows:
The present invention is based on the theory of Hough transform, and inclination is improved with reference to the method for horizontal rim detection in image The accuracy of angle detection, randomly generates the text images of some rotations, and detection error is within ± 1 °, and in calculating process Floating number can be optimized in advance with look-up table, to lift calculating speed, be more suitable for embedded system.The present invention is that one kind passes through Input picture estimates the angle of inclination in the image level direction in itself, has compared with strongly-adaptive and robustness.It can intert In the calculating context at any required estimation image inclination angle, car plate is not only applicable to, more OCR can be used in and daily image is compiled Collect in software.
Brief description of the drawings
Fig. 1 is common license plate sloped mode:Horizontal vertical direction tilts schematic diagram simultaneously;
Fig. 2 is common license plate sloped mode:The shear of vertical direction tilts schematic diagram;
Fig. 3 is schematic diagram of the Hough transform in straight-line detection.
Fig. 4 is to represent straight line accompanying drawings in a manner of y=ax+b in two-dimensional coordinate system.
Fig. 5 is a, and b regards variable mappings as to another coordinate system a-b schematic diagram.
Fig. 6 is the schematic diagram that Fig. 5 is mapped to by Fig. 4.
Fig. 7 is to be substituted for a-b coordinate systems and polar coordinate system θ-ρ schematic diagrames.
Fig. 8 is the original image containing two orthogonal straight lines.
Fig. 9 is the original image containing two orthogonal straight lines by obtaining horizontal coordinate after Hough transform as θ, vertical Coordinate is ρ schematic diagram.
Figure 10 is inventive algorithm flow chart.
Figure 11 is the schematic diagram after binaryzation in the present invention.
Figure 12 is the schematic diagram after horizontal edge detects in the present invention.
Figure 13 is the schematic diagram after vertical edge detects in the present invention.
Figure 14 is the shear amount schematic diagram that vertical direction each column is calculated in the present invention.
Figure 15 is the shear amount method schematic diagram that vertical direction each column is calculated in the present invention.
Figure 16 is the result schematic diagram after the present invention corrects.
Figure 17 is to do horizontal cutting by inventive algorithm to become to obtain remedial frames schematic diagram.
Embodiment
Below in conjunction with the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, Obviously, described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.Based in the present invention Embodiment, the every other embodiment that those of ordinary skill in the art are obtained under the premise of creative work is not made, all Belong to the scope of protection of the invention.
Hough transform has several purposes, is commonly used in straight-line detection, and its principle is as follows:
It is well known that representing straight line in a manner of y=ax+b in two-dimensional coordinate system, wherein a and b determine as parameter The slope (angle) and intercept of this straight line are determined.
And straight line is made up of infinite multiple points, in this straight line to taking two points (xi, yi), (xj, yj) obvious xi, Yi, xj, yj are constant and meet yi=axi+b, yj=axj+b, (xi, yi) are now regarded as one group of parameter, (xj, yj) regards as Another group, and a, b regards variable as, will be mapped to another coordinate system:
So far, two straight lines on a-b coordinate systems are mapped to by two points on the straight line of x-y coordinate system
B=-xi+yi
B=-xj+yj
It is clear that the coordinate of this two straight-line intersections is the parameter that (a, b) is just the straight line in x-y coordinate system, Straight line y=ax+b is mapped as a point in coordinate system a-b.
Similarly, a-b coordinate systems before are substituted for and polar coordinate system θ-ρ is then represented by:
Xcos θ+ysin θ=ρ
The original image that two orthogonal straight lines are contained on the left side is by obtaining right figure wherein horizontal coordinate after Hough transform θ, vertical coordinate ρ, the point of two extreme values of circle mark are two straight lines of the corresponding left figure of the most point of curve intersection, angle Directly can directly it be read from horizontal coordinate.
During Recognition Algorithm of License Plate, due to having already passed through coarse positioning, selected region often includes car plate The maximum region of area, and the horizontal edge of characters on license plate has obvious directive property so foundation can be used as to detect car plate It is equally effective that angle of inclination and Hough are interrupted straight line to detection.
Embodiment 1
In the embodiment of the present invention, a kind of license plate sloped angle detection algorithm, comprise the following steps:
1) original image matrix binaryzation T is inputtedb[W, H];
2) x ∈ [0, W-1], y ∈ [0, H-1], a kind of edge algorithms are selected to handle to obtain horizontal edge matrix Te[W, H], If edge, Te[x, y]=1;Otherwise Te[x, y]=0.
Wherein x ∈ [0, W-1], y ∈ [0, H-1], put Te[x, y]=0
If Tb[x, y]==1 and Tb[x, y+1]==0 Te[x, y+1]=1
If Tb[x, y]==0 and Tb[x, y+1]==1 Te[x, y+1]=1
3) ρ is asked according to the high H of the wide W of imageMAX, ρMAX 2=W2+H2
4) generation conversion ballot matrix T [ρMAX, θMAX], θMAXIt is desirable 90 °;
5) by T [ρMAX, θMAX] in all elements set to 0;
6) for horizontal edge matrix TeEach element in [W, H], if Te[x, y]==1, from-θMAXTo θMAXMeter Calculate ρ values ρ=y*sin (θ)+x*cos (θ), ballot matrix T [ρ, θ]=T [ρ, θ]+1;(wherein " T [ρ, θ]=T [ρ, θ]+1 " Mean that T [ρ, θ] value adds 1 certainly, "==" represent that logic " being equal to " "=" represents the value on right side to be assigned to the left side)
7) it is inclined angle to take the θ in ballot matrix T [ρ, θ] corresponding to ρ element maximums.
After the present invention realizes, specific implementation process CIMS is simple, as shown in Figure 10.
Y*sin (θ)+x*cos (θ) can make integer table in advance to reduce operand wherein in above-mentioned 6th step, and θ's passs Increase to 1 ° and be enough to ensure that precision.
It is the effect implemented using above-mentioned algorithm below:
Original image is as shown in Figure 1.
Binaryzation result such as Figure 11.
Horizontal edge testing result such as Figure 12.
Vertical edge testing result such as Figure 13.
Horizontal edge and vertical edge are implemented hough become scaling method detect horizontal tilt angle into -14 °, vertically incline Rake angle is that the simplification of 167 ° of consideration algorithms replaces rotation to correct, it is necessary to calculate the shear of vertical direction each column with shear herein Amount such as Figure 14.
Method such as Figure 15.Comprise the following steps that described:
A. known image width is W, then the maximum displacement of vertical direction is:offvmax=W*tan (- 14 °);
B. because triangle etc. compares, it is pixel level coordinate that can calculate each column vertical shift j:offv=(W-j) * offvmax/W;
C. shear amount is subtracted by column, obtains the row coordinate after each column is corrected:inew=i-offvj.
Result such as Figure 16 after correction.
Similarly, it is also necessary to the detection of vertical edge angle is done, due to preceding step detection vertical tilt angle for 167 ° by upper State algorithm and do horizontal shear, finally give remedial frames, such as Figure 17.
It is obvious to a person skilled in the art that the invention is not restricted to the details of above-mentioned one exemplary embodiment, Er Qie In the case of without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter From the point of view of which point, embodiment all should be regarded as exemplary, and be nonrestrictive, the scope of the present invention is by appended power Profit requires rather than described above limits, it is intended that all in the implication and scope of the equivalency of claim by falling Change is included in the present invention.
Moreover, it will be appreciated that although the present specification is described in terms of embodiments, not each embodiment is only wrapped Containing an independent technical scheme, this narrating mode of specification is only that those skilled in the art should for clarity Using specification as an entirety, the technical solutions in the various embodiments may also be suitably combined, forms those skilled in the art It is appreciated that other embodiment.

Claims (3)

1. a kind of detection algorithm of license plate sloped angle, it is characterised in that comprise the following steps:
1) original image matrix binaryzation T is inputtedb[W, H];
2) handle to obtain horizontal edge matrix T by edge algorithmse[W, H], if edge, Te[x, y]=1;Otherwise Te[x, y] =0;
3) the vertical coordinate ρ in polar coordinate system θ-ρ is sought according to the high H of the wide W of imageMAX, ρMAX 2=W2+H2
4) generation conversion ballot matrix T [ρMAX, θMAX], θMAXTake 90 °;
5) by T [ρMAX, θMAX] in all elements set to 0;
6) for horizontal edge matrix TeEach element in [W, H], if Te[x, y]==1, from-θMAXTo θMAXCalculate ρ Value ρ=y*sin (θ)+x*cos (θ), ballot matrix T [ρ, θ]=T [ρ, θ]+1;
7) it is inclined angle to take the θ in ballot matrix T [ρ, θ] corresponding to ρ element maximums.
2. the detection algorithm of license plate sloped angle according to claim 1, it is characterised in that in step 6), y*sin (θ)+ X*cos (θ) makes integer table, and θ's is incremented by 1 °.
3. the detection algorithm of license plate sloped angle according to claim 1, it is characterised in that when detecting horizontal tilt angle Spend to be corrected during θ with shear, comprise the following steps that described:
A. known image width is W, then the maximum displacement of vertical direction is:offvmax=W*tan (θ);
B. because triangle etc. compares, it is pixel level coordinate to calculate each column vertical shift j:offv=(W-j) * offvmax/W;
C. shear amount is subtracted by column, obtains the row coordinate after each column is corrected:inew=i-offvj.
CN201711051233.4A 2017-10-31 2017-10-31 A kind of detection algorithm of license plate sloped angle Pending CN107704858A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711051233.4A CN107704858A (en) 2017-10-31 2017-10-31 A kind of detection algorithm of license plate sloped angle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711051233.4A CN107704858A (en) 2017-10-31 2017-10-31 A kind of detection algorithm of license plate sloped angle

Publications (1)

Publication Number Publication Date
CN107704858A true CN107704858A (en) 2018-02-16

Family

ID=61176541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711051233.4A Pending CN107704858A (en) 2017-10-31 2017-10-31 A kind of detection algorithm of license plate sloped angle

Country Status (1)

Country Link
CN (1) CN107704858A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309828A (en) * 2019-06-27 2019-10-08 浙江工业大学 A kind of inclination license plate antidote

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101118596A (en) * 2007-09-04 2008-02-06 西安理工大学 License plate sloped correcting method based on supporting vector machines
CN101315668A (en) * 2008-07-01 2008-12-03 上海大学 Automatic detection method for test paper form
CN101334836A (en) * 2008-07-30 2008-12-31 电子科技大学 License plate positioning method incorporating color, size and texture characteristic
CN101625760A (en) * 2009-07-28 2010-01-13 谭洪舟 Method for correcting certificate image inclination
CN102496018A (en) * 2011-12-08 2012-06-13 方正国际软件有限公司 Document skew detection method and system
CN103279736A (en) * 2013-04-27 2013-09-04 电子科技大学 License plate detection method based on multi-information neighborhood voting
CN105447852A (en) * 2015-11-12 2016-03-30 四川浩特通信有限公司 Vehicle license plate detection and identification method based on Hough transform
CN106485248A (en) * 2016-10-20 2017-03-08 江苏商贸职业学院 A kind of slag-soil truck license plate sloped correcting method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101118596A (en) * 2007-09-04 2008-02-06 西安理工大学 License plate sloped correcting method based on supporting vector machines
CN101315668A (en) * 2008-07-01 2008-12-03 上海大学 Automatic detection method for test paper form
CN101334836A (en) * 2008-07-30 2008-12-31 电子科技大学 License plate positioning method incorporating color, size and texture characteristic
CN101625760A (en) * 2009-07-28 2010-01-13 谭洪舟 Method for correcting certificate image inclination
CN102496018A (en) * 2011-12-08 2012-06-13 方正国际软件有限公司 Document skew detection method and system
CN103279736A (en) * 2013-04-27 2013-09-04 电子科技大学 License plate detection method based on multi-information neighborhood voting
CN105447852A (en) * 2015-11-12 2016-03-30 四川浩特通信有限公司 Vehicle license plate detection and identification method based on Hough transform
CN106485248A (en) * 2016-10-20 2017-03-08 江苏商贸职业学院 A kind of slag-soil truck license plate sloped correcting method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周俊: "《计算机控制技术》", 31 December 2016 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309828A (en) * 2019-06-27 2019-10-08 浙江工业大学 A kind of inclination license plate antidote

Similar Documents

Publication Publication Date Title
CN103116896B (en) Automatic detection tracking method based on visual saliency model
US11838606B2 (en) Methods and systems for large-scale determination of RGBD camera poses
EP3576017A1 (en) Method, apparatus, and device for determining pose of object in image, and storage medium
CN105488501B (en) The method of license plate sloped correction based on rotation projection
CN108537782B (en) Building image matching and fusing method based on contour extraction
CN109886896A (en) A kind of blue License Plate Segmentation and antidote
CN102331795B (en) Method for controlling sunlight reflecting device to automatically track sun based on facula identification
JPH10208056A (en) Line detection method
CN107622271A (en) Handwriting text lines extracting method and system
CN111860498B (en) Method, device and storage medium for generating antagonism sample of license plate
CN105590112B (en) Text judgment method is tilted in a kind of image recognition
KR20200071853A (en) System and method for detecting and recognizing license plate
US20230095142A1 (en) Method and apparatus for improving object image
CN105184294B (en) It is a kind of based on pixel tracking inclination text judge recognition methods
CN107992869A (en) For tilting the method, apparatus and electronic equipment of word correction
CN106228531B (en) Automatic vanishing point calibration method and system based on horizon line search
CN104537627B (en) A kind of post-processing approach of depth image
CN102073862B (en) Method for quickly calculating layout structure of document image
CN103679700A (en) Bill image inversion detection system
CN109858484B (en) Multi-class transformation license plate correction method based on deflection evaluation
CN107704858A (en) A kind of detection algorithm of license plate sloped angle
CN110991440A (en) Pixel-driven mobile phone operation interface text detection method
CN114511865A (en) Method and device for generating structured information and computer readable storage medium
CN108961182A (en) Vertical direction vanishing point detection method and video positive twist method for video image
CN108256475B (en) Bill image inversion detection method

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

Application publication date: 20180216