Camera occlusion detection method, device, equipment, vehicle and medium

CN122928814APending Publication Date: 2026-10-16CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611136217.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0005]本发明的目的之一在于提供一种摄像头遮挡检测方法,以解决现有技术中的摄像头遮挡检测不准确,容易出现误判的问题;目的之二在于提供一种摄像头遮挡检测装置;目的之三在于提供一种电子设备,目的之四在于提供一种车辆;目的之五在于提供一种计算机可读存储介质

Benefits of technology

[0051] (1) By first establishing an image sequence organized in chronological order, then constructing a background model from the target images of the L frames in the previous historical window, and using the background model for background matching analysis of the M frame image, the occlusion detection is based on the background statistical features within the historical period, rather than on the instantaneous difference between two consecutive frames. Corresponding to the continuous changes in the background in dynamic driving scenes and the complex lighting fluctuations in fixed monitoring scenes, this processing structure can suppress short-term brightness changes, local motion interference and global scene changes while maintaining the feasibility of the processing flow, thereby improving the accuracy of lens occlusion detection and avoiding misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122928814A_ABST
    Figure CN122928814A_ABST
Patent Text Reader

Abstract

The application relates to a camera shielding detection method, device, equipment, vehicle and medium, the method comprising: acquiring an image sequence, the image sequence comprising at least N frames of images collected by a camera in a target scene, N being a positive integer; based on the position of each frame of image in the image sequence, extracting L frames of target images before the Mth frame of image from the image sequence, L being a positive integer; constructing a background model according to the L frames of target images; and determining whether the camera lens is shielded when collecting the Mth frame of image by using the background model. The method can accurately detect whether the camera lens is shielded, and misjudgment is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of autonomous driving technology, specifically to a method, apparatus, equipment, vehicle, and medium for detecting camera occlusion. Background Technology

[0002] In autonomous driving systems, cameras are critical perception devices that need to capture information about the surrounding environment in real time. If a camera is obstructed for an extended period (e.g., by foreign objects), core functions such as target recognition and lane keeping may fail.

[0003] Currently, camera occlusion detection typically uses image processing methods such as keyframe binarization comparison, background modeling, or local region analysis to determine the occlusion status.

[0004] However, the current occlusion detection method has low accuracy and is prone to misjudgment. Summary of the Invention

[0005] One objective of this invention is to provide a camera occlusion detection method to solve the problem of inaccurate camera occlusion detection and the tendency to make false judgments in the prior art; a second objective is to provide a camera occlusion detection device; a third objective is to provide an electronic device; a fourth objective is to provide a vehicle; and a fifth objective is to provide a computer-readable storage medium.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] A method for detecting camera occlusion includes:

[0008] Acquire an image sequence, the image sequence comprising at least N frames of images captured by the camera in the target scene, where N is a positive integer;

[0009] Based on the position of each frame in the image sequence, extract L target images that precede the Mth frame from the image sequence, where L is a positive integer;

[0010] Based on the L frames of target images, construct a background model;

[0011] Using the background model, it is determined whether the lens of the camera is obstructed when capturing the Mth frame image.

[0012] Furthermore, the acquisition of the image sequence includes:

[0013] Acquire K frames of original images captured by the camera in the target scene, where K is a positive integer greater than or equal to N;

[0014] Sample images are extracted from the K-frame original images, and the sample images are captured by the camera when it is in motion;

[0015] The image sequence is constructed based on the sample images.

[0016] Furthermore, constructing the image sequence based on the sample images includes:

[0017] Determine whether a first target region exists in each region of the sample image, wherein the pixel value change in the first target region is less than a preset threshold;

[0018] If the first target region exists, then the image sequence is constructed based on the sample image.

[0019] Furthermore, in the image sequence, there is at least one frame of image spaced between each frame of the target image.

[0020] Furthermore, the step of constructing a background model based on the L-frame target image includes:

[0021] Determine the second target region from each frame of the target image;

[0022] The background model is constructed based on the second target region in each frame of the target image.

[0023] Furthermore, determining whether the lens of the camera is obstructed when capturing the Mth frame image using the background model includes:

[0024] The background model is used to separate the foreground and background of the Mth frame image to determine the pixel ratio of the background in the Mth frame image.

[0025] If the pixel percentage of the background is greater than the first percentage threshold, it is determined that the camera lens is blocked when capturing the Mth frame image.

[0026] Furthermore, the camera is at least one of a vehicle's front-view camera, rear-view camera, and panoramic camera.

[0027] Furthermore, it also includes:

[0028] When it is detected that the camera lens is blocked when capturing the Mth frame image, and the vehicle is in a tunnel scene, and the camera is the panoramic camera, a third target area is determined in each frame of the target image;

[0029] Based on the third target region described in each frame of the target image, a new background model is reconstructed;

[0030] The new background model is used to re-detect whether the lens of the panoramic camera is obstructed when acquiring the Mth frame image.

[0031] Furthermore, the step of re-detecting whether the lens of the panoramic camera is obstructed when acquiring the Mth frame image using the new background model includes:

[0032] Obtain the second percentage threshold corresponding to the tunnel scenario;

[0033] Based on the new background model, the foreground and background of the Mth frame image are separated to determine the pixel proportion of the background in the Mth frame image;

[0034] If the pixel percentage of the background is greater than the second percentage threshold, it is determined that the lens of the panoramic camera is obstructed when capturing the Mth frame image.

[0035] Furthermore, prior to acquiring the image sequence, the method further includes:

[0036] When the camera is a panoramic camera, it detects whether the vehicle is driving at night;

[0037] If the vehicle is not driving at night, then the camera is determined to be in the target scene.

[0038] Furthermore, it also includes:

[0039] When the camera lens is detected to be blocked, determine whether the vehicle is in autonomous driving mode;

[0040] If the vehicle is in the autonomous driving mode, an alarm will be issued and / or the autonomous driving strategy will be adjusted.

[0041] A camera occlusion detection device, comprising:

[0042] An acquisition module is used to acquire an image sequence, the image sequence including at least N frames of images captured by the camera in the target scene, where N is a positive integer;

[0043] The extraction module is used to extract L target images preceding the M-th frame image from the image sequence based on the position of each frame image in the image sequence, where L is a positive integer;

[0044] The construction module is used to construct a background model based on the L-frame target image;

[0045] The determination module is used to determine, using the background model, whether the lens of the camera is obstructed when capturing the Mth frame image.

[0046] An electronic device includes: a memory and a processor;

[0047] The memory stores computer-executed instructions;

[0048] The processor executes the computer execution instructions stored in the memory, causing the processor to perform the above-described method.

[0049] A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the above-described method.

[0050] The beneficial effects of this invention are:

[0051] (1) By first establishing an image sequence organized in chronological order, then constructing a background model from the target images of the L frames in the previous historical window, and using the background model for background matching analysis of the M frame image, the occlusion detection is based on the background statistical features within the historical period, rather than on the instantaneous difference between two consecutive frames. Corresponding to the continuous changes in the background in dynamic driving scenes and the complex lighting fluctuations in fixed monitoring scenes, this processing structure can suppress short-term brightness changes, local motion interference and global scene changes while maintaining the feasibility of the processing flow, thereby improving the accuracy of lens occlusion detection and avoiding misjudgment.

[0052] (2) By extracting the target area from the original image, subsequent operations on each frame are performed on the image block of the target area, which can reduce the amount of computation in the camera occlusion detection process;

[0053] (3) If the image is initially determined to be occluded, other target areas are dynamically selected to continue background modeling and occlusion detection to avoid false alarms.

[0054] (4) Based on navigation or perception information, when the camera is identified as being in a tunnel scene, the percentage threshold for occlusion and the judgment area can be appropriately increased to improve the accuracy of camera occlusion detection in tunnel scenes. Attached Figure Description

[0055] Figure 1 A schematic flowchart illustrating the camera occlusion detection method provided in this application embodiment;

[0056] Figure 2 A schematic diagram illustrating the processing based on a fixed-length historical frame buffer queue provided in an embodiment of this application;

[0057] Figure 3 This is a flowchart illustrating the camera occlusion determination process provided in an embodiment of this application.

[0058] Figure 4 This is a schematic diagram of the target region in the target image provided in the embodiments of this application;

[0059] Figure 5 A flowchart of a long-term camera occlusion algorithm based on background modeling is provided for embodiments of this application;

[0060] Figure 6 A schematic diagram of the camera occlusion detection device provided in this application;

[0061] Figure 7 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

[0062] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.

[0063] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0064] Camera occlusion detection technology is widely used in visual perception scenarios such as autonomous driving, security monitoring, and intelligent transportation. In autonomous driving scenarios, cameras are installed on the exterior of the vehicle, and the images they capture change continuously as the vehicle moves. In fixed monitoring scenarios, although the camera is installed in a fixed position, images may still be abnormal due to dust, film, foreign objects, or human occlusion. Therefore, stable detection of lens occlusion is required in both cases.

[0065] In existing technologies, a common approach is to perform grayscale conversion, binarization, and differential comparison on keyframes of the video, and determine the presence of abnormal regions based on pixel changes between consecutive frames. However, the binarization comparison method is quite sensitive to threshold changes. Under complex lighting conditions such as darkness, strong light, and tunnel entrances / exits, the grayscale distribution of the image is prone to significant fluctuations, leading to unstable detection results.

[0066] Furthermore, for moving vehicle cameras, the background content itself is constantly changing, and differences between consecutive frames do not necessarily indicate occlusion, easily leading to misjudgments of normal scene changes as lens malfunctions. Moreover, when vehicles enter special environments such as tunnels or nighttime roads, increased background similarity or decreased overall brightness can also cause false alarms regarding occlusion, thereby affecting the reliability of autonomous driving perception or the effective warning capabilities of the monitoring system.

[0067] In view of this, this application provides a camera occlusion detection method, which acquires an image sequence and extracts L target images before the M-th frame image from the image sequence based on the position of each frame image in the image sequence. Then, a background model is constructed based on the L-th frame target images. The background model is used to determine whether the camera lens is occluded when the camera acquires the M-th frame image, thereby achieving more accurate and stable camera occlusion judgment.

[0068] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0069] Figure 1 This is a flowchart illustrating the camera occlusion detection method provided in an embodiment of this application. Figure 1 As shown, this camera occlusion detection method can be implemented through the following steps:

[0070] Step 110: Obtain the image sequence. The image sequence includes at least N frames of images captured by the camera in the target scene, where N is a positive integer.

[0071] Step 120: Based on the position of each frame in the image sequence, extract the L target images preceding the M-th frame from the image sequence. Where L is a positive integer;

[0072] Step 130: Construct a background model based on the target image in frame L.

[0073] Step 140: Using the background model, determine whether the camera lens is obstructed when capturing the Mth frame image.

[0074] In step 110 above, the image sequence serves as the input data set for subsequent background modeling and lens occlusion determination. Specifically, it can refer to a set of multiple frames of image data acquired by the camera in the target scene in chronological order.

[0075] The target scene is used to define the actual working environment of the camera. For example, the target scene can include the following two types: (i) The pixel values ​​of the occluded area do not change much: When transparent or light-transmitting materials are attached to the camera, the area shows a blurry image state more often. This is the detection and judgment of blur rather than occlusion; (ii) The vehicle is in motion: When the vehicle is stationary, each frame of the camera image is relatively similar, and the result obtained by the background modeling scheme is unreasonable.

[0076] In this embodiment, the execution entity can be an electronic device, such as an in-vehicle domain controller, an edge computing device, or a server-side processing module.

[0077] After the camera continuously outputs the raw video stream, the video acquisition interface decodes, buffers, and arranges the images according to the timestamp or frame number to form an accessible image sequence.

[0078] Each frame in the image sequence can be sourced from continuously sampled video frames or from image frames extracted from the video stream at preset intervals. When continuous sampling is used, the original acquisition order is maintained between frames. When interval extraction is used, the extraction period is set to correspond to the camera output frame rate, so that the retained frames can still represent the change process of the target scene in the time dimension.

[0079] Furthermore, to ensure effective subsequent processing, the image sequence can synchronously record the acquisition time, frame index, resolution information, and camera identifier for each frame during its formation, and write these data into a circular buffer or sequential storage queue. When the number of buffered image frames reaches a preset value of N, the image sequence is marked as a detectable sequence, triggering subsequent target image extraction processing based on historical frames.

[0080] In one possible embodiment, the images output by the camera are first processed to uniformly size them so that each frame entering the image sequence has a consistent width and height, such as 1280×720 pixels, 1920×1080 pixels, or a fixed resolution consistent with the original output of the camera, so as to ensure that the coordinate positions of each frame correspond one-to-one when performing pixel-by-pixel statistics.

[0081] In another exemplary implementation, abnormal frames can be removed during image sequence generation. Abnormal frames include frames with decoding failures, missing data, or timestamp jumps exceeding a threshold. Upon detection of an abnormal frame, it is discarded, and the sequence continues to wait for the next valid frame to enter, thus maintaining the temporal continuity of the image sequence.

[0082] For dynamic vehicle scenarios, the images captured by the camera will continuously change as the vehicle moves. Therefore, the image sequence formed in this step not only saves the current frame, but also saves the historical acquisition results before the current frame, so that subsequent processing can make judgments based on historical images rather than single-frame results.

[0083] For fixed monitoring scenarios, even if the overall background changes little, the image sequence is still maintained according to the same mechanism so that a comparable background representation can be constructed based on image features within a continuous time period, in cases of dust adhesion, film obstruction, or foreign object coverage.

[0084] In step 120 above, the Mth frame image is the image to be detected for whether there is lens occlusion. Its position in the image sequence can be determined by the frame number, timestamp sorting position, or cache index position.

[0085] L target images are used to construct a background model, reflecting the scene background features over a period of time before the acquisition of the M-th image. Here, L is a positive integer, and M is greater than L, such that at least L available historical images exist before the M-th image.

[0086] In the specific implementation of step 120 above, after selecting the current detection frame in the image sequence, the frame is marked as the Mth frame image, and the target image of the Lth frame is extracted forward according to the frame position.

[0087] For example, if the image sequence is sequentially denoted as I1, I2, ..., IM-1, IM, then the extracted L-frame target image is located before the M-th frame image, and the M-th frame image is IM. By extracting historical images backward based on the current position, the statistical basis of the background model comes from images before the current detection time, avoiding directly including the current frame to be judged in the background statistics and ensuring that the subsequent comparison relationship is clear.

[0088] In addition, when extracting L frames of target images, it is necessary to first determine whether there are enough historical frames in the current image sequence. If M is less than or equal to L, it means that the historical frames before the current M-th frame image are insufficient to complete the background construction. At this time, subsequent images can continue to be received until M is greater than L before detection is started.

[0089] For high frame rate scenarios, directly using all historical images would increase computational overhead. Therefore, images can be pre-processed in a fixed manner during the image sequence formation stage, and then L target images can be extracted from the processed sequence. In this step, the image sequence represents an addressable set of temporal frames, the Mth frame represents the current target, and the L target images represent a set of historical samples for constructing the background model. These three elements form a clear temporal relationship.

[0090] In one possible implementation, the value of L is set according to the scene frame rate and the background change rate. For example, in a video stream of 30 frames per second, L is taken as an integer between 10 and 30, so that the background model covers a historical range of about 0.33 seconds to 1 second. In a fixed monitoring scene, a larger value of L can also be taken to enhance statistical stability.

[0091] In step 130 above, the background model is used to characterize the background features under normal scene conditions and serves as a reference for judging lens occlusion in the Mth frame image.

[0092] The L-frame target images provide historical samples needed for background model construction, and the background model can be built based on the statistical features of the L-frame target images. In this step, the background model is specifically manifested as a background representation data structure generated from the L-frame target images, which can be either a background image or other data combinations used to represent the background state.

[0093] Once the background model is constructed, it can be written to the background cache of the current detection period and associated with the corresponding M-th frame image index. Since the background model is generated entirely based on the L target images preceding the M-th frame, it describes the scene background state before the current detection time and does not contain information from the M-th frame image itself.

[0094] This step replaces simple frame difference comparison with background modeling within the history window, so that subsequent shot occlusion judgment no longer directly relies on the instantaneous difference between two consecutive frames, but rather on background features over a period of time. The constructed background model can be used for subsequent occlusion judgment.

[0095] For step 140 above, the M-th frame image can be converted into a data representation format consistent with the background model. Then, the difference between the M-th frame image and the background model is calculated, and the lens of the camera is determined to be blocked when the camera captures the M-th frame image based on the difference.

[0096] In this step, the M-th frame image is the current judgment object, the background model is the judgment reference, and whether the lens is occluded is the state result output based on the correspondence between the M-th frame image and the background model.

[0097] For example, the state result can be a binary result, including occluded and unoccluded. Alternatively, the state result can also be a detection result with confidence.

[0098] After outputting the results, the Mth frame image and the corresponding occlusion determination result can be written to the log or state cache for subsequent use by the vehicle perception system or monitoring platform.

[0099] The camera occlusion detection method provided in this application first establishes an image sequence organized in chronological order, then constructs a background model from the target images of L frames in the previous historical window, and uses this background model for background matching analysis of the Mth frame image. This allows occlusion detection to be based on the statistical features of the background within a historical time period, rather than on the instantaneous difference between two consecutive frames. Corresponding to the continuous changes in the background in dynamic driving scenes and the complex lighting fluctuations in fixed monitoring scenes, this processing structure can maintain the feasibility of the processing flow while suppressing short-term brightness changes, local motion interference, and global scene changes, thereby improving the accuracy of lens occlusion detection and avoiding misjudgments.

[0100] In some embodiments, the raw images captured by the camera can be processed to form the image sequence in step 110 above by the following steps:

[0101] Step 11: Acquire K frames of raw images captured by the camera in the target scene. Where K is a positive integer greater than or equal to N;

[0102] Step 12: Extract sample images from the K-frame raw images. The sample images are captured by the camera while it is in motion.

[0103] Step 13: Construct an image sequence based on the sample images.

[0104] In this embodiment, the K-frame raw images are the set of raw images output by the camera in the target scene. The raw images can be images acquired continuously or images acquired at a preset acquisition interval, as long as they can reflect the actual acquisition results in the target scene.

[0105] Sample images are images selected from the original images for subsequent processing, corresponding to the acquisition results when the camera is in motion.

[0106] For example, the motion state of the camera can be characterized by the vehicle's running state, the gimbal's rotation state, or the displacement state of the camera's mounting carrier, or it can be identified based on the scene change characteristics between adjacent images.

[0107] In the specific implementation, after the camera continuously outputs image data in the target scene, it first caches no less than N frames of original images, and then combines the status information from the vehicle controller, gimbal controller or inertial navigation module to determine whether the camera is in motion at the corresponding moment of each original image.

[0108] When a camera is detected to be in motion, the corresponding original image is extracted as a sample image. When the camera is stationary (e.g., a security camera that continuously monitors in one direction without rotating or moving), it is not included in the sample image set.

[0109] Subsequently, the sample images are arranged according to the original acquisition sequence and organized into an image sequence to form a serialized image input that can be used for subsequent calls.

[0110] The image sequence can be stored in a memory buffer or local storage medium and directly accessed during subsequent occlusion detection.

[0111] By constructing an image sequence from images captured only when the camera is in motion, the images in the sequence can more effectively reflect changes in dynamic scenes, thus providing a stable data foundation for subsequent background modeling and lens occlusion determination based on the image sequence.

[0112] Furthermore, in some other embodiments, it can be first determined whether a first target region exists in each region of the sample image; if a first target region exists, an image sequence is constructed based on the sample image. The pixel values ​​in the first target region change by less than a preset threshold.

[0113] In this embodiment, the first target region may be identified as an occluded region during subsequent detection. Therefore, it is necessary to detect whether such a first target region exists in the sample image in the early stage to improve detection efficiency.

[0114] The first target region is used to characterize a local area in the sample image with small grayscale or color fluctuations. The pixel value change is less than a preset threshold, which indicates that the pixel dispersion in the region is low and the region content is relatively stable in space.

[0115] The preset threshold can be set according to the noise level of the imaging sensor, the range of scene brightness variation, and the stability requirements of the subsequent background model. In practical applications, this threshold can also be adjusted in combination with the resolution and exposure parameters of different cameras.

[0116] In this embodiment, the sample image can be divided into multiple sub-regions of the same size, and the variation range of grayscale value, brightness value or color component value of pixels in each sub-region can be counted. Then, the variation range is compared with a preset threshold to identify whether there is a first target region that meets the conditions.

[0117] Specifically, when the pixel value change in a certain area meets the threshold constraint, that area is determined as the first target area. When the first target area exists, it is determined that the camera has a potential occlusion possibility.

[0118] This embodiment detects the existence of a first target region in advance, which can detect the possibility of potential lens occlusion. When the first target region exists, an image sequence is constructed, which makes the image entering subsequent processing have high local stability. Moreover, the effective information in the image sequence is more concentrated in the area with less change, and the background model can more easily extract stable features, thereby improving the consistency of judgment when detecting camera occlusion and reducing invalid interference introduced by drastic local changes.

[0119] In some embodiments, in an image sequence, there is at least one frame of image spaced between each frame of the target image. For example, Figure 2This is a schematic diagram illustrating the processing based on a fixed-length historical frame buffer queue provided in an embodiment of this application, as shown below. Figure 2 As shown, the image sequence of the camera includes frames 1 to 1+5a. First, the image sequence is downsampled and frames are extracted to obtain frames 1, 1+a, 1+2a, 1+3a, 1+4a and 1+5a.

[0120] If it is necessary to detect the 1+3a frame, then the 1st frame, the 1+a frame, and the 1+2a frame before the 1+3a frame need to be extracted as 3 target images.

[0121] In this context, there is an interval of a-1 non-target images between the first target image frame and the (1+2a)th target image frame. Non-target images can be image frames continuously captured by the camera but not selected into the target image set, and their content has a discrete temporal distribution with the preceding and following target images.

[0122] In this embodiment, target images can be extracted from the image sequence at fixed frame intervals, such as every other frame or every few frames, to prevent consecutive sampling of target images between adjacent frames. Alternatively, target images can be selected according to a preset frame skipping rule while meeting sampling density requirements, ensuring that the images used for background modeling have a certain degree of dispersion in the time dimension. With this sampling method, similar regions between target images will not highly overlap due to continuous acquisition, and the input samples of the background model will not be overly concentrated on local changes at adjacent time points.

[0123] Since there is at least a one-frame interval between target images, the samples on which the background model is based can cover more dispersed scene states, thereby making the subsequent lens occlusion determination of the Mth frame image more stable.

[0124] After obtaining L frames of target images in this embodiment, the redundant correlation between adjacent target images is reduced, and the sensitivity of the background model to short-term fluctuations is weakened, thereby making the occlusion detection results more consistent with the real changes in the target scene.

[0125] Furthermore, in some embodiments, a second target region can be determined from each frame of the target image; then, a background model is constructed based on the second target region in each frame of the target image.

[0126] In this embodiment, the second target region is used to characterize a local image region in the target image that meets the preset background stability condition.

[0127] The local image region can be a continuous block of pixels, a connected region, or a region obtained by filtering after dividing it into grids. Specifically, it can be determined based on the range of pixel grayscale variation, color consistency, texture similarity, or edge variation within the region.

[0128] The second target region can be obtained by performing region segmentation on each frame of the target image, or it can be directly located according to a preset coordinate range, mask template, or detection rules.

[0129] In this embodiment, when processing the target image of each frame, the corresponding second target region is first determined, and then the second target region in each frame is input into the background model construction unit for comprehensive processing.

[0130] The background model can employ a pixel mean model, median model, weighted update model, or a background representation model based on statistical distribution. In this model, the second target region in each frame of the target image is used to provide background candidate information, and after accumulation over multiple frames, a background description with temporal stability is formed.

[0131] In addition, for scenarios that require consideration of computational efficiency, only the second target region in some frames can be selected for modeling, or the features of the second target region in each frame can be compressed before fusion.

[0132] In this embodiment, by acquiring L frames of target images, the second target region that meets the stable characteristics in each frame of target images is first extracted, and then the background model is constructed based on the consistency of these regions in the time dimension, so that the background model can better reflect the long-term stable scene content within the lens's field of view, and provide a basis for subsequent judgment on whether there is occlusion in the Mth frame image.

[0133] The background model construction method provided in this embodiment no longer relies on full modeling of the entire frame image, but focuses on the stable information in the second target area for construction. Therefore, the model matches the background features of the target scene to a higher degree, and the background references used for subsequent lens occlusion judgment are more concentrated. It can maintain good stability and processing efficiency in dynamic scenes and complex lighting conditions.

[0134] Furthermore, in some embodiments, Figure 3 The following is a flowchart illustrating the specific process for determining camera occlusion in an embodiment of this application: Figure 3 As shown, it includes the following steps:

[0135] Step 310: Use the background model to separate the foreground and background of the Mth frame image and determine the pixel ratio of the background in the Mth frame image;

[0136] Step 320: If the pixel ratio of the background is greater than the first percentage threshold, it is determined that the lens is blocked when the camera is capturing the Mth frame image.

[0137] In this embodiment, the separation of foreground and background refers to classifying each pixel in the M-th frame image according to the background model, classifying pixels that match the background model more closely as background pixels, and classifying pixels that differ more from the background model as foreground pixels, and then calculating the proportion of background pixels in the M-th frame image accordingly.

[0138] The background pixel ratio can be expressed as the ratio of the number of background pixels to the total number of pixels in the Mth frame, or as the ratio of the number of background pixels to the total number of pixels in a preset area.

[0139] The first percentage threshold is used to characterize the boundary value for lens occlusion determination. Its value can be set according to the background stability, lens field of view, and image resolution in different application scenarios.

[0140] In the specific implementation, the background model can be constructed from the target images of L frames preceding the M-th frame, and the statistical characteristics, color distribution characteristics, or local texture characteristics of the background pixels are used as the separation criteria. After acquiring the M-th frame image, it is input into the background model for pixel-by-pixel comparison, and the background or foreground marker corresponding to each pixel is output. Then, the pixels marked as background are counted and the proportion is calculated.

[0141] Specifically, when the proportion of background pixels in the entire frame exceeds a first percentage threshold, it indicates that a large area of ​​the current image conforms to the characteristics of the background model, and the camera may be occluded. Therefore, an occlusion determination result is output. When the proportion does not exceed the threshold, the unoccluded state is maintained.

[0142] This embodiment, by employing the aforementioned background model separation and proportion judgment method, can distinguish between stable regions and abnormal occlusion regions in the M-th frame image, and uses the background pixel proportion as the basis for lens occlusion judgment, thereby enabling the lens occlusion recognition result to have good stability and consistency, and to adapt to image changes in different scenarios.

[0143] In addition, in the field of autonomous driving technology, the aforementioned camera is at least one of a vehicle's front-view camera, rear-view camera, and panoramic camera.

[0144] The front-view camera is installed at the front of the vehicle, the rear-view camera is installed at the rear of the vehicle, and the panoramic cameras are installed on the left and right sides of the vehicle, respectively.

[0145] Furthermore, in some embodiments, to reduce false positives, if the electronic device indicates that the camera lens is obstructed when capturing the Mth frame image during the initial detection, and if the vehicle is in a tunnel scene and the camera is a panoramic camera, a second detection can be performed. The specific steps are as follows:

[0146] Step 21: Reconstruct a new background model based on the third target region in each frame of the target image;

[0147] Step 22 uses the new background model to re-detect whether the lens of the panoramic camera is obstructed when acquiring the M-th frame image.

[0148] In this embodiment, a target image frame can be divided into multiple target regions, and the third target region is a region that is different from the second target region.

[0149] The third target region refers to a local image region in each frame of the target image that is adapted to the tunnel scene. The third target region can be a part of the image with relatively stable brightness changes, clear structural features, and minimal impact from the vehicle's own movement. The new background model is a background representation reconstructed based on the third target region in each frame of the target image, used to replace the background model used in the initial detection.

[0150] In actual processing, after initially determining that the M-th frame image has occlusion, the vehicle is in a tunnel environment, and the current camera is a panoramic camera, the third target region is extracted from several target images corresponding to the M-th frame image. The third target region in each frame is then aligned in position and corrected for feature consistency. Subsequently, the background pixel distribution is updated based on these third target regions to form a new background model.

[0151] The new background model is then used to re-separate the foreground and background of the M-th frame image, and the lens occlusion determination result is re-output based on the background pixel ratio or the range of the lens occlusion area.

[0152] For example, Figure 4 This is a schematic diagram of the target region in the target image provided in the embodiments of this application, such as... Figure 4 As shown, the central region 0 is initially used as the second target region to construct the background model. When occlusion is first detected using this background model, subsequent regions are selected sequentially. Figure 4 Regions 1, 2, 3, and 4 are designated as the third target regions, and then new background modeling and occlusion judgment are performed.

[0153] This embodiment utilizes multiple target regions in the panoramic camera image to achieve multiple remodeling in a tunnel scene. This allows the background representation to accurately reflect changes in lighting and texture features within the tunnel, and subsequent judgments no longer rely entirely on the initial background model. Consequently, the lens occlusion detection results of the panoramic camera in the tunnel environment are more stable. Furthermore, since the reconstructed background model is only performed on the third target region, the processing scope is relatively concentrated, which reduces the computational burden caused by repeated modeling across the entire frame while maintaining detection accuracy.

[0154] Furthermore, based on the above embodiments, in some embodiments, in tunnel scenarios, when occlusion detection is performed again, it can be achieved through the following steps:

[0155] Step 31: Obtain the second percentage threshold corresponding to the tunnel scene;

[0156] Step 32: Based on the new background model, separate the foreground and background of the M-th frame image and determine the pixel proportion of the background in the M-th frame image;

[0157] Step 33: If the pixel ratio of the background is greater than the second percentage threshold, it is determined that the lens of the panoramic camera is obstructed when capturing the Mth frame image.

[0158] In this embodiment, because the tunnel walls are very similar and the image blocks used for background modeling are very similar, false occlusions are easily detected. Therefore, a special second percentage threshold needs to be set in the tunnel scene. This second percentage threshold can be greater than the first percentage threshold mentioned above.

[0159] The second percentage threshold can be determined by preset parameters of the tunnel scene, or it can be corrected by combining the statistical results of historical images in the tunnel.

[0160] In specific implementation, after detecting that the panoramic camera is in a tunnel scene, the second percentage threshold is read from the parameter library corresponding to the tunnel scene, or the distribution range of the background ratio is statistically analyzed based on the pre-collected tunnel image samples, and the second percentage threshold is generated accordingly.

[0161] Subsequently, the M-th frame image is input into the new background model, which classifies the pixels in the M-th frame image and outputs the mask results for the foreground and background regions respectively. Then, the pixel ratio of the background is calculated based on the number of pixels in the background region and the total number of pixels in the M-th frame image.

[0162] If this percentage exceeds the second percentage threshold, it indicates that a large area in the current image is abnormally occupied by the background. Combined with the imaging characteristics of the panoramic camera in the tunnel environment, it can be further confirmed that the lens is obstructed.

[0163] This embodiment sets a separate threshold for tunnel scenes and combines it with a new background model to re-separate the foreground and background of the current frame, enabling lens occlusion determination to adapt to the characteristics of varying lighting and high scene similarity within tunnels. This allows for more stable re-detection of lens occlusion status of panoramic cameras in tunnel environments, and outputs occlusion determination information for subsequent alarm or perception control use.

[0164] In addition, in some embodiments, when the camera is a panoramic camera, it can detect whether the vehicle is driving at night; if the vehicle is not driving at night, it is determined that the camera is in the target scene.

[0165] For example, night driving refers to the operation of a vehicle from sunset to sunrise, or the operation of a vehicle when the ambient light intensity is lower than a preset threshold.

[0166] In this embodiment, after the camera is connected to the vehicle controller, the controller can first read the current time information, location information and ambient light information, and compare the time information with a preset nighttime period, or compare the ambient light information with a preset illuminance threshold, in order to determine whether the vehicle is in a nighttime driving state.

[0167] In this embodiment, for nighttime scenes, the front and rear lights of the vehicle are on when the vehicle is in motion. Under unobstructed conditions, the images from the front and rear cameras will not be completely dark, while the panoramic cameras on both sides of the vehicle may remain consistently dark. Therefore, for nighttime scenes, the overall grayscale value of the images from the two panoramic cameras on the same side is determined. If both camera images on the same side are very dark (it's difficult to determine whether they are obstructed or in a dark environment), no image sequence is constructed for background modeling, thereby reducing computational load.

[0168] This embodiment determines whether the vehicle is driving at night before acquiring the image sequence, and confirms that the panoramic camera is in the target scene when it is not driving at night. This limits the acquisition of subsequent image sequences to scenes that better meet the lens occlusion detection conditions, providing a more stable input basis for background model construction and lens occlusion determination. This reduces the impact of low-light conditions at night on image content stability and improves the scene adaptability and judgment consistency of the panoramic camera in subsequent lens occlusion detection.

[0169] Based on the above embodiments, in some embodiments, when the camera lens is detected to be blocked, it is determined whether the vehicle is in autonomous driving mode; if the vehicle is in autonomous driving mode, an alarm is issued and / or the autonomous driving strategy is adjusted.

[0170] In this embodiment, whether the vehicle is in autonomous driving mode is used to characterize the current operating state of the vehicle, which is currently taken over by manual driving, assisted driving, or autonomous driving control unit.

[0171] The alarm notification is used to output lens obstruction information on the cockpit display module, voice broadcast module, or remote alarm module to alert the driver or remote supervisor to the camera malfunction.

[0172] Adjusting the autonomous driving strategy is used to coordinate perception, planning, or control strategies within the autonomous driving controller. For example, it can reduce the perception weight that depends on the camera, switch to a redundant sensor fusion mode, limit the output of some autonomous driving functions, or trigger degraded control when lens occlusion persists.

[0173] In practice, after determining that the camera lens is blocked, when the vehicle is in autonomous driving mode, the controller reads the preset linkage response strategy table and determines the output method based on the installation position of the camera blocking the lens, the duration of the lens blocking, and the current vehicle speed.

[0174] Specifically, in scenarios where the forward-facing camera lens is obstructed, the controller can prioritize issuing an audible and visual alarm and simultaneously notify the autonomous driving master control unit to reduce the confidence level of lane keeping and target recognition; in scenarios where the panoramic camera lens is obstructed, the controller can remove the local perception results corresponding to that camera from the fused input and call other surrounding sensors to compensate for blind spot information.

[0175] In this implementation, after detecting that the camera lens is obstructed, the system first determines whether the vehicle is in autonomous driving mode, and then executes an alarm or adjusts the strategy based on the determination result. This allows the camera lens obstruction detection result to be linked with the vehicle's operating status. Since camera lens obstruction in autonomous driving mode directly affects perception input and control decisions, this linkage processing enables the system to output operating prompts in a timely manner and downgrade or reconfigure the autonomous driving function, thereby allowing the vehicle to maintain a more stable control state when sensors malfunction.

[0176] By adopting this embodiment, when the camera lens is obstructed and the vehicle is in autonomous driving mode, an alarm can be triggered in a timely manner and the autonomous driving strategy can be adjusted synchronously. This ensures that the lens obstruction anomaly is no longer limited to the detection level, but can directly affect the vehicle control link, thereby improving the timeliness of state perception and the consistency of control response during autonomous driving operation.

[0177] Figure 5 A flowchart of a long-term camera occlusion algorithm based on background modeling is provided for embodiments of this application, as follows: Figure 5 As shown, background modeling is performed by acquiring L historical frame images to form a background model or foreground model for detecting the current frame image and determining the background image in the current frame image for occlusion judgment.

[0178] Background modeling refers to extracting static background components by analyzing pixel value changes in a video sequence and applying this information to computer vision tasks such as object detection and motion tracking. In practical applications, background modeling is commonly used in video surveillance, pedestrian detection, and vehicle recognition. In videos, the background is typically defined as a relatively stable element, such as walls, the ground, or the sky. The goal of background modeling is to separate dynamic foreground objects from the static background for further analysis and processing.

[0179] In this embodiment, considering the high resolution of the raw image input captured by the camera, performing background modeling on the raw image would place high demands on the computing power of the computing platform on which the algorithm runs, and would also consume significant system resources, potentially impacting other running functions. Therefore, in some implementations, a specific region can be extracted from the raw image, and subsequent operations on each frame can be performed on image blocks within that specific region.

[0180] In addition, please continue to refer to the above. Figure 2 , Figure 2 The process of image caching and occlusion detection is described, and a fixed-length historical frame cache queue is used to store historical images for background modeling.

[0181] Furthermore, considering the need to detect long-term camera occlusion, images are saved and processed every 'a' frames instead of every single frame. After startup, the first, 1+a, and 1+2*a frames are sequentially added to the historical image cache queue. For the 1+3*a frame, the images in the historical frame cache queue (i.e., the first, 1+a, and 1+2*a frames) are traversed to perform background modeling. Then, the updated and modeled foreground or background model is applied to the 1+3*a frame to obtain the foreground or background in the 1+3*a frame.

[0182] In this process, the occluded area will be judged as the background. If the percentage of pixels judged as background in the overall image is greater than a certain threshold, the camera is considered to be occluded in the current frame.

[0183] In other embodiments, image patches from the camera view can be selected for modeling to reduce computational load. Furthermore, to expand the assessable area, the position of the image patches can be dynamically adjusted even if occlusion is initially identified.

[0184] In this embodiment, each judgment only models pixels within an image block of a certain size, which reduces the amount of computation.

[0185] Furthermore, for cameras mounted on the exterior of the vehicle, the scene seen by the camera is constantly changing as the vehicle moves, making it impossible to pre-train a Gaussian mixture model. In this embodiment, the Gaussian mixture model is dynamically updated continuously during vehicle movement, and the frame is also used to train and update the Gaussian mixture model in the event of occlusion.

[0186] The Gaussian mixture model is used to determine whether the camera is occluded, and it is applicable to the scenario of vehicle movement. However, it cannot reconstruct and complete the occluded area.

[0187] Among them, the optimization of the Gaussian mixture model: the false alarm scenarios encountered during real vehicle testing are mainly two types: tunnel scenarios and nighttime scenarios, which are concentrated on the panoramic cameras distributed on both sides of the vehicle body.

[0188] Compared to front-view and rear-view cameras, the panoramic camera has a limited view of the scene. In tunnel scenes, because tunnel walls and image blocks used for background modeling are very similar, false occlusions are easily detected. Therefore, a non-fixed region of interest determination method is used for all panoramic cameras.

[0189] Reference Figure 2 By default, the model is performed on region 0, which is the center of the camera. If region 0 is occluded, the background modeling and judgment are performed on regions 1, 2, 3, and 4 in sequence. The number of pixels in the above 5 regions is the same, so the amount of computation per frame will not change.

[0190] Because it uses a non-fixed region of interest approach, it can identify a larger image area, thus reducing false alarms to some extent. In addition, based on navigation or perception information, it can be determined that the vehicle has entered a tunnel; therefore, the percentage of cases flagged as occlusion can be appropriately increased, further reducing false alarms.

[0191] In nighttime scenarios, when a vehicle is in motion, both the front and rear lights will be on. Under unobstructed conditions, the front and rear view cameras will not display completely dark images, while the panoramic cameras on both sides of the vehicle may remain consistently dark. For nighttime scenes, the overall grayscale value of the images from the two panoramic cameras on the same side is assessed. If both camera images on the same side are very dark (it's difficult to determine whether they are obstructed or in a dark environment), background modeling is not performed, thus reducing computational load.

[0192] In some implementations, when an obstruction is detected, a prompt can be issued to the driver to guide them to handle the obstruction in a timely manner; when the intelligent driving function is enabled, the function will be downgraded (for example, if the panoramic camera detects an obstruction, the lane changing function will be suppressed). The obstruction detection is given to the system as the output of the perception module, and the system decides to downgrade or disable the relevant function without supplementing the obstructed part of the camera.

[0193] Alternatively, an image quality segmentation model can be introduced first to segment out the occluded areas in the camera image, and then background modeling can be used to assist in the judgment, reducing the impact of model missegmentation.

[0194] Figure 6 This is a schematic diagram of the camera occlusion detection device provided in this application, as shown below. Figure 6 As shown, the camera occlusion detection device 60 provided in this embodiment includes:

[0195] The acquisition module 601 is used to acquire an image sequence, which includes at least N frames of images captured by the camera in the target scene. Here, N is a positive integer.

[0196] Extraction module 602 is used to extract L target images preceding the M-th frame image from the image sequence based on the position of each frame image in the image sequence. Where L is a positive integer.

[0197] Module 603 is used to construct a background model based on the target image of frame L.

[0198] The determination module 604 is used to determine, using the background model, whether the lens of the camera is obstructed when capturing the Mth frame image.

[0199] Optionally, the acquisition module can be specifically used for:

[0200] Acquire K frames of raw images captured by the camera in the target scene, where K is a positive integer greater than or equal to N;

[0201] Sample images are extracted from the K-frame raw images. These sample images are captured by the camera while it is in motion.

[0202] Construct an image sequence based on the sample images.

[0203] Optionally, the acquisition module can be specifically used for:

[0204] Determine whether a first target region exists in each region of the sample image, and the change in pixel value in the first target region is less than a preset threshold;

[0205] If a first target region exists, an image sequence is constructed based on the sample images.

[0206] Optionally, in the image sequence, there is at least one frame of image spaced between each target image.

[0207] Optionally, the construction module can be used to: determine a second target region from each frame of the target image; and construct a background model based on the second target region in each frame of the target image.

[0208] Optionally, the determining module can be used to: separate the foreground and background of the Mth frame image using a background model, and determine the pixel ratio of the background in the Mth frame image; if the pixel ratio of the background is greater than a first percentage threshold, it is determined that the lens of the camera is blocked when acquiring the Mth frame image.

[0209] Optionally, the camera is at least one of a front-view camera, a rear-view camera, and a panoramic camera for the vehicle.

[0210] Optionally, a re-detection module is also included for:

[0211] When it is detected that the camera lens is blocked while capturing the Mth frame image, the vehicle is in a tunnel scene, and the camera is a panoramic camera, the third target area is determined in each frame of the target image.

[0212] Based on the third target region in each frame of the target image, a new background model is reconstructed;

[0213] The new background model is used to re-detect whether the lens of the panoramic camera is obstructed when acquiring the M-th frame image.

[0214] Optionally, the re-detection module can be used specifically for:

[0215] Obtain the second percentage threshold corresponding to the tunnel scenario;

[0216] Based on the new background model, the foreground and background of the Mth frame image are separated to determine the pixel proportion of the background in the Mth frame image.

[0217] If the background pixel ratio is greater than the second percentage threshold, it is determined that the lens of the panoramic camera is obstructed when capturing the Mth frame image.

[0218] Optionally, it also includes a scene determination module, used to detect whether the vehicle is driving at night when the camera is a panoramic camera; if the vehicle is not driving at night, it determines that the camera is in the target scene.

[0219] Optionally, it also includes a prompting module, used to determine whether the vehicle is in autonomous driving mode when the camera lens is detected to be obstructed; if the vehicle is in autonomous driving mode, it will issue an alarm prompt and / or adjust the autonomous driving strategy.

[0220] The camera occlusion detection device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0221] Figure 7 A schematic diagram of the structure of the electronic device provided in this application. Figure 7 As shown, the electronic device 70 provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the electronic device 70 further includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus.

[0222] In a specific implementation, at least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the above-described method.

[0223] The specific implementation process of the processor can be found in the above method embodiments, and its implementation principle and technical effect are similar, so it will not be repeated here.

[0224] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0225] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0226] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0227] This application also provides a vehicle, which includes a vehicle body, a camera disposed on the vehicle body, and the aforementioned electronic device disposed on the vehicle body, wherein the electronic device is connected to the camera; the electronic device is used to perform the aforementioned method.

[0228] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0229] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0230] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0231] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0232] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0233] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0234] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0235] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0236] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0237] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

[0238] The above embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention.

Claims

1. A method for detecting camera occlusion, characterized in that, include: Acquire an image sequence, the image sequence comprising at least N frames of images captured by the camera in the target scene, where N is a positive integer; Based on the position of each frame in the image sequence, extract L target images that precede the Mth frame from the image sequence, where L is a positive integer; Based on the L frames of target images, construct a background model; Using the background model, it is determined whether the lens of the camera is obstructed when capturing the Mth frame image.

2. The method according to claim 1, characterized in that, The acquisition of the image sequence includes: Acquire K frames of original images captured by the camera in the target scene, where K is a positive integer greater than or equal to N; Sample images are extracted from the K-frame original images, and the sample images are captured by the camera when it is in motion; The image sequence is constructed based on the sample images.

3. The method according to claim 2, characterized in that, The step of constructing the image sequence based on the sample images includes: Determine whether a first target region exists in each region of the sample image, wherein the pixel value change in the first target region is less than a preset threshold; If the first target region exists, then the image sequence is constructed based on the sample image.

4. The method according to claim 1, characterized in that, In the image sequence, there is at least one frame of image spaced between each frame of the target image.

5. The method according to claim 1, characterized in that, The step of constructing a background model based on the L-frame target image includes: Determine the second target region from each frame of the target image; The background model is constructed based on the second target region in each frame of the target image.

6. The method according to claim 1, characterized in that, The step of using the background model to determine whether the camera lens is obstructed when capturing the Mth frame image includes: The background model is used to separate the foreground and background of the Mth frame image to determine the pixel ratio of the background in the Mth frame image. If the pixel percentage of the background is greater than the first percentage threshold, it is determined that the camera lens is blocked when capturing the Mth frame image.

7. The method according to any one of claims 1-6, characterized in that, The camera is at least one of the vehicle's front-view camera, rear-view camera, and panoramic camera.

8. The method according to claim 7, characterized in that, Also includes: When it is detected that the camera lens is blocked when capturing the Mth frame image, and the vehicle is in a tunnel scene, and the camera is the panoramic camera, a third target area is determined in each frame of the target image; Based on the third target region described in each frame of the target image, a new background model is reconstructed; The new background model is used to re-detect whether the lens of the panoramic camera is obstructed when acquiring the Mth frame image.

9. The method according to claim 8, characterized in that, The step of re-detecting whether the lens of the panoramic camera is obstructed when acquiring the Mth frame image using the new background model includes: Obtain the second percentage threshold corresponding to the tunnel scenario; Based on the new background model, the foreground and background of the Mth frame image are separated to determine the pixel proportion of the background in the Mth frame image; If the pixel percentage of the background is greater than the second percentage threshold, it is determined that the lens of the panoramic camera is obstructed when capturing the Mth frame image.

10. The method according to claim 7, characterized in that, Before acquiring the image sequence, the method further includes: When the camera is a panoramic camera, it detects whether the vehicle is driving at night; If the vehicle is not driving at night, then the camera is determined to be in the target scene.

11. The method according to claim 7, characterized in that, Also includes: When the camera lens is detected to be blocked, determine whether the vehicle is in autonomous driving mode; If the vehicle is in the autonomous driving mode, an alarm will be issued and / or the autonomous driving strategy will be adjusted.

12. A camera occlusion detection device, characterized in that, include: An acquisition module is used to acquire an image sequence, the image sequence including at least N frames of images captured by the camera in the target scene, where N is a positive integer; The extraction module is used to extract L target images preceding the M-th frame image from the image sequence based on the position of each frame image in the image sequence, where L is a positive integer; The construction module is used to construct a background model based on the L-frame target image; The determination module is used to determine, using the background model, whether the lens of the camera is obstructed when capturing the Mth frame image.

13. An electronic device, characterized in that, include: Memory and processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-11.

14. A vehicle, characterized in that, include: The vehicle body, a camera disposed on the vehicle body, and an electronic device as described in claim 13 disposed on the vehicle body, wherein the electronic device is connected to the camera; The electronic device is used to perform the method as described in any one of claims 1-11.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-11.