Detection method, device and equipment for vehicle light device and storage medium
By performing image processing and communication domain detection of the lighting device of the trackless rubber wheel truck, the problem of lighting device detection before the vehicle goes down the well is solved, fast and accurate detection is achieved, and vehicle safety is improved.
Patent Information
- Application Number
- CN202411546314.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-11
AI Technical Summary
Before the trackless rubber wheel truck goes down the well, the vehicle lighting device needs to be detected to avoid downhole accidents, but the prior art is difficult to achieve fast and accurate detection.
By sending instructions, the vehicle to be detected turns on the lighting device, obtains continuous multi-frame images, performs image processing and connectivity domain detection, and determines the position and normality of the lighting device.
It realizes rapid and accurate detection of vehicle lighting devices, improves vehicle safety, and avoids possible underground accidents.
Smart Images

Figure CN119595258A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle safety technology, and in particular to a detection method, device, equipment and storage medium for a vehicle lighting device. Background Art
[0002] Trackless rubber-tyred vehicles are a common means of transportation in mines. Due to the dark and foggy environment underground, if there is an abnormality in the vehicle's lighting device during the operation of the trackless rubber-tyred vehicle underground, it may cause a serious underground accident. Therefore, before the trackless rubber-tyred vehicle goes down the mine, it is necessary to inspect the vehicle's lighting device to determine whether there is any abnormality in the vehicle's lighting device. Summary of the invention
[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0004] In a first aspect, the present application proposes a method for detecting a vehicle lighting device, the method comprising: sending an indication message; wherein the indication message is used to instruct the vehicle to be detected to turn on the corresponding lighting device to be detected; obtaining a plurality of consecutive first frames of an image of the area where the vehicle to be detected is located; processing the first image to obtain a plurality of consecutive foreground binary images corresponding to the vehicle to be detected; performing a connected domain detection on the foreground binary image to obtain the location of an area where the grayscale value changes; obtaining a device location corresponding to the lighting device to be detected based on the first image; and determining whether the lighting device to be detected is normal based on the area location and the device location.
[0005] In one implementation, before sending the indication information, the method also includes: S1: determining that the vehicle to be detected enters a preset target area, and obtaining a plurality of consecutive second images of the vehicle to be detected; S2: tracking the vehicle to be detected based on the second image, and obtaining a target tracking result; S3: determining whether the vehicle to be detected is in a stationary state based on the target tracking result; S4: determining that the vehicle to be detected is in a stationary state, continuing to execute the step of sending the indication information, otherwise returning to execute S1.
[0006] In an optional implementation, the target tracking result includes the vehicle position of the vehicle to be detected, and the processing of the first image to obtain a continuous multi-frame foreground binary image corresponding to the vehicle to be detected includes: performing image segmentation on each frame of the first image based on the vehicle position to obtain a regional image corresponding to the vehicle to be detected; performing Gaussian background modeling and binarization processing on the continuous multi-frame regional images in sequence to obtain the continuous multi-frame foreground binary images.
[0007] In an optional implementation, determining whether the vehicle to be detected is in a stationary state based on the target tracking result includes: based on the target tracking result, obtaining the vehicle position of the vehicle to be detected in each frame of the second image; wherein the vehicle position includes the target vehicle position corresponding to the last frame image in the second image; obtaining the mean position and position variance corresponding to the vehicle position; obtaining the difference between the target vehicle position and the mean position; and in response to the difference being less than the position variance, determining that the vehicle to be detected is in a stationary state.
[0008] In one implementation, obtaining the device position corresponding to the lighting device to be detected based on the first image includes: performing image recognition on the first image to obtain a first position of a target marker; obtaining relative position information between the target marker and the lighting device to be detected; obtaining a first initial device position of the lighting device to be detected based on the first position and the relative position information; inputting the first image into a pre-trained position recognition model to obtain a second initial device position of the lighting device to be detected; and correcting the first initial device position based on the second initial device position to obtain the device position.
[0009] In an optional implementation, the target identifier is the license plate of the vehicle to be detected, and the method further includes: extracting image information from the multiple consecutive frames of first images based on the first position to obtain the license plate information of the vehicle to be detected; and storing the license plate information and the monitoring results of the lighting device to be detected in association with each other.
[0010] In a second aspect, the present application proposes a detection device for a vehicle lighting device, the device comprising: a sending module, used to send indication information; wherein the indication information is used to instruct the vehicle to be detected to turn on the corresponding lighting device to be detected; an acquisition module, used to acquire multiple consecutive frames of first images of the area where the vehicle to be detected is located; a first processing module, used to process the first image to obtain multiple consecutive frames of foreground binary images corresponding to the vehicle to be detected; a second processing module, used to perform connected domain detection on the foreground binary image to obtain the location of the area where the grayscale value changes; a third processing module, used to obtain the device location corresponding to the lighting device to be detected based on the first image; and a fourth processing module, used to determine whether the lighting device to be detected is normal based on the area location and the device location.
[0011] In one implementation, the device also includes a fifth processing module, which is used to perform the following steps before sending the indication information: S1: determine that the vehicle to be detected enters a preset target area, and obtain multiple consecutive frames of second images of the vehicle to be detected; S2: track the vehicle to be detected based on the second image to obtain a target tracking result; S3: determine whether the vehicle to be detected is in a stationary state based on the target tracking result; S4: determine that the vehicle to be detected is in a stationary state, continue to execute the step of sending the indication information, otherwise return to execute S1.
[0012] In an optional implementation, the target tracking result includes the vehicle position of the vehicle to be detected, and the first processing module can be used to perform image segmentation on each frame of the first image based on the vehicle position to obtain the area image corresponding to the vehicle to be detected; and perform Gaussian background modeling and binarization processing on the continuous multiple frames of area images in sequence to obtain the continuous multiple frames of foreground binary images.
[0013] In an optional implementation, the fifth processing module can be used for the target tracking results to obtain the vehicle position of the vehicle to be detected in each frame of the second image; wherein the vehicle position includes the target vehicle position corresponding to the last frame image in the second image; obtain the mean position and position variance corresponding to the vehicle position; obtain the difference between the target vehicle position and the mean position; in response to the difference being less than the position variance, determine that the vehicle to be detected is in a stationary state.
[0014] In one implementation, the third processing module can be used to: perform image recognition on the first image to obtain a first position of a target marker; obtain relative position information between the target marker and the lighting device to be detected; based on the first position and the relative position information, obtain a first initial device position of the lighting device to be detected; input the first image into a pre-trained position recognition model to obtain a second initial device position of the lighting device to be detected; and correct the first initial device position based on the second initial device position to obtain the device position.
[0015] In an optional implementation, the target identifier is the license plate of the vehicle to be detected, and the device also includes a sixth processing module, which is used to extract image information from the continuous multiple frames of first images based on the first position to obtain the license plate information of the vehicle to be detected; and store the license plate information and the monitoring results of the lighting device to be detected in association with each other.
[0016] In a third aspect, the present application proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the vehicle lighting device detection method as described in the first aspect.
[0017] In a fourth aspect, the present application proposes a computer-readable storage medium for storing instructions, which, when executed, enables the method described in the first aspect to be implemented.
[0018] In a fifth aspect, the present application proposes a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the vehicle lighting device detection method as described in the first aspect.
[0019] The vehicle lighting device detection method, device, equipment and storage medium provided by the present application can obtain corresponding continuous multiple frames of foreground binary images based on the continuous multiple frames of first images of the area where the vehicle to be detected is located, and perform connected domain detection on the foreground binary images to obtain the area position where the grayscale value changes, thereby determining whether the lighting device to be detected is normal based on the area position and the device position corresponding to the lighting device to be detected obtained based on the first image. It can realize rapid and accurate detection of vehicle lighting devices, thereby improving vehicle safety.
[0020] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0022] Figure 1 It is a flow chart of a method for detecting a vehicle lighting device provided in an embodiment of the present application;
[0023] Figure 2 is a flow chart of another method for detecting a vehicle lighting device provided in an embodiment of the present application;
[0024] Figure 3 is a flow chart of another method for detecting a vehicle lighting device provided in an embodiment of the present application;
[0025] Figure 4 It is a structural schematic diagram of a detection device for a vehicle lighting device provided in an embodiment of the present application;
[0026] Figure 5is a schematic structural diagram of another vehicle lighting device detection device provided in an embodiment of the present application;
[0027] Figure 6 is a structural schematic diagram of another vehicle lighting device detection device provided in an embodiment of the present application;
[0028] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0030] The following describes a method and device for detecting a vehicle lighting device according to an embodiment of the present application with reference to the accompanying drawings.
[0031] Figure 1 FIG. 1 is a flow chart of a method for detecting a vehicle lighting device provided in an embodiment of the present application. Figure 1 As shown, the method may include but is not limited to the following steps:
[0032] Step S101: Send instruction information.
[0033] The above instruction information is used to instruct the vehicle to be detected to turn on the corresponding lighting device to be detected.
[0034] For example, if the vehicle to be detected can be controlled by an external command, instruction information is sent to the vehicle to be detected so that the vehicle to be detected turns on the corresponding lighting device to be detected.
[0035] For example, if the vehicle to be detected cannot be controlled by external commands, a corresponding command can be issued to the driver of the vehicle through a pre-set screen to enable the driver of the vehicle to turn on the corresponding lighting device to be detected.
[0036] Among them, the above-mentioned vehicle to be inspected can be a trackless rubber-wheeled vehicle.
[0037] It is understandable that the vehicle to be detected may include multiple lighting devices, such as headlights, turn signals, taillights, brake lights, and width lights. The method of any embodiment of the present application may be used to detect each lighting device separately.
[0038] Step S102: Acquire a plurality of consecutive first image frames of the area where the vehicle to be detected is located.
[0039] Exemplarily, a plurality of continuous first image frames of the area where the vehicle to be detected is located are acquired through a pre-set camera device.
[0040] It should be noted that the various lighting devices to be detected of the vehicle are respectively arranged at different positions of the vehicle, so multiple camera devices can be pre-arranged at multiple positions around the vehicle to obtain corresponding images as the first image according to the positions of the lighting devices that need to be detected.
[0041] Step S103: Process the first image to obtain a plurality of continuous foreground binary images corresponding to the vehicle to be detected.
[0042] Exemplarily, image recognition is performed on the first image to obtain a regional image of the area where the vehicle to be detected is located, and foreground processing and binarization processing are performed on the regional image in sequence to obtain multiple frames of continuous foreground binary images.
[0043] Step S104: Perform connected domain detection on the foreground binary image to obtain the location of the region where the gray value changes.
[0044] Exemplarily, connected domain detection is performed on each frame of the foreground binary image to obtain the connected areas in each frame of the foreground binary image, the position of each connected area and the grayscale value of each connected area, so as to obtain the area positions of areas with similar positions and changed grayscale values in foreground binary images of different frames.
[0045] Step S105: obtaining a device position corresponding to the lighting device to be detected based on the first image.
[0046] Exemplarily, image recognition is performed on the first image to obtain the device position of the lighting device to be detected.
[0047] Step S106: Based on the area location and the device location, determine whether the lighting device to be inspected is normal.
[0048] Exemplarily, if based on the area position and the device position, it is determined that the degree of overlap between the area where the grayscale changes and the area where the lighting device to be detected is located is greater than or equal to a preset overlap threshold (for example, 90 percent), then it is determined that the lighting device to be detected is normal; if based on the area position and the device position, it is determined that the degree of overlap between the area where the grayscale changes and the area where the lighting device to be detected is located is less than the preset overlap threshold, then it is determined that there is an abnormality in the lighting device to be detected.
[0049] By implementing the embodiments of the present application, it is possible to obtain corresponding continuous multiple frames of foreground binary images based on the continuous multiple frames of first images of the area where the vehicle to be detected is located, and perform connected domain detection on the foreground binary images to obtain the location of the area where the grayscale value changes, thereby determining whether the lighting device to be detected is normal based on the location of the area and the device location corresponding to the lighting device to be detected obtained based on the first image. Rapid and accurate detection of vehicle lighting devices can be achieved, thereby improving vehicle safety.
[0050] In some embodiments, after determining that all the lighting devices of the vehicle to be detected are normal, the vehicle to be detected may be allowed to pass. For example, taking the vehicle to be detected as a trackless rubber-tyred vehicle as an example, after determining that all the lighting devices of the trackless rubber-tyred vehicle are normal, the trackless rubber-tyred vehicle is allowed to enter the mine.
[0051] In some embodiments, after determining that the vehicle to be detected meets the requirements, the light device to be detected of the vehicle to be detected can be monitored. As an example, see Figure 2 , Figure 2 FIG. 1 is a flow chart of another method for detecting a vehicle lighting device provided in an embodiment of the present application. Figure 2 As shown, the method may include but is not limited to the following steps:
[0052] Step S201: Acquire multiple consecutive frames of second images of the vehicle to be detected.
[0053] In some embodiments, the steps of the embodiments of the present application may be performed after the vehicle to be detected enters a preset target area, which is an area where the preset image acquisition device can accurately acquire images.
[0054] Exemplarily, it is determined that the vehicle to be detected enters a preset target area, and a plurality of consecutive frames of second images of the vehicle to be detected are acquired through the same camera device used to acquire the first image.
[0055] Step S202: Track the vehicle to be detected based on the second image to obtain a target tracking result.
[0056] Exemplarily, the acquired second image is preprocessed, including denoising, enhancement and other operations, to improve image quality. Based on the preprocessed image data, a Kalman filter algorithm is first used to predict the predicted position of the current vehicle in the next frame of the image, and then a Hungarian matching algorithm is used to match the predicted position to obtain a target tracking result.
[0057] Step S203: Determine whether the vehicle to be detected is in a stationary state based on the target tracking result.
[0058] Exemplarily, based on the target tracking result, it is determined whether the position of the vehicle to be detected in the second image of different frames has changed. If it has not changed, it is determined that the vehicle to be detected is stationary; if it has changed, it is determined that the vehicle to be detected is not stationary.
[0059] In some embodiments, the above-mentioned determination of whether the vehicle to be detected is in a stationary state based on the target tracking result may include the following steps:
[0060] A1: Based on the target tracking result, the vehicle position of the vehicle to be detected in each frame of the second image is obtained.
[0061] The vehicle position includes the target vehicle position corresponding to the last frame image in the second image.
[0062] Exemplarily, the vehicle position of the vehicle to be detected in each frame of the second image in the target tracking result is obtained.
[0063] A2: Get the mean position and position variance corresponding to the vehicle position.
[0064] Exemplarily, based on the vehicle positions corresponding to the second images of different frames, the corresponding position means and position variances are obtained.
[0065] A3: Get the difference between the target vehicle position and the mean position.
[0066] A4: In response to the difference being less than the position variance, it is determined that the vehicle to be detected is in a stationary state.
[0067] Exemplarily, in response to a difference between the target vehicle position and the mean position being smaller than the position variance, it is determined that the vehicle to be detected is in a stationary state.
[0068] Exemplarily, in response to a difference between the target vehicle position and the mean position being greater than or equal to the position variance, it is determined that the vehicle to be detected is not stationary.
[0069] Step S204: if it is determined that the vehicle to be detected is stationary, continue to execute the step of sending the indication information, otherwise return to execute step S201.
[0070] As an example, it is determined that the vehicle to be detected is in a stationary state, and the subsequent steps of the embodiment of the present application are continued.
[0071] As an example, if it is determined that the vehicle to be detected is not stationary, the process returns to step S201 to detect again whether the vehicle to be detected is stationary.
[0072] Step S205: Send instruction information.
[0073] In the embodiments of the present application, step S201 can be implemented by any of the methods in the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.
[0074] Step S206: Acquire a plurality of consecutive first image frames of the area where the vehicle to be detected is located.
[0075] In the embodiments of the present application, step S206 can be implemented by any of the methods in the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.
[0076] Step S207: Process the first image to obtain a plurality of continuous foreground binary images corresponding to the vehicle to be detected.
[0077] Exemplarily, the first image is converted into a grayscale image and denoised, a threshold is dynamically calculated based on local features of the image, each pixel in the first image is compared with the threshold, pixels greater than or equal to the threshold are set to white, and pixels less than the threshold are set to black, thereby obtaining a foreground binary image corresponding to each frame of the first image.
[0078] In some embodiments, the target tracking result includes the vehicle position of the vehicle to be detected. The first image is processed to obtain a continuous multi-frame foreground binary image corresponding to the vehicle to be detected, including: performing image segmentation on each frame of the first image based on the vehicle position to obtain a regional image corresponding to the vehicle to be detected; performing Gaussian background modeling and binarization processing on the continuous multi-frame regional images in turn to obtain a continuous multi-frame foreground binary image.
[0079] Exemplarily, image segmentation is performed on each acquired first image frame based on the vehicle position obtained by target tracking, and a regional image of the area where the vehicle to be detected is located in each frame of the first image is obtained. Gaussian background modeling and binarization are performed on the acquired regional images in sequence to obtain multiple consecutive frames of foreground binary images.
[0080] Step S208: Perform connected domain detection on the foreground binary image to obtain the location of the region where the gray value changes.
[0081] In the embodiments of the present application, step S208 can be implemented in any of the ways in the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.
[0082] Step S209: obtaining a device position corresponding to the lighting device to be detected based on the first image.
[0083] In the embodiments of the present application, step S209 can be implemented in any of the ways in the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.
[0084] Step S2010: Based on the area location and the device location, determine whether the lighting device to be inspected is normal.
[0085] In the embodiments of the present application, step S2010 can be implemented in any of the ways in the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.
[0086] By implementing the embodiments of the present application, after the vehicle to be detected enters the target area, target tracking can be performed based on the acquired continuous multiple-frame second image, so as to determine whether the vehicle to be detected is in a stationary state based on the target tracking result, and perform subsequent steps after determining that the vehicle to be detected is in a stationary state, thereby ensuring the accuracy of the detection result.
[0087] In some embodiments, the position of the light device to be detected can be determined based on the position of the marker on the vehicle to be detected. As an example, see Figure 3 , Figure 3 FIG. 1 is a flow chart of another method for detecting a vehicle lighting device provided in an embodiment of the present application. Figure 3 As shown, the method may include but is not limited to the following steps:
[0088] Step S301: Send instruction information.
[0089] In the embodiments of the present application, step S301 can be implemented in any of the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.
[0090] Step S302: Acquire a plurality of consecutive first image frames of the area where the vehicle to be detected is located.
[0091] In the embodiments of the present application, step S302 can be implemented by any of the methods in the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.
[0092] Step S303: Process the first image to obtain a plurality of continuous foreground binary images corresponding to the vehicle to be detected.
[0093] In the embodiments of the present application, step S303 can be implemented by any of the methods in the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.
[0094] Step S304: Perform connected domain detection on the foreground binary image to obtain the location of the region where the gray value changes.
[0095] In the embodiments of the present application, step S304 can be implemented by any of the methods in the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.
[0096] Step S305: Perform image recognition on the first image to obtain the first position of the target marker.
[0097] Exemplarily, a pre-trained SSD (Single Shot MultiBox Detector) target detection network is used to perform image monitoring on the first image to obtain a first position of a preset target marker in the first image.
[0098] The target marker may be a fixed marker pre-installed on the vehicle to be detected, or the target marker may be a pre-selected fixed marker originally on the vehicle to be detected.
[0099] It should be noted that, since it has been determined that the vehicle to be detected is stationary at this time, the relative position information between the vehicle to be detected and the image acquisition device no longer changes, so any frame of the first image can be monitored to obtain the first position of the target marker.
[0100] In some embodiments, the target identifier is the license plate of the vehicle to be detected, and the above method may also include: extracting image information from multiple consecutive frames of first images based on the first position to obtain the license plate information of the vehicle to be detected; and associating and storing the license plate information and the monitoring results of the lighting device to be detected.
[0101] Exemplarily, a pre-trained RNN (Recurrent Neural Network) network is used to extract information from an area image corresponding to a target marker to obtain license plate information; the license plate information is associated with a lighting device detection result corresponding to the vehicle to be detected and stored for subsequent query.
[0102] Step S306: Obtain the relative position information between the target marker and the lighting device to be detected.
[0103] Exemplarily, the relative position information between the target marker and the lighting device to be detected is obtained by pre-measurement.
[0104] Step S307: based on the first position and the relative position information, obtaining a first initial device position of the lighting device to be detected.
[0105] Exemplarily, the first position of the target marker is adjusted based on the relative position information to obtain a first initial device position of the lighting device to be detected.
[0106] Step S308: input the first image into a pre-trained position recognition model to obtain a second initial device position of the lighting device to be detected.
[0107] Exemplarily, the first image is input into a pre-trained position recognition model, and a second initial device position of the lighting device to be detected output by the position recognition model is obtained.
[0108] Step S309: Correct the first initial device position based on the second initial device position to obtain a device position.
[0109] Exemplarily, if the overlap rate between the second initial device position and the first initial device position is greater than or equal to a preset overlap rate threshold, the average position of the first initial device position and the second initial device position is used as the device position of the lighting device to be detected.
[0110] As an example, if the coincidence rate between the second initial device position and the first initial device position is less than a preset coincidence rate threshold, the aforementioned steps are re-executed to re-acquire the device position of the lighting device to be detected.
[0111] As an example, if the overlap rate between the second initial device position and the first initial device position is greater than or equal to a preset overlap rate threshold, the first initial device position is used as the device position of the lighting device to be detected.
[0112] As an example, if the overlap rate between the second initial device position and the first initial device position is greater than or equal to a preset overlap rate threshold, the second initial device position is used as the device position of the lighting device to be detected.
[0113] Step S3010: Based on the area location and the device location, determine whether the lighting device to be inspected is normal.
[0114] In the embodiments of the present application, step S3010 can be implemented in any of the ways in the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.
[0115] By implementing the embodiments of the present application, the first initial device position of the light device to be detected can be obtained based on the first position of the target marker and the relative position information between the target marker and the light device to be detected, and the first image can be recognized based on the pre-trained position recognition model to obtain the second initial device position, and the first initial device position can be corrected based on the second initial device position to obtain the device position. The device position of the light device to be detected can be made more accurate, thereby realizing rapid and accurate detection of the vehicle light device, thereby improving vehicle safety.
[0116] See also Figure 4 , Figure 4 Schematic diagram of the structure of a detection device for a vehicle lighting device provided in an embodiment of the present application. Figure 4As shown, the device 400 includes: a sending module 401, used for sending indication information; wherein the indication information is used to instruct the vehicle to be detected to turn on the corresponding lighting device to be detected; an acquisition module 402, used for acquiring a plurality of consecutive first images of the area where the vehicle to be detected is located; a first processing module 403, used for processing the first image to obtain a plurality of consecutive foreground binary images corresponding to the vehicle to be detected; a second processing module 404, used for performing connected domain detection on the foreground binary image to obtain the location of the area where the grayscale value changes; a third processing module 405, used for obtaining the device location corresponding to the lighting device to be detected based on the first image; and a fourth processing module 406, used for determining whether the lighting device to be detected is normal based on the area location and the device location.
[0117] In one implementation, the apparatus further includes a fifth processing module. As an example, see Figure 5 , Figure 5 Schematic diagram of another vehicle lighting device detection device provided in an embodiment of the present application. Figure 5 As shown, the device 500 also includes a fifth processing module 507, which is used to perform the following steps before sending the indication information:, which is used to perform the following steps: S1: determine that the vehicle to be detected enters the preset target area, and obtain multiple consecutive frames of the second image of the vehicle to be detected; S2: perform target tracking on the vehicle to be detected based on the second image, and obtain the target tracking result; S3: determine whether the vehicle to be detected is in a stationary state based on the target tracking result; S4: determine that the vehicle to be detected is in a stationary state, continue to execute the step of sending the indication information, otherwise return to execute S1. Among them, Figure 5 Modules 501 to 506 in Figure 4 Modules 401 to 406 in the embodiment have the same structure and function.
[0118] In an optional implementation, the fifth processing module 507 can be used for target tracking results to obtain the vehicle position of the vehicle to be detected in each frame of the second image; wherein the vehicle position includes the target vehicle position corresponding to the last frame image in the second image; obtain the mean position and position variance corresponding to the vehicle position; obtain the difference between the target vehicle position and the mean position; in response to the difference being less than the position variance, determine that the vehicle to be detected is in a stationary state.
[0119] In an optional implementation, the target tracking result includes the vehicle position of the vehicle to be detected. The first processing module 403 can be used to perform image segmentation on each frame of the first image based on the vehicle position to obtain the area image corresponding to the vehicle to be detected; and perform Gaussian background modeling and binarization processing on multiple consecutive frames of area images in sequence to obtain multiple consecutive frames of foreground binary images.
[0120] In one implementation, the third processing module 405 can be used to: perform image recognition on the first image to obtain a first position of a target marker; obtain relative position information between the target marker and the lighting device to be detected; based on the first position and the relative position information, obtain a first initial device position of the lighting device to be detected; input the first image into a pre-trained position recognition model to obtain a second initial device position of the lighting device to be detected; and correct the first initial device position based on the second initial device position to obtain the device position.
[0121] In an optional implementation, the target identifier is a license plate of a vehicle to be detected, and the device further includes a sixth processing module. As an example, see Figure 6 , Figure 6 Schematic diagram of the structure of another vehicle lighting device detection device provided in the embodiment of the present application. Figure 6 As shown, the device 600 further includes a sixth processing module 607, which is used to extract image information from a plurality of consecutive first image frames based on the first position, obtain the license plate information of the vehicle to be detected, and associate and store the license plate information with the monitoring result of the lighting device to be detected. Figure 6 Modules 601 to 606 in Figure 4 Modules 401 to 406 in the embodiment have the same structure and function.
[0122] Through the device of the embodiment of the present application, based on the acquired continuous multiple-frame first image of the area where the vehicle to be detected is located, the corresponding continuous multiple-frame foreground binary image can be acquired, and the connected domain detection can be performed on the foreground binary image to obtain the area position where the gray value changes, so as to determine whether the lighting device to be detected is normal according to the area position and the device position corresponding to the lighting device to be detected obtained based on the first image. It is possible to achieve rapid and accurate detection of vehicle lighting devices, thereby improving vehicle safety.
[0123] It should be noted that the above explanations and descriptions of the embodiment of the detection method of the vehicle lighting device are also applicable to the detection device of the vehicle lighting device of this embodiment, and will not be repeated here.
[0124] In order to implement the above embodiment, the present application also proposes an electronic device. Figure 7 , Figure 7 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 7 As shown, the electronic device 700 includes: a processor 701, and a memory 702 communicatively connected to the processor 701; the memory 702 stores computer-executable instructions; the processor 701 executes the computer-executable instructions stored in the memory to implement the method provided in the aforementioned embodiment.
[0125] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.
[0126] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.
[0127] In the description of this application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in this article is merely a way to describe the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0128] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0129] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0130] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0131] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0132] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0133] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0134] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0135] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for detecting a vehicle lighting device, characterized in that: include: Sending instruction information; wherein the instruction information is used to instruct the vehicle to be detected to turn on the corresponding lighting device to be detected; Acquire a plurality of continuous first image frames of the area where the vehicle to be detected is located; Processing the first image to obtain a continuous multi-frame foreground binary image corresponding to the vehicle to be detected; Performing connected domain detection on the foreground binary image to obtain the location of the area where the gray value changes; Obtaining a device position corresponding to the lighting device to be detected based on the first image; Based on the area location and the device location, determine whether the lighting device to be detected is normal.
2. The method according to claim 1, characterized in that Before sending the indication information, the method further includes: S1: Determine that the vehicle to be detected enters a preset target area, and obtain a plurality of consecutive second images of the vehicle to be detected; S2: Tracking the vehicle to be detected based on the second image to obtain a target tracking result; S3: Determine whether the vehicle to be detected is in a stationary state based on the target tracking result; S4: Determine that the vehicle to be detected is in a stationary state, and continue to execute the step of sending the instruction information; otherwise, return to execute S1.
3. The method according to claim 2, characterized in that The target tracking result includes the vehicle position of the vehicle to be detected, and the processing of the first image to obtain a continuous multi-frame foreground binary image corresponding to the vehicle to be detected includes: Performing image segmentation on each frame of the first image based on the vehicle position to obtain a region image corresponding to the vehicle to be detected; Gaussian background modeling and binarization processing are performed on the continuous multi-frame regional images in sequence to obtain the continuous multi-frame foreground binary images.
4. The method according to claim 2, characterized in that The determining whether the vehicle to be detected is in a stationary state based on the target tracking result includes: Based on the target tracking result, the vehicle position of the vehicle to be detected in each frame of the second image is obtained; wherein the vehicle position includes the target vehicle position corresponding to the last frame of the second image; Obtaining the mean position and position variance corresponding to the vehicle position; Obtaining a difference between the target vehicle position and the mean position; In response to the difference being smaller than the position variance, it is determined that the vehicle to be detected is in a stationary state.
5. The method according to claim 1, characterized in that The obtaining, based on the first image, a device position corresponding to the light device to be detected includes: Performing image recognition on the first image to obtain a first position of a target marker; Acquiring relative position information between the target marker and the lighting device to be detected; Based on the first position and the relative position information, acquiring a first initial device position of the lighting device to be detected; Inputting the first image into a pre-trained position recognition model to obtain a second initial device position of the lighting device to be detected; The first initial device position is corrected based on the second initial device position to obtain the device position.
6. The method according to claim 5, characterized in that The target identifier is the license plate of the vehicle to be detected, and the method further includes: Extracting image information from the plurality of consecutive first image frames based on the first position to obtain license plate information of the vehicle to be detected; The license plate information and the monitoring result of the lighting device to be detected are stored in association.
7. A detection device for a vehicle lighting device, characterized in that: include: A sending module, used for sending instruction information; wherein the instruction information is used for instructing the vehicle to be detected to turn on the corresponding lighting device to be detected; An acquisition module, used for acquiring a plurality of consecutive first images of the area where the vehicle to be detected is located; A first processing module, used for processing the first image to obtain a continuous multi-frame foreground binary image corresponding to the vehicle to be detected; The second processing module is used to perform connected domain detection on the foreground binary image to obtain the location of the area where the gray value changes; A third processing module, configured to obtain a device position corresponding to the lighting device to be detected based on the first image; The fourth processing module is used to determine whether the lighting device to be detected is normal based on the area location and the device location.
8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.