Method and device for accurately positioning license plate and computer readable storage medium

文档序号:1545161 发布日期:2020-01-17 浏览:4次 中文

阅读说明:本技术 一种车牌的精确定位方法及装置、计算机可读存储介质 (Method and device for accurately positioning license plate and computer readable storage medium ) 是由 陈杰 刘源 龚国成 方绍波 于 2018-07-10 设计创作,主要内容包括:本发明公开了一种车牌的精确定位方法,该方法包括:第n次获取特征点的位置;其中,特征点为车牌图像边缘两边相交的点;n为大于等于1且小于等于N的整数;N为最大执行次数并且为大于2的整数;基于第n次获取特征点的位置,选取车牌图像的局部区域图像并提取局部区域图像的图像特征,得到与第n次获取特征点的位置对应的特征向量;其中,局部区域图像为车牌图像的部分图像;基于第n特征向量,确定特征点的平移距离,并基于平移距离更新特征点的位置;其中,更新后的特征点的位置能够接近期望的特征点的位置,以使得车牌能够精确定位。本发明的实施例同时公开了一种车牌精确定位装置和计算机存储介质。(The invention discloses a method for accurately positioning a license plate, which comprises the following steps: acquiring the position of the feature point for the nth time; wherein, the characteristic points are the points of intersection of two sides of the edge of the license plate image; n is an integer of 1 or more and N or less; n is the maximum number of executions and is an integer greater than 2; selecting a local area image of the license plate image and extracting image features of the local area image based on the position of the feature point acquired for the nth time to obtain a feature vector corresponding to the position of the feature point acquired for the nth time; the local area image is a partial image of the license plate image; determining the translation distance of the feature point based on the nth feature vector, and updating the position of the feature point based on the translation distance; and the positions of the updated characteristic points can be close to the positions of the expected characteristic points, so that the license plate can be accurately positioned. The embodiment of the invention also discloses a license plate accurate positioning device and a computer storage medium.)

1. A method for accurately positioning a license plate, the method comprising:

acquiring the position of the feature point for the nth time; wherein the characteristic points are points at which two sides of the edge of the license plate image are intersected; n is an integer of 1 or more and N or less; n is the maximum number of executions and is an integer greater than 2;

based on the position of the feature point obtained for the nth time, selecting a local area image of the license plate image and extracting the image feature of the local area image to obtain a feature vector corresponding to the position of the feature point obtained for the nth time; wherein the local area image is a partial image of the license plate image;

determining translation distances of the feature points based on the nth feature vector, and updating the positions of the feature points based on the translation distances; and the positions of the updated characteristic points can be close to the positions of expected characteristic points, so that the license plate can be accurately positioned.

2. The method of claim 1, wherein selecting the local area image of the license plate image based on the position of the n-th acquired feature point comprises:

determining a selection proportion corresponding to the times n of acquiring the characteristic points on the basis of the times n of acquiring the characteristic points;

and selecting a local area image of the license plate image based on the nth selection proportion and the position of the nth acquired feature point.

3. The method of claim 2,

and controlling the nth selection proportion to be larger than the (n + 1) th selection proportion.

4. The method of claim 1, wherein the determining a translation distance of the feature point based on the nth feature vector and updating the location of the feature point based on the translation distance comprises:

acquiring a weight value corresponding to the nth feature vector based on the nth feature vector;

obtaining the translation distance of the feature point based on the nth feature vector and the weight value corresponding to the nth feature vector;

and updating the positions of the feature points based on the translation distance and the positions of the feature points.

5. The method according to claim 4, wherein before obtaining the weight value corresponding to the nth feature vector based on the nth feature vector, the method further comprises:

acquiring at least one group of historical sample data; the historical sample data comprises at least one group of characteristic vectors and initial positions and target positions corresponding to the characteristic vectors; the initial position is the initial position of the feature point corresponding to the feature vector, and the target position is the precise position of the feature point corresponding to the feature vector;

and determining a weight value corresponding to each group of feature vectors based on the at least one group of feature vectors and the initial position and the target position corresponding to the feature vectors to obtain a corresponding relation table of the feature vectors and the weight values.

6. The method according to claim 4 or 5, characterized in that the method further comprises:

acquiring the position of the feature point acquired for the nth time and the position of the updated feature point;

and updating the corresponding relation between the feature vector and the weight value based on the nth feature vector, the position of the feature point obtained for the nth time and the position of the updated feature point.

7. A device for accurately positioning a license plate, the device comprising:

the acquiring unit is used for acquiring the position of the feature point for the nth time; wherein the characteristic points are points at which two sides of the edge of the license plate image are intersected; n is an integer of 1 or more and N or less; n is the maximum number of executions and is an integer greater than 2;

the feature extraction unit is used for selecting a local area image of the license plate image and extracting image features of the local area image based on the position of the feature point acquired for the nth time to obtain a feature vector corresponding to the position of the feature point acquired for the nth time; wherein the local area image is a partial image of the license plate image;

the processing unit is used for determining the translation distance of the feature point based on the nth feature vector and updating the position of the feature point based on the translation distance; and the positions of the updated characteristic points can be close to the positions of expected characteristic points, so that the license plate can be accurately positioned.

8. The apparatus of claim 7, wherein:

the characteristic extraction unit is also used for determining a selection proportion corresponding to the times n of acquiring the characteristic points based on the times n of acquiring the characteristic points; and selecting a local area image of the license plate image based on the nth selection proportion and the position of the nth acquired feature point.

9. The apparatus of claim 8, wherein:

the feature extraction unit is used for controlling the nth selection proportion to be larger than the (n + 1) th selection proportion.

10. The apparatus of claim 7, wherein:

the processing unit is specifically configured to obtain, based on the nth feature vector, a weight value corresponding to the nth feature vector; obtaining the translation distance of the feature point based on the nth feature vector and the weight value corresponding to the nth feature vector; and updating the positions of the feature points based on the translation distance and the positions of the feature points.

11. The apparatus of claim 10, wherein:

the processing unit is further configured to obtain at least one set of historical sample data; the historical sample data comprises at least one group of characteristic vectors and initial positions and target positions corresponding to the characteristic vectors; the initial position is the initial position of the feature point corresponding to the feature vector, and the target position is the precise position of the feature point corresponding to the feature vector; and determining a weight value corresponding to each group of feature vectors based on the at least one group of feature vectors and the initial position and the target position corresponding to the feature vectors to obtain a corresponding relation table of the feature vectors and the weight values.

12. The apparatus according to claim 10 or 11, wherein:

the processing unit is further configured to obtain the position of the feature point obtained for the nth time and the position of the updated feature point; and updating the corresponding relation between the feature vector and the weight value based on the nth feature vector, the position of the feature point obtained for the nth time and the position of the updated feature point.

13. A device for accurately locating a license plate, the device comprising: a processor and a memory configured to store a computer program capable of running on the processor,

wherein the processor is configured to perform the steps of the method of any one of claims 1 to 6 when running the computer program.

14. A computer readable storage medium, characterized in that the computer readable storage medium stores one or more programs which are executable by one or more processors to implement the steps of the method for the precise positioning of a license plate according to any one of claims 1 to 6.

Technical Field

The invention relates to the technical field of image recognition, in particular to a method and a device for accurately positioning a license plate and a computer readable storage medium.

Background

At present, the identity of a vehicle is identified through license plate recognition, and the license plate recognition is used for realizing a large-scale vehicle management function. Therefore, the vehicle identification technology has wide application prospect in vehicle registration places and vehicle management places such as large parking lots, shopping malls, residential districts, highway electronic toll collection and the like. The license plate identification technology comprises two parts of license plate positioning and license plate identification, the license plate positioning is the basis of the license plate identification, and the accuracy of the license plate positioning has important influence on the whole license plate identification system.

The accurate license plate positioning is a process of removing redundant areas and acquiring character area images aiming at initially positioned license plate images. In practical application, related technologies for accurately positioning license plates generally adopt attribute information of the license plates, such as color and shape of the license plates, to accurately position the license plates. However, the above method inevitably causes the problems of inaccurate positioning or positioning errors under the conditions that the resolution of the acquired image is low, or the license plate is polluted, degraded or deformed. Therefore, a method for accurately positioning a license plate is needed to solve the above-mentioned problems of positioning failure, inaccurate positioning or positioning error.

Disclosure of Invention

In view of this, embodiments of the present invention provide a method and an apparatus for accurately positioning a license plate, and a computer-readable storage medium, so as to solve the problems of positioning failure, inaccurate positioning, or positioning error in the prior art.

In order to achieve the purpose, the technical scheme of the invention is realized as follows:

in a first aspect, an embodiment of the present invention provides a method for accurately positioning a license plate, where the method includes:

acquiring the position of the feature point for the nth time; wherein the characteristic points are points at which two sides of the edge of the license plate image are intersected; n is an integer of 1 or more and N or less; n is the maximum number of executions and is an integer greater than 2;

based on the position of the feature point obtained for the nth time, selecting a local area image of the license plate image and extracting the image feature of the local area image to obtain a feature vector corresponding to the position of the feature point obtained for the nth time; wherein the local area image is a partial image of the license plate image;

determining translation distances of the feature points based on the nth feature vector, and updating the positions of the feature points based on the translation distances; and the positions of the updated characteristic points can be close to the positions of expected characteristic points, so that the license plate can be accurately positioned.

In a second aspect, an embodiment of the present invention provides a device for accurately positioning a license plate, where the device includes:

the acquiring unit is used for acquiring the position of the feature point for the nth time; wherein the characteristic points are points at which two sides of the edge of the license plate image are intersected; n is an integer of 1 or more and N or less; n is the maximum number of executions and is an integer greater than 2;

the feature extraction unit is used for selecting a local area image of the license plate image and extracting image features of the local area image based on the position of the feature point acquired for the nth time to obtain a feature vector corresponding to the position of the feature point acquired for the nth time; wherein the local area image is a partial image of the license plate image;

the processing unit is used for determining the translation distance of the feature point based on the nth feature vector and updating the position of the feature point based on the translation distance; and the positions of the updated characteristic points can be close to the positions of expected characteristic points, so that the license plate can be accurately positioned.

In a third aspect, an embodiment of the present invention provides a device for accurately positioning a license plate, where the device includes: a processor and a memory configured to store a computer program capable of running on the processor,

wherein the processor is configured to perform the steps of the method of the first aspect when executing the computer program.

In a fourth aspect, a computer-readable storage medium is provided, which is characterized by storing one or more programs, which are executable by one or more processors, to implement the steps of the information identification method according to the first aspect.

The method and the device for accurately positioning the license plate and the computer-readable storage medium provided by the embodiment of the invention firstly obtain the positions of the feature points of the license plate image, select the local area image based on the positions of the feature points, extract the image features of the local area image to obtain the feature vectors, then obtain the translation distance of the feature points according to the feature vectors, update the positions of the feature points based on the translation distance, and further obtain the positions of the feature points when the feature points are adjusted next time; therefore, the positions of the feature points are adjusted and updated for N times, and the positions of the feature points are corrected step by step, so that the accurate position of the license plate can be obtained after the feature points are adjusted and updated for N times; therefore, in the process of accurately positioning the license plate, the attribute characteristics of any license plate are not relied on, and the condition that the abnormal license plate is positioned unsuccessfully is avoided; meanwhile, the positions of the feature points are updated for N times, and the positions of the feature points are corrected for multiple times, so that the accuracy of license plate positioning can be improved; has stronger transportability and applicability.

Drawings

In the drawings, which are not necessarily drawn to scale, like reference numerals may describe similar components in different views. The drawings illustrate generally, by way of example, but not by way of limitation, various embodiments discussed herein.

Fig. 1 is a schematic flow chart of a method for accurately positioning a license plate according to an embodiment of the present invention;

fig. 2 is a schematic diagram of a license plate image after rough positioning according to an embodiment of the present invention;

FIG. 3 is a schematic flow chart illustrating another method for accurately positioning a license plate according to an embodiment of the present invention;

FIG. 4 is a schematic diagram of a segmented local area image according to an embodiment of the present invention;

FIG. 5 is a schematic diagram of a license plate image after precise positioning according to an embodiment of the present invention;

FIG. 6 is a schematic diagram of another license plate image after precise positioning according to an embodiment of the present disclosure;

FIG. 7 is a schematic structural diagram of a license plate accurate positioning device according to an embodiment of the present invention;

fig. 8 is a schematic diagram illustrating a hardware structure of the license plate accurate positioning device according to the embodiment of the present invention.

Detailed Description

So that the manner in which the features and elements of the present invention can be understood in detail, a more particular description of the invention, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings.

In the process of license plate recognition, the accurate positioning of the license plate is a process of removing redundant areas and acquiring character area images aiming at the license plate images after rough positioning, and has important influence on the recognition accuracy of a license plate recognition system. The accurate positioning of the license plate depends on the result of the license plate inclination correction, that is, the accurate positioning of the license plate is performed after the license plate inclination correction.

There are various current schemes for accurately positioning a license plate, and the most common schemes include the following two schemes:

the first scheme is as follows: and (3) solving the upper and lower boundaries of the license plate characters by utilizing the texture jump condition of the character region, and performing sliding window processing according to the widths of the upper and lower boundaries because the format of the license plate is uniform and fixed, calculating the corresponding width, and selecting the region with the most dense characters as a result of accurate positioning.

Scheme II: and (3) accurately positioning the license plate according to the color of the license plate, specifically, extracting an area of each color from the corrected image in sequence because the color of the license plate has three fixed formats of blue, yellow and green, and considering that the area of the extracted area closest to the rectangle is the area for accurately positioning the license plate.

In the above related technical solutions for accurately positioning the license plate, the accurate positioning of the license plate is realized by using certain attribute information of the license plate, such as color, shape and other information; if the resolution of the acquired license plate image is low, or the license plate is polluted, degraded or deformed, the attribute information of the license plate cannot be used for accurate positioning, so that the problems of positioning failure or inaccurate positioning are caused. Therefore, the embodiment of the invention provides a method for accurately positioning a license plate, which can realize accurate positioning of the license plate without depending on the attribute information of the license plate.

The present invention will be described in further detail with reference to the accompanying drawings and examples.

The embodiment of the invention provides a method for accurately positioning a license plate, which comprises the following steps of:

and 101, acquiring the position of the feature point at the nth time.

Wherein, the characteristic points are the points of intersection of two sides of the edge of the license plate image; n is an integer of 1 or more and N or less; n is the maximum number of executions and is an integer greater than 2.

In other embodiments of the present invention, the obtaining of the position of the feature point n in step 101 may be implemented by a license plate accurate positioning device; the license plate accurate positioning device can be a device capable of acquiring images. In practical application, the license plate accurate positioning device can shoot dynamic or static automobile images through a video camera or a camera; and finally, carrying out accurate positioning on the license plate based on the image included by the coarse positioning frame.

In practical applications, a rectangle can be determined by four vertices, that is, four sides of the rectangle are determined by four vertices; therefore, in the embodiment, the accurate positioning of the license plate can be realized by accurately determining the positions of the four vertexes of the license plate; the characteristic points are points at which two sides of the edge of the license plate image are intersected; that is, the feature points are four vertices in a rectangular license plate image.

In other embodiments of the present invention, the position of the feature point obtained at the 1 st time is obtained based on a coarse positioning frame obtained after coarse positioning; specifically, the positions of the feature points acquired at the 1 st time are the positions of four vertices in a coarse positioning frame of the license plate image, as shown in fig. 2, a dotted line is the coarse positioning frame formed after coarse positioning, and the positions of the four vertices of the coarse positioning frame may be the positions of the feature points acquired at the 1 st time. After the license plate accurate positioning device acquires the position of the feature point for the first time, the feature point is adjusted and updated according to a certain rule, so that the feature point is gradually close to the expected feature point. Then, the position of the feature point acquired by the license plate accurate positioning device at the 2 nd time may be the position of the feature point acquired at the 1 st time after adjustment and update. By analogy, the position of the feature point obtained at the ith time is the position of the feature point obtained at the ith-1 time after the feature point is obtained at the ith-1 time; wherein i is 2, 3, …, N.

And 102, selecting a local area image of the license plate image and extracting image features of the local area image based on the position of the feature point acquired for the nth time to obtain a feature vector corresponding to the position of the feature point acquired for the nth time.

The local area image is a part image of the license plate image.

In other embodiments of the present invention, step 102 selects a local area image of the license plate image and extracts image features of the local area image based on the position of the feature point obtained the nth time, and obtaining the feature vector corresponding to the position of the feature point obtained the nth time may be implemented by the license plate accurate positioning device.

Here, selecting the local area image of the license plate based on the position of the n-th acquired feature point may include: selecting a part of license plate images as local area images near the position of the feature point acquired for the nth time; it should be noted that the local area image includes the feature point obtained at the nth time.

Further, based on the selected local area image, extracting image features in the local area image; the image features may be image recognition features such as Histogram of Oriented Gradient (HOG) features, Local Binary Pattern (LBP) features, Scale Invariant Feature Transform (SIFT) features, or Haar (Haar) features. After the image features are extracted, a feature vector corresponding to the position of the feature point obtained at the nth time can be obtained; the nth feature vector may characterize texture features of the image around the location of the feature point acquired the nth time.

And 103, determining the translation distance of the feature point based on the nth feature vector, and updating the position of the feature point based on the translation distance.

And the positions of the updated characteristic points can be close to the positions of the expected characteristic points, so that the license plate can be accurately positioned.

In other embodiments of the present invention, the step 103 determines the translation distance of the feature point based on the nth feature vector, and updates the position of the feature point based on the translation distance may be implemented by the license plate precise positioning device. Here, the nth feature vector may represent texture features around the position of the feature point acquired the nth time; by analyzing texture features around the position of the feature point acquired at the nth time, the distance between the position of the current feature point and the position of the expected feature point can be deduced; the distance between the position of the current feature point and the position of the expected feature point can be understood as the translation distance of the feature point.

In practical application, the distance between the position of the current feature point and the position of the expected feature point can be obtained by acquiring a large amount of sample data, establishing a data model of the corresponding relation between the feature vector of the image and the translation distance based on a deep learning algorithm, and further obtaining the translation distance corresponding to the position of the current feature point according to the corresponding relation model.

Further, after the position and the translation distance of the current feature point are determined, the feature point is moved according to the translation distance, and the position of the updated feature point is obtained. Here, the process of adjusting the current position of the feature point is substantially a process of correcting the position of the feature point, so that the position of the feature point is closer to the position of the vertex of the actual license plate.

In other embodiments of the present invention, after updating the position of the current feature point, steps 101 to 103 are repeatedly executed until N is equal to N. Therefore, in this embodiment, it can be understood that the process of updating the positions of the feature points in the license plate image and gradually correcting the positions of the feature points is performed N times, that is, the positions of the feature points are iterated N times to implement a multi-stage regression of the feature points, so that the positions of the feature points gradually approach to the expected positions, and the purpose of accurately positioning the license plate is achieved. The positions of the feature points after N times of adjustment are the accurate positions of the feature points, and the license plate can be accurately positioned according to the accurate positions; here, N is an empirical value and can be adjusted according to actual needs.

The method for accurately positioning the license plate comprises the steps of firstly obtaining the positions of feature points of a license plate image, selecting a local area image based on the positions of the feature points, extracting the image features of the local area image to obtain feature vectors, then obtaining the translation distance of the feature points according to the feature vectors, updating the positions of the feature points based on the translation distance, and further obtaining the positions of the feature points when the feature points are adjusted next time; therefore, the positions of the feature points are adjusted and updated for N times, and the positions of the feature points are corrected step by step, so that the accurate position of the license plate can be obtained after the feature points are adjusted and updated for N times; therefore, in the process of accurately positioning the license plate, the attribute characteristics of any license plate are not relied on, and the condition that the abnormal license plate is positioned unsuccessfully is avoided; meanwhile, the positions of the feature points are updated for N times, and the positions of the feature points are corrected for multiple times, so that the accuracy of license plate positioning can be improved; has stronger transportability and applicability.

Based on the foregoing embodiments, an embodiment of the present invention provides a method for accurately positioning a license plate, which is shown in fig. 3 and includes the following steps:

and 301, acquiring the position of the characteristic point for the nth time by the license plate accurate positioning device.

Wherein, the characteristic points are the points of intersection of two sides of the edge of the license plate image; n is an integer of 1 or more and N or less; n is the maximum number of executions and is an integer greater than 2.

And step 302, determining a selection proportion corresponding to the times n of acquiring the characteristic points by the license plate accurate positioning device based on the times n of acquiring the characteristic points.

And step 303, selecting a local area image of the license plate image by the license plate accurate positioning device based on the nth selection proportion and the position of the nth acquired feature point.

The local area image is a part image of the license plate image.

In other embodiments of the present invention, in order to ensure the uniformity of the scales of the local region image and the whole license plate image, when the license plate accurate positioning device selects the local region image based on the position of the current feature point, the size of the selected local region image needs to be controlled to be adapted to the size of the license plate image surrounded by the position of the current feature point; that is, the selected local area image is in proportional relation with the size of the license plate area surrounded by the current feature points.

In this embodiment, the selection ratio when selecting the local area image may be preset; moreover, the selection proportion is different when the local area image is selected each time. Selecting a local area image once after acquiring the position of the characteristic point each time; therefore, the selection ratio when the local area image is selected each time has a corresponding relationship with the number n of times of acquiring the feature point.

Through the analysis, it can be known that n represents an iteration level, and the deeper the iteration level is, the closer the position of the feature point is to the position of the vertex of the actual license plate; therefore, as the iteration level deepens, the selected local area image is gradually reduced; here, it can be realized by controlling the nth selection ratio to be larger than the (n + 1) th selection ratio.

Exemplarily, with WnRepresenting the size of a license plate image surrounded by the position of the current feature point; by wnCharacterizing selected local regionsThe size of the domain image; wherein, wnAnd WnThe relationship between them can be expressed by the following formula:

wn=αnWn(1);

wherein alpha isnRepresenting the current nth selected proportion, alphanHas a value range of [0, 1 ]]And n represents the current iteration level.

And step 304, the license plate accurate positioning device extracts the image features of the local area image to obtain the feature vector corresponding to the position of the feature point obtained at the nth time.

Here, the description will be given taking the acquisition of the HOG feature of the local area image as an example.

After the local area image is selected, the HOG characteristic is extracted from the local area image, and the method comprises the following steps:

A. calculating a gradient; gradient calculation is carried out on the selected local area image, namely, the gradient is calculated through [ -1,0,1 [ -1]And [1,0, -1]TAnd calculating the horizontal gradient and the vertical gradient of each pixel point in the local area image by using the gradient operator to obtain the gradient direction and the gradient size of each pixel.

B. Dividing the local area image into a plurality of cells; for example, the selected local area is divided into 4x4 detection windows, each of which is subdivided into equally large unit cells as shown in fig. 4; the shaded portion in fig. 4 is a unit cell, and the size is 2 × 2.

C. Selecting a direction channel; evenly dividing the angle of 0-180 degrees or 0-360 degrees into n directional channels;

D. acquiring a histogram; counting the number of each pixel in each unit cell in a channel to obtain a histogram; here, the abscissa of the histogram is the n directional channels selected in step C, and the ordinate of the histogram is the cumulative sum of the gradient magnitudes of the pixels belonging to a certain directional channel; and splicing the histograms in each cell in each detection window to finally obtain a group of characteristic vectors, wherein the characteristic vectors can represent the integral image texture characteristics of the local area image. Here, the feature vector is a feature vector corresponding to the position of the feature point acquired the nth time. It should be noted that the concatenation of the histograms of each cell in each detection window may be a concatenation of the histograms of each cell in a clockwise or counterclockwise direction.

And 305, acquiring a weight value corresponding to the nth characteristic vector by the license plate accurate positioning device based on the nth characteristic vector.

The license plate accurate positioning device can pre-store a corresponding relation table of the characteristic vectors and the weight values; after the nth characteristic vector is obtained, the license plate accurate positioning device searches a weight value corresponding to the nth characteristic vector from the corresponding relation table of the characteristic vector and the weight value.

In practical application, the correspondence table between the feature vectors and the weight values can be obtained through the following steps:

step 3051, the license plate accurate positioning device obtains at least one group of historical sample data.

The historical sample data comprises at least one group of characteristic vectors and initial positions and target positions corresponding to the characteristic vectors; the initial position is the initial position of the characteristic point corresponding to the characteristic vector, and the target position is the accurate position of the characteristic point corresponding to the characteristic vector;

step 3052, the license plate accurate positioning device determines a weight value corresponding to each group of feature vectors based on at least one group of feature vectors and the initial position and the target position corresponding to the feature vectors to obtain a feature vector and weight value correspondence table.

According to the initial position and the target position of the feature point in the historical sample data, a position difference value △ x can be obtained, generally, the smaller the position difference value between the initial position and the target position is, the closer the initial position is to the target position is, therefore, in the data training process, the weight value which enables the position difference value to be the minimum can be obtained as the optimal weight value, and specifically, the optimal weight value corresponding to the feature vector can be obtained through the following formula:

Figure BDA0001725953580000101

wherein X is a feature vector, delta is a weight value distributed to the feature vector X in the data training process, and delta*The obtained optimal weight value corresponding to the feature vector X is obtained.

By the method, the optimal weight value corresponding to the feature vector in each group of sample data can be obtained, the feature vector of each group corresponds to the optimal weight value, a corresponding relation table of the feature vector and the weight value is generated and stored in the storage space of the license plate accurate positioning device, and the license plate accurate positioning device can read the corresponding relation table.

And step 306, the license plate accurate positioning device obtains the translation distance of the feature point based on the nth feature vector and the weight value corresponding to the nth feature vector.

In this embodiment, the translation distance d of the feature point can be obtained by the following formula:

d=δ**X (3);

wherein X is a feature vector, δ*The obtained optimal weight value corresponding to the feature vector X is obtained.

And 307, updating the positions of the feature points by the license plate accurate positioning device based on the translation distance and the positions of the feature points.

In step 306, the translation distance of the feature point is obtained, and the feature point is moved according to the translation distance to obtain the updated position of the feature point. Specifically, the updated position of the feature point can be obtained by the following formula:

f(x,y)n+1=f(x,y)n+dn(4);

wherein, f (x, y)nFor the nth time the position of the feature point is acquired, dnThe translation distance corresponding to the position of the feature point for the nth acquisition, f (x, y)n+1Is the position of the updated feature point.

In other embodiments of the present invention, after updating the position of the current feature point, steps 301 to 307 are repeatedly executed until N is equal to N.

In this embodiment, the positions of the feature points in the license plate image are updated N times, and the positions of the feature points are gradually corrected, that is, the positions of the feature points are iterated N times, so that the multi-level regression of the feature points is realized, and the positions of the feature points are gradually close to the expected positions, thereby achieving the purpose of accurately positioning the license plate. As N is larger, the position of the obtained final feature point is closer to the position of the vertex of the actual license plate, as shown in fig. 5 and 6, fig. 5 is a position where the feature point is located when an iteration is performed in the embodiment of the present invention, that is, when N is 1; in fig. 5, black dots represent the positions of the feature points. Fig. 6 shows the positions of the feature points when five iterations are performed, i.e., when n is 5. Obviously, as the iteration hierarchy deepens, the positions of the feature points are closer to the positions of the vertexes of the actual license plate.

Further, step 307 may be followed by the following steps:

and 308, the license plate accurate positioning device acquires the position of the feature point acquired for the nth time and the position of the updated feature point.

And 309, updating the corresponding relation between the feature vector and the weight value by the license plate accurate positioning device based on the nth feature vector, the position of the feature point obtained for the nth time and the position of the updated feature point.

In other embodiments of the present invention, after the step 307 is completed, the position of the updated feature point may be obtained; then, a position difference value is obtained according to the position of the feature point before updating and the position of the feature point after updating, and meanwhile, the nth feature vector is also known; therefore, a group of sample data can be obtained from the data, and the corresponding relation between the feature vector and the weight value can be updated according to the group of sample data, so that the corresponding relation between the feature vector and the weight value is closer to the actual situation, and the real situation can be represented.

It should be noted that, for the explanation of the same or related steps in this embodiment as in other embodiments, reference may be made to the description in other embodiments, and details are not described here again.

The method for accurately positioning the license plate comprises the steps of firstly obtaining the positions of feature points of a license plate image, selecting a local area image based on the positions of the feature points, extracting the image features of the local area image to obtain feature vectors, then obtaining the translation distance of the feature points according to the feature vectors, updating the positions of the feature points based on the translation distance, and further obtaining the positions of the feature points when the feature points are adjusted next time; therefore, the positions of the feature points are adjusted and updated for N times, and the positions of the feature points are corrected step by step, so that the accurate position of the license plate can be obtained after the feature points are adjusted and updated for N times; therefore, in the process of accurately positioning the license plate, the attribute characteristics of any license plate are not relied on, and the condition that the abnormal license plate is positioned unsuccessfully is avoided; meanwhile, the positions of the feature points are updated for N times, and the positions of the feature points are corrected for multiple times, so that the accuracy of license plate positioning can be improved; has stronger transportability and applicability.

In order to implement the method according to the embodiment of the present invention, an embodiment of the present invention further provides a license plate accurate positioning device, as shown in fig. 7, where the license plate accurate positioning device includes:

an acquisition unit 71 configured to acquire the position of the feature point n-th time; wherein the characteristic points are points at which two sides of the edge of the license plate image are intersected; n is an integer of 1 or more and N or less; n is the maximum number of executions and is an integer greater than 2;

a feature extraction unit 72, configured to select a local area image of the license plate image and extract image features of the local area image based on the position of the feature point obtained for the nth time, so as to obtain a feature vector corresponding to the position of the feature point obtained for the nth time; wherein the local area image is a partial image of the license plate image;

a processing unit 73, configured to determine a translation distance of the feature point based on the nth feature vector, and update a position of the feature point based on the translation distance; and the positions of the updated characteristic points can be close to the positions of expected characteristic points, so that the license plate can be accurately positioned.

In some embodiments, the feature extraction unit 72 is further configured to determine, based on the number n of times of obtaining the feature point, a selection ratio corresponding to the number n of times of obtaining the feature point; and selecting a local area image of the license plate image based on the nth selection proportion and the position of the nth acquired feature point.

In some embodiments, the feature extraction unit 72 is configured to control the nth selection ratio to be greater than the (n + 1) th selection ratio.

In some embodiments, the processing unit 73 is specifically configured to obtain, based on the nth feature vector, a weight value corresponding to the nth feature vector; obtaining the translation distance of the feature point based on the nth feature vector and the weight value corresponding to the nth feature vector; and updating the positions of the feature points based on the translation distance and the positions of the feature points.

In some embodiments, the processing unit 73 is further configured to obtain at least one set of historical sample data; the historical sample data comprises at least one group of characteristic vectors and initial positions and target positions corresponding to the characteristic vectors; the initial position is the initial position of the feature point corresponding to the feature vector, and the target position is the precise position of the feature point corresponding to the feature vector; and determining a weight value corresponding to each group of feature vectors based on the at least one group of feature vectors and the initial position and the target position corresponding to the feature vectors to obtain a corresponding relation table of the feature vectors and the weight values.

In some embodiments, the processing unit 73 is further configured to obtain the position of the feature point obtained the nth time and the position of the updated feature point; and updating the corresponding relation between the feature vector and the weight value based on the nth feature vector, the position of the feature point obtained for the nth time and the position of the updated feature point.

The accurate positioning device for the license plate provided by the embodiment of the invention comprises the following steps of firstly obtaining the position of a feature point of a license plate image, selecting a local area image based on the position of the feature point, extracting the image feature of the local area image to obtain a feature vector, then obtaining the translation distance of the feature point according to the feature vector, updating the position of the feature point based on the translation distance, and further obtaining the position of the feature point when the feature point is adjusted next time; therefore, the positions of the feature points are adjusted and updated for N times, and the positions of the feature points are corrected step by step, so that the accurate position of the license plate can be obtained after the feature points are adjusted and updated for N times; therefore, in the process of accurately positioning the license plate, the attribute characteristics of any license plate are not relied on, and the condition that the abnormal license plate is positioned unsuccessfully is avoided; meanwhile, the positions of the feature points are updated for N times, and the positions of the feature points are corrected for multiple times, so that the accuracy of license plate positioning can be improved; has stronger transportability and applicability.

Based on the hardware implementation of each unit in the above license plate accurate positioning device, in order to implement the license plate accurate positioning method provided by the embodiment of the present invention, an embodiment of the present invention further provides a license plate accurate positioning device, as shown in fig. 8, where the license plate accurate positioning device 80 includes: a processor 81 and a memory 82 configured to store a computer program capable of running on the processor,

wherein the processor 81 is configured to perform the method steps in the preceding embodiments when running the computer program.

In an exemplary embodiment, the present invention further provides a computer readable storage medium, such as a memory 82, comprising a computer program, which is executable by a processor 81 of the license plate pinpointing device 80 to perform the steps of the aforementioned method. The computer-readable storage medium may be a Memory such as a magnetic random access Memory (FRAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a flash Memory (FlashMemory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM).

The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于HDNet的输电场景下吊车入侵检测机制

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!