CN110400259B - Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation - Google Patents

Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation Download PDF

Info

Publication number
CN110400259B
CN110400259B CN201910682586.7A CN201910682586A CN110400259B CN 110400259 B CN110400259 B CN 110400259B CN 201910682586 A CN201910682586 A CN 201910682586A CN 110400259 B CN110400259 B CN 110400259B
Authority
CN
China
Prior art keywords
image
motor vehicle
license plate
rotation
coordinate
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
CN201910682586.7A
Other languages
Chinese (zh)
Other versions
CN110400259A (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.)
Traffic Management Research Institute of Ministry of Public Security
Original Assignee
Traffic Management Research Institute of Ministry of Public Security
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 Traffic Management Research Institute of Ministry of Public Security filed Critical Traffic Management Research Institute of Ministry of Public Security
Priority to CN201910682586.7A priority Critical patent/CN110400259B/en
Publication of CN110400259A publication Critical patent/CN110400259A/en
Application granted granted Critical
Publication of CN110400259B publication Critical patent/CN110400259B/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
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • G06T3/608Rotation of whole images or parts thereof by skew deformation, e.g. two-pass or three-pass rotation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)
  • Traffic Control Systems (AREA)

Abstract

The invention provides a motor vehicle license plate image inclination angle correction system based on a least square method and coordinate rotation, which comprises the following components: an edge calculation unit, an inclination calculation unit and a rotation calculation unit; the edge calculation unit is used for calculating edge pixel points of the motor vehicle license plate image; the inclination angle calculating unit is used for calculating the inclination angle of the image of the license plate of the motor vehicle; the rotation calculation unit is used for correcting the inclined motor vehicle license plate image to be straight. The edge calculation unit includes: detecting the edge of the image of the motor vehicle license plate and determining the detection area of the image of the motor vehicle license plate; the inclination calculation unit includes: selecting a sample for calculating the inclination angle of the motor vehicle license plate image and calculating the inclination angle of the motor vehicle license plate image; the rotation calculation unit includes: the motor vehicle license plate image rotates positively and the motor vehicle license plate image rotates reversely; the invention can improve the identification accuracy of the vehicle number plate and improve the functional performance of the traffic technology monitoring equipment.

Description

Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation
Technical Field
The invention relates to the technical field of intelligent transportation, in particular to a motor vehicle license plate image inclination angle correction system and method based on a least square method and coordinate rotation.
Background
In China, the motor vehicle number plate is a legal mark registered by the public security traffic control department and used for granting the motor vehicles to run on roads in the border of the people's republic of China. The earliest motor vehicle number plate in China appears in the plain end of 27 years, and after a new China is established, the earliest motor vehicle number plate in China undergoes a plurality of changes and becomes a current 92-type motor vehicle number plate, wherein the industrial technical standard is motor vehicle number plate of the people's republic of China (GA36), and the standard makes clear regulations on the contents of classification, specification, color, application range, style, technical requirements and the like of the motor vehicle number plate. In recent decades, with the development of intelligent traffic technology, China installs a plurality of traffic technology monitoring cameras on roads to capture and identify motor vehicle license plates so as to manage motor vehicle drivers. However, in practice, the camera mounting rod is often influenced by wind or the vehicle running on the road base in a day and month accumulation manner, and the camera mounting rod is displaced a little, so that the image of the vehicle license plate shot by the camera mounting rod is inclined, and the license plate character recognition result is adversely influenced.
Under the background, the invention provides a motor vehicle license plate image inclination angle correction system and method based on a least square method and coordinate rotation.
Disclosure of Invention
The invention aims to overcome the influence of the inclination of the motor vehicle license plate when the motor vehicle license plate is shot by the existing traffic technology monitoring equipment, provides a motor vehicle license plate image inclination angle correction system and method based on a least square method and coordinate rotation, improves the identification accuracy of the motor vehicle license plate, and further improves the performance of the traffic technology monitoring equipment. The technical scheme adopted by the invention is as follows:
a motor vehicle license plate image inclination correction system based on a least square method and coordinate rotation comprises the following steps: an edge calculation unit, an inclination calculation unit and a rotation calculation unit;
the edge calculation unit is used for calculating edge pixel points of the motor vehicle license plate image;
the inclination angle calculating unit is used for calculating the inclination angle of the image of the license plate of the motor vehicle;
the rotation calculation unit is used for correcting the inclined motor vehicle license plate image to be straight.
Further, the air conditioner is provided with a fan,
the edge calculation unit includes: detecting the edge of the motor vehicle license plate image and determining the motor vehicle license plate image detection area;
detecting the edge of the image of the number plate of the motor vehicle: firstly, converting the motor vehicle license plate image from a color space to a gray scale space, and then calculating the horizontal gradient of the motor vehicle license plate gray scale image to obtain a motor vehicle license plate edge image;
determining the image detection area of the number plate of the motor vehicle: determining a motor vehicle license plate detection area from the upper direction, the lower direction, the left direction and the right direction according to the characteristics of the motor vehicle license plate edge image;
the inclination calculation unit includes: selecting a sample for calculating the inclination angle of the motor vehicle license plate image and calculating the inclination angle of the motor vehicle license plate image;
selecting a sample for calculating the inclination angle of the motor vehicle license plate image: selecting typical edge pixel points from the edge images of the motor vehicle license plates as samples for calculating the inclination angles;
calculating the inclination angle of the image of the number plate of the motor vehicle: according to the selected sample, the inclination angle of the image of the number plate of the motor vehicle is obtained through a least square method;
the rotation calculation unit includes: the motor vehicle license plate image rotates positively and the motor vehicle license plate image rotates reversely;
the motor vehicle license plate image is rotating: rotating the image coordinates of the motor vehicle license plate according to the inclination angle, establishing a coordinate mapping relation between the image coordinates before rotation and the image coordinates after rotation, and assigning the coordinate pixel values of the image coordinates after rotation by the corresponding coordinate pixel values before image rotation according to the mapping relation;
reverse rotation of the motor vehicle license plate image: and for the null point in the rotated image, rotating the coordinate of the null point to the original image in the opposite direction, establishing a coordinate mapping relation between the rotated image and the original image before rotation, and performing bilinear interpolation correction on the motor vehicle license plate image according to the mapping.
A motor vehicle license plate image inclination angle correction method based on a least square method and coordinate rotation comprises the following steps:
step 1, converting a motor vehicle number plate color image into a motor vehicle number plate gray image;
step 2, calculating the horizontal gradient of the gray level image of the motor vehicle license plate to obtain a motor vehicle license plate edge image;
step 3, determining a motor vehicle number plate detection area from the upper direction, the lower direction, the left direction and the right direction according to the characteristics of the edge image of the motor vehicle number plate;
step 4, selecting typical edge pixel points from the edge images of the motor vehicle license plates as samples for calculating the inclination angles;
step 5, solving the inclination angle of the image of the number plate of the motor vehicle by a least square method according to the selected sample;
step 6, rotating the image coordinates of the motor vehicle license plate according to the inclination angle, establishing a coordinate mapping relation between the image coordinates before rotation and the image coordinates after rotation, and assigning the coordinate pixel values of the image coordinates after rotation by the corresponding coordinate pixel values before image rotation according to the mapping relation;
and 7, for the null point in the rotated image, rotating the coordinate of the null point to the original image in the opposite direction, establishing a coordinate mapping relation between the rotated image and the original image before rotation, and performing bilinear interpolation correction on the motor vehicle license plate image according to the mapping.
The invention has the advantages that:
(1) the edge pixel points of the motor vehicle license plate are identified through the horizontal gradient, so that the operation amount is low, and the accuracy rate is high.
(2) Through the regional vehicle license plate of accurate discernment, focus on the license plate pixel, reduced the interference of other non-motor vehicle license plate image pixels, improved interference immunity.
(3) The inclination angle of the motor vehicle number plate image is calculated by selecting the typical edge pixel points of the motor vehicle number plate edge image as least square method samples, so that the complexity and the calculation amount of calculation are reduced.
(4) The motor vehicle license plate image is rotated through coordinate transformation to achieve the purpose of correcting the motor vehicle license plate, and the influence of vacancy caused by rotation is smoothed by means of an interpolation processing method, so that the effect of correcting and correcting the motor vehicle license plate image is improved.
Drawings
FIG. 1 is a schematic diagram of the system of the present invention.
FIG. 2 is a schematic view of a color image of the license plate of the motor vehicle of the present invention.
Fig. 3 is a schematic view of a gray scale image of the number plate of the motor vehicle of the present invention.
Fig. 4 is a schematic view of an edge image of the number plate of the motor vehicle according to the present invention.
FIG. 5 is a top, bottom, left and right minimum detection area diagram of the license plate of the motor vehicle of the present invention
FIG. 6 is a schematic diagram of a typical edge pixel of the license plate of the motor vehicle according to the present invention.
Fig. 7 is a view showing the coordinate positive rotation effect of the motor vehicle license plate image of the present invention.
Fig. 8 is a diagram of the interpolation effect after the coordinates of the image of fig. 7 are reversely rotated.
Detailed Description
The invention is further illustrated by the following specific figures and examples.
As shown in fig. 1, a system for correcting the inclination of an image of a number plate of a motor vehicle based on a least square method and coordinate rotation, includes: an edge calculation unit 10, a tilt calculation unit 20, and a rotation calculation unit 30;
the edge calculating unit 10 is used for calculating edge pixel points of the motor vehicle license plate image;
the inclination angle calculating unit 20 is used for calculating the inclination angle of the image of the license plate of the motor vehicle;
the rotation calculation unit 30 is used to correct the tilted license plate image of the vehicle to be flat.
The edge calculation unit 10 includes: detecting the edge of the motor vehicle license plate image and determining the motor vehicle license plate image detection area;
detecting the edge of the image of the number plate of the motor vehicle: firstly, converting the motor vehicle license plate image from a color space to a gray scale space, and then calculating the horizontal gradient of the motor vehicle license plate gray scale image to obtain a motor vehicle license plate edge image;
determining the image detection area of the number plate of the motor vehicle: determining a motor vehicle license plate detection area from the upper direction, the lower direction, the left direction and the right direction according to the characteristics of the motor vehicle license plate edge image;
the inclination calculation unit 20 includes: selecting a sample for calculating the inclination angle of the motor vehicle license plate image and calculating the inclination angle of the motor vehicle license plate image;
selecting a sample for calculating the inclination angle of the motor vehicle license plate image: selecting typical edge pixel points from the edge images of the motor vehicle license plates as samples for calculating the inclination angles;
calculating the inclination angle of the image of the number plate of the motor vehicle: according to the selected sample, calculating the inclination angle of the image of the number plate of the motor vehicle by a least square method;
the rotation calculation unit 30 includes: the motor vehicle license plate image rotates positively and the motor vehicle license plate image rotates reversely;
the motor vehicle license plate image is rotating: rotating the image coordinates of the motor vehicle license plate according to the inclination angle, establishing a coordinate mapping relation between the image coordinates before rotation and the image coordinates after rotation, and assigning the coordinate pixel values of the image coordinates after rotation by the corresponding coordinate pixel values before image rotation according to the mapping relation;
reverse rotation of the motor vehicle license plate image: and establishing a coordinate mapping relation between the rotated and non-rotated blank points in the rotated image, and performing bilinear interpolation correction on the motor vehicle license plate image according to the mapping.
The motor vehicle license plate image inclination angle correction method based on the least square method and the coordinate rotation comprises the following steps:
step 1, image gray level conversion: converting the motor vehicle number plate color image into a motor vehicle number plate gray image;
assume that at coordinate (i, j), the color image pixel of the motor vehicle license plate
Figure RE-GDA0002198349430000031
R, G, B components of are respectively
Figure RE-GDA0002198349430000032
And
Figure RE-GDA0002198349430000033
same position gray scale image pixel value
Figure RE-GDA0002198349430000034
The transformation is as follows:
Figure RE-GDA0002198349430000035
for example: FIG. 2 is a color image I1 of a motor vehicle license plate, and FIG. 3 is a gray scale image I2 of the motor vehicle license plate;
step 2, edge detection: calculating the horizontal gradient of the gray level image of the motor vehicle license plate to obtain an edge image of the motor vehicle license plate;
because the horizontal direction characteristic of the motor vehicle license plate is more obvious than the vertical direction characteristic, the edge image I3 of the motor vehicle license plate is calculated according to the horizontal gradient of the gray image I2 of the motor vehicle license plate, and the formula is as follows:
Figure RE-GDA0002198349430000041
where th1 is the threshold: if the horizontal gradient of a certain pixel point of the motor vehicle license plate is not less than th1, the pixel point is an edge pixel point;
for example: FIG. 4 is an edge image of a motor vehicle license plate, and white pixel points are edge pixel points of the motor vehicle license plate;
step 3, area detection: determining a motor vehicle license plate detection area from the upper direction, the lower direction, the left direction and the right direction according to the characteristics of the motor vehicle license plate edge image;
(1) upper and lower boundaries: suppose W1And H1I3 line size and I3 line scanning, wherein the upper boundary up is detected by scanning from the topmost end line by line downwards, and the lower boundary down is detected by scanning from the lowest end line by line upwards;
Figure RE-GDA0002198349430000042
where th2 is the threshold: scanning from the top end downwards line by line, and when a certain line has more than th2 white points, the line number of the line is up; scanning from the lowest end to the upper line by line, and when a certain line has more than th2 white points, the line number of the line is down;
(2) left and right borders: a column scanning I3, which scans and detects the left boundary left from the leftmost side column by column to the right and the right boundary right from the rightmost side column by column to the left;
Figure RE-GDA0002198349430000043
where th3 is the threshold: scanning from the leftmost end to the right row by row, and when a certain row has more than th3 white dots, the number of the rows is left; scanning from the rightmost end to the left row by row, and when a certain row has more than th3 white dots, the number of the rows of the row is right;
for example: the white frame in fig. 5 is the detection area determined by up, down, left and right of the license plate of the motor vehicle;
step 4, selecting a dip angle calculation sample: selecting typical edge pixel points from the edge image of the motor vehicle license plate as samples for calculating the inclination angle;
edge pixel points which simultaneously satisfy the formula (5) principle 1, principle 2 and principle 3 in the ranges of left boundary left, right boundary right, upper boundary up and lower boundary down of the edge image I3 of the motor vehicle license plate are used as inclination angle calculation samples;
Figure RE-GDA0002198349430000051
for example: the white points in FIG. 6 are tilt angle calculation samples selected according to equation (5);
step 5, calculating the inclination angle: according to the selected sample, calculating the inclination angle of the image of the number plate of the motor vehicle by a least square method;
assuming that there are m dip sample points of formula (5), the row coordinate xkK 1,2, … m, column coordinate ykK is 1,2, … m, distributed on two sides of a straight line y, ax and b, and is a slope, b is an intercept, and according to the principle of least square method, an objective function is established as follows:
Figure RE-GDA0002198349430000052
the partial derivatives are zero for a and b respectively:
Figure RE-GDA0002198349430000053
Figure RE-GDA0002198349430000054
the inclination angle theta of the automobile license plate image is (a/pi) × 180;
step 6, image positive rotation: rotating the image coordinates of the motor vehicle license plate according to the inclination angle, establishing a coordinate mapping relation between the image coordinates before rotation and the image coordinates after rotation, and assigning the coordinate pixel values of the image coordinates after rotation by the corresponding coordinate pixel values before image rotation according to the mapping relation;
(1) graph-number coordinate transformation: firstly, establishing a mapping relation between the image coordinates of the license plate of the motor vehicle before rotation and the mathematical coordinates during rotation, and defining the mapping relation as image-number coordinate transformation; assuming that the coordinate system before the rotation of the motor vehicle license plate image is an image coordinate system, the coordinate system during the rotation is a mathematical coordinate system, and the image coordinate system is a point (0.5W)1,0.5H1) Is the origin (0,0) of the mathematical coordinate system, the point (i, j) of the image coordinate system and the point of the mathematical coordinate system
Figure RE-GDA0002198349430000055
The mapping relationship is as follows:
Figure RE-GDA0002198349430000056
(2) rotating the coordinates; secondly, rotating the number plate image of the motor vehicle in a mathematical coordinate system; supposition point
Figure RE-GDA0002198349430000057
Rotate counterclockwise around the origin (0,0) by theta with the coordinates after rotation being
Figure RE-GDA0002198349430000058
Establishing
Figure RE-GDA0002198349430000059
And
Figure RE-GDA00021983494300000510
the mapping relationship is as follows:
Figure RE-GDA0002198349430000061
(3) number-picture chairStandard transformation: establishing a mapping relation between the mathematical coordinates during rotation and the image coordinates of the motor vehicle license plate after rotation again, and defining the mapping relation as number-image coordinate transformation; assuming that the coordinate system of the rotated image is a new image coordinate system, W2And H2For the height and width of the new image, the origin (0,0) of the mathematical coordinate system is the midpoint (0.5W) of the new image coordinate system after rotation2,0.5H2) New image coordinate system point
Figure RE-GDA0002198349430000062
And point of mathematical coordinate system
Figure RE-GDA0002198349430000063
The mapping relationship is as follows:
Figure RE-GDA0002198349430000064
(4) pixel assignment: after the figure-figure coordinate transformation, the coordinate rotation and the figure-figure coordinate transformation, the coordinates of the number plate image of the motor vehicle after the rotation
Figure RE-GDA0002198349430000065
The mapping relation with the coordinates (i, j) before rotation is as follows:
Figure RE-GDA0002198349430000066
assuming that the image of the rotated license plate of the motor vehicle is I4, when the formula (12) is shown
Figure RE-GDA0002198349430000067
And
Figure RE-GDA0002198349430000068
while for integers, the pixels are assigned as follows:
Figure RE-GDA0002198349430000069
when the formula (12)
Figure RE-GDA00021983494300000610
Or
Figure RE-GDA00021983494300000611
When not an integer, since the image coordinates are integers,
Figure RE-GDA00021983494300000612
the pixel value at the coordinates (i, j) before rotation is a non-image coordinate
Figure RE-GDA00021983494300000613
Cannot be mapped to a rotated pixel value
Figure RE-GDA00021983494300000614
When rotated, each coordinate of the image I4
Figure RE-GDA00021983494300000615
Can be mapped with the coordinates (I, j) of the original image I1,
Figure RE-GDA00021983494300000616
when the image I4 has been rotated to a certain coordinate
Figure RE-GDA00021983494300000617
When the mapping cannot be established with the coordinates (I, j) of the original image I1, the pixel value at the coordinates is a null point;
for example: fig. 7 is a diagram of the effect after the image is rotated, wherein the black dots are blank dots.
And 7, reversely rotating the image: for the null point in the rotated image, the coordinate of the null point is reversely rotated to the original image, a coordinate mapping relation between the rotated image and the original image before rotation is established, and the motor vehicle license plate image is subjected to bilinear interpolation correction according to mapping;
(1) graph-mathematical coordinate transformation: in contrast to step 6(3), set up
Figure RE-GDA00021983494300000618
And
Figure RE-GDA00021983494300000619
the mapping relation is as follows:
Figure RE-GDA00021983494300000620
(2) and (3) coordinate rotation: in contrast to the step 6(2),
Figure RE-GDA00021983494300000621
rotate clockwise around the origin (0,0) by theta, the coordinates after rotation being
Figure RE-GDA0002198349430000071
Establishing
Figure RE-GDA0002198349430000072
And
Figure RE-GDA0002198349430000073
the mapping relationship is as follows:
Figure RE-GDA0002198349430000074
(3) number-graph coordinate transformation: in contrast to step 6(1), set up
Figure RE-GDA0002198349430000075
Mapping relation with (i, j):
Figure RE-GDA0002198349430000076
(4) pixel interpolation: after the figure-figure coordinate transformation, the coordinate rotation and the figure-figure coordinate transformation, the coordinates before rotation (i, j) and the coordinates after rotation of the number plate image of the motor vehicle after rotation
Figure RE-GDA0002198349430000077
The mapping relationship is as follows:
Figure RE-GDA0002198349430000078
similarly to step 6, when i or j of formula (17) is not an integer, (i, j) is a non-image coordinate, assuming that
Figure RE-GDA0002198349430000079
The 4 pixels which are nearest to (i, j) and are arranged at the upper left, the upper right, the lower left and the lower right,
Figure RE-GDA00021983494300000710
and
Figure RE-GDA00021983494300000711
the row distance of c and the column distance of d are estimated by a bilinear interpolation method
Figure RE-GDA00021983494300000712
The values are as follows:
Figure RE-GDA00021983494300000713
for example: fig. 8 is a graph showing the interpolation effect after the coordinates of the image in fig. 7 are reversely rotated.
In summary, according to the motor vehicle license plate image inclination angle correction method based on the least square method and the coordinate rotation, the vehicle license plate detection area is reduced, and the vehicle license plate area is accurately identified; the inclination angle of the motor vehicle license plate image is calculated by selecting typical edge pixel points of the motor vehicle license plate edge image as least square method samples, so that the complexity and the calculation amount of calculation are reduced; the motor vehicle license plate image is rotated through coordinate transformation to achieve the purpose of correcting the motor vehicle license plate, and the influence of vacancy caused by rotation is smoothed by means of an interpolation processing method. The method overcomes the influence of vehicle number plate inclination caused by weather or road conditions, improves the identification accuracy of the vehicle number plate, and also improves the functional performance of the traffic technology monitoring equipment.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention has been described in detail with reference to examples, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, which should be covered by the claims of the present invention.

Claims (8)

1. A motor vehicle license plate image inclination correction system based on a least square method and coordinate rotation is characterized by comprising the following components: an edge calculation unit, an inclination calculation unit and a rotation calculation unit;
the edge calculation unit is used for calculating edge pixel points of the motor vehicle license plate image;
the inclination angle calculating unit is used for calculating the inclination angle of the image of the license plate of the motor vehicle;
the rotation calculation unit is used for correcting the inclined motor vehicle license plate image to be straight;
the edge calculation unit includes: detecting the edge of the motor vehicle license plate image and determining the motor vehicle license plate image detection area;
detecting the edge of the image of the number plate of the motor vehicle: firstly, converting the motor vehicle license plate image from a color space to a gray scale space, and then calculating the horizontal gradient of the motor vehicle license plate gray scale image to obtain a motor vehicle license plate edge image;
determining the image detection area of the number plate of the motor vehicle: determining a motor vehicle license plate detection area from the upper direction, the lower direction, the left direction and the right direction according to the characteristics of the motor vehicle license plate edge image;
the inclination calculation unit includes: selecting a sample for calculating the inclination angle of the motor vehicle license plate image and calculating the inclination angle of the motor vehicle license plate image;
selecting a sample for calculating the inclination angle of the motor vehicle license plate image: selecting typical edge pixel points from the edge images of the motor vehicle license plates as samples for calculating the inclination angles;
calculating the inclination angle of the image of the number plate of the motor vehicle: according to the selected sample, calculating the inclination angle of the image of the number plate of the motor vehicle by a least square method;
the rotation calculation unit includes: the motor vehicle license plate image rotates positively and the motor vehicle license plate image rotates reversely;
the motor vehicle license plate image is rotating: rotating the image coordinates of the motor vehicle license plate according to the inclination angle, establishing a coordinate mapping relation between the image coordinates before rotation and the image coordinates after rotation, and assigning the coordinate pixel values of the image coordinates after rotation by the corresponding coordinate pixel values before image rotation according to the mapping relation;
reverse rotation of the motor vehicle license plate image: and for the null points in the rotated image, rotating the coordinates of the null points to the original image in the opposite direction, establishing a coordinate mapping relation between the rotated image and the original image before rotation, and performing bilinear interpolation correction on the motor vehicle license plate image according to the mapping.
2. A motor vehicle license plate image inclination angle correction method based on a least square method and coordinate rotation is characterized by comprising the following steps:
step 1, converting a motor vehicle license plate color image into a motor vehicle license plate gray image;
step 2, calculating the horizontal gradient of the gray level image of the motor vehicle license plate to obtain a motor vehicle license plate edge image;
step 3, determining a motor vehicle license plate detection area from the upper direction, the lower direction, the left direction and the right direction according to the characteristics of the edge image of the motor vehicle license plate;
step 4, selecting typical edge pixel points from the edge images of the motor vehicle license plates as samples for calculating the inclination angles;
step 5, solving the inclination angle of the image of the number plate of the motor vehicle by a least square method according to the selected sample;
step 6, rotating the image coordinates of the motor vehicle license plate according to the inclination angle, establishing a coordinate mapping relation between the image coordinates before rotation and the image coordinates after rotation, and assigning the coordinate pixel values of the image coordinates after rotation by the corresponding coordinate pixel values before image rotation according to the mapping relation;
and 7, for the null points in the rotated image, rotating the coordinates of the null points to the original image in the opposite direction, establishing a coordinate mapping relation between the rotated image and the original image before rotation, and performing bilinear interpolation correction on the motor vehicle license plate image according to the mapping.
3. The method for correcting the inclination of the image of the license plate of a motor vehicle based on the least square method and the coordinate rotation as set forth in claim 2,
in step 2, according to the horizontal gradient of the gray level image I2 of the motor vehicle license plate, calculating an edge image I3 of the motor vehicle license plate, wherein the formula is as follows:
Figure FDA0003574229110000021
where th1 is the threshold: if the horizontal gradient of a certain pixel point of the motor vehicle license plate is not lower than th1, the pixel point is an edge pixel point.
4. The method for correcting the inclination of the image of the license plate of a motor vehicle based on the least square method and the coordinate rotation of claim 3,
the step 3 specifically comprises the following steps:
(1) upper and lower boundaries: suppose W1And H1I3 line size and I3 line scanning, wherein the upper boundary up is detected by scanning from the topmost end line by line downwards, and the lower boundary down is detected by scanning from the lowest end line by line upwards;
Figure FDA0003574229110000022
where th2 is the threshold: scanning from the top end downwards line by line, and when a certain line has more than th2 white points, the line number of the line is up; scanning from the lowest end to the upper line by line, and when a certain line has more than th2 white points, the line number of the line is down;
(2) left and right borders: a column scanning I3, which scans and detects the left boundary left from the leftmost side column by column to the right and the right boundary right from the rightmost side column by column to the left;
Figure FDA0003574229110000023
where th3 is the threshold: scanning from the leftmost end to the right row by row, and when a certain row has more than th3 white dots, the number of the rows is left; scanning from the rightmost end to the left column by column, when a certain column has more than th3 white dots, the number of columns of the column is right.
5. The method for correcting the inclination of the image of the number plate of a motor vehicle based on the least square method and the coordinate rotation as set forth in claim 4,
the step 4 specifically comprises the following steps: edge pixel points which simultaneously satisfy the formula (5) principle 1, principle 2 and principle 3 in the ranges of left boundary left, right boundary right, upper boundary up and lower boundary down of the edge image I3 of the motor vehicle license plate are used as inclination angle calculation samples;
Figure FDA0003574229110000031
6. the method for correcting the inclination of the image of the license plate of a motor vehicle based on the least square method and the coordinate rotation of claim 5,
the step 5 specifically comprises the following steps:
assume that there are m dip sample points, row coordinate xkK 1,2, … m, column coordinate ykK is 1,2, … m, distributed on two sides of a straight line y, ax + b, a is a slope and b is an intercept, and an objective function is established according to the principle of least square method as follows:
Figure FDA0003574229110000032
the partial derivatives are zero for a and b respectively:
Figure FDA0003574229110000033
Figure FDA0003574229110000034
the inclination angle theta of the vehicle license plate image is (a/pi) × 180.
7. The method for correcting the inclination of the image of the license plate of a motor vehicle based on the least square method and the coordinate rotation of claim 6,
the step 6 specifically comprises the following steps:
(1) graph-number coordinate transformation: firstly, establishing a mapping relation between the image coordinates of the license plate of the motor vehicle before rotation and the mathematical coordinates during rotation, and defining the mapping relation as image-number coordinate transformation; assuming that the coordinate system before the rotation of the motor vehicle license plate image is an image coordinate system, the coordinate system during the rotation is a mathematical coordinate system, and the image coordinate system is a point (0.5W)1,0.5H1) Is the origin (0,0) of the mathematical coordinate system, the point (i, j) of the image coordinate system and the point of the mathematical coordinate system
Figure FDA0003574229110000035
The mapping relationship is as follows:
Figure FDA0003574229110000036
(2) rotating the coordinates; secondly, rotating the number plate image of the motor vehicle in a mathematical coordinate system; supposition point
Figure FDA0003574229110000037
Rotate counterclockwise around the origin (0,0) by theta with the coordinates after rotation being
Figure FDA0003574229110000038
Establishing
Figure FDA0003574229110000039
And with
Figure FDA00035742291100000310
The mapping relationship is as follows:
Figure FDA0003574229110000041
(3) number-graph coordinate transformation: establishing a mapping relation between the mathematical coordinates during rotation and the coordinates of the image of the number plate of the motor vehicle after rotation again, and defining the mapping relation as number-image coordinate transformation; assuming that the coordinate system of the rotated image is a new image coordinate system, W2And H2For the height and width of the new image, the origin (0,0) of the mathematical coordinate system is the midpoint (0.5W) of the new image coordinate system after rotation2,0.5H2) Points of a new image coordinate system
Figure FDA0003574229110000042
And point of mathematical coordinate system
Figure FDA0003574229110000043
The mapping relationship is as follows:
Figure FDA0003574229110000044
(4) pixel assignment: after the figure-figure coordinate transformation, the coordinate rotation and the figure-figure coordinate transformation, the coordinates of the number plate image of the motor vehicle after the rotation
Figure FDA0003574229110000045
The mapping relation with the coordinates (i, j) before rotation is as follows:
Figure FDA0003574229110000046
assuming that the image of the rotated license plate of the motor vehicle is I4, when the formula (12) is shown
Figure FDA0003574229110000047
And
Figure FDA0003574229110000048
while for integers, the pixels are assigned as follows:
Figure FDA0003574229110000049
when the formula (12) is
Figure FDA00035742291100000410
Or
Figure FDA00035742291100000411
When not an integer, since the image coordinates are integers,
Figure FDA00035742291100000412
the pixel value at the coordinates (i, j) before rotation is a non-image coordinate
Figure FDA00035742291100000413
Cannot be mapped to a rotated pixel value
Figure FDA00035742291100000414
When rotated, each coordinate of the image I4
Figure FDA00035742291100000415
Can be mapped with the coordinates (I, j) of the original image I1,
Figure FDA00035742291100000416
when the image I4 has been rotated to a certain coordinate
Figure FDA00035742291100000417
When the mapping cannot be established with the coordinates (I, j) of the original image I1, the pixel value at the coordinates is null.
8. The method for correcting the inclination of the image of the license plate of a motor vehicle based on the least square method and the coordinate rotation of claim 7,
the step 7 specifically comprises the following steps:
(1) graph-mathematical coordinate transformation: in contrast to step 6(3), set up
Figure FDA00035742291100000418
And with
Figure FDA00035742291100000419
The mapping relation is as follows:
Figure FDA00035742291100000420
(2) and (3) coordinate rotation: in contrast to the step 6(2),
Figure FDA00035742291100000421
rotate clockwise around the origin (0,0) by theta, the coordinates after rotation being
Figure FDA00035742291100000422
Establishing
Figure FDA00035742291100000423
And
Figure FDA00035742291100000424
the mapping relationship is as follows:
Figure FDA0003574229110000051
(3) number-graph coordinate transformation: in contrast to step 6(1), set up
Figure FDA0003574229110000052
Mapping relationship with (i, j):
Figure FDA0003574229110000053
(4) pixel interpolation: after the figure-figure coordinate transformation, the coordinate rotation and the figure-figure coordinate transformation, the coordinates before rotation (i, j) and the coordinates after rotation of the number plate image of the motor vehicle after rotation
Figure FDA0003574229110000054
The mapping relationship is as follows:
Figure FDA0003574229110000055
similarly to step 6, when i or j of formula (17) is not an integer, (i, j) is a non-image coordinate, assuming that
Figure FDA0003574229110000056
The 4 pixels which are nearest to (i, j) and are arranged at the upper left, the upper right, the lower left and the lower right,
Figure FDA0003574229110000057
and with
Figure FDA0003574229110000058
The row distance of c and the column distance of d are estimated by a bilinear interpolation method
Figure FDA0003574229110000059
The values are as follows:
Figure FDA00035742291100000510
CN201910682586.7A 2019-07-26 2019-07-26 Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation Active CN110400259B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910682586.7A CN110400259B (en) 2019-07-26 2019-07-26 Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910682586.7A CN110400259B (en) 2019-07-26 2019-07-26 Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation

Publications (2)

Publication Number Publication Date
CN110400259A CN110400259A (en) 2019-11-01
CN110400259B true CN110400259B (en) 2022-07-05

Family

ID=68326184

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910682586.7A Active CN110400259B (en) 2019-07-26 2019-07-26 Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation

Country Status (1)

Country Link
CN (1) CN110400259B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104318233A (en) * 2014-10-19 2015-01-28 温州大学 Method for horizontal tilt correction of number plate image
CN104408451A (en) * 2014-10-30 2015-03-11 安徽清新互联信息科技有限公司 Least-square-method-based license plate correction method
CN106874904A (en) * 2017-01-09 2017-06-20 北京大学深圳研究生院 A kind of car plate picture antidote and device
CN109145915A (en) * 2018-07-27 2019-01-04 武汉科技大学 License plate rapid distortion antidote under a kind of complex scene

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104318233A (en) * 2014-10-19 2015-01-28 温州大学 Method for horizontal tilt correction of number plate image
CN104408451A (en) * 2014-10-30 2015-03-11 安徽清新互联信息科技有限公司 Least-square-method-based license plate correction method
CN106874904A (en) * 2017-01-09 2017-06-20 北京大学深圳研究生院 A kind of car plate picture antidote and device
CN109145915A (en) * 2018-07-27 2019-01-04 武汉科技大学 License plate rapid distortion antidote under a kind of complex scene

Also Published As

Publication number Publication date
CN110400259A (en) 2019-11-01

Similar Documents

Publication Publication Date Title
CN107729899B (en) License plate number recognition method and device
CN106951879B (en) Multi-feature fusion vehicle detection method based on camera and millimeter wave radar
CN103065138B (en) Recognition method of license plate number of motor vehicle
CN105488501A (en) Method for correcting license plate slant based on rotating projection
CN112257539B (en) Method, system and storage medium for detecting position relationship between vehicle and lane line
CN107563330B (en) Horizontal inclined license plate correction method in surveillance video
CN109886175B (en) Method for detecting lane line by combining straight line and circular arc
CN104899554A (en) Vehicle ranging method based on monocular vision
CN109242870A (en) A kind of sea horizon detection method divided based on image with textural characteristics
WO2009100058A2 (en) Object detection and recognition system
US10318824B2 (en) Algorithm to extend detecting range for AVM stop line detection
CN111126306A (en) Lane line detection method based on edge features and sliding window
CN102419820A (en) Method for rapidly detecting car logo in videos and images
CN109635737A (en) Automobile navigation localization method is assisted based on pavement marker line visual identity
CN108133170B (en) Window positioning method for multi-directional vehicle
CN108846363A (en) A kind of subregion vehicle bottom shadow detection method based on divergence expression scanning
CN106951896A (en) A kind of license plate image sloped correcting method
CN106709952A (en) Automatic calibration method of display screen
CN114719873B (en) Low-cost fine map automatic generation method and device and readable medium
CN109858484B (en) Multi-class transformation license plate correction method based on deflection evaluation
CN110889342B (en) Identification method of deceleration strip
CN109800641B (en) Lane line detection method based on threshold value self-adaptive binarization and connected domain analysis
JP6205712B2 (en) Crosswalk detector and pedestrian crossing detection method
CN110400259B (en) Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation
CN108389177B (en) Vehicle bumper damage detection method and traffic safety early warning 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
GR01 Patent grant
GR01 Patent grant