Driving intention detection method and device, computer equipment and storage medium thereof
By performing object detection and color space conversion on the front image of the vehicle, and judging turn signals using brightness sequence and frequency characteristics, the problem of vehicle light detection being susceptible to environmental interference is solved, efficient and accurate turn signals detection is achieved, and error detection and calculation amount is reduced.
Patent Information
- Application Number
- CN202510420075.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, vehicle lighting detection is susceptible to environmental interference, has a high error detection rate, is large in calculation, and it is difficult to distinguish vehicle lighting when the lighting conditions are poor, increasing the detection cost.
By collecting the image ahead of the vehicle, performing object detection and color space conversion, using brightness sequence and frequency characteristics to judge turn signals, and using multi-threaded parallel processing to improve detection efficiency and accuracy.
In an environment where light conditions change frequently, the accuracy of turn signal detection is improved, the error detection rate is reduced, the calculation amount is reduced, real-time detection is achieved, and reliable vehicle intention information is provided.
Smart Images

Figure CN120339996A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image processing, and in particular, to a driving intention detection method and apparatus, a computer device, and a storage medium thereof. Background Technique
[0002] With the development of computer vision and deep learning technologies, image-based vehicle behavior detection has become a research hotspot. As an important part of vehicle behavior analysis, vehicle light detection can provide key information for autonomous vehicles to help judge the intentions of the vehicles ahead. The image-based detection method only locates the vehicle by collecting images or videos of other vehicles through the vehicle's camera and then detects the turn signal.
[0003] However, this method is vulnerable to interference from interfering objects (such as reflective signs, street lights, etc.) in the vehicle's surrounding environment, which easily leads to false detection. And only by the method of first locating the vehicle, it is impossible to distinguish the lights emitted by different types of vehicle lamps such as tail lights, brake lights, width indicator lights, and turn signals in an environment with poor lighting conditions. In addition, the computational complexity of this detection method is relatively large. If high-computing-power hardware is used, the detection cost of turn signal detection will increase. Summary of the Invention
[0004] In view of this, it is necessary to provide a driving intention detection method and apparatus, a computer device, and a storage medium thereof.
[0005] In a first aspect, an embodiment of the present application provides a driving intention detection method, where the driving intention detection method includes: collecting an initial image in a first color space of an image in front of a current vehicle; detecting a plurality of regions of interest from the initial image based on object detection, where the object detection is used to detect a plurality of target vehicles, each region of interest corresponds to a part of the initial image and contains at least one target vehicle; converting the initial image from the first color space to a second color space; obtaining the brightness sequence of each region of interest in parallel; determining in parallel whether the frequency feature of each brightness sequence conforms to a preset frequency feature of a turn signal; when it is determined that the frequency feature of a brightness sequence conforms to the preset frequency feature, determining that the corresponding brightness sequence is generated by the turn signal emitting light, and obtaining the brightness information of the turn signal according to the corresponding brightness sequence, where the brightness information is used to predict the driving intention of the target vehicle where the turn signal is located.
[0006] Second aspect, an embodiment of the present application provides a driving intention detection device. The driving intention detection device includes an acquisition module, a target detection module, an image processing module, a brightness acquisition module, a turn signal detection module, and a turn signal information acquisition module. The acquisition module is configured to acquire an initial image in a first color space of the image in front of the current vehicle; the target detection module is configured to detect a plurality of regions of interest from the initial image based on target detection, and the target detection is used to detect a plurality of target vehicles. Each region of interest corresponds to a part of the initial image and contains at least one target vehicle; the image processing module is configured to convert the initial image from the first color space to a second color space; the brightness acquisition module is configured to acquire the brightness sequence of each region of interest in parallel; the turn signal detection module is configured to determine in parallel whether the frequency feature of each brightness sequence conforms to a preset frequency feature of the turn signal; when it is determined that the frequency feature of a brightness sequence conforms to the preset frequency feature, the turn signal information acquisition module is configured to determine that the corresponding brightness sequence is generated by the turn signal emitting light, and acquire the brightness information of the turn signal according to the corresponding brightness sequence, and the brightness information is used to predict the driving intention of the target vehicle where the turn signal is located.
[0007] Third aspect, an embodiment of the present application provides a computer device. The computer device includes a memory and a processor. The memory is used to store a computer program; the processor is used to execute the computer program to implement the above-mentioned driving intention detection method.
[0008] Fourth aspect, an embodiment of the present application provides a computer-readable storage medium. The computer-readable storage medium is used to store a computer program, and the computer program is executed to implement the above-mentioned driving intention detection method.
[0009] The above-mentioned driving intention detection method and device, computer device, and its storage medium detect a plurality of regions of interest containing target vehicles by performing target detection on the initial image, and convert the first color space of the regions of interest to a second color space that can distinguish turn signals through brightness and chromaticity, so that during the driving process of the current vehicle with frequently changing lighting conditions, the brightness sequences of a plurality of regions of interest can be acquired in parallel, and then the brightness sequence emitted by the turn signal can be distinguished in parallel, improving the accuracy of turn signal detection, reducing the false detection rate, and at the same time improving the detection efficiency by allocating corresponding threads for parallel processing, reducing the amount of calculation, realizing the real-time detection of turn signals without increasing the hardware cost, and providing more reliable key information for judging the intention of the vehicle in front. Description of the Drawings
[0010] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the structures shown in these drawings.
[0011] Figure 1 The first flowchart of the driving intention detection method provided by the embodiment of the present application.
[0012] Figure 2 The flowchart of the sub-steps of step S103 provided by the embodiment of the present application.
[0013] Figure 3 The second flowchart of the driving intention detection method provided by the embodiment of the present application.
[0014] Figure 4 The flowchart of the sub-steps of step S104 provided by the embodiment of the present application.
[0015] Figure 5 The flowchart of the sub-steps of step S1042 provided by the embodiment of the present application.
[0016] Figure 6 The flowchart of the sub-steps of step S105 provided by the embodiment of the present application.
[0017] Figure 7 The structural schematic diagram of the driving intention detection device provided by the embodiment of the present application.
[0018] Figure 8 The internal structural schematic diagram of the computer device applying the driving intention detection method provided by the embodiment of the present application.
[0019] The realization of the purpose of the present application, functional features and advantages will be further described in combination with the embodiments with reference to the drawings. Specific embodiments
[0020] In order to make the purpose, technical solutions and advantages of the present application more clear, the following will further describe the present application in detail in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0021] In the description and claims of this application and the above-mentioned accompanying drawings, the terms "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar planning objects, and do not necessarily describe a specific order or sequence. It should be understood that such data used can be interchanged under appropriate circumstances. In other words, the described embodiments are implemented in an order other than that illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof may further include other elements. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to only those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0022] It should be noted that in this application, the descriptions involving "first", "second", etc. are only for descriptive purposes and should not be construed as indicating or implying their relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. Additionally, the technical solutions between various embodiments can be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0023] Please refer to Figure 1 , which is the first flowchart of the driving intention detection method provided by the embodiments of this application. This application provides a driving intention detection method. The driving intention detection method is implemented by a computer device. The driving intention detection method improves the efficiency of detecting the turn signal by invoking multiple threads inside the computer device and reduces the computational workload of the central processing unit (CPU) of the computer device. Among them, the computer device can be a device for reading images, and the threads can be provided by the CPU or by other components with the function of providing threads, such as general-purpose computing on graphics processing units (GPGPU). The driving intention detection method includes steps S101 - S106.
[0024] Step S101, collect an image in front of the current vehicle to obtain an initial image in the first color space.
[0025] In step S101, the current vehicle can be an autonomous vehicle. The image in front of the current vehicle can be obtained by an image acquisition component provided on the current vehicle, such as a camera module, by taking a picture of the front during the driving of the current vehicle. The first color space is the color space where the image acquisition component initially locates when acquiring images. In this application, the first color space is the RGB color space, which is a color model used to represent the colors of things, and commonly uses the red component (R component), green component (G component), and blue component (B component), that is, the components of the three primary colors, to represent the color components of different things. The initial image can be a single image taken by the image acquisition component at the current moment, or multiple frames of images acquired by the image acquisition component within a preset acquisition time interval. The preset acquisition time interval can be set relatively according to the distance between the current vehicle and other vehicles during driving, or determined according to the initial parameters of the image acquisition component.
[0026] Step S102, detect a plurality of regions of interest from the initial image based on object detection.
[0027] In step S102, object detection is used to detect a plurality of target vehicles. Object detection can be implemented based on deep learning using object detection algorithms to detect a plurality of target vehicles in front of the current vehicle. Object detection algorithms include but are not limited to the YOLO (You Only Look Once) algorithm, SSD (Single Shot MultiBox Detector) algorithm, RetinaNet algorithm, etc. The region of interest (ROI) is a detection box formed after detecting target vehicles in the initial image through object detection. Each region of interest corresponds to a part of the initial image and contains at least one target vehicle. Specifically, each region of interest contains only one target vehicle to facilitate the subsequent confirmation of the target vehicle to which the turn signal belongs after the turn signal is detected. Further, the region of interest at least includes the image corresponding to one or more lamps at the position of the turn signal in the target vehicle. The multiple lamps are multiple lamps provided on the target vehicle for emitting light to the outside to indicate the expected driving intention of the target vehicle, such as turning left, turning right, braking, etc. For the current vehicle, since the initial image is the image in front of the current vehicle, therefore, the multiple lamps are correspondingly multiple lamps provided at the rear of the target vehicle, such as tail lamps, brake lamps, width indicator lamps, turn signals, etc.
[0028] Step S103, convert the initial image from the first color space to the second color space.
[0029] In step S103, due to the differences in the emission colors and frequencies of different lamps, and when the current vehicle is moving, the emission colors of the lamps of other target vehicles in the first color space are easily affected by environmental light changes and are difficult to identify. Therefore, it is necessary to perform a color space conversion on the initial image in the first color space to more easily distinguish the turn signals. Specifically, the second color space is the YUV color space, which is a color space used to describe the brightness and chrominance of things, and is commonly represented by the luminance component (Y component), the first chrominance component (U component), and the second chrominance component (V component) to represent the brightness and chrominance presented by things. The first color space and the second color space can be converted. By performing a color space conversion on the color of the collected initial image, the present application can better separate color information and brightness information, reduce the influence of light changes on color detection, facilitate extracting the color of the expected vehicle lights in the initial image, improve the color detection rate, and thus more accurately detect the turn signals and their corresponding target vehicles.
[0030] Please refer to Figure 2 , which is the flowchart of the sub-steps of step S103 provided by the embodiment of the present application. Converting the initial image from the first color space to the second color space includes steps S1031 - S1033.
[0031] Step S1031, allocate corresponding first threads according to the number of pixels in the initial image.
[0032] In step S1031, the first thread is a thread for single instruction multiple data calculation based on NEON. The initial image contains a number of pixels. During the process of obtaining the pixel color components in the first color space, the computer device can implement concurrent operation of multiple threads in one process through internal components. And since the process of obtaining the color components of each pixel in the initial image does not interfere with each other. Therefore, in this embodiment, the first threads are allocated corresponding to the number of pixels in the initial image, so that each first thread obtains the color components of one pixel. Since each first thread needs to obtain the color components of one pixel, the number of allocated first threads is also the number of pixels.
[0033] Step S1032, use each first thread to concurrently obtain the first color components of each pixel in the initial image in the first color space.
[0034] In step S1032, multiple threads can be concurrent in a process, and each thread executes different tasks in parallel. In this embodiment, the acquisition processes of the color components of each pixel in the initial image do not interfere with each other. Therefore, parallel conversion can be achieved. That is to say, when a sufficient number of first threads are allocated, multiple first threads are concurrent in the process of acquiring the color components of each pixel, and each first thread acquires the color components of one pixel in parallel, so that the color components of all pixels are acquired in parallel, improving the calculation efficiency and reducing the running time.
[0035] Step S1033: Use each first thread to convert the first color component of each pixel into the second color component of each pixel in the second color space in parallel.
[0036] In step S1033, the second color component includes a luminance component and a chrominance component. The chrominance component includes a first chrominance component and a second chrominance component. Since color space conversion is required after acquiring the color components of each pixel, and the conversion processes of each pixel's color space do not interfere with each other, parallel conversion can be achieved through the same first threads as those for acquiring the color components. That is to say, when a sufficient number of first threads are allocated, multiple first threads are concurrent in the process of converting each pixel's color space, and each first thread converts each pixel in parallel, so that all pixels' color spaces are converted in parallel, improving the calculation efficiency and reducing the running time.
[0037] Specifically, for a first thread, the conversion formula from the RGB color space to the YUV color space is:
[0038] Y = 0.299·R + 0.587·G + 0.114·B
[0039] U = -0.147·R - 0.289·G + 0.436·B
[0040] V = 0.615·R - 0.515·G - 0.100·B
[0041] Wherein, R, G, and B respectively represent the R component (red component), G component (green component), and B component (blue component) of each pixel in the initial image in the first color space, and the value ranges of the three are [0, 255], [0, 255], and [0, 255] respectively. Y represents the luminance component (Y component), and the value range is [0, 255]. U and V respectively represent the first chrominance component (U component) and the second chrominance component (V component), and the value ranges are [-128, 127] and [-128, 127] respectively.
[0042] Taking 16 as an example of the number of the first threads, for each pixel, the values corresponding to the R component, G component, and B component of each pixel are 8-bit unsigned integers (uint8). Loading the R component, G component, and B component at once by 16 first threads can be expressed as:
[0043]
[0044]
[0045] Among them, R1, R2, ……, R16 respectively represent the R components in the 1st thread, 2nd thread, …… 16th thread. By analogy, the meanings of G1, G2, ……, G16 and B1, B2, ……, B16 can be deduced.
[0046] More specifically, since the conversion formula from the RGB color space to the YUV color space involves floating-point operations, it is necessary to convert the 8-bit integers in the RGB color space into floating-point numbers:
[0047]
[0048] Then calculate the components of YUV according to the calculation formula respectively:
[0049]
[0050] Accordingly, by allocating 16 first threads, it is possible to calculate 16 data at once, that is, convert 16 pixels from the first color space to the second color space at once, greatly shortening the time for color space conversion.
[0051] Step S104, obtain the brightness sequence of each region of interest in parallel.
[0052] In step S104, the initial image is a multi-frame image. Each frame of the image includes several regions of interest. The brightness sequence is the light emitted by the lamps of the target vehicle in a specific manner within a preset time. In this application, the brightness sequence corresponding to the light emitted by the turn signal is distinguished from the brightness sequences of the lights emitted by different lamps in each region of interest.
[0053] Please refer to Figure 4 , which is the flowchart of the sub-steps of step S104 provided by the embodiment of this application. Obtaining the brightness sequence of each region of interest in parallel includes steps S1041 - S1042.
[0054] Step S1041, allocate corresponding second threads according to the number of regions of interest.
[0055] In step S1041, the second thread is a thread for single instruction multiple data (SIMD) computing based on NEON. During the process of obtaining the luminance sequence of each region of interest (ROI), the computing device can implement concurrent running of multiple threads in one process through internal components. And since the processes of obtaining the luminance sequence of each ROI do not interfere with each other. Therefore, in this embodiment, the second threads are allocated corresponding to the number of ROIs, so that each second thread obtains the luminance sequence of one ROI. Since each second thread needs to obtain the luminance sequence of one ROI, the number of allocated second threads is also the number of ROIs.
[0056] Step S1042: Use each second thread to concurrently obtain the luminance sequence of each ROI.
[0057] In step S1042, multiple threads can be concurrent in one process, and each thread executes different tasks in parallel. In this embodiment, the processes of obtaining the luminance sequence of each ROI do not interfere with each other. Therefore, concurrent acquisition can be achieved. That is to say, when a sufficient number of second threads are allocated, multiple second threads are concurrent during the process of obtaining the luminance sequence of each ROI, and each second thread concurrently obtains the luminance sequence of each ROI, so that all ROIs concurrently obtain the luminance sequence, improving the computing efficiency and reducing the running time.
[0058] Please refer to Figure 5 , which is the flowchart of the sub-steps of step S1042 provided by the embodiment of the present application. Using each second thread to concurrently obtain the luminance sequence of each ROI includes steps S10421 - S10422.
[0059] Step S10421: According to the luminance components of each pixel in each ROI, use each second thread to concurrently calculate the luminance value of each ROI in each frame of image.
[0060] In step S10421, for the current frame of image, if the number of frames of the initial image is defined as T, then the luminance value L t of the ROI can be calculated by the following formula:
[0061]
[0062] where, ∣R∣ is the number of pixels in the ROI. It(x, y) is the luminance component of the pixel point (x, y) in the t-th frame, and L t is the total luminance value corresponding to the luminance components of each pixel point (x, y) in the current frame of image. Accordingly, the luminance values of each ROI in each frame of image can be concurrently calculated by a sufficient number of second threads, and then the luminance value of each frame of image can be obtained.
[0063] Step S10422: Record the brightness values of each corresponding region of interest in the initial image according to the time order of each frame of the image to obtain each brightness sequence.
[0064] In step S10422, the brightness value L of each frame t is recorded to obtain a brightness sequence:
[0065] S = [L1, L2, L3, …, L T
[0066] where S represents the brightness sequence, and L1, L2, L3, …, L T respectively represent the brightness values of the region of interest in the 1st frame, 2nd frame, 3rd frame, …, Tth frame. Accordingly, recording the brightness values of a region of interest in time order obtains a brightness sequence. Furthermore, the brightness values of other regions of interest are also recorded in time order to obtain corresponding brightness sequences, that is, each brightness sequence is obtained.
[0067] Step S105: Parallelly determine whether the frequency characteristics of each brightness sequence conform to the preset frequency characteristics of the turn signal.
[0068] In step S105, the frequency characteristic is the stroboscopic law of the lamp. The preset frequency characteristics include a preset frequency and a preset amplitude corresponding to the preset frequency. It can be understood that due to the existence of vehicle regulations, the light-emitting modes of different lamps, especially the stroboscopic laws, are different. Therefore, the frequency characteristics of the turn signal can be determined from the brightness sequence of each region of interest through multiple pre-confirmed stroboscopic laws of the turn signal.
[0069] Please refer to Figure 6 , which is the flowchart of the sub-steps of step S105 provided by the embodiment of the present application. Parallelly determining whether the frequency characteristics of each brightness sequence conform to the preset frequency characteristics of the turn signal includes steps S1051 - S1053.
[0070] Step S1051: Allocate corresponding third threads according to the number of brightness sequences.
[0071] In step S1051, the third thread is a thread for single-instruction multiple-data calculation based on NEON. In the process of judging the frequency characteristics of each luminance sequence, the computer device can realize the concurrent running of multiple threads in one process through internal components. And since the processes of judging the frequency characteristics of each luminance sequence do not interfere with each other. Therefore, in this embodiment, the third threads are correspondingly allocated according to the number of luminance sequences, so that each third thread judges the frequency characteristics of one luminance sequence. Since each third thread needs to judge the frequency characteristics of one luminance sequence, the number of allocated third threads is also the number of luminance sequences. It can be understood that the first thread, the second thread, and the third thread can be the same thread, only with differences in the functions implemented.
[0072] Step S1052, use each third thread to perform a discrete Fourier transform on each luminance sequence in parallel to obtain the spectrum of each luminance sequence.
[0073] In step S1052, multiple threads can be concurrent in one process, and each thread executes different tasks in parallel. In this embodiment, the processes of judging the frequency characteristics of each luminance sequence do not interfere with each other. Therefore, parallel acquisition can be realized. That is to say, when a sufficient number of third threads are allocated, multiple third threads are concurrent in the process of judging the frequency characteristics of each luminance sequence, and each third thread judges the frequency characteristics of one luminance sequence in parallel, so that the frequency characteristics of all luminance sequences are judged in parallel, improving the calculation efficiency and reducing the running time.
[0074] Specifically, for the third thread, frequency domain analysis is performed through a discrete Fourier transform (DFT), and then specific frequency characteristics are extracted. After performing DFT on the luminance sequence S in this application, its spectrum F(f) can be expressed as:
[0075]
[0076] where f is a specific frequency. F(f) is the amplitude corresponding to the frequency f. Exemplarily, the frequency range of the turn signal is usually f ∈ [1, 2] Hz. Assuming that the frame rate of the initial image is 30 FPS, then after DFT of the frequency of the turn signal, the corresponding discrete frequency range is f ∈ [30, 60] Hz.
[0077] Step S1053, according to a preset frequency, extract the amplitude corresponding to the preset frequency from each spectrum, and judge whether the amplitude meets the preset amplitude.
[0078] In step S1053, when it is judged that the amplitude extracted from the spectrum corresponding to the preset frequency meets the preset amplitude, it is determined that the luminance sequence corresponding to the corresponding spectrum is generated by the turn signal emitting light.
[0079] Specifically, the amplitude |F(f)| of frequency f in the extracted spectrum F(f) can be expressed as:
[0080] f max =argmax|F(f)|, f ∈ [1, 2]
[0081] When f max falls within the frequency range of the turn signal, i.e., [30, 60] Hz, then the amplitude conforms to the preset amplitude of the turn signal, and it can be determined that the brightness sequence corresponding to the corresponding spectrum is generated by the turn signal lighting.
[0082] Step S106: When it is determined that the frequency characteristics of a brightness sequence conform to the preset frequency characteristics, it is determined that the corresponding brightness sequence is generated by the turn signal lighting, and the brightness information of the turn signal is obtained according to the corresponding brightness sequence.
[0083] In step S106, the brightness information is used to predict the driving intention of the target vehicle where the turn signal is located. Combining with step S105, when the amplitude corresponding to the preset frequency conforms to the preset amplitude of the turn signal, that is, when the frequency characteristics of the brightness sequence conform to the preset frequency characteristics, it can be determined that the corresponding brightness sequence is generated by the turn signal lighting. Furthermore, the autonomous vehicle can obtain the driving intention of the corresponding target vehicle according to the corresponding brightness sequence, so as to formulate the driving strategy of the autonomous vehicle more accurately.
[0084] Please refer to Figure 2 , which is the flowchart of the sub-steps of step S103 provided by the embodiment of the present application. After each first thread is used to parallelly convert the first color component of each pixel into the second color component of each pixel in the second color space, the detection method further includes steps S201 - S202.
[0085] Step S201: Use the preset chromaticity component range of the turn signal to perform color masking on each region of interest to determine whether the chromaticity components of the pixels in each region of interest fall within the preset chromaticity component range.
[0086] Step S202: Obtain all the pixels in each region of interest whose chromaticity components fall within the preset chromaticity component range to obtain the expected turn signal region of each region of interest, and the turn signal is located in the expected turn signal region.
[0087] In step S201, the potential position of the turn signal is determined in the region of interest, and the turn signal is jointly detected by combining the brightness sequences of the respective regions of interest. Taking the turn signal as an example, the range of the first chrominance component U in the chrominance component of the turn signal is [80, 130], and the range of the second chrominance component V is [150, 255]. For each pixel, a color mask M(x, y) can be generated to correspondingly indicate the position that conforms to the chrominance component of the turn signal emission color in the region of interest, thereby obtaining the expected turn signal region. Specifically, the color mask M(x, y) indicates whether each pixel belongs to the region of the turn signal, and its representation form is:
[0088]
[0089] where M(x, y) = 1 indicates that the pixel belongs to the region of the turn signal, that is, the expected turn signal region, and M(x, y) = 0 indicates that the pixel does not belong to the region of the turn signal.
[0090] Please refer to Figure 7 which is the structural schematic diagram of the driving intention detection device provided by the embodiment of the present application. The present application also provides a driving intention detection device 11. The driving intention detection device 11 includes an acquisition module 110, a target detection module 111, an image processing module 112, a brightness acquisition module 113, a turn signal detection module 114, and a turn signal information acquisition module 115.
[0091] The acquisition module 110 is used to acquire an initial image in the first color space of the image in front of the current vehicle.
[0092] The target detection module 111 is used to detect a plurality of regions of interest from the initial image based on target detection. The target detection is used to detect a plurality of target vehicles. Each region of interest corresponds to a part of the initial image and contains at least one target vehicle.
[0093] The image processing module 112 is used to convert the initial image from the first color space to the second color space.
[0094] The brightness acquisition module 113 is used to parallel acquire the brightness sequences of each region of interest.
[0095] The turn signal detection module 114 is used to parallel determine whether the frequency characteristics of each brightness sequence conform to the preset frequency characteristics of the turn signal.
[0096] When it is determined that the frequency characteristics of a brightness sequence conform to the preset frequency characteristics, the turn signal information acquisition module 115 is used to determine that the corresponding brightness sequence is generated by the turn signal emission, and obtain the brightness information of the turn signal according to the corresponding brightness sequence. The brightness information is used to predict the driving intention of the target vehicle where the turn signal is located.
[0097] Please refer toFigure 8 , which is a schematic internal structure diagram of a computer device for implementing the driving intention detection method provided by an embodiment of the present application.
[0098] As Figure 8 shown, the computer device 100 includes a memory 901 and a processor 902. Among them, the processor 902 is used to run computer program instructions in the memory 901 to implement the driving intention detection method.
[0099] The memory 901 includes at least one type of readable storage medium, which includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 901 can be an internal storage unit of the computer device in some embodiments, such as the hard disk of the computer device. The memory 901 can also be an external storage device of the computer device in other embodiments, such as a plug-in hard disk configured in the computer device, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 901 can also include both the internal storage unit and the external storage device of the computer device. The memory 901 can be used not only to store application software installed in the computer device and various types of data, such as the code of the driving intention detection method, but also to temporarily store data that has been output or will be output.
[0100] Further, the computer device 100 further includes a bus 903. The bus 903 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 8 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0101] Further, the computer device 100 can also include a display component 904. The display component 904 can be an LED display, a liquid crystal display, a touch liquid crystal display, and an Organic Light-Emitting Diode (OLED) toucher, etc. Among them, the display component 904 can also be appropriately referred to as a display device or a display unit, and is used to display the information processed in the computer device 100 and to display a visual user interface.
[0102] Further, the computer device 100 may further include a communication component 905. The communication component 905 may optionally include a wired communication component and / or a wireless communication component (such as a Wi-Fi communication component, a Bluetooth communication component, etc.), and is generally used to establish a communication connection between the computer device 100 and other computer devices.
[0103] Figure 8 Only the computer device 100 with some components and implementing the driving intention detection method is shown. Those skilled in the art can understand that Figure 8 the shown structure does not limit the computer device 100, and it may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0104] In the above embodiments, it can be implemented in whole or in part by software, hardware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.
[0105] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer device may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, a computer, a server, or a data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that a computer can store, or a data storage device such as a server or a data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0106] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.
[0107] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0108] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0109] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes 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 steps of the methods in various embodiments of the present application. The foregoing storage medium includes: USB flash drives, removable hard disks, read-only storage media (ROM, Read-Only Memory), random access storage media (RAM, Random Access Memory), magnetic disks, or optical discs and other various media that can store program codes.
[0111] In the above embodiments, several regions of interest containing the target vehicle are obtained by performing target detection on the initial image, and the first color space of the regions of interest is converted to a second color space that can distinguish the turn signal by brightness and chromaticity, so that the current vehicle can parallelly obtain the brightness sequences of several regions of interest during the driving process with frequently changing lighting conditions, and then parallelly distinguish the brightness sequence emitted by the turn signal, improving the accuracy of turn signal detection, reducing the false detection rate, and at the same time improving the detection efficiency by allocating corresponding threads for parallel processing, reducing the amount of calculation, and realizing the real-time detection of the turn signal without increasing the hardware cost, providing more reliable key information for judging the intention of the vehicle ahead.
[0112] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.
[0113] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0114] The above are only the preferred embodiments of this application, and of course, the scope of the rights of this application cannot be limited thereby. Therefore, equivalent changes made according to the claims of this application still fall within the scope covered by this application.
Claims
1. A driving intention detection method, characterized in that, The described driving intention detection method includes: Collecting an initial image in a first color space of the image in front of the current vehicle; Detecting a number of regions of interest from the initial image based on object detection, where the object detection is used to detect a number of target vehicles, each region of interest corresponds to a part of the initial image and contains at least one target vehicle; Converting the initial image from the first color space to a second color space; Parallelly obtaining the brightness sequence of each region of interest; Parallelly determining whether the frequency characteristics of each brightness sequence conform to the preset frequency characteristics of the turn signal; When it is determined that the frequency characteristics of a brightness sequence conform to the preset frequency characteristics, determining that the corresponding brightness sequence is generated by the emission of the turn signal, and obtaining the brightness information of the turn signal according to the corresponding brightness sequence, where the brightness information is used to predict the driving intention of the target vehicle where the turn signal is located.
2. The detection method according to claim 1, characterized in that, Converting the initial image from the first color space to a second color space includes: Allocating corresponding first threads according to the number of pixels in the initial image; Using each first thread to parallelly obtain the first color component of each pixel in the first color space of the initial image; Using each first thread to parallelly convert the first color component of each pixel into the second color component of each pixel in the second color space.
3. The detection method according to claim 2, characterized in that, The second color component includes a brightness component and a chrominance component; after using each first thread to parallelly convert the first color component of each pixel into the second color component of each pixel in the second color space, the detection method further includes: Performing color masking on each region of interest using the preset chrominance component range of the turn signal to determine whether the chrominance components of the pixels in each region of interest fall within the preset chrominance component range; Obtaining all the pixels in each region of interest whose chrominance components fall within the preset chrominance component range to obtain the expected turn signal region of each region of interest, where the turn signal is located in the expected turn signal region.
4. The detection method according to claim 3, wherein Parallelly obtaining the brightness sequence of each region of interest includes: Allocating corresponding second threads according to the number of regions of interest; Using each second thread to parallelly obtain the brightness sequence of each region of interest.
5. The detection method according to claim 4, wherein The initial image is a multi-frame image, and each frame image includes a number of regions of interest; using each second thread to parallelly obtain the brightness sequence of each region of interest includes: According to the brightness components of the pixels in each region of interest, using each second thread to parallelly calculate the brightness values of the regions of interest in each frame image; Recording the brightness values of the corresponding regions of interest in the order of the time of each frame image in the initial image to obtain each brightness sequence.
6. The detection method according to claim 1, characterized in that The preset frequency characteristics include a preset frequency and a preset amplitude corresponding to the preset frequency; Parallelly determining whether the frequency characteristics of each brightness sequence conform to the preset frequency characteristics of the turn signal includes: Allocating corresponding third threads according to the number of brightness sequences; Performing discrete Fourier transform on each of the luminance sequences in parallel using every third thread to obtain the spectrum of each luminance sequence; Extracting the amplitude corresponding to the preset frequency from each spectrum according to the preset frequency, and determining whether the amplitude meets the preset amplitude.
7. The detection method according to claim 6, wherein Each region of interest contains only one target vehicle; when it is determined that the amplitude corresponding to the preset frequency extracted from the spectrum meets the preset amplitude, it is determined that the luminance sequence corresponding to the spectrum is generated by the turn signal emitting light.
8. A driving intention detection device, characterized in that, The driving intention detection device includes: An acquisition module for acquiring an initial image in the first color space of the image in front of the current vehicle; A target detection module for detecting a plurality of regions of interest from the initial image based on target detection, the target detection being used to detect a plurality of target vehicles, each region of interest corresponding to a part of the initial image and containing at least one target vehicle; An image processing module for converting the initial image from the first color space to the second color space; A luminance acquisition module for acquiring the luminance sequences of each region of interest in parallel; A turn signal detection module for determining in parallel whether the frequency characteristics of each luminance sequence meet the preset frequency characteristics of the turn signal; A turn signal information acquisition module, when it is determined that the frequency characteristics of a luminance sequence meet the preset frequency characteristics, for determining that the corresponding luminance sequence is generated by the turn signal emitting light, and acquiring the luminance information of the turn signal according to the corresponding luminance sequence, the luminance information being used to predict the driving intention of the target vehicle where the turn signal is located.
9. A computer device, characterized in that, The computer device includes: A memory for storing a computer program; and A processor for executing the computer program to implement the driving intention detection method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, and the computer program is executed to implement the driving intention detection method according to any one of claims 1-7.