Identification method and device

By collecting and processing images in the driving recorder, identifying parking line and traffic light information, and combining related images to judge the behavior of running a red light, the problem of manual confirmation in the existing technology is solved, automatic recognition is achieved, and efficiency and accuracy are improved. .

CN113761967BActive Publication Date: 2024-11-29CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010486131.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-01
Publication Date
2024-11-29
Estimated Expiration
2040-06-01

AI Technical Summary

Technical Problem

In the prior art, the identification of vehicle red light incidents relies on manually viewing images taken by cameras, which consumes a lot of manpower and time and is inefficient.

Method used

By collecting images in the dash recorder, preprocessing it and identifying parking line and traffic light information, determining whether the vehicle is at the intersection of traffic lights, and using the associated images to determine whether there is red light running, realizing automatic recognition.

Benefits of technology

It saves a lot of manpower and time, improves recognition efficiency and accuracy, and realizes intelligent automatic identification of vehicle running red lights.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761967B_ABST
    Figure CN113761967B_ABST
Patent Text Reader

Abstract

The present application discloses a recognition method and device, wherein the method comprises: collecting at least two frames of images recorded by a driving recorder within a certain period of time, and preprocessing the at least two frames of images; identifying stop line information and traffic light information in each frame of images after preprocessing; determining whether a vehicle is at a traffic light intersection within the certain period of time based on the stop line information and traffic light information; in the case where it is identified that the vehicle is at a traffic light intersection within the certain period of time, identifying a target image from the at least two frames of images after preprocessing, wherein the target image is characterized as an image in which the vehicle first crosses the stop line in the at least two frames of images; obtaining at least two frames of associated images that are temporally adjacent to the target image from the at least two frames of images after preprocessing; and determining whether the vehicle has run a red light within the certain period of time based on the at least two frames of associated images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to image processing technology, and in particular to a recognition method and device. Background Art

[0002] In the prior art, multiple cameras are usually installed at traffic intersections to shoot vehicles from multiple angles to identify whether a vehicle has run a red light. However, when insurance companies need to make claims for vehicles running red lights, they cannot use the images taken by the cameras at the traffic intersections. They can only manually check the images in the vehicle's driving recorder to manually confirm whether the vehicle has run a red light. This manual confirmation method consumes a lot of manpower and time. Summary of the invention

[0003] In order to solve the existing technical problems, the present application provides a recognition method and device, which can realize automatic recognition of whether a vehicle runs a red light, thereby avoiding a large amount of manpower and time.

[0004] The technical solution of this application is implemented as follows:

[0005] The present application provides an identification method, the method comprising:

[0006] Collect at least two frames of images recorded by the driving recorder within a certain period of time;

[0007] Preprocessing the at least two frames of images;

[0008] Identify the stop line information and traffic light information in each frame image after preprocessing;

[0009] Determine whether the vehicle is at a traffic light intersection within the certain time period according to the stop line information and the traffic light information;

[0010] In the case where it is identified that the vehicle is at the traffic light intersection within the certain period of time, a target image is identified from the at least two frames of images after preprocessing, wherein the target image is characterized as an image in which the vehicle first crosses the stop line in the at least two frames of images;

[0011] Obtaining at least two frames of associated images that are temporally adjacent to the target image from the at least two frames of preprocessed images;

[0012] Based on the at least two frames of associated images, it is determined whether the vehicle has run a red light within the certain period of time.

[0013] In the above solution, determining whether the vehicle has run a red light within the certain period of time based on the at least two frames of associated images includes:

[0014] Determining the driving state of the vehicle within the certain period of time based on the at least two frames of associated images;

[0015] Extracting the traffic light information in the at least two associated images from the preprocessed traffic light information in the at least two frames of images;

[0016] According to the driving state and the traffic light information in the at least two frames of associated images, it is determined whether the vehicle has run a red light within the certain period of time.

[0017] In the above solution, the step of identifying the parking line information in each frame image after preprocessing includes:

[0018] Identify the parking line region of interest of each frame image after preprocessing;

[0019] Identify whether there are longitudinal lane lines and / or transverse lane lines in the stop line region of interest;

[0020] The longitudinal lane lines and / or transverse lane lines existing in the identified stop line region of interest are regarded as stop line information.

[0021] In the above solution, identifying the target image from the at least two pre-processed frames of images includes:

[0022] Recognize longitudinal lane lines and / or transverse lane lines on each preprocessed frame image;

[0023] For each frame image that identifies longitudinal lane lines and / or transverse lane lines, an image in which a breakpoint first appears in the longitudinal lane line and / or a longitudinal tangent point first formed between the front of the vehicle and the transverse lane line is identified as a target image.

[0024] In the above solution, the step of identifying the traffic light information in each frame of the preprocessed image includes:

[0025] Identify the traffic light region of interest from each preprocessed frame image;

[0026] According to the aspect ratio of the traffic light region of interest, the traffic light region of interest that meets the requirements is screened out;

[0027] Matching the sample data with the traffic light region of interest that meets the requirements, the sample data being the features of the traffic lights characterized by different colors and shapes;

[0028] According to the matching result, a traffic light region of the image including the traffic light region of interest that meets the requirements and traffic light information in the image are obtained;

[0029] The traffic light information includes traffic light information representing different colors and different shapes.

[0030] In the above solution, for at least a portion of the first image in the image including the traffic light region of interest that meets the requirements, the first image is an image in which the traffic light information in the image cannot be obtained according to the matching result.

[0031] Obtaining a traffic light region of interest that meets the requirements of the first image;

[0032] Classify the sample data according to the shape of traffic lights;

[0033] According to the classified sample data, the traffic light interest region that meets the requirements of the first image is divided into shapes;

[0034] The color and shape of the traffic light in the first image are identified from the traffic light interest region divided into a certain shape.

[0035] In the above solution, the determining the driving state of the vehicle within the certain period of time based on the at least two frames of associated images includes:

[0036] Obtaining the vertical position of the traffic light from at least two preprocessed frames of images, and determining the driving state of the vehicle according to the change of the vertical position of the traffic light in the at least two associated frames of images; the driving state includes at least moving forward and stopping;

[0037] The horizontal position of the traffic light is obtained from at least two preprocessed image frames, and the driving direction of the vehicle is determined according to the change of the horizontal position of the traffic light in the at least two associated image frames.

[0038] The embodiment of the present application further provides an identification device, the device comprising a collection unit, a preprocessing unit, a first identification unit, a first determination unit, a second identification unit, an acquisition unit, and a second determination unit; wherein,

[0039] The acquisition unit is used to acquire at least two frames of images recorded by the driving recorder within a certain period of time;

[0040] The preprocessing unit is used to preprocess the at least two frames of images;

[0041] The first recognition unit is used to recognize the stop line information and the traffic light information in each frame image after preprocessing;

[0042] The first determination unit is used to determine whether the vehicle is at a traffic light intersection within the certain time according to the stop line information and the traffic light information;

[0043] The second recognition unit is used to recognize a target image from the at least two frames of images after preprocessing when recognizing that the vehicle is at the traffic light intersection within the certain period of time, wherein the target image is characterized as an image of the vehicle first crossing the stop line in the at least two frames of images;

[0044] The acquisition unit is used to obtain at least two frames of associated images that are temporally adjacent to the target image from the at least two frames of preprocessed images;

[0045] The second determination unit is used to determine whether the vehicle has run a red light within the certain period of time based on the at least two frames of associated images.

[0046] In the above solution, the second determining unit is further used for:

[0047] Determining the driving state of the vehicle within the certain period of time based on the at least two frames of associated images;

[0048] Extracting the traffic light information in the at least two associated images from the preprocessed traffic light information in the at least two frames of images;

[0049] According to the driving state and the traffic light information in the at least two frames of associated images, it is determined whether the vehicle has run a red light within the certain period of time.

[0050] In the above solution, the first identification unit is further used for:

[0051] Identify the stop line region of interest of each frame image after preprocessing; identify whether there are longitudinal lane lines and / or transverse lane lines in the stop line region of interest; regard the longitudinal lane lines and / or transverse lane lines existing in the identified stop line region of interest as stop line information.

[0052] In the above solution, the second identification unit is further used for:

[0053] Recognize longitudinal lane lines and / or transverse lane lines on each preprocessed frame image;

[0054] For each image that identifies longitudinal lane lines and / or transverse lane lines, an image that identifies the first breakpoint in the longitudinal lane line and / or the first longitudinal tangent point between the front of the vehicle and the transverse lane line is determined as a target image.

[0055] In the above solution, the first identification unit is further used for:

[0056] Identify the traffic light region of interest from each preprocessed frame image;

[0057] According to the aspect ratio of the traffic light region of interest, the traffic light region of interest that meets the requirements is screened out;

[0058] Matching the sample data with the traffic light region of interest that meets the requirements, the sample data being the features of the traffic lights characterized by different colors and shapes;

[0059] According to the matching result, a traffic light region of the image including the traffic light region of interest that meets the requirements and traffic light information in the image are obtained;

[0060] The traffic light information includes traffic light information representing different colors and different shapes.

[0061] In the above solution, for at least part of the first image in the image including the traffic light region of interest that meets the requirements, the first image is an image in which traffic light information in the image cannot be obtained according to the matching result, the first recognition unit is further used to:

[0062] Obtaining a traffic light region of interest that meets the requirements of the first image;

[0063] Classifying the sample data according to the shape of the traffic light; dividing the shape of the traffic light region of interest that meets the requirements of the first image according to the classified sample data;

[0064] The color and shape of the traffic light in the first image are identified from the traffic light interest region divided into a certain shape.

[0065] In the above solution, the second determining unit is further used for:

[0066] Obtaining the vertical position of the traffic light from at least two preprocessed image frames, and determining the driving state of the vehicle according to the change of the vertical position of the traffic light in the at least two associated image frames; the driving state includes at least moving forward and stopping;

[0067] The horizontal position of the traffic light is obtained from at least two preprocessed image frames, and the driving direction of the vehicle is determined according to the change of the horizontal position of the traffic light in the at least two associated image frames.

[0068] The present application provides a recognition method and device, wherein the recognition method comprises: collecting at least two frames of images recorded by a driving recorder within a certain period of time, preprocessing the collected at least two frames of images, determining whether a vehicle is at a traffic light intersection within a certain period of time according to the traffic light information and stop line information recognized from the at least two frames of images after preprocessing, and in the case where the vehicle is at a traffic light intersection within a certain period of time, identifying the image of the first time of pressing the stop line from the at least two frames of images after preprocessing as a target image, obtaining at least two frames of associated images adjacent to the target image in time, and determining whether the vehicle runs a red light within a certain period of time according to the at least two frames of associated images. The recognition method provided by the present application automatically collects and recognizes images in the driving recorder, and does not require manual collection and recognition, thereby saving a lot of manpower and time. In addition, the recognition method in the embodiment of the present application makes full use of the data in the driving recorder, and does not require additional data collection. And it can use the at least two frames of associated images in the driving recorder that are adjacent to the image of the first time of pressing the stop line in time to identify whether the vehicle runs a red light, thereby realizing intelligent recognition, without the need for manual recognition, saving manpower and time. This automatic recognition of red light running behavior using associated images can improve recognition accuracy.

[0069] In the technical solution for determining whether a vehicle runs a red light at a traffic light intersection based on at least two frames of associated images, the present application determines the driving state of the vehicle at the traffic light intersection based on the vertical position of the traffic light and the horizontal position of the traffic light in at least two frames of associated images, which can improve the accuracy of recognition;

[0070] In the technical solution for identifying the parking line information in at least two frames of images, the present application automatically identifies the parking line information in each frame of preprocessed images to avoid manual review and spend a lot of manpower and time, thereby improving recognition efficiency and reducing the cost required for recognition;

[0071] In the technical solution for identifying the target image in at least two frames of images, the present application determines that the image where the vehicle first crosses the stop line is the target image based on the first appearance of a breakpoint in the longitudinal lane line in the stop line information and / or the first longitudinal tangent point formed between the front of the vehicle and the transverse lane line, thereby improving the accuracy of identification;

[0072] In the technical solution for identifying traffic light information in at least two frames of images, the present application pre-processes at least two frames of images, identifies a traffic light region of interest, and screens out a traffic light region of interest that meets the requirements according to the aspect ratio of the traffic light region of interest. The traffic light region that meets the requirements can be automatically screened out from the traffic light region according to the aspect ratio of the traffic light region. Compared with manual processing, the processing time is shortened, thereby improving the efficiency of identifying traffic light information in each frame of image; further, the present application matches the sample data with the traffic light region of interest that meets the requirements, and can improve the accuracy of matching based on the sample data obtained by comprehensively considering the shape and color (traffic light information) of the traffic lights in real life;

[0073] The present application also considers that there are images in which the traffic light information in the image cannot be obtained according to the matching results. By matching such images with sample data classified according to shapes, it can be ensured that the traffic light area and traffic light information in the image including the traffic light area of ​​interest that meets the requirements are all identified according to the matching results, thereby preventing the omission of some traffic light areas and traffic light information in the image that meet the requirements, thereby improving the rigor of identifying the red light running behavior of vehicles;

[0074] In the technical solution for determining whether a vehicle is located at a traffic light intersection within a certain period of time, the present application identifies whether the vehicle is at a traffic light intersection based on a combination of stop line information and traffic light information, thereby avoiding inaccurate identification of traffic light intersections and improving the accuracy of automatically identifying vehicles running red lights based on at least two frames of images in a driving recorder. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0076] Figure 1 A flowchart of an identification method provided in an embodiment of the present application;

[0077] Figure 2 A schematic diagram of coordinates of a traffic light region of interest that meets the requirements provided in an embodiment of the present application;

[0078] Figure 3 A schematic diagram of traffic light sample data provided in an embodiment of the present application;

[0079] Figure 4 A coordinate diagram for identifying a vehicle driving state provided in an embodiment of the present application;

[0080] Figure 5 A schematic diagram of a flow chart of an identification device provided in an embodiment of the present application;

[0081] Figure 6 An example of an application scenario of an identification method provided in an embodiment of the present application Figure 1 ;

[0082] Figure 7 An example of an application scenario of an identification method provided in an embodiment of the present application Figure 2 ;

[0083] Figure 8 A schematic diagram of a process for identifying traffic light information provided in an embodiment of the present application;

[0084] Fig. 9 A schematic diagram of a process for identifying stop line information and driving status provided in an embodiment of the present application;

[0085] Fig.10 A schematic diagram of the hardware structure of an identification device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0086] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily.

[0087] In current technology, cameras are usually installed at multiple locations at intersections (traffic light intersections) to shoot the exterior of the vehicle from multiple angles to identify whether the vehicle has run a red light. In order to facilitate non-traffic department personnel or organizations (such as insurance companies) to determine whether a vehicle has run a red light at an intersection, the embodiment of the present application provides an identification method that uses images captured by a driving recorder inside the vehicle to identify the vehicle's red light running behavior. Figure 1 FIG. 1 is a flow chart of an identification method provided in an embodiment of the present application, wherein the method comprises:

[0088] (Step) S101: Collect at least two frames of images recorded by the driving recorder within a certain period of time;

[0089] S102: Preprocessing the at least two frames of images;

[0090] In order to determine whether a vehicle runs a red light when passing a certain traffic light intersection within a certain period of time, at least two frames of images recorded by a driving recorder within a certain period of time are collected and preprocessed. Specifically, the preprocessing steps are graying, binarization and edge detection of each of the at least two frames of images.

[0091] Among them, grayscale is to set the parameter values ​​of the three parameters R (Red), G (Green) and B (Blue) of each pixel in the image to the same value to simplify the color data in the image. In general, the grayscale value can be the average or weighted average of the R, G and B parameters of the original pixel, or the value of one parameter (such as R) among R, G and B. Take the pixel F in a frame of image as an example. The R, G and B parameters of F are 50, 180 and 220 respectively. The average of 50, 180 and 220 is calculated to get 150, and the R, G and B parameters of F are updated to 150.

[0092] Binarization is to set the R, G, and B parameter values ​​of the pixels in the grayscale image that are greater than the set threshold to the maximum value of 255, and the R, G, and B parameter values ​​of the pixels that are less than or equal to the set threshold to the minimum value of 0, so that the R, G, and B parameter values ​​of each pixel in the image are only 0 or 255. While further simplifying the color data in the image, it also highlights the pixels with obvious brightness changes in the image, so that only white areas with high brightness and black areas with low brightness are presented in the image. Assuming that the set threshold is 150, the R, G, and B parameters of the grayscale pixel F are 150, then the R, G, and B parameters of the pixel F are updated to 0.

[0093] Perform edge detection on the binarized image, identify the pixels with obvious brightness changes in the image, and obtain the edges of the high-brightness area and the low-brightness area in the image. Obviously, in each frame of the image, the stop line information and the traffic light information are both high-brightness areas. By identifying the edges of the high-brightness area and the low-brightness area, the edges of the area where the stop line information and the traffic light information are located can be determined in the image.

[0094] After preprocessing at least two frames of images, S103 and S104 are executed.

[0095] S103: Identifying the stop line information and the traffic light information in each frame image after preprocessing;

[0096] S104: Determine whether the vehicle is at a traffic light intersection within the certain time period according to the stop line information and the traffic light information;

[0097] It can be understood that the purpose of S101 to S104 is to obtain the stop line information and traffic light information in the at least two frames of images after preprocessing, and determine whether the vehicle is at the traffic light intersection within the certain time based on the two types of information in the at least two frames of images after preprocessing. In addition, the traffic light information described in the embodiment of the present application includes the shape and color of the traffic light, and the recognition of the traffic light information described below is specifically the recognition of the shape and color of the traffic light.

[0098] After executing the method in S102, continue to execute S103 to identify the stop line information and traffic light information in each frame image after preprocessing. Obviously, S103 involves identifying two different types of information, the stop line information and the traffic light information. Based on this, the identification of the stop line information and the traffic light information will be described in the first part and the second part respectively.

[0099] Let's first look at the first part: identifying the parking line information in each frame image after preprocessing. The identifying the parking line information in the at least two frames of images after preprocessing includes:

[0100] The first step is to identify the parking line area of ​​interest of each frame image after preprocessing;

[0101] Step 2: Identify whether there are longitudinal lane lines and / or transverse lane lines in the stop line area of ​​interest;

[0102] The third step is to regard the longitudinal lane lines and / or transverse lane lines existing in the identified stop line region of interest as stop line information.

[0103] From the first step, it can be seen that in order to accurately determine whether a vehicle is at a traffic light intersection within a certain period of time, it is necessary to identify whether there is a stop line information in front of the front of the vehicle in each frame image recorded by the collected driving recorder within a certain period of time. Therefore, it is necessary to first identify the preset stop line area of ​​interest in front of the front of the vehicle. Specifically, the stop line area of ​​interest is a rectangular area determined in front of the front of the vehicle in each frame image according to a preset length and width, which is used to identify whether there is a stop line information in front of the front of the vehicle. When the vehicle is in a forward driving state, the image information in the stop line area of ​​interest in each frame image keeps changing.

[0104] Following the method in the first step, the method in the second step is to identify whether there are lateral lane lines and / or longitudinal lane lines in the stop line area of ​​interest in each frame image after preprocessing, and in the third step, it is indicated that the lateral lane lines and / or longitudinal lane lines identified in the second step are the stop line information, thereby determining that when the lateral lane lines and / or longitudinal lane lines are identified in the stop line area of ​​interest, the stop line information is identified.

[0105] Through the solution in the first part above, the parking line information in each frame image after preprocessing can be automatically recognized to avoid manual review which consumes a lot of manpower and time, thereby improving recognition efficiency and reducing the cost required for recognition.

[0106] During the implementation of the method for identifying the stop line information in each frame image after preprocessing in the first part, the method for identifying the traffic light information in each frame image after preprocessing in the second part can be implemented simultaneously or at different times, depending on the actual situation (such as the hardware performance of the running program).

[0107] Next, let's look at the second part: identifying the traffic light information in each frame of image after preprocessing. The identifying of the traffic light information in each frame of image includes:

[0108] The first step is to identify the traffic light region of interest from each frame of preprocessed images;

[0109] Step 2: According to the aspect ratio of the traffic light interest region, the traffic light interest region that meets the requirements is screened out;

[0110] Step 3: Match the sample data with the traffic light region of interest that meets the requirements, where the sample data is the features of the traffic lights characterized by different colors and shapes;

[0111] Step 4: based on the matching result, a traffic light region of an image including a traffic light region of interest that meets the requirements and traffic light information in the image are obtained; wherein the traffic light information includes traffic light information representing different colors and different shapes.

[0112] First, in the first step, the traffic light region of interest is identified from each preprocessed frame image. The specific method is to identify the white region with high brightness in each preprocessed frame image, and use the identified white region similar to a quadrilateral as the traffic light region of interest, and the traffic light region of interest in each preprocessed frame image can be identified. In addition to identifying the traffic light region of interest in each preprocessed frame image by identifying the white region with high brightness in each preprocessed frame image, in order to obtain a white region with an edge closer to a quadrilateral, the preprocessed image can also be preprocessed by an expansion operation, and the recognition of the traffic light region of interest is realized in this way. Specifically, for each preprocessed frame image (each preprocessed frame image includes a white region), the preprocessed frame image is expanded, and the expansion operation of the image can expand the white region in the image, and the expanded white region can form a quadrilateral convex body, and one or more quadrilateral convex bodies in each preprocessed frame image are identified as the traffic light region of interest. The aforementioned dilation operation is equivalent to a preprocessing scheme adopted before identifying the traffic light region of interest. This preprocessing scheme can highlight the white area in the image, so that the traffic light region of interest can be identified more accurately.

[0113] Then in the second step, in order to filter out the traffic light region of interest that meets the requirements from the traffic light region of interest, a point on the vehicle in each frame image is selected as the origin (such as the center point of the vehicle in the image), the horizontal line where the origin is located is used as the X-axis, and the vertical line where the origin is located is used as the Y-axis to establish a two-dimensional coordinate system. Then, taking the processing of a traffic light region of interest in a frame image as an example, according to the vertical coordinates of the highest point and the lowest point in the traffic light region of interest, and the horizontal coordinates of the leftmost point and the rightmost point, the minimum circumscribed rectangle of the traffic light region of interest, as well as its width and height are obtained, and the ratio of the width to the height is calculated to obtain the aspect ratio of the traffic light region of interest in the image. When the aspect ratio is greater than the first threshold and less than the second threshold, the traffic light region of interest is determined to be a traffic light region of interest that meets the requirements, otherwise the traffic light region of interest is discarded. Among them, the first threshold is less than the second threshold, and the values ​​of the first threshold and the second threshold depend on the actual situation. Generally, a decimal close to 1 is selected, for example, the first threshold is set to 0.667 and the second threshold is set to 1.8. For further elaboration of the scheme in the first step, please refer to the following description of Figure 2 The method in the second step can automatically select the traffic light area that meets the requirements from the traffic light area according to the aspect ratio of the traffic light area. Compared with manual processing, the processing time is shortened, thereby improving the efficiency of identifying the traffic light information in each frame image.

[0114] Then in the third step, in order to identify the traffic light information in the image including the traffic light region of interest that meets the requirements, various forms of traffic light information are determined as sample data according to the shape and color of the traffic light information, and the traffic light region of interest that meets the requirements is matched based on the sample data, thereby obtaining the traffic light region and traffic light information in the image. Among them, the shape of the traffic light information includes at least a circle and an arrow shape, and the colors are generally three (for example, red, green, and yellow). Assuming that the sample data is determined based on the shape of the traffic light being a circle and an arrow shape, and based on the color of the traffic light being three (for example, red, green, and yellow), twelve forms of traffic light information can be obtained as sample data, including three color forms of circular traffic lights (circular red light, circular green light, and circular yellow light) and nine forms of arrow-shaped traffic lights in three directions × three colors (left turn arrow-shaped red light, left turn arrow-shaped green light, left turn arrow-shaped yellow light, straight arrow-shaped red light, straight go arrow-shaped green light, straight go arrow-shaped yellow light, right turn arrow-shaped red light, right turn arrow-shaped green light, right turn arrow-shaped yellow light). For details, please refer to Figure 3 Twelve sample traffic light samples in the sample data. In a preferred solution, a convolutional neural network is used to match an image including a traffic light region of interest that meets the requirements with sample data, specifically: the sample data is put into a convolutional neural network as a reference object, and the convolutional neural network is trained using a traffic light image with a known traffic light region and traffic light information, so as to obtain a convolutional neural network that can accurately match the known traffic light image with the sample data. An image including a traffic light region of interest that meets the requirements is input into a convolutional neural network, matched with the sample data in the convolutional neural network, and a traffic light region in the image including a traffic light region of interest that meets the requirements is output, and the traffic light information of the image is determined. If the traffic light region cannot be identified, it is determined that there is no traffic light region and traffic light information in the image. Among them, the convolutional neural network includes but is not limited to a visual geometry network (Visual Geometry Group Net, VGGNet) and an Alex network (AlexNet) and other convolutional neural networks applied to image classification, the purpose of which is to identify the traffic light region in an image including a traffic light region of interest that meets the requirements and determine the traffic light information of the image. By comprehensively considering the shape and color of traffic lights in real life (traffic light information), the sample data obtained can improve the matching accuracy when used for matching with an image including a traffic light region of interest that meets the requirements.

[0115] In the fourth step, based on the matching results in the second step, the traffic light area in the image is identified from the image including the traffic light area of ​​interest that meets the requirements, it is determined whether there is a traffic light area and traffic light information in the image, and the traffic light area and traffic light information in the image where the traffic light area and traffic light information exist are identified. This automatic recognition process improves the efficiency of identifying vehicles running red lights.

[0116] It should be noted that, according to the matching result in the third step, some images in the image including the traffic light region of interest that meets the requirements can identify the traffic light region and traffic light information, and other images cannot identify the traffic light region and traffic light information, and these images are referred to as first images. In a preferred solution, in order to determine whether the first image has the traffic light region and traffic light information, it is necessary to perform the fifth step to prevent the traffic light region and traffic light information in the image from being missed.

[0117] Step 5. For at least part of the first image in the image including the traffic light region of interest that meets the requirements, the first image is an image in which the traffic light information in the image cannot be obtained based on the matching result, obtain the traffic light region of interest that meets the requirements of the first image; classify the sample data according to the shape of the traffic lights; based on the classified sample data, divide the traffic light region of interest that meets the requirements of the first image into shapes; and identify the color and shape of the traffic light in the first image from the traffic light region of interest divided into certain shapes.

[0118] In the fifth step, considering that matching all sample data with an image including a traffic light region of interest that meets the requirements will result in an inaccurate matching result, the sample data is classified according to the shape of the traffic light, and the sample data of different shapes are matched with the traffic light region of interest that meets the requirements in the first image, and the traffic light region and traffic light information of part or all of the image are identified from the first image. Taking sample data of a certain shape as an example, in a preferred solution, a convolutional neural network is used to match the first image with sample data of different shapes, specifically: the sample data of the shape is put into the convolutional neural network as a reference object, and the convolutional neural network is trained using the traffic light image of the shape with known traffic light region and traffic light information, so as to obtain a convolutional neural network region that can accurately match the known traffic light image with the sample data of the shape. The first image is input into the convolutional neural network, and matched with the sample data of the shape in the convolutional neural network. According to the matching result, the traffic light interest region in the first image corresponding to the shape that meets the requirements is output, and the traffic light region of the image corresponding to the shape that can identify the traffic light region and traffic light information is obtained, and the traffic light information of the image is determined. If the traffic light region cannot be identified, it is determined that the traffic light region and traffic light information of the image cannot be identified using the sample data of the shape, and the sample data of another shape is used to identify the part of the first image where the traffic light region and traffic light information are not identified. For the sample data of another shape, the convolutional neural network is trained with the same principle, and the part of the first image where the traffic light region and traffic light information are not identified is matched with the sample data of the shape, and so on. Finally, the first image where the traffic light region cannot be identified is an image without a traffic light region. Among them, the convolutional neural network includes but is not limited to the convolutional neural network applied to image classification such as the Visual Geometry Group Net (VGGNet) and the Alex network (AlexNet), and the purpose is to identify the traffic light region in the first image and determine the traffic light information of the image. Through this solution, it can be ensured that the traffic light area and traffic light information in the image including the traffic light area of ​​interest that meets the requirements are identified, preventing the omission of some traffic light areas and traffic light information in the image that meet the requirements, thereby improving the rigor of identifying vehicles running red lights.

[0119] According to the stop line information of each preprocessed frame image identified in the first part and the traffic light information of each preprocessed frame image identified in the second part, S104 is executed to determine whether the vehicle is at a traffic light intersection.

[0120] It should be noted here that when judging whether a vehicle is at a traffic light intersection within a certain period of time, it is not possible to simply judge that the vehicle in the image is at a traffic light intersection based on the stop line information identified in a preprocessed frame of the image, but also to judge based on the traffic light information identified in the image. If the judgment is based only on the stop line information, an intersection with no traffic lights but with stop lines will be mistakenly identified as a traffic light intersection. If the identification is based only on traffic light information, all images in which traffic light information can be identified will be filtered as images that include traffic light intersections. Based on the above considerations, the present application identifies whether a vehicle is at a traffic light intersection based on a combination of stop line information and traffic light information, thereby avoiding inaccurate identification of traffic light intersections and improving the accuracy of automatically identifying vehicles running red lights based on at least two frames of images in the driving recorder.

[0121] After determining whether the vehicle is at a traffic light intersection, S105 is executed to identify a target image from at least two pre-processed frames of images to determine in which frame of image the vehicle first crosses the stop line when the vehicle is at the traffic light intersection.

[0122] S105: in a case where it is identified that the vehicle is at the traffic light intersection within the certain period of time, identifying a target image from the at least two frames of images after preprocessing, wherein the target image is characterized as an image in which the vehicle first crosses the stop line in the at least two frames of images;

[0123] Specifically, the parking line information includes transverse lane lines and longitudinal lane lines. Accordingly, the identifying the target image from the at least two pre-processed frames includes: identifying longitudinal lane lines and / or transverse lane lines for each pre-processed frame image; for each frame image that includes longitudinal lane lines and / or transverse lane lines, determining the image where the longitudinal lane line first appears at a breakpoint and / or the front of the vehicle first forms a longitudinal tangent point with the transverse lane line as the target image.

[0124] It can be understood that when a vehicle crosses a stop line, the longitudinal lane line and / or the transverse lane line are identified for each preprocessed frame image, and the longitudinal tangent point formed by the vehicle head and the transverse lane line can be identified from the preprocessed image, and the breakpoint on the longitudinal lane line can also be identified from the image. According to at least one of the two situations of the stop line in the image, the image in which the vehicle crosses the stop line for the first time is determined as the target image. After the target image is determined from at least two preprocessed frames of images, S106 and S107 are executed to determine at least two associated images that are temporally adjacent to the target image, so as to determine whether the vehicle has run a red light within a certain period of time based on the at least two associated images.

[0125] S106: Obtaining at least two frames of associated images that are temporally adjacent to the target image from the at least two frames of preprocessed images;

[0126] S107: Determine whether the vehicle runs a red light within the certain period of time based on the at least two frames of associated images.

[0127] Specifically, the images that are temporally adjacent to the target image may be several frames of images before the target image appears and several frames of images after the target image appears, and the number of images that appear before and after the target image may be the same or different; they may also be images that appear within a period of time before the target image and images that appear within a period of time after the target image, and the time periods of the images that appear before and after the target image may be the same or different. The number of frames of the adjacent images that appear before and after may be set to 30 frames, and the time period of the adjacent images that appear before and after may be set to within 10 seconds.

[0128] Wherein, determining whether the vehicle has run a red light within the certain period of time based on the at least two frames of associated images includes:

[0129] The first step is to determine the driving state of the vehicle within the certain period of time based on the at least two frames of associated images;

[0130] Step 2: extracting the traffic light information in the at least two associated images from the preprocessed traffic light information in the at least two frames of images;

[0131] The third step is to determine whether the vehicle has run a red light within the certain period of time according to the driving status and the traffic light information in the at least two frames of associated images.

[0132] It should be noted here that the method for determining the traffic light information of the at least two frames of associated images can refer to the method for determining the traffic light information in at least two frames of images after preprocessing (part two) mentioned above. Because the traffic light information in at least two frames of images after preprocessing has been identified in the aforementioned part of the embodiment of the present application, the traffic light information of each frame of the at least two associated images can be extracted from the determined traffic light information in at least two frames of images after preprocessing.

[0133] Based on the extracted traffic light information of at least two frames of associated images, in the first step, the driving state of the vehicle in each of the at least two frames of associated images is determined according to the traffic light information in the at least two frames of associated images, and the driving state includes the driving state and driving direction of the vehicle. Among them, the driving state of the vehicle in the embodiment of the present application includes moving forward and stopping, and the driving direction includes turning left, going straight, and turning right. Accordingly, the determining of the driving state of the vehicle within the certain period of time based on the at least two frames of associated images includes:

[0134] (1) obtaining the vertical position of the traffic light from at least two preprocessed image frames, and determining the driving state of the vehicle according to the change of the vertical position of the traffic light in the at least two associated image frames; the driving state includes at least moving forward and stopping;

[0135] Specifically, a point on the vehicle captured in each frame of the preprocessed image is selected as the origin (such as the center of the vehicle in the image), the horizontal line where the origin is located is used as the X-axis, and the vertical line where the origin is located is used as the Y-axis to establish a two-dimensional coordinate system. One or more points are obtained from the traffic light area of ​​each frame of at least two associated images, and the driving state of the vehicle in the current frame is determined based on the change of the ordinate (vertical position) of one or more points in the current frame relative to the previous frame. The driving state of the vehicle in each determined frame is statistically analyzed, and the driving state of the vehicle at the traffic light intersection is obtained according to the statistical results.

[0136] (2) Obtaining the horizontal position of the traffic light from at least two preprocessed image frames, and determining the driving direction of the vehicle in the target image based on the change in the horizontal position of the traffic light in the at least two associated image frames.

[0137] Specifically, a point on the vehicle captured in each frame of the image is selected as the origin (such as the center of the vehicle in the image), the horizontal line where the origin is located is used as the X-axis, and the vertical line where the origin is located is used as the Y-axis to establish a two-dimensional coordinate system, which can be the same as the coordinate system in (1). One or more points are obtained from the traffic light area of ​​each frame of at least two associated images, and the driving direction of the vehicle in the current frame is determined based on the change of the horizontal coordinate (horizontal position) of one or more points in the current frame relative to the previous frame. The driving direction of the vehicle in each determined frame is counted, and the driving direction of the vehicle at the traffic light intersection is obtained according to the statistical results.

[0138] In the above scheme, the driving state of the vehicle at the traffic light intersection is determined based on the vertical position of the traffic light and the horizontal position of the traffic light in at least two frames of associated images, which can improve the accuracy of recognition.

[0139] In the second step, the traffic light information of at least two frames of associated images is extracted from the determined traffic light information of at least two frames of images after preprocessing. The specific method can be referred to the above content, which will not be described in detail here.

[0140] Then, in the third step, it is determined whether the vehicle has run a red light at the traffic light intersection based on the driving state of the vehicle within the first time determined in the first step and the traffic light direction within the first time determined in the second step. When the driving state of the vehicle is forward, if the driving direction of the vehicle is consistent with the direction in which the red light prohibits forward movement in the traffic light information, it is determined that the vehicle has run a red light within the certain time.

[0141] Next, combine Figure 2 , Figure 4 , Figure 6-9 , a recognition method provided by an embodiment of the present application is described in detail. Assuming that the traffic light is a commonly used traffic light, the commonly used traffic lights are classified by shape, including round traffic lights and arrow-shaped traffic lights. Among them, the round traffic lights include red round lights, green round lights and yellow round lights; the arrow-shaped traffic lights have arrows in three directions, namely left turn arrows, straight arrows and right turn arrows, and these arrows each have three colors: red, green and yellow. Specifically, the various forms of traffic lights can be referred to Figure 3 Sample data in . Figure 6 As shown in the figure, it is a frame of image captured by the driving recorder in the application scenario of a round traffic light. Figure 7 As shown in FIG. 1 , a frame of image captured by a driving recorder in an application scenario of an arrow-shaped traffic light. In both application scenarios, a recognition method provided in an embodiment of the present application can be used. Figure 6 Taking as an example, an identification method provided in an embodiment of the present application is described in detail.

[0142] like Figure 6 As shown in the figure, this frame includes the stop line area of ​​interest and the circular traffic light area. Among them, the longitudinal lane line in the stop line area has a breakpoint, and the front of the vehicle also forms a longitudinal tangent point with the transverse lane line, indicating that the vehicle has crossed the stop line in this frame. Figure 6 When a vehicle crosses the stop line for the first time, Figure 6 is the target image in at least two frames.

[0143] End of Introduction Figure 6 After that, the next step will be Figure 2 , Figure 4 , Figure 8 and Fig. 9 Combination Figure 6 The application scenario in the embodiment of the present application describes in detail the specific principles of an identification method provided by the embodiment of the present application.

[0144] In order to determine whether a vehicle runs a red light at a traffic light intersection within a certain period of time, at least two frames of images are first preprocessed, and traffic light information and stop line information are identified from the at least two preprocessed images. Based on the two types of information, it is determined whether the vehicle is at the traffic light intersection.

[0145] Read at least two frames of images recorded by the driving recorder within a certain period of time, taking one of the frames as an example (such as Figure 6 ), combined with Figure 8 The specific principle of identifying the traffic light information in the frame is described below:

[0146] S801: Read a frame of image (such as Figure 6 );

[0147] S802: Preprocess the image. The specific method is as follows: Grayscale the image by setting the color parameters G, R, and B values of each pixel in the image to their average values, turning the image into a grayscale image. For example, for a pixel point F, calculate the average value f of the three parameters G, R, and B according to the parameter values of F, and update the G, R, and B parameter values to f. Then binarize the grayscale image. Taking pixel point F as an example, when f is greater than a preset threshold (e.g., 150), set the G, R, and B parameter values to 255, and when f is less than or equal to the preset threshold (e.g., 150), set the G, R, and B parameter values to 0, and process each pixel in the grayscale image in this way. In the resulting binary image, the bright and dark regions are both prominent. Then perform edge detection on the binary image to identify the edges of the bright and dark regions, and determine the bright white regions (suspected regions of interest for traffic lights) in the image. At this time, there is one or more white regions in the image.

[0148] S803: Identify the region of interest for the traffic light. The specific method is as follows: The preprocessed image includes bright white regions similar to quadrilaterals (as shown in Figure 2 ), and identify this white region as the region of interest for the traffic light. In addition to this method, the preprocessed image can also be dilated first. The dilation operation will make the edges of one or more white regions in the preprocessed image closer to quadrilaterals, obtaining one or more quadrilateral convex polyhedrons in the image, and determine this quadrilateral convex polyhedron as the region of interest for the traffic light.

[0149] S804: Determine whether the aspect ratio meets a certain range. If yes, go to S804a; if no, go to S804b. The specific method is as follows: As shown in Figure 2 , select a point on the vehicle in each frame of the image as the origin (such as the center point of the vehicle in the image), use the horizontal line where the origin is located as the X-axis, and use the vertical line where the origin is located as the Y-axis to establish a two-dimensional coordinate system. Obtain the ordinate g2 of the highest point, the ordinate g1 of the lowest point, the abscissa k1 of the leftmost point, and the abscissa k2 of the rightmost point in the region of interest for the traffic light. Determine the minimum bounding rectangle of the region of interest for the traffic light according to the values of these four coordinates, and calculate the value Z of its aspect ratio. When 0.667 < Z < 1.8, determine the region of interest for the traffic light as the region of interest for the traffic light that meets the requirements, and go to S804a; otherwise, go to S804b.

[0150] S804a: Determine the region of interest for the traffic light that meets the requirements. Go to S805.

[0151] S804b: The region of interest for the traffic light does not meet the requirements. End.

[0152] S805: Determine whether the traffic light region of interest that meets the requirements matches the sample data. The specific method is: use the trained first convolutional neural network to compare the traffic light region of interest that meets the requirements with the sample data, identify the traffic light region of interest that meets the requirements and is consistent with any traffic light information in the sample data as the traffic light region, and record the traffic light information of the traffic light region, and go to S805a; otherwise, go to S805b.

[0153] S805a: Identify the traffic light area and traffic light information.

[0154] S805b: The traffic light region of interest that meets the requirements does not match.

[0155] The above scheme S801~S805b is used to identify at least two frames of images collected to obtain images including traffic light areas and traffic light information. In order to prevent S804~S805 from failing to identify all images (first images) with traffic light information, the sample data is classified into circular and arrow shapes. The trained second convolutional neural network is used to compare the unmatched traffic light interest regions that meet the requirements in S805b with the circular sample data, and the traffic light interest regions that meet the requirements and are consistent with any traffic light information in the circular sample data are identified as traffic light areas, and the traffic light information of the traffic light areas is recorded; the trained third convolutional neural network is used to compare the traffic light interest regions that meet the requirements that are not identified by the second convolutional neural network with the arrow-shaped sample data, and the traffic light interest regions that meet the requirements that are consistent with any traffic light information in the arrow-shaped sample data are identified as traffic light areas, and the traffic light information of the traffic light areas is recorded. Among them, the first to third convolutional neural networks can be implemented by convolutional neural networks applied to image classification, such as but not limited to Visual Geometry Group Net (VGGNet) and Alex Network (AlexNet). However, there are also differences among these three convolutional neural networks, and different convolutional neural networks are obtained from different training samples. It can be understood that since they are obtained from different training samples, at least some of the weight parameters in these three convolutional neural networks are different. Among them, the weight parameters of the first convolutional neural network are obtained by training with sample data of traffic lights of all shapes (circular and arrow-shaped). The weight parameters of the second convolutional neural network are obtained by training with sample data of circular traffic lights. The weight parameters of the third convolutional neural network are obtained by training with sample data of arrow-shaped traffic lights. Here, in order to facilitate the distinction between them, they are regarded as different convolutional neural networks.

[0156] Traffic light information in at least two frames of images is counted, and the left turn sequence (recorded as sequence L), straight sequence (recorded as sequence S) and right turn sequence (recorded as sequence R) are defined according to the direction of the traffic light. According to the color of the traffic light, 0 represents no traffic light, 1 represents a green light, 2 represents a yellow light, and 3 represents a red light. The color of the light indicating a left turn in each frame of image is counted to obtain the sequence L. Similarly, the color of the light indicating a straight and right turn in each frame of image is processed accordingly.

[0157] In order to accurately judge whether a vehicle runs a red light within a certain period of time, Fig. 9 S911~S913 and Figure 8 The traffic light information determined by the process: left turn sequence L, straight sequence S and right turn sequence R. Calculate the weighted value L of the traffic light information of the target image and the 30 frames before and after it respectively n , S n and R n , the formula is:

[0158]

[0159] Among them, L n , S n and R n are the weighted values ​​of the traffic light information for left turn, straight ahead and right turn, respectively. i represents the i-th frame image, and the target image is the 30th frame image as a reference. The range of i is 0 to 60; ε i represents the weighting coefficient corresponding to the i-th frame image, which is a fixed value set according to the actual needs of each frame image; l i 、s i and r i They represent the i-th element in the left turn sequence L, the straight sequence S, and the right turn sequence R, respectively. n , S n and R n After rounding, 0 means there was no traffic light when the vehicle crossed the line (the traffic light was broken or switched), 1 means the traffic light was green when the vehicle crossed the line, 2 means the traffic light was yellow when the vehicle crossed the line, and 3 means the traffic light was red when the vehicle crossed the line.

[0160] It should be noted that, in the case of a circular traffic light, L n , S n and R n Only one of them can get 1, 2 or 3, and the rest are 0; in the case of an arrow-shaped traffic light, L in a frame of image n , S n and R n The values ​​of are different.

[0161] To Figure 6For example, the specific steps of processing a frame of image in the frame and identifying the parking line information and driving status in the frame are shown in Fig. 9 :

[0162] For the specific steps of S901 to S902, please refer to Figure 8 S801~S802 in it.

[0163] S903: Identify the area of ​​interest of the parking line. The specific method is as follows: Figure 6 The parking line area of ​​interest in the image is a rectangular area determined in front of the front of the vehicle in each frame image according to a preset length (horizontal side) and width. For example, the length of the rectangular area is set to 2 meters, the width is 1.5 meters, and the distance from the front of the vehicle is 0 centimeters.

[0164] S904: Identify whether there is parking line information in the parking line area of ​​interest. The specific method is: based on the preprocessed image, determine whether there is a strip of white area in the brightness area of ​​the parking line area of ​​interest, identify the longitudinal strip of white area as the longitudinal lane line, identify the transverse strip of white area as the transverse lane line, and regard the longitudinal lane line and the transverse lane line as parking line information.

[0165] S905: Recognize the longitudinal lane line of each pre-processed frame image and determine whether the front of the vehicle forms a longitudinal tangent point with the transverse lane line (refer to Figure 6 If the value is midpoint Z), the process goes to S907 or S906 to continue judging; if not, the process goes to S906 to continue judging.

[0166] S906: Recognize the horizontal lane line of each pre-processed frame image and determine whether the vertical lane line has a breakpoint (refer to Figure 6 Midpoint H), if yes, go to S907; if no, go to S908.

[0167] S907: Determine that the vehicle is on the stop line.

[0168] S908: Determine that the vehicle has not crossed the stop line.

[0169] According to S901 to S908, it is identified whether there is parking line information in at least two frames of images after preprocessing, and the image showing the parking line is pressed is recorded as 1, and the image without the parking line being pressed or without the parking line information is recorded as 0, and a set of sequences is obtained in chronological order...1111000..., recorded as T.

[0170] S909: Determine the image of the vehicle first crossing the stop line as the target image. The specific method is: determine the image represented by 1 at the junction of 1 and 0 in the T sequence as the target image.

[0171] S910: Determine the 30 frames of images before and after the target image. The specific method is: extract 30 frames of images before and after the target image (this value may vary depending on the actual situation) from at least two frames of images after preprocessing. These images are images that are adjacent to the target image in time and are regarded as associated images.

[0172] S911: Determine whether the vertical position difference of the traffic light area in the adjacent images is greater than a third threshold. The specific method is: Figure 4 , assuming Figure 4 The coordinate system established in Figure 2 The coordinate system in is the same. One or more points are obtained from the traffic light area of ​​each frame image of at least two associated frames (61 frames in total), and the vertical position difference (positive value) of the traffic light area is determined based on the change of the vertical coordinate (vertical position) of one or more points in the current frame relative to the previous frame. When the vertical position difference is greater than a third threshold value (for example, 0.2), it is determined that the vehicle is in a forward driving state in the current frame, and the process goes to S911a. Otherwise, the vehicle is in a stopped driving state, and the process goes to S911b.

[0173] It should be noted that S911 involves two methods for determining the vertical displacement difference of the vehicle in the current frame.

[0174] Method 1: Based on the change of the ordinate (vertical position) of a point in the current frame relative to the previous frame, determine the vertical displacement difference (positive value) of the vehicle in the current frame. If the vertical displacement difference is greater than 0.2, it is determined that the vehicle is in a forward driving state in the current frame. Figure 4 As shown, assuming that the traffic light areas in the adjacent images are Green 1 and Green 2, and Green 1 belongs to the previous frame, and Green 2 belongs to the current frame. The vertical coordinate of Green 1 is Y1, the vertical coordinate of Green 2 is Y2, and (Y2-Y1) is taken as the vertical displacement difference.

[0175] Method 2: Based on the change of the vertical coordinates (vertical positions) of multiple points in the current frame relative to the previous frame, determine the vertical position difference (positive value) of the vehicle in the current frame. Specifically, based on the change of the vertical coordinates (vertical positions) of j points in the current frame relative to the previous frame, obtain the vertical coordinates {x 11 , x 12 , x 13 , ..., x 1j}, the vertical coordinate {x 21 , x 22 , x 23 , ..., x 2j}, according to the Euclidean distance formula The average vertical position difference d is calculated, and d is normalized to obtain the normalized average vertical position d1. When the normalized average vertical displacement d1 is greater than 0.2, it is determined that the vehicle is in a forward driving state in the current frame.

[0176] S911a: The vehicle moves forward.

[0177] S911b: The vehicle stops.

[0178] S912: Determine whether the horizontal position difference of the traffic light area in the adjacent images is greater than a positive value, wherein the positive value may be 0.2, in meters.

[0179] S913: Determine whether the horizontal position difference of the traffic light area in the adjacent images is greater than a negative value, wherein the negative value may be -0.2, in meters.

[0180] The specific method of S912 to S913 is as follows: Figure 4 , assuming Figure 4 The coordinate system established in Figure 2 The principle is the same. Get the center point of the identified traffic light area, and characterize the ordinate of the point as the horizontal position of the traffic light area. Assume that the traffic light areas in the adjacent images are Green 1 and Green 2, and Green 1 belongs to the previous frame and Green 2 belongs to the current frame. The horizontal coordinate of Green 1 is Q1, and the horizontal coordinate of Green 2 is Q2. (Q2-Q1) is used as the horizontal position difference. When the horizontal position difference is greater than 0.2, go to S914. When the horizontal position difference is less than -0.2, go to S916. Otherwise, go to S915.

[0181] S914: The vehicle turns right.

[0182] S915: The vehicle goes straight.

[0183] S916: The vehicle turns left.

[0184] In the above scheme, according to Figure 8 The method in can obtain the traffic light information in at least two frames of images. Fig. 9 According to the method in the embodiment, the stop line information in at least two frames of images can be obtained, and the target image can be determined according to the stop line information in each frame of images, and then the 30 frames of images before and after the target image can be determined in time. The traffic light information in the target image and the 30 frames before and after the target image can be extracted from the traffic light information in at least two frames of images to determine the traffic light information within the certain time. According to the vertical position and level of the traffic lights in the target image and the 30 frames before and after the target image, the driving state and driving direction of the vehicle within the certain time can be determined. If the driving direction of the vehicle in the forward state is consistent with the direction in which the vehicle is prohibited from moving forward represented by the traffic light information, it can be determined that the vehicle ran a red light at the traffic light intersection within a certain time.

[0185] Specifically: when the vehicle turns left within the certain time, if the traffic light information indicates a left turn red light; when the vehicle goes straight within the certain time, if the traffic light information indicates a straight go red light; or when the vehicle turns right within the certain time, if the traffic light information indicates a right turn red light; it is determined that the vehicle ran a red light at the traffic light intersection within the certain time.

[0186] The method in the above scheme realizes the automatic recognition of at least two frames of images recorded by the driving recorder within a certain period of time. According to the recognized traffic light information, stop line information and vehicle driving status, it can accurately judge whether the vehicle runs a red light at the traffic light intersection, and has good application prospects.

[0187] The present application also provides an identification device, such as Figure 5 As shown, the device includes a collection unit 51, a preprocessing unit 52, a first identification unit 53, a first determination unit 54, a second identification unit 55, an acquisition unit 56 and a second determination unit 57; wherein,

[0188] The acquisition unit 51 is used to acquire at least two frames of images recorded by the driving recorder within a certain period of time.

[0189] The preprocessing unit 52 is used to preprocess at least two frames of images;

[0190] The first recognition unit 53 is used to recognize the stop line information and the traffic light information in each frame image after preprocessing;

[0191] The first determination unit 54 is used to determine whether the vehicle is at a traffic light intersection within the certain time according to the stop line information and the traffic light information;

[0192] The second recognition unit 55 is used to recognize a target image from the at least two frames of images after preprocessing when it is recognized that the vehicle is at the traffic light intersection within the certain period of time, wherein the target image is characterized as an image of the vehicle first crossing the stop line in the at least two frames of images;

[0193] The acquisition unit 56 is used to obtain at least two frames of associated images that are temporally adjacent to the target image from the at least two frames of preprocessed images;

[0194] The second determination unit 57 is used to determine whether the vehicle has run a red light within the certain period of time according to the at least two frames of associated images.

[0195] In the above solution, the second determining unit 57 is further used for:

[0196] Determining the driving state of the vehicle within the certain period of time based on the at least two frames of associated images;

[0197] Extracting the traffic light information in the at least two associated images from the preprocessed traffic light information in the at least two frames of images;

[0198] According to the driving state and the traffic light information in the at least two frames of associated images, it is determined whether the vehicle has run a red light within the certain period of time.

[0199] In the above solution, the first identification unit 53 is further used for:

[0200] Identify the stop line region of interest of each frame image after preprocessing; identify whether there are longitudinal lane lines and / or transverse lane lines in the stop line region of interest; regard the longitudinal lane lines and / or transverse lane lines existing in the identified stop line region of interest as stop line information.

[0201] In the above solution, the second identification unit 55 is further used for:

[0202] Recognize longitudinal lane lines and / or transverse lane lines on each preprocessed frame image;

[0203] For each image that identifies longitudinal lane lines and / or transverse lane lines, an image that identifies the first breakpoint in the longitudinal lane line and / or the first longitudinal tangent point between the front of the vehicle and the transverse lane line is determined as a target image.

[0204] In the above solution, the first identification unit 53 is also used for:

[0205] Identify the traffic light region of interest from each preprocessed frame image;

[0206] According to the aspect ratio of the traffic light region of interest, the traffic light region of interest that meets the requirements is screened out;

[0207] Matching the sample data with the traffic light region of interest that meets the requirements, the sample data being the features of the traffic lights characterized by different colors and shapes;

[0208] According to the matching result, a traffic light region of the image including the traffic light region of interest that meets the requirements and traffic light information in the image are obtained;

[0209] The traffic light information includes traffic light information representing different colors and different shapes.

[0210] In the above solution, for at least part of the first image in the image of interest including the traffic light meeting the requirement, the first image is an image in which the traffic light information in the image cannot be obtained according to the matching result, the first recognition unit 53 is further used to:

[0211] Obtaining a traffic light region of interest that meets the requirements of the first image;

[0212] Classifying the sample data according to the shape of the traffic light; dividing the shape of the traffic light region of interest that meets the requirements of the first image according to the classified sample data;

[0213] The color and shape of the traffic light in the first image are identified from the traffic light interest region divided into a certain shape.

[0214] In the above solution, the second determining unit 57 is further used for:

[0215] Obtaining the vertical position of the traffic light from at least two preprocessed image frames, and determining the driving state of the vehicle according to the change of the vertical position of the traffic light in the at least two associated image frames; the driving state includes at least moving forward and stopping;

[0216] The horizontal position of the red traffic light is obtained from at least two preprocessed image frames, and the driving direction of the vehicle in the target image is determined according to the change of the horizontal position of the traffic light in the at least two associated image frames.

[0217] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the program is at least used to execute when executed by a processor Figures 1 to 9 The steps of any of the methods shown. The computer-readable storage medium may specifically be a memory.

[0218] The embodiment of the present application also provides an identification device. Fig.10 Schematic diagram of the hardware structure of the identification device of the embodiment of the present application. Fig.10 As shown, the device includes: a communication component 10.3 for data transmission, at least one processor 10.1 and a memory 10.2 for storing a computer program that can be run on the processor 10.1. The various components in the terminal are coupled together via a bus system 10.4. It can be understood that the bus system 10.4 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 10.4 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig.10 In the specification, various buses are labeled as bus system 10.4.

[0219] Wherein, when the processor 10.1 executes the computer program, at least Figures 1 to 9 Any of the steps of the method shown.

[0220] It can be understood that the memory 10.2 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be 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 magnetic random access memory (FRAM), a ferromagnetic random access memory, a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAMbus random access memory (DRRAM).The memory 72 described in the embodiments of the present application is intended to include, but is not limited to, these and any other suitable types of memory.

[0221] The method disclosed in the above embodiment of the present application can be applied to the processor 10.1, or implemented by the processor 10.1. The processor 10.1 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 10.1 or the instruction in the form of software. The above processor 10.1 can be a general processor, a digital signal processing (Digital Signal Processing, DSP), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 10.1 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present invention. The general processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 10.2. The processor 10.1 reads the information in the memory 10.2 and completes the steps of the above method in combination with its hardware.

[0222] In an exemplary embodiment, the identification device can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), FPGA, general-purpose processor, controller, MCU, microprocessor, or other electronic components to execute the aforementioned identification method.

[0223] In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0224] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0225] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately configured as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0226] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.

[0227] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0228] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0229] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0230] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0231] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A recognition method, characterized in that: The method comprises: Collect at least two frames of images recorded by the driving recorder within a certain period of time; Preprocessing the at least two frames of images; Identify the stop line information and traffic light information in each frame image after preprocessing; Determine whether the vehicle is at a traffic light intersection within the certain time period according to the stop line information and the traffic light information; In the case where it is identified that the vehicle is at the traffic light intersection within the certain period of time, a target image is identified from the at least two frames of images after preprocessing, wherein the target image is characterized as an image in which the vehicle first crosses the stop line in the at least two frames of images; Obtaining at least two frames of associated images that are temporally adjacent to the target image from the at least two frames of preprocessed images; Determining, based on the at least two frames of associated images, whether the vehicle has run a red light within the certain period of time; The determining, based on the at least two frames of associated images, whether the vehicle has run a red light within the certain period of time includes: Determining the driving state of the vehicle within the certain period of time based on the at least two frames of associated images; Extracting the traffic light information in the at least two associated images from the preprocessed traffic light information in the at least two frames of images; According to the driving state and the traffic light information in the at least two frames of associated images, it is determined whether the vehicle has run a red light within the certain period of time.

2. The method according to claim 1, characterized in that The identifying of the parking line information in each frame image after preprocessing includes: Identify the parking line region of interest of each frame image after preprocessing; Identify whether there are longitudinal lane lines and / or transverse lane lines in the stop line region of interest; The longitudinal lane lines and / or transverse lane lines existing in the identified stop line region of interest are regarded as stop line information.

3. The method according to claim 2, characterized in that The step of identifying a target image from the at least two pre-processed frames of images comprises: Recognize longitudinal lane lines and / or transverse lane lines on each preprocessed frame image; For each frame image that identifies longitudinal lane lines and / or transverse lane lines, an image in which a breakpoint first appears in the longitudinal lane line and / or a longitudinal tangent point first formed between the front of the vehicle and the transverse lane line is identified as a target image.

4. The method according to claim 1, characterized in that The identifying of traffic light information in each frame image after preprocessing includes: Identify the traffic light region of interest from each preprocessed frame image; According to the aspect ratio of the traffic light region of interest, the traffic light region of interest that meets the requirements is screened out; Matching the sample data with the traffic light region of interest that meets the requirements, the sample data being the features of the traffic lights characterized by different colors and shapes; According to the matching result, a traffic light region of the image including the traffic light region of interest that meets the requirements and traffic light information in the image are obtained; The traffic light information includes traffic light information representing different colors and different shapes.

5. The method according to claim 4, characterized in that For at least a portion of a first image in an image including a traffic light region of interest that meets the requirement, the first image is an image in which traffic light information cannot be obtained according to the matching result, Obtaining a traffic light region of interest that meets the requirements of the first image; Classify the sample data according to the shape of traffic lights; According to the classified sample data, the traffic light interest region that meets the requirements of the first image is divided into shapes; The color and shape of the traffic light in the first image are identified from the traffic light interest region divided into a certain shape.

6. The method according to claim 1, characterized in that The determining the driving state of the vehicle within the certain period of time based on the at least two frames of associated images includes: Obtaining the vertical position of the traffic light from at least two preprocessed frames of images, and determining the driving state of the vehicle according to the change of the vertical position of the traffic light in the at least two associated frames of images; the driving state includes at least moving forward and stopping; The horizontal position of the traffic light is obtained from at least two preprocessed image frames, and the driving direction of the vehicle is determined according to the change of the horizontal position of the traffic light in the at least two associated image frames.

7. An identification device, characterized in that: The device comprises a collection unit, a preprocessing unit, a first recognition unit, a first determination unit, a second recognition unit, an acquisition unit and a second determination unit; wherein, The acquisition unit is used to acquire at least two frames of images recorded by the driving recorder within a certain period of time; The preprocessing unit is used to preprocess the at least two frames of images; The first recognition unit is used to recognize the stop line information and the traffic light information in each frame image after preprocessing; The first determination unit is used to determine whether the vehicle is at a traffic light intersection within the certain time according to the stop line information and the traffic light information; The second recognition unit is used to recognize a target image from the at least two frames of images after preprocessing when recognizing that the vehicle is at the traffic light intersection within the certain period of time, wherein the target image is characterized as an image of the vehicle first crossing the stop line in the at least two frames of images; The acquisition unit is used to obtain at least two frames of associated images that are temporally adjacent to the target image from the at least two frames of preprocessed images; The second determination unit is used to determine whether the vehicle has run a red light within the certain period of time according to the at least two frames of associated images; The method for determining whether the vehicle has run a red light within a certain period of time according to the at least two frames of associated images includes: Determining the driving state of the vehicle within the certain period of time based on the at least two frames of associated images; Extracting the traffic light information in the at least two associated images from the preprocessed traffic light information in the at least two frames of images; According to the driving state and the traffic light information in the at least two frames of associated images, it is determined whether the vehicle has run a red light within the certain period of time.

8. The device according to claim 7, characterized in that The first identification unit is further used for: Identify the stop line region of interest of each frame image after preprocessing; identify whether there are longitudinal lane lines and / or transverse lane lines in the stop line region of interest; regard the longitudinal lane lines and / or transverse lane lines existing in the identified stop line region of interest as stop line information.

9. The device according to claim 8, characterized in that The second identification unit is further used for: Recognize longitudinal lane lines and / or transverse lane lines on each preprocessed frame image; For each image that identifies longitudinal lane lines and / or transverse lane lines, an image that identifies the first breakpoint in the longitudinal lane line and / or the first longitudinal tangent point between the front of the vehicle and the transverse lane line is determined as a target image.

10. The device according to claim 7, characterized in that The first identification unit is further used for: Identify the traffic light region of interest from each preprocessed frame image; According to the aspect ratio of the traffic light region of interest, the traffic light region of interest that meets the requirements is screened out; Matching the sample data with the traffic light region of interest that meets the requirements, the sample data being the features of the traffic lights characterized by different colors and shapes; According to the matching result, a traffic light region of the image including the traffic light region of interest that meets the requirements and traffic light information in the image are obtained; The traffic light information includes traffic light information representing different colors and different shapes.

11. The device according to claim 10, characterized in that For at least a portion of a first image in an image including a traffic light region of interest that meets the requirement, the first image being an image in which traffic light information cannot be obtained according to the matching result, the first recognition unit is further configured to: Obtaining a traffic light region of interest that meets the requirements of the first image; Classifying the sample data according to the shape of the traffic light; dividing the shape of the traffic light region of interest that meets the requirements of the first image according to the classified sample data; The color and shape of the traffic light in the first image are identified from the traffic light interest region divided into a certain shape.

12. The device according to claim 7, characterized in that The second determining unit is further configured to: Obtaining the vertical position of the traffic light from at least two preprocessed frames of images, and determining the driving state of the vehicle according to the change of the vertical position of the traffic light in the at least two associated frames of images; the driving state includes at least moving forward and stopping; The horizontal position of the traffic light is obtained from at least two preprocessed image frames, and the driving direction of the vehicle is determined according to the change of the horizontal position of the traffic light in the at least two associated image frames.

Citation Information

Patent Citations

  • Traffic light detection and lane state recognition for autonomous vehicles

    US20200135030A1

  • Image recording apparatus and method

    US6919823B1