A monocular camera-based LED double-lamp recognition method, device, equipment and medium

By acquiring video frames with a monocular camera and utilizing bright spot recognition and feature filtering techniques, combined with Kalman filtering to predict vehicle trajectories, the reliability and accuracy issues of line-crossing detection in racing scenarios have been resolved, achieving high robustness and practicality in complex scenarios.

CN121033357BActive Publication Date: 2026-01-02AI TUER
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511565821.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-01-02
Estimated Expiration
2045-10-30

AI Technical Summary

Technical Problem

Existing technologies have low reliability and accuracy in line detection in racing scenarios. Traditional methods such as magnetic induction coils, infrared beams, RFID and optical motion capture systems have problems such as complex deployment, high cost and weak anti-interference. Monocular vision solutions based on LED blinking recognition are not robust and practical enough in complex scenarios.

Method used

A monocular camera is used to acquire video frames at a preset frequency. Flashing light spots are selected through bright spot recognition and feature matching technology. Vehicle trajectories are predicted using algorithms such as Kalman filtering. Flashing light spots and constant light spots are selected by combining brightness features and other features. Accurate spatial and temporal correlation is performed based on association matching technology. Vehicle trajectories are predicted by combining Kalman filtering, and line crossing events are determined comprehensively.

Benefits of technology

It improves the accuracy and anti-interference ability of vehicle recognition, enhances the reliability and precision of line crossing detection, and improves robustness and practicality in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033357B_ABST
    Figure CN121033357B_ABST
Patent Text Reader

Abstract

The application relates to the field of image processing, in particular to an LED double-lamp recognition method and device based on a monocular camera, equipment and a medium. The method comprises the following steps: ensuring data real-time by collecting video frames at a preset frequency, accurately distinguishing constant light and flickering light spots by using bright spot recognition and feature screening, and effectively excluding environmental interference; accurately associating the double-lamp spots of the same vehicle in space and time by using an association matching technology, and improving the accuracy of target vehicle recognition; predicting the vehicle trajectory based on Kalman filtering and other algorithms, and comprehensively judging the line-crossing event by combining the line-crossing time difference and the speed condition, which not only improves the smoothness and anti-interference ability of vehicle trajectory prediction, but also enhances the reliability and accuracy of line-crossing detection, so that the method has high robustness and practicality in complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, in particular to a LED double light recognition method and device based on a monocular camera, equipment and medium. BACKGROUND

[0002] In the racing scene, line crossing detection is the core link to determine the competition results and analyze the tactical strategy, and its accuracy and reliability directly affect the fairness of the event and the audience experience. Traditional line crossing detection technologies are difficult to meet the engineering needs in high-speed, multi-vehicle and complex lighting environments due to their respective limitations.

[0003] Specifically, in the prior art, the magnetic induction coil needs to damage the track ground structure, which has high maintenance cost and poor flexibility; the infrared shooting is easily disturbed by environmental light changes, rain, snow and other bad weather, resulting in false detection or missed detection; the RFID scheme relies on vehicle-mounted tags, which has the risk of tag damage, metal shielding and other missed reading, and cannot realize passive detection; the optical motion capture system can achieve millimeter-level accuracy, but requires multiple cameras to be synchronously arranged (the cost of a single set of equipment exceeds 100,000 yuan), which has higher deployment complexity and hardware cost than the budget of small and medium-sized events.

[0004] In recent years, the monocular vision scheme based on LED flicker recognition has become a research hotspot due to its non-contact and low-cost advantages, but its reliability and accuracy in actual application of line crossing detection are low, which makes it have low robustness and practicality in complex scenes. SUMMARY

[0005] In order to improve the reliability and accuracy of line crossing detection, the present application provides a LED double light recognition method and device based on a monocular camera, equipment and medium.

[0006] In the first aspect, the present application provides a LED double light recognition method based on a monocular camera, which adopts the following technical scheme:

[0007] A LED double light recognition method based on a monocular camera, comprising:

[0008] receiving a double light video frame collected by a monocular camera, wherein the monocular camera collects video frames at a preset frequency, the double light video frame contains at least one target vehicle, the target vehicle is any vehicle in the to-be-detected vehicle, and the to-be-detected vehicle is installed with one constant light and one flickering light;

[0009] identifying bright spots in each double light video frame and screening out flickering light spots and constant light spots from the bright spots;

[0010] associating and matching the flickering light spots and the constant light spots to obtain at least one group of associated light spots;

[0011] Based on the associated light spots, a vehicle trajectory of the target vehicle is predicted, and whether the target vehicle crosses the line is determined based on the vehicle trajectory.

[0012] By adopting the above technical solutions, the data real-time performance is ensured by collecting video frames at a preset frequency, the constant light and flashing light spots are accurately distinguished by using the bright spot identification and feature screening, and the environmental interference is effectively excluded; the same vehicle double light spots are accurately associated in space and time by using the association matching technology, and the accuracy of target vehicle identification is improved; the vehicle trajectory is predicted based on the Kalman filtering algorithm and the like, and the crossing line event is comprehensively determined in combination with the double light crossing line time difference and speed condition, which not only improves the smoothness and anti-interference ability of vehicle trajectory prediction, but also enhances the reliability and accuracy of crossing line detection, so that the robustness and practicality are high in complex scenes.

[0013] In a possible implementation, the flashing light spots and the constant light spots are screened out from the bright spots, including:

[0014] The brightness feature and the spectral characteristic feature corresponding to each bright spot are extracted;

[0015] Based on the brightness feature and the spectral characteristic feature, the brightness change trend and the spectral similarity of each bright spot in continuous multiple frames of double light video frames are calculated;

[0016] Based on the brightness change trend and the spectral similarity, in combination with a preset flashing light determination rule and a preset constant light determination rule, the flashing light spots meeting the flashing light feature and the constant light spots meeting the constant light feature are respectively screened out to obtain the flashing light spots and the constant light spots, wherein the flashing light determination rule is that the brightness fluctuation amplitude exceeds a preset fluctuation threshold and the fluctuation frequency is within a preset frequency range, and the constant light determination rule includes that the brightness fluctuation amplitude is within a preset tolerance range and the spectral similarity is higher than a preset similarity threshold.

[0017] In a possible implementation, the flashing light spots and the constant light spots are associated and matched to obtain at least one group of associated light spots, including:

[0018] The center pixel coordinates corresponding to each of the flashing light spots and each of the constant light spots are determined, and the center pixel coordinates are converted into physical space coordinates;

[0019] Vehicle data corresponding to the target vehicle is obtained, and a light distance range and an angle threshold corresponding to the target vehicle are set based on the vehicle data, wherein the vehicle data includes constant light positions and flashing light positions;

[0020] Based on each physical space coordinate, for each flashing light spot, all constant light spots are traversed to calculate the straight-line distance between the two in the physical space and the included angle of the connection line and the preset reference direction, if there is a target constant light spot, it is determined that the target constant light spot and the flashing light spot are an initial associated light spot group, the corresponding straight-line distance of the target constant light spot is within the corresponding light distance range and the corresponding included angle is not greater than the corresponding angle threshold;

[0021] Each initial associated light spot group in the continuous double-lamp video frame is tracked, and the physical spacing fluctuation value of the initial associated light spot group in each double-lamp video frame is calculated, if the fluctuation value is less than the fluctuation value threshold and the associated state is maintained in the continuous double-lamp video frame, it is determined that the initial associated light spot group is a final associated light spot group;

[0022] Based on each final associated light spot group, at least one group of associated light spots is obtained.

[0023] In a possible implementation, the center pixel coordinates corresponding to each flashing light spot and each constant light spot are determined, including:

[0024] Each flashing light spot and each constant light spot is subjected to image segmentation processing, and the pixel region corresponding to each light spot is extracted;

[0025] The contour detection is performed on each pixel region to obtain the minimum circumscribed rectangle of each light spot;

[0026] Based on the minimum circumscribed rectangle, the confidence degree corresponding to each pixel point in each double-lamp video frame is calculated;

[0027] Based on the confidence degree, the center pixel coordinates corresponding to each flashing light spot and each constant light spot are determined.

[0028] In a possible implementation, based on the minimum circumscribed rectangle, the confidence degree corresponding to each pixel point in each double-lamp video frame is calculated, and the calculation process of the confidence degree corresponding to each pixel point in each double-lamp video frame includes:

[0029] A local coordinate system is established with the center point of the minimum circumscribed rectangle as the origin, and the normalized distance of each pixel point in the minimum circumscribed rectangle region relative to the origin is calculated;

[0030] According to the normalized distance, the first confidence degree corresponding to each pixel point is calculated based on a Gaussian confidence function;

[0031] The brightness value and the edge gradient intensity of each pixel point are extracted, and the second confidence degree corresponding to each pixel point is calculated based on the brightness value and the edge gradient intensity;

[0032] determine a confidence degree corresponding to each pixel point in the dual-lamp video frame based on the first confidence degree and the second confidence degree.

[0033] In a possible implementation, the vehicle trajectory of the target vehicle is predicted based on the associated light spot, including:

[0034] taking the center pixel coordinates corresponding to the associated light spot as a trajectory reference point of the target vehicle in the corresponding dual-lamp video frame;

[0035] establishing a state vector of the target vehicle based on the trajectory reference point, the state vector including position information and speed information;

[0036] inputting an observation position of any dual-lamp video frame into a prediction model based on a Kalman filtering algorithm to obtain a state estimation value of the target vehicle in the any dual-lamp video frame, and generating a smooth motion trajectory of the target vehicle according to the state estimation value.

[0037] In a possible implementation, the state vector of the target vehicle is established based on the trajectory reference point, including:

[0038] taking the pixel coordinates of the trajectory reference point in any dual-lamp video frame as an initial observation position of the target vehicle;

[0039] constructing an initial state vector of the target vehicle with the initial observation position and a zero initial speed;

[0040] determining a state transition matrix corresponding to the any dual-lamp video frame, and defining a measurement matrix;

[0041] obtaining the state vector of the target vehicle based on the initial state vector, the state transition matrix, and the measurement matrix.

[0042] In a second aspect, the present application provides an LED dual-lamp recognition device based on a monocular camera, which adopts the following technical solution:

[0043] An LED dual-lamp recognition device based on a monocular camera, including:

[0044] a receiving module configured to receive dual-lamp video frames collected by a monocular camera, wherein the monocular camera collects video frames at a preset frequency, the dual-lamp video frames contain at least one target vehicle, the target vehicle is any vehicle in a to-be-detected vehicle, and the to-be-detected vehicle is installed with one constant light and one flashing light;

[0045] a recognition module configured to recognize bright spots in each dual-lamp video frame, and screen out flashing light spots and constant light spots from the bright spots;

[0046] The matching module is configured to perform correlation matching on the flickering light spot and the constant light spot to obtain at least one set of correlated light spots.

[0047] The prediction module is configured to predict a vehicle trajectory of the target vehicle based on the correlated light spots, and determine whether the target vehicle has crossed the line based on the vehicle trajectory.

[0048] In a third aspect, the present application provides an electronic device, which adopts the following technical solution:

[0049] An electronic device, comprising:

[0050] at least one processor;

[0051] a memory;

[0052] at least one application program, wherein the at least one application program is stored in the memory and configured to be executed by the at least one processor, and the at least one application program is configured to execute the method of any one of the above first aspect.

[0053] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:

[0054] A computer-readable storage medium, comprising a computer program stored therein, which can be loaded and executed by a processor to execute the method of any one of the above first aspect.

[0055] In summary, the present application has the following beneficial technical effects:

[0056] By collecting video frames at a preset frequency to ensure real-time data, using bright spot identification and feature screening to accurately distinguish constant light and flickering light spots, effectively excluding environmental interference; by using correlation matching technology to accurately correlate the double light spots of the same vehicle in space and time, the accuracy of target vehicle identification is improved; based on Kalman filtering algorithm and other algorithms to predict vehicle trajectory, and combined with the double light crossing time difference and speed condition to comprehensively determine the crossing event, not only improves the smoothness and anti-interference ability of vehicle trajectory prediction, but also enhances the reliability and accuracy of crossing detection, so as to have high robustness and practicality in complex scenes. BRIEF DESCRIPTION OF DRAWINGS

[0057] Figure 1 is a flowchart of a LED double light identification method based on a monocular camera provided by an embodiment of the present application;

[0058] Figure 2 is a block diagram of a LED double light identification device based on a monocular camera provided by an embodiment of the present application;

[0059] Figure 3is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0060] The following will be described in detail below with reference to the accompanying drawings of the embodiments of the present application. Figure 1 - the accompanying drawings Figure 3 The present application will be described in further detail.

[0061] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of 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 work fall within the scope of protection of the present application.

[0062] In order to facilitate understanding of the technical solutions proposed in the present application, first, several elements that will be introduced in the description of the present application are introduced. It should be understood that the following introduction is only for the convenience of understanding these elements in order to understand the content of the embodiments of the present application, and does not necessarily cover all possible cases.

[0063] At present, the line passing detection system of kart and similar racing cars mostly uses ground magnetic induction coils, infrared transmission, RFID or high-cost optical motion capture systems. These schemes have problems of complex deployment, high cost and weak anti-interference. In recent years, an optical method of identifying ID by LED flicker has been tried, but in a monocular vision system, due to factors such as brightness, light spot area, imaging blur caused by vehicle distance change, the LED flicker sequence cannot be stably decoded in the image, especially when the vehicle passes through the camera area at high speed, the recognition accuracy and robustness are difficult to guarantee.

[0064] Traditional magnetic induction coils need to damage the ground structure, infrared transmission is easily disturbed by environmental light, RFID relies on vehicle-mounted labels and has the risk of missing reading. Although the optical motion capture system has high precision, it needs multiple cameras to be synchronized and the cost is high (more than 100,000 yuan for a single set of equipment). The existing LED flicker identification scheme faces three major challenges in monocular vision:

[0065] 1. Large dynamic range of brightness: LED light spot is easy to overexpose when the vehicle is close, and the signal-to-noise ratio is low when the vehicle is far away;

[0066] 2. Motion blur interference: high-speed movement (> 60km / h) causes the flicker light track to be trailed, and the binary sequence is broken;

[0067] 3. Multi-target occlusion: when multiple vehicles are parallel, the light is overlapped, and the traditional detection algorithm cannot stably associate the ID.

[0068] In view of this, see Figure 1The embodiment of the application provides a LED double-lamp recognition method based on a monocular camera, which is executed by an electronic device, and the method comprises the following steps:

[0069] Step S101, receiving a double-lamp video frame collected by a monocular camera.

[0070] In the embodiment of the application, the monocular camera collects video frames at a preset frequency, the double-lamp video frame contains at least one target vehicle, the target vehicle is any vehicle in the vehicle to be detected, the vehicle to be detected is provided with one constant light and one flashing light, and the double-lamp video frame is a single frame image collected by the monocular camera and containing at least one target vehicle. Because the target vehicle is provided with the constant light and the flashing light, the image will present light spots corresponding to the two kinds of lights, so it is called “double-lamp video frame”.

[0071] The constant light is an LED lamp installed at a specific position of the vehicle to be detected, which keeps constant brightness output and does not flash when working, and is mainly used to provide a brightness reference and a spatial reference for the electronic device to assist the identification and decoding of the flashing light. The flashing light is an LED lamp installed at another specific position of the vehicle to be detected, which realizes high-frequency flashing (such as 500 Hz) by using the PWM (pulse width modulation) technology, and the flashing sequence contains preset encoding information (such as vehicle ID), which is used for the electronic device to identify the vehicle identity and track the vehicle movement.

[0072] Specifically, the electronic device receives the video stream collected by the monocular camera at a preset frequency (such as 120 frames per second) in real time through a USB or network interface, and decodes the video stream into a continuous double-lamp video frame sequence. Specifically, the electronic device establishes a communication connection with the monocular camera through a preset data transmission interface, receives the video stream data output by the camera in real time according to the preset collection frequency of the monocular camera, a data buffer module is built-in the electronic device, the received video stream is frame-analyzed, the continuous video stream is disassembled into single-frame image data (i.e. double-lamp video frame), and a unique time stamp (accurate to millisecond level) is added to each double-lamp video frame, which is stored in a local storage unit (such as a solid state disk) for subsequent processing and calling.

[0073] Step S102, identifying the bright spots in each double-lamp video frame, and screening the flashing light spot and the constant light spot from the bright spots.

[0074] The flashing light spot is a brightness area formed by the flashing light in the double-lamp video frame, and the brightness of the light spot in different frames will present periodic changes because the flashing light flashes at a high frequency. Similarly, the constant light spot is a brightness area formed by the constant light in the double-lamp video frame, and the brightness of the light spot in different frames remains basically unchanged because the constant light has constant brightness.

[0075] The gray processing is performed on each frame of image, and the highlight area with higher brightness than the surrounding environment can be extracted by adaptive threshold segmentation (such as Otsu algorithm). Subsequently, the brightness change mode of the highlight is analyzed by using the optical flow method or the inter-frame difference: the constant light has a low brightness change rate (such as <5%) in the continuous frames because of the continuous light emission, and the flickering light has a brightness change rate significantly higher than the threshold (such as >30%) and the flickering frequency matches the preset value (such as 2Hz) because of the periodic light-on and light-off. In this way, the flickering light spot and the constant light spot are screened out.

[0076] In one possible implementation of the embodiments of the present application, the flickering light spot and the constant light spot are screened out from the highlights, including:

[0077] The brightness feature and the spectral characteristic feature corresponding to each highlight are extracted;

[0078] Based on the brightness feature and the spectral characteristic feature, the brightness change trend and the spectral similarity of each highlight in the continuous multiple frames of double-light video frames are calculated;

[0079] Based on the brightness change trend and the spectral similarity, the flickering light spot meeting the flickering light feature and the constant light spot meeting the constant light feature are screened out respectively by combining the preset flickering light determination rule and the preset constant light determination rule, to obtain the flickering light spot and the constant light spot, wherein the flickering light determination rule is that the brightness fluctuation amplitude exceeds the preset fluctuation threshold and the fluctuation frequency is within the preset frequency range, and the constant light determination rule includes that the brightness fluctuation amplitude is within the preset tolerance range and the spectral similarity is higher than the preset similarity threshold.

[0080] The brightness feature is the gray value distribution characteristic of the highlight area in the image, reflecting the light and dark degree and the change range; and the spectral characteristic feature is the color distribution information of the highlight in the visible light band, such as the RGB channel value or the HSV hue value, which is used to distinguish the spectral characteristics of different light sources.

[0081] Specifically, the pre-processing is performed on each frame of image collected by the monocular camera, the brightness feature is first extracted by gray processing, that is, the pixel gray value and the statistical characteristic (such as mean, variance, maximum / minimum value) of each highlight, and the spectral characteristic feature is obtained by using the multi-spectral analysis technology. For example, the red, green and blue channel proportions of the highlight area are calculated in the RGB color space, or the hue and saturation information is extracted in the HSV space, to form a multi-dimensional feature vector.

[0082] Further, the same bright spot in consecutive N frames (such as N = 10) is tracked to calculate the time series data of its brightness characteristics. The amplitude of brightness fluctuation (such as maximum-minimum) and the fluctuation frequency (such as the number of extreme points per unit time) are calculated by a sliding window to form a brightness change trend curve. At the same time, the spectral characteristic feature difference between adjacent frames can be calculated by using cosine similarity or Euclidean distance algorithm to generate a spectral similarity matrix, which quantifies the color stability of the bright spot.

[0083] Further, the brightness change trend and the spectral similarity are input into a preset judgment module. For a flashing light, it is checked whether the brightness fluctuation amplitude exceeds a threshold (such as > 30% gray value) and the fluctuation frequency is within a preset range (such as 1-5 Hz); for a constant light, it is verified whether the brightness fluctuation is within a tolerance range (such as < 5%) and the spectral similarity is higher than a threshold (such as > 0.9). The light spots meeting the conditions are marked as flashing light spots or constant light spots, respectively.

[0084] Step S103, the flashing light spots and the constant light spots are associated and matched to obtain at least one group of associated light spots.

[0085] Among them, the associated light spots are the combination of the flashing light spots and the constant light spots of the same target vehicle obtained by the association and matching.

[0086] Specifically, the feature matching algorithm (such as SIFT or optical flow tracking) can be used to associate the spatial positions of the flashing / constant light spots in adjacent frames. First, the center coordinates of the light spots are calculated, and the spatial similarity between the light spots is measured by Euclidean distance or Mahalanobis distance; secondly, the brightness change mode (such as flashing frequency consistency) is verified. Finally, the double light spots of the same target vehicle are matched into an associated group, and each group contains one flashing light spot and one constant light spot.

[0087] A possible implementation of an embodiment of the present application associates and matches the flashing light spots and the constant light spots to obtain at least one group of associated light spots, including:

[0088] Determine the respective center pixel coordinates of each flashing light spot and each constant light spot, and convert the center pixel coordinates into physical space coordinates;

[0089] Obtain vehicle data corresponding to the target vehicle, and set the light distance range and the angle threshold corresponding to the target vehicle based on the vehicle data, wherein the vehicle data includes constant light position and flashing light position;

[0090] Based on each physical space coordinate, for each flashing light spot, all constant light spots are traversed to calculate the straight-line distance between the two in the physical space and the included angle of the connection line with the preset reference direction. If there is a target constant light spot, it is determined that the target constant light spot and the flashing light spot are an initial associated light spot group, the straight-line distance corresponding to the target constant light spot is within the corresponding light distance range, and the corresponding included angle is not greater than the corresponding angle threshold value.

[0091] Each initial associated light spot group in the continuous double-lamp video frame is tracked, and the physical spacing fluctuation value of the initial associated light spot group in each double-lamp video frame is calculated. If the fluctuation value is less than the fluctuation value threshold value and the associated state is maintained in the continuous double-lamp video frame, it is determined that the initial associated light spot group is a final associated light spot group.

[0092] Based on each final associated light spot group, at least one group of associated light spots is obtained.

[0093] The center pixel coordinates are the geometric center positions of the light spots in the image, which are represented by pixel row and column indexes. The physical space coordinates are the position coordinates of the light spots in the real-world three-dimensional scene, which are associated with the camera coordinate system or the world coordinate system.

[0094] Specifically, the center pixel coordinates (u, v) of each flashing light spot and constant light spot are accurately calculated by an image processing algorithm (such as contour moment calculation or deep learning key point detection). Subsequently, the device utilizes the internal parameters (focal length, principal point) and external parameters (position and attitude of the camera relative to the world coordinate system) obtained through camera calibration in advance, combined with the preset ground plane assumption (i.e. the vehicle moves on the ground), to back-project the two-dimensional pixel coordinates to the three-dimensional world coordinate system through perspective geometry, obtaining a corresponding physical space coordinate (X, Y, Z). Since the ground is assumed to be horizontal, the height Z is usually set to 0, and the calculation mainly obtains X and Y coordinates.

[0095] Further, the electronic device accesses a vehicle database stored in its internal storage. The database pre-stores data of each participating vehicle, of which the most critical is the physical installation distance D (for example, 10 cm) between the constant light on the vehicle and the flashing light. According to this known physical distance D, the calibration parameters of the camera, and the current approximate distance of the vehicle, the pixel distance range that the two lights should present in the image is calculated, and further converted into the distance range in the physical space (i.e. the light distance range, for example [D-ε, D+ε] meters, ε is the tolerance). At the same time, according to the driving characteristics of the racing car (usually the vehicle head points to the forward direction), the device sets an angle threshold value (for example, 30°) to constrain the included angle between the connection line of the two lights and the vehicle forward direction (the preset reference direction, usually the track direction or the vehicle speed direction).

[0096] Further, all the flashing light spots and constant light spots in the current frame are exhaustively traversed. For each flashing light spot, the physical spatial straight-line distance between it and each constant light spot is calculated. Meanwhile, the included angle between the connecting vector and the preset reference direction is calculated. If there is a target constant light spot such that the calculated straight-line distance falls within the light distance range corresponding to the vehicle, and the included angle is not greater than the angle threshold, then the pair of flashing light and constant light spots are marked as an initial associated light spot group. The initial associated light spot groups in consecutive multiple frames (such as 5 frames) are tracked, and the physical spacing fluctuation value (such as standard deviation) of the two groups of light spots in each frame is calculated. If the fluctuation value is less than a preset threshold (such as 0.1 meters) and the associated state is maintained in consecutive frames, then it is determined as a final associated light spot group. For example, if the standard deviation of the spacing is 0.08 meters (<0.1 meters) within 5 frames, and there is no interruption, then it is confirmed as a stable associated group.

[0097] In a possible implementation of the embodiment of the application, the center pixel coordinates corresponding to each flashing light spot and each constant light spot are determined, including:

[0098] Each flashing light spot and each constant light spot is subjected to image segmentation processing, and the pixel region corresponding to each light spot is extracted;

[0099] The contour detection is performed on each pixel region, and the minimum circumscribed rectangle of each light spot is obtained;

[0100] Based on the minimum circumscribed rectangle, the confidence degree corresponding to each pixel point in each pair of light video frames is calculated;

[0101] Based on the confidence degree, the center pixel coordinates corresponding to each flashing light spot and each constant light spot are determined.

[0102] The pixel region refers to the collection of all pixels in the image that belong to the same physical object (here, an LED light spot).

[0103] Specifically, the original video frame is preprocessed (such as Gaussian filter denoising), and an adaptive threshold segmentation algorithm (such as Otsu's Method) or a fixed high threshold segmentation is adopted to binarize the image. In this process, the LED light spot region with brightness much higher than the background will be segmented out to become a foreground white region, and the background will become black. Through a connected domain analysis algorithm, a unique label is assigned to each independent white region. Each marked white pixel set is the pixel region corresponding to a light spot.

[0104] Further, for each obtained pixel region, an algorithm such as Suzuki 85 contour tracing algorithm is used to extract the boundary contour line of the region, and based on this contour, the minimum circumscribed rectangle of the region is calculated. This rectangle is the smallest rectangle that can completely enclose the contour, and its angle can be rotated (rotated rectangle) to adapt to the shape of the light spot in different directions.

[0105] Further, a confidence map is constructed based on the pixel features (such as brightness gradient, texture consistency) of the light spot region, and the weighted centroid method is used to calculate the light spot center coordinates according to the confidence map. Specifically, the coordinates of all pixel points in the minimum circumscribed rectangle are weighted and averaged, and the weight is the confidence value, to finally obtain the accurate center pixel coordinates of the flickering / constant light spot.

[0106] In one possible implementation of the embodiment of the present application, the confidence degree corresponding to each pixel point in each double-lamp video frame is calculated based on the minimum circumscribed rectangle, and the calculation process of the confidence degree corresponding to each pixel point in each double-lamp video frame includes:

[0107] A local coordinate system is established with the center point of the minimum circumscribed rectangle as the origin, and the normalized distance of each pixel point in the minimum circumscribed rectangle region relative to the origin is calculated;

[0108] According to the normalized distance, the first confidence degree corresponding to each pixel point is calculated based on a Gaussian confidence function;

[0109] The brightness value and edge gradient strength of each pixel point are extracted, and the second confidence degree corresponding to each pixel point is calculated based on the brightness value and edge gradient strength;

[0110] Based on the first confidence degree and the second confidence degree, the confidence degree corresponding to each pixel point in the double-lamp video frame is determined.

[0111] When processing the minimum circumscribed rectangle of each light spot, first, the geometric center point of the rectangle is set as the origin (0, 0) of the local coordinate system. Then, for each pixel point in the rectangular region, the Euclidean distance of the pixel point to the origin is calculated. In order to eliminate the scale difference caused by different sizes of light spots, the original distance is divided by half of the diagonal length of the rectangle (or other normalization factors) to obtain the normalized distance of the pixel point. The value of this value is usually in the range of [0, 1], and the origin is 0 and the corner of the rectangle is 1.

[0112] Further, based on the normalized distance, a two-dimensional Gaussian function is applied to calculate the first confidence degree. The formula is where d is the normalized distance, and s is the standard deviation of the Gaussian kernel (e.g. 0.2). The closer the pixel point is to the center, the higher the first confidence is, forming a bell-shaped distribution with high center and low edge, and the aging function outputs a value between 0 and 1, i.e. the first confidence degree. The physical meaning is: the closer the pixel point is to the center of the rectangle (the smaller d is), the higher the confidence of the pixel point as a "center point" (closer to 1); the farther away (the larger d is), the lower the confidence (closer to 0). This reflects a priori geometric assumption: the center of the light spot is more likely to be located in the center region of the circumscribed rectangle. Further, the gray brightness value (0-255) and the edge gradient intensity calculated by the Sobel operator are extracted for each pixel point. The second confidence is calculated using a weighted product model: C2 = brightness x where k is the attenuation coefficient (e.g. 0.5). The area with high brightness and low gradient (such as the center of the light spot) obtains high confidence, while the high gradient area (such as the edge) has reduced confidence.

[0113] Further, the first and second confidences are fused using a geometric mean method: C final = to obtain the confidence degree corresponding to each pixel point. This method takes into account both spatial distance distribution and pixel feature constraints, emphasizing both the center geometric position and the consistency of brightness and gradient features, and finally obtaining the comprehensive confidence value of each pixel point.

[0114] In step S104, the vehicle trajectory of the target vehicle is predicted based on the associated light spots, and whether the target vehicle has crossed the line is determined based on the vehicle trajectory.

[0115] Specifically, the electronic device maintains a Kalman filter for each group of associated light spots. The state vector of the filter includes the position and velocity of the center point of the light spot group. In each frame, the filter first predicts its position according to the motion model (prediction step), and then corrects it using the actual detected position of the current frame (update step) to output a smooth and accurate trajectory point. The line crossing determination is a multi-condition decision process: the system continuously monitors the smoothed trajectory, and when it is judged that the center points of the flashing light and the constant light cross a virtual end line defined in the image in a very short time interval (e.g. <50ms) in sequence, and the vehicle longitudinal speed estimated from the trajectory is greater than a threshold (e.g. 5km / h), then an effective line crossing event is triggered, and the corresponding vehicle ID and timestamp are recorded.

[0116] In one possible implementation of the embodiment of the present application, the vehicle trajectory of the target vehicle is predicted based on the associated light spots, comprising:

[0117] The center pixel coordinates corresponding to the associated light spots are taken as the trajectory reference points of the target vehicle in the corresponding double light video frames;

[0118] establish a state vector of the target vehicle based on the trajectory reference point, the state vector including position information and speed information;

[0119] based on a Kalman filtering algorithm, inputting the observation position of any double-lamp video frame into a prediction model to obtain a state estimation value of the target vehicle in any double-lamp video frame, and generating a smooth motion trajectory of the target vehicle according to the state estimation value.

[0120] taking the center pixel coordinates of the associated light spot group (the center point pair of the flashing light and the constant light) in each frame of image as the trajectory reference point of the target vehicle. For example, if the center coordinates of the flashing light are (150, 200) and the center coordinates of the constant light are (155, 202), the geometric midpoint (152.5, 201) of the two points is taken as the trajectory reference point of the frame, or the midpoint of the connecting line of the double-lamp centers is directly used as the vehicle position representation. Based on the trajectory reference point, the electronic device establishes a state vector of the target vehicle. The state vector includes position information (such as x and y coordinates) and speed information (such as speed components in x and y directions). For example, if the k-th frame reference point coordinates are (x , ), the state vector can be defined as [x , , ,k ,k], wherein ,k and ,k are calculated by difference of adjacent frame positions or estimated by a motion model.

[0121] Further, a Kalman filtering algorithm is used to predict and smooth the trajectory. The specific process includes: based on the state vector of the last frame and a motion model (such as a uniform speed model), predicting the state estimation value and the covariance matrix of the current frame; comparing the observation position (the trajectory reference point) of the current frame with the predicted value, adjusting the predicted value through the Kalman gain to obtain a more accurate state estimation value; through fusion of multiple state estimation values, a smooth motion trajectory curve is generated to suppress the interference of observation noise on the trajectory.

[0122] In one possible implementation of the embodiments of the present application, a state vector of the target vehicle is established based on the trajectory reference point, including:

[0123] taking the pixel coordinates of the trajectory reference point in any double-lamp video frame as the initial observation position of the target vehicle;

[0124] constructing an initial state vector of the target vehicle with the initial observation position and zero initial speed;

[0125] determining a state transition matrix corresponding to any double-lamp video frame, and defining a measurement matrix;

[0126] Based on the initial state vector, the state transition matrix and the measurement matrix, the state vector of the target vehicle is obtained.

[0127] From the associated light spot group, the double-lamp center pixel coordinates (such as the midpoint (152.5, 201) of the flashing light (150, 200) and the constant light (155, 202)) are extracted as the initial observation position of the target vehicle in the first frame. The coordinates are directly mapped through the image coordinate system, reflecting the initial spatial position of the vehicle in the image plane. Based on the initial observation position (x0, y0), the initial state vector [x0, y0, 0, 0] is constructed. The last two zeros represent the initial speed of zero, assuming that the vehicle is at rest or the speed is unknown in the first frame, which will be corrected in the subsequent filtering iteration.

[0128] Further, two core matrices are defined to configure the Kalman filter:

[0129] State transition matrix (F): This matrix is based on a physical motion model. A uniform speed model can be used. The mathematical form of the matrix is fixed, but its parameters depend on the frame time Δt (i.e. 1 / frame rate). According to the camera's acquisition frame rate (such as 120fps, then Δt≈0.0083 seconds), the Δt element in the matrix is automatically calculated and filled.

[0130] Measurement matrix (H): This matrix defines how the state space maps to the measurement space. Since the state vector contains position and velocity [u, v, , ]^T, and the observation value only has position [u, v]^T, the measurement matrix is defined as a fixed form matrix to "extract" the position component from the state vector.

[0131] Further, the outputs of the first three steps - the initial state vector x0, the state transition matrix F and the measurement matrix H - are used as initialization parameters to completely configure a Kalman filter instance dedicated to tracking this target vehicle. From then on, for each new video frame, the state vector no longer needs to be "established", but by calling the prediction and update methods of the filter instance, the optimal state vector estimate value of the current frame is recursively obtained. This constantly updated state vector estimate value is the state vector of the target vehicle.

[0132] The embodiment of the application provides a LED double-lamp recognition method based on a monocular camera, ensures data real-time by collecting video frames according to a preset frequency, accurately distinguishes constant light and flickering light spots by using light point recognition and feature screening, effectively excludes environmental interference, accurately associates double light spots of the same vehicle in space and time by using association matching technology, improves the accuracy of target vehicle recognition, predicts the vehicle trajectory based on Kalman filtering and other algorithms, and comprehensively determines the line-crossing event in combination with the line-crossing time difference and speed conditions, thereby improving the smoothness and anti-interference capability of vehicle trajectory prediction, enhancing the reliability and accuracy of line-crossing detection, and making the method have high robustness and practicality in a complex scene.

[0133] The above embodiment introduces a LED double-lamp recognition method based on a monocular camera from the perspective of a method flow, and the following embodiment introduces a LED double-lamp recognition device based on a monocular camera from the perspective of a virtual module or a virtual unit, which will be specifically described in the following embodiment.

[0134] Referring to Figure 2 The LED double-lamp recognition device 20 based on the monocular camera specifically can include a receiving module 201, an identification module 202, a matching module 203 and a prediction module 204, and specifically:

[0135] A LED double-lamp recognition device 20 based on a monocular camera includes:

[0136] The receiving module 201 is configured to receive double-lamp video frames collected by a monocular camera, wherein the monocular camera collects video frames according to a preset frequency, and the double-lamp video frames contain at least one target vehicle, the target vehicle being any vehicle in a to-be-detected vehicle, and the to-be-detected vehicle being provided with one constant light and one flickering light;

[0137] The identification module 202 is configured to identify light points in each double-lamp video frame and screen out flickering light spots and constant light spots from the light points.

[0138] The matching module 203 is configured to perform association matching on the flickering light spots and the constant light spots to obtain at least one group of associated light spots.

[0139] The prediction module 204 is configured to predict a vehicle trajectory of the target vehicle based on the associated light spots and determine whether the target vehicle crosses a line based on the vehicle trajectory.

[0140] In one possible implementation of the embodiment of the application, when the identification module 202 screens out the flickering light spots and the constant light spots from the light points, the identification module 202 is specifically configured to:

[0141] extract the brightness feature and the spectral characteristic feature corresponding to each light point.

[0142] Based on the brightness feature and the spectral characteristic feature, a brightness change trend and a spectral similarity of each bright spot in continuous multiple frames of double-lamp video frames are calculated;

[0143] Based on the brightness change trend and the spectral similarity, a flashing light spot and a constant light spot are filtered out respectively according to a preset flashing light judgment rule and a preset constant light judgment rule, to obtain the flashing light spot and the constant light spot, wherein the flashing light judgment rule is that a brightness fluctuation amplitude exceeds a preset fluctuation threshold and a fluctuation frequency is within a preset frequency range, and the constant light judgment rule includes that a brightness fluctuation amplitude is within a preset tolerance range and a spectral similarity is higher than a preset similarity threshold.

[0144] In a possible implementation of the embodiment of the present application, when the matching module 203 performs correlation matching on the flashing light spot and the constant light spot to obtain at least one group of correlated light spots, the matching module 203 is specifically configured to:

[0145] determine a center pixel coordinate corresponding to each flashing light spot and each constant light spot respectively, and convert the center pixel coordinate into a physical space coordinate;

[0146] obtain vehicle data corresponding to the target vehicle, and set a light distance range and an angle threshold corresponding to the target vehicle based on the vehicle data, wherein the vehicle data includes a constant light position and a flashing light position;

[0147] based on each physical space coordinate, for each flashing light spot, all constant light spots are traversed, a straight line distance between the two in the physical space and an included angle between a connection line and a preset reference direction are calculated, if there is a target constant light spot, the target constant light spot and the flashing light spot are determined as an initial correlated light spot group, and the straight line distance corresponding to the target constant light spot is within the corresponding light distance range and the corresponding included angle is not greater than the corresponding angle threshold;

[0148] each initial correlated light spot group in the continuous double-lamp video frames is tracked, a physical distance fluctuation value of the initial correlated light spot group in each double-lamp video frame is calculated, if the fluctuation value is less than a fluctuation value threshold and the initial correlated light spot group maintains a correlated state in the continuous double-lamp video frames, the initial correlated light spot group is determined as a final correlated light spot group;

[0149] based on each final correlated light spot group, at least one group of correlated light spots is obtained.

[0150] In a possible implementation of the embodiment of the present application, when the matching module 203 determines the center pixel coordinate corresponding to each flashing light spot and each constant light spot respectively, the matching module 203 is specifically configured to:

[0151] perform image segmentation processing on each flashing light spot and each constant light spot, and extract a pixel region corresponding to each light spot;

[0152] performing contour detection on each pixel region to obtain a minimum circumscribed rectangle of each light spot;

[0153] based on the minimum circumscribed rectangle, calculating a confidence degree corresponding to each pixel point in each double-lamp video frame;

[0154] based on the confidence degree, determining a center pixel coordinate corresponding to each flickering light spot and each constant light spot.

[0155] In a possible implementation of the embodiment of the application, the matching module 203 calculates a confidence degree corresponding to each pixel point in each double-lamp video frame based on the minimum circumscribed rectangle, and in the calculation process of the confidence degree corresponding to each pixel point in each double-lamp video frame, the matching module 203 is specifically configured to:

[0156] establishing a local coordinate system with the center point of the minimum circumscribed rectangle as the origin, and calculating a normalized distance of each pixel point in the minimum circumscribed rectangle region relative to the origin;

[0157] calculating a first confidence degree corresponding to each pixel point based on a Gaussian confidence function according to the normalized distance;

[0158] extracting a brightness value and an edge gradient intensity of each pixel point, and calculating a second confidence degree corresponding to each pixel point based on the brightness value and the edge gradient intensity;

[0159] determining a confidence degree corresponding to each pixel point in the double-lamp video frame based on the first confidence degree and the second confidence degree.

[0160] In a possible implementation of the embodiment of the application, the prediction module 204, when predicting a vehicle trajectory of the target vehicle based on the associated light spot, is specifically configured to:

[0161] taking the center pixel coordinate corresponding to the associated light spot as a trajectory reference point of the target vehicle in the corresponding double-lamp video frame;

[0162] based on the trajectory reference point, establishing a state vector of the target vehicle, the state vector including position information and speed information;

[0163] based on a Kalman filtering algorithm, inputting an observation position of any double-lamp video frame into a prediction model to obtain a state estimation value of the target vehicle in the any double-lamp video frame, and generating a smooth motion trajectory of the target vehicle according to the state estimation value.

[0164] In a possible implementation of the embodiment of the application, the prediction module 204, when establishing a state vector of the target vehicle based on the trajectory reference point, is specifically configured to:

[0165] taking a pixel coordinate of the trajectory reference point in any double-lamp video frame as an initial observation position of the target vehicle.

[0166] constructing an initial state vector of the target vehicle with an initial observation position and a zero initial velocity;

[0167] determining a state transition matrix corresponding to any pair of double-lamp video frames, and defining a measurement matrix;

[0168] obtaining a state vector of the target vehicle based on the initial state vector, the state transition matrix, and the measurement matrix.

[0169] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0170] Referring to Figure 3 , the embodiments of the present application also introduce an electronic device from the perspective of an entity device, such as Figure 3 , as shown in Figure 3 , the electronic device 30 shown in the figure includes a processor 301 and a memory 303. Wherein, the processor 301 and the memory 303 are connected, such as through the bus 302. Optionally, the electronic device 30 can also include a transceiver 304. It should be noted that, in actual application, the transceiver 304 is not limited to one, and the structure of the electronic device 30 does not constitute a limitation on the embodiments of the present application.

[0171] The processor 301 can be a CPU (Central Processing Unit, central processor), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, application specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can realize or execute various exemplary logical blocks, modules and circuits described in combination with the disclosure content of the present application. The processor 301 can also be a combination of computing functions, such as one or more microprocessor combinations, combinations of DSP and microprocessor, etc.

[0172] The bus 302 can include a path that transmits information between the above-mentioned components. The bus 302 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 302 can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 3 In the figure, only one thick line is used to represent the bus, but it does not mean that there is only one bus or only one type of bus.

[0173] The memory 303 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this.

[0174] The memory 303 is used to store application program codes for implementing the scheme of the present application, and is controlled to execute by the processor 301. The processor 301 is used to execute the application program codes stored in the memory 303 to realize the content shown in the foregoing method embodiments.

[0175] The electronic device includes, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a PMP (Portable Multimedia Player), a vehicle terminal (for example, a car navigation terminal), etc., and a fixed terminal such as a digital TV, a desktop computer, etc., and can also be a server, etc. Figure 3 The electronic device shown is only an example and should not bring any limitation to the function and use range of the embodiments of the present application.

[0176] The embodiments of the present application provide a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program runs on a computer, the computer can execute the corresponding content in the foregoing method embodiments.

[0177] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in a sequential order following the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated otherwise herein, the execution of the steps is not strictly limited to the order indicated by the arrows, and can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order is not necessarily sequential, but can be round-robin or alternating with at least some of the other steps or sub-steps or stages of other steps.

[0178] The above is only some embodiments of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should also be considered as the protection scope of the present application.

Claims

1. A method for LED double-lamp recognition based on a monocular camera, characterized in that, The method comprises the following steps: receiving a double-lamp video frame collected by a monocular camera, wherein the monocular camera collects video frames at a preset frequency, the double-lamp video frame contains at least one target vehicle, and the target vehicle is any one of a plurality of to-be-detected vehicles, and each to-be-detected vehicle is provided with a constant light and a flashing light; identifying a bright spot in each double-lamp video frame and screening a flashing light spot and a constant light spot from the bright spot; correlation matching the flashing light spot and the constant light spot to obtain at least one group of correlated light spots; based on the correlated light spots, predicting a vehicle trajectory of the target vehicle, and determining whether the target vehicle has crossed a line based on the vehicle trajectory; screening the flashing light spot and the constant light spot from the bright spot comprises: extracting a brightness feature and a spectral characteristic feature corresponding to each bright spot; based on the brightness feature and the spectral characteristic feature, calculating a brightness change trend and a spectral similarity of each bright spot in a plurality of continuous double-lamp video frames; based on the brightness change trend and the spectral similarity, combining a preset flashing light judgment rule and a preset constant light judgment rule to screen a flashing light spot meeting the flashing light feature and a constant light spot meeting the constant light feature respectively to obtain the flashing light spot and the constant light spot, wherein the flashing light judgment rule is that a brightness fluctuation amplitude exceeds a preset fluctuation threshold and a fluctuation frequency is within a preset frequency range, and the constant light judgment rule comprises that a brightness fluctuation amplitude is within a preset tolerance range and a spectral similarity is higher than a preset similarity threshold; correlation matching the flashing light spot and the constant light spot to obtain at least one group of correlated light spots comprises: determining a center pixel coordinate corresponding to each flashing light spot and each constant light spot respectively, and converting the center pixel coordinate into a physical space coordinate; obtaining vehicle data corresponding to the target vehicle, and setting a light distance range and an angle threshold corresponding to the target vehicle based on the vehicle data, wherein the vehicle data comprises a constant light position and a flashing light position; based on each physical space coordinate, for each flashing light spot, traversing all constant light spots to calculate a straight line distance in a physical space and an included angle of a connecting line with a preset reference direction, if there is a target constant light spot, determining that the target constant light spot and the flashing light spot are an initial correlated light spot group, and the straight line distance corresponding to the target constant light spot is within the corresponding light distance range and the corresponding included angle is not greater than the corresponding angle threshold; tracking each initial correlated light spot group in continuous double-lamp video frames to calculate a physical distance fluctuation value of the initial correlated light spot group in each double-lamp video frame, if the fluctuation value is less than a fluctuation value threshold and the initial correlated light spot group remains in a correlated state in continuous double-lamp video frames, determining that the initial correlated light spot group is a final correlated light spot group; based on each final correlated light spot group, obtaining at least one group of correlated light spots.

2. The monocular camera-based LED dual-lamp recognition method according to claim 1, characterized in that, The method comprises the following steps: image segmentation processing is performed on each of the flickering light spots and each of the constant light spots to extract a pixel region corresponding to each light spot; contour detection is performed on each of the pixel regions to obtain a minimum circumscribed rectangle of each light spot; a confidence degree corresponding to each pixel point in each double-lamp video frame is calculated based on the minimum circumscribed rectangle; based on the confidence degree, center pixel coordinates corresponding to each of the flickering light spots and each of the constant light spots are determined.

3. The monocular camera-based LED dual-lamp recognition method according to claim 2, characterized in that, based on the minimum circumscribed rectangle, a confidence degree corresponding to each pixel point in each double-lamp video frame is calculated, wherein the calculation process of the confidence degree corresponding to each pixel point in each double-lamp video frame includes: a local coordinate system is established with a center point of the minimum circumscribed rectangle as an origin, and a normalized distance of each pixel point in the minimum circumscribed rectangle region relative to the origin is calculated; based on a Gaussian confidence function, a first confidence degree corresponding to each pixel point is calculated according to the normalized distance; a brightness value and an edge gradient intensity of each pixel point are extracted, and a second confidence degree corresponding to each pixel point is calculated based on the brightness value and the edge gradient intensity; based on the first confidence degree and the second confidence degree, a confidence degree corresponding to each pixel point in the double-lamp video frame is determined.

4. The monocular camera-based LED dual-lamp recognition method according to claim 2 or 3, characterized in that, based on the associated light spots, a vehicle trajectory of the target vehicle is predicted, including: the center pixel coordinates corresponding to the associated light spots are taken as trajectory reference points of the target vehicle in the corresponding double-lamp video frame; based on the trajectory reference points, a state vector of the target vehicle is established, the state vector including position information and speed information; based on a Kalman filtering algorithm, an observation position of any double-lamp video frame is input into a prediction model to obtain a state estimation value of the target vehicle in the any double-lamp video frame, and a smooth motion trajectory of the target vehicle is generated according to the state estimation value.

5. The monocular camera-based LED dual-lamp recognition method according to claim 4, characterized in that, based on the trajectory reference points, a state vector of the target vehicle is established, including: pixel coordinates of the trajectory reference points in any double-lamp video frame are taken as an initial observation position of the target vehicle; an initial state vector of the target vehicle is constructed with the initial observation position and a zero initial speed; a state transition matrix corresponding to the any double-lamp video frame is determined, and a measurement matrix is defined; based on the initial state vector, the state transition matrix and the measurement matrix, the state vector of the target vehicle is obtained.

6. A monocular camera-based LED dual-lamp recognition device, characterized in that, including: a receiving module configured to receive double-lamp video frames collected by a monocular camera, wherein the monocular camera collects video frames at a preset frequency, and the double-lamp video frames contain at least one target vehicle, the target vehicle being any vehicle in a to-be-detected vehicle, and the to-be-detected vehicle being provided with one constant light and one flickering light; an identification module configured to identify bright spots in each of the double-lamp video frames, and to screen out flickering light spots and constant light spots from the bright spots; a matching module configured to perform association matching on the flickering light spots and the constant light spots to obtain at least one group of associated light spots; A prediction module is configured to predict a vehicle trajectory of the target vehicle based on the associated light spot, and determine whether the target vehicle crosses the line based on the vehicle trajectory.

7. An electronic device, comprising: The electronic device includes: at least one processor; a memory; at least one application program, wherein the at least one application program is stored in the memory and configured to be executed by the at least one processor, and the at least one application program is configured to implement the monocular camera-based LED double-lamp recognition method according to any one of claims 1-5.

8. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program product, when executed in the computer, causes the computer to implement the monocular camera-based LED double-lamp recognition method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Method and system for improving parking space recognition rate and parking capability in dark light environment

    CN115489514A

  • Control method of rearview mirror, electronic equipment and vehicle

    CN120716588A