Image detection method, device and computer readable storage medium

By using an image deraining model and differential information processing, the interference problem in rainy weather recognition is solved, achieving high accuracy and robust rainy weather detection.

CN115761575BActive Publication Date: 2026-05-12ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2022-10-27
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies are easily affected by irrelevant objects when identifying objects in rainy weather, resulting in poor accuracy and low robustness, especially when the rainfall is light.

Method used

An image deraining model is used to process the current image in the video stream to remove rain. The first frame difference map and the second frame difference map between the current image and the reference image are obtained. The difference information is used to determine whether it is a rain scene, eliminate the interference of moving objects, and optimize the detection process by combining scene classification network.

Benefits of technology

It improves the accuracy and robustness of rain detection, can accurately determine whether it is raining, reduces false alarms, and adapts to different environmental changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115761575B_ABST
    Figure CN115761575B_ABST
Patent Text Reader

Abstract

The application provides an image detection method and device and a computer readable storage medium. A current image in a video stream is obtained, and a reference image is obtained. The current image is input into a rain removal model to obtain a processed image processed by the rain removal model. A first frame difference image of the current image and the reference image is obtained, and a second frame difference image of the processed image and the reference image is obtained. Difference information of the first frame difference image and the second frame difference image is obtained, and it is determined whether the difference information meets a preset condition. In the manner, whether it is a rainy day can be accurately determined through the difference information of the current image and the current image processed by the rain removal, other factors in the image background can be excluded, the accuracy is improved, misjudgment is prevented, and robustness is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application mainly relates to the technical field of video image processing, and in particular to an image detection method and device and a computer readable storage medium. BACKGROUND

[0002] In the technical field of video image processing, for the recognition and judgment of rainy days, it is usually judged whether it is raining or the weather category is judged according to the road surface situation in the video by the water mist caused by the vehicle passing through the road surface in the video frame, which is easily disturbed by irrelevant objects, cannot detect the case of small rainfall, has poor accuracy, is time-delayed, and has low robustness. SUMMARY

[0003] To solve the above technical problems, the present application provides an image detection method, device and computer readable storage medium.

[0004] To solve the above technical problems, the present application provides an image detection method, device and computer readable storage medium.

[0005] Obtaining a current image in a video stream, and obtaining a reference image;

[0006] Inputting the current image into a rain removal model to obtain a processed image processed by the rain removal model;

[0007] Obtaining a first frame difference image of the current image and the reference image, and a second frame difference image of the processed image and the reference image, respectively;

[0008] Obtaining difference information of the first frame difference image and the second frame difference image, and judging whether the difference information meets a preset condition;

[0009] If yes, it is determined that the scene of the current image is a rainy scene.

[0010] The reference image is a previous frame image of the current image in the video stream.

[0011] The difference information of the first frame difference image and the second frame difference image includes:

[0012] Calculating a third frame difference image of the first frame difference image and the second frame difference image;

[0013] Obtaining a plurality of pixel blocks of the third frame difference image, and calculating the pixel value of each pixel block;

[0014] Obtaining the number of pixel blocks in the third frame difference image whose pixel value is greater than or equal to a preset pixel value threshold;

[0015] Generating the difference information by using the number.

[0016] wherein the third frame difference map is obtained by acquiring a plurality of pixel blocks and calculating a pixel value of each pixel block;

[0017] The first frame difference map is divided into a plurality of first pixel blocks, and the second frame difference map is divided into a plurality of second pixel blocks;

[0018] The first pixel block and the second pixel block at the same position are subtracted to obtain a pixel block on the third frame difference map;

[0019] wherein the difference between the first pixel block and the second pixel block is taken as the pixel value of the pixel block at the same position on the third frame difference map.

[0020] wherein the third frame difference map is obtained by acquiring a plurality of pixel blocks, comprising:

[0021] Based on the video stream, a moving object on the current image is detected to obtain position information of the moving object;

[0022] After the third frame difference map is divided into pixel blocks, the pixel blocks containing the moving object are excluded based on the position information to obtain a plurality of pixel blocks of the third frame difference map.

[0023] wherein the determination of whether the difference information meets the preset condition comprises:

[0024] Based on the difference information, the number of pixel blocks with a pixel value greater than or equal to a preset pixel value threshold is obtained.

[0025] When the number is greater than or equal to a preset number, it is determined that the scene of the current image is a rain scene.

[0026] wherein after determining that the scene of the current image is a rain scene, the image detection method further comprises:

[0027] Continuously acquiring other images in the video stream and acquiring rain images in the other images determined as rain scenes;

[0028] When the scenes of the continuous multiple frames of images are all rain scenes, it is determined that the scene of the video stream is a rain scene.

[0029] wherein after acquiring the current image in the video stream, the image detection method further comprises:

[0030] Acquiring current scene information of the current image;

[0031] When it is determined based on the current scene information that the current image is an indoor scene, the next frame of image of the current image in the video stream is continuously acquired.

[0032] When the current image is determined to be an outdoor scene based on the current scene information, a reference image is obtained.

[0033] To address the aforementioned technical problems, this application also proposes an image detection device, which includes a processor and a memory connected to the processor, wherein...

[0034] The memory stores program instructions;

[0035] The processor is used to execute the program instructions stored in the memory to implement the image detection method described above.

[0036] To address the aforementioned technical problems, this application also proposes a computer-readable storage medium storing program instructions that, when executed, implement the aforementioned image detection method.

[0037] Compared with existing technologies, the beneficial effects of this application are as follows: the image detection device acquires the current image and a reference image from the video stream; the current image is input into a rain removal model to obtain a processed image after processing by the rain removal model; a first frame difference image between the current image and the reference image, and a second frame difference image between the processed image and the reference image are acquired respectively; the difference information between the first frame difference image and the second frame difference image is acquired, and it is determined whether the difference information meets preset conditions. Through the above method, using an image rain removal model for rain removal processing can effectively remove only the rainwater portion of the image in most common scenarios without modifying other image information; furthermore, by comparing the difference information between the first frame difference image and the second frame difference image, it can determine whether it is a rainy day without needing to capture very clear raindrops or detect the image information itself. It can accurately determine whether it is a rainy day based on the difference information, eliminating interference from other factors in the image background, improving the accuracy of rain detection and recognition, reducing the probability of false judgments, and improving robustness. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] in:

[0040] Figure 1 This is a flowchart illustrating the first embodiment of the image detection method provided in this application;

[0041] Figure 2 This is a schematic diagram of the overall process of the image detection method provided in this application;

[0042] Figure 3 yes Figure 1 A schematic diagram of the specific sub-steps of step S14 in the image detection method shown;

[0043] Figure 4 This is a flowchart illustrating the second embodiment of the image detection method provided in this application;

[0044] Figure 5 This is a flowchart illustrating the third embodiment of the image detection method provided in this application;

[0045] Figure 6 This is a schematic diagram of the framework of an embodiment of the image detection device provided in this application;

[0046] Figure 7 This is a schematic diagram of the structure of an embodiment of the computer storage medium provided in this application. Detailed Implementation

[0047] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0048] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0049] To address the technical problems described in the background section, please refer to the following for details. Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating the first embodiment of the image detection method provided in this application. Figure 2 This is a schematic diagram of the overall flow of the image detection method provided in this application.

[0050] like Figure 1As shown, the image detection method in this embodiment specifically includes the following steps:

[0051] Step S11: Obtain the current image in the video stream and obtain the reference image.

[0052] Specifically, video streams can be acquired in real time through video surveillance equipment and transmitted in real time over a network, or retrieved from storage devices. The current image is an image at any moment in the video stream, while the reference image can be any image. For example, the reference image can be the previous frame of the current image, the same image as the current image, or an image at any moment in the video stream containing the current image or in other video streams.

[0053] Step S12: Input the current image into the rain removal model to obtain the processed image after the rain removal model has processed it.

[0054] Specifically, the image detection device can pre-model the rainy scene to obtain a trained rain removal model, such as a rain removal deep neural network. The modeling process is consistent with the conventional neural network training process and will not be described in detail here.

[0055] Among them, the image detection device uses a rain removal model to analyze the current image f. n The image q is obtained by performing rain removal processing on (x,y) using the rain removal model. n (x,y).

[0056] The rain removal model is as follows:

[0057]

[0058] Where O represents the rainy input image, and B represents the clean background layer. This represents a layer of rain lines with the same direction. Summing the rain lines with different directions yields an effect that closely resembles the real scene. α represents the transmission rate, which in the imaging model of atmospheric scattering represents the proportion of light intensity at a point that is attenuated before entering the imaging device. A represents ambient light.

[0059] Step S13: Obtain the first frame difference map between the current image and the reference image, and the second frame difference map between the processed image and the reference image.

[0060] Specifically, both the first frame difference image and the second frame difference image are images composed of pixel differences obtained by subtracting the pixel values ​​of pixels at the same coordinate positions between the two images.

[0061] Optionally, in one embodiment of this application, the reference image may be the previous frame image of the current image in the video stream.

[0062] Specifically, the image detection device detects the current image f n= (x, y) and the previous frame image f of the current image n-1 = (x,y) calculate the frame difference to obtain the first frame difference map D. n = (x, y), and its specific formula is shown below:

[0063] D n (x,y)=|f n (x,y)-f n-1 (x,y)

[0064] The image detection device processes the image q after the rain removal model. n = (x, y) and the previous frame image f of the current image n-1 = (x,y) calculate the frame difference to obtain the second frame difference map E. n = (x, y), and its specific formula is shown below:

[0065] E n (x,y)=|q n (x,y)-f n-1 (x,y)|

[0066] Alternatively, in another embodiment of this application, the reference image may also be a blank image, which is a reference image in which the pixel value of all pixels is 0.

[0067] Specifically, at this time, when the reference image in step S13 above is a blank image, that is, the previous frame image f of the current image. n-1 (x,y)=0, at this time the first frame difference image D n (x,y)=|f n (x,y)-0|, second frame difference map E n (x,y)=|q n (x,y)-0|.

[0068] In this embodiment, the image detection device sets a blank control to perform self-comparison on the current image, eliminating the need to acquire other frame images, reducing comparisons, lowering computational complexity, and improving computational efficiency. Furthermore, while simplifying the comparison process, the device performs rain removal comparison on its own image, making changes more obvious and easier to judge.

[0069] Step S14: Obtain the difference information between the first frame difference image and the second frame difference image, and determine whether the difference information meets the preset conditions.

[0070] The difference information includes, but is not limited to, the differences between the first frame difference map and the second frame difference map in terms of position data, color data, status data, and light transmission data.

[0071] The preset condition can be whether the difference information between the first frame difference map and the second frame difference map is greater than or equal to a preset threshold.

[0072] Specifically, the image detection device acquires difference information in ways including but not limited to the following: processing the difference image D of the first frame... n The sub-block set PD is obtained by performing a block division operation on (x,y). ij And the second frame difference map E n The sub-block set PE is obtained by performing a block division operation on (x, y). ij The image detection device further processes the sub-block set PD ij and sub-block set PE ij The difference between sub-blocks at the same position is calculated. The difference information is obtained by combining the differences of each sub-block. Then, it is determined whether the difference information meets the preset conditions. If the preset conditions are met, the scene of the current image is determined to be a rain scene.

[0073] In another embodiment, the image detection device may first compare the overall differences between the first frame difference image and the second frame difference image to obtain the difference image information, namely the third frame difference image, and then perform block processing on the third frame difference image. Further, by judging whether the difference information meets the preset conditions, if the preset conditions are met, the scene of the current image is determined to be a rain scene.

[0074] This application also proposes an embodiment for further obtaining difference information between the first frame difference map and the second frame difference map. Please refer to the following for details. Figure 2 See also Figure 3 , Figure 3 yes Figure 1 A schematic diagram of the specific sub-steps of step S14 in the image detection method shown.

[0075] The steps of the image detection device acquiring difference information between the first frame difference map and the second frame difference map include:

[0076] Step S141: Calculate the third frame difference map between the first frame difference map and the second frame difference map.

[0077] Specifically, in one embodiment, the third frame difference map can be obtained by the image detection device dividing the first frame difference map and the second frame difference map into blocks, and then the image detection device subtracts the pixel blocks at the same position between the first frame difference map and the second frame difference map to obtain the pixel difference value of each pixel block. Finally, the pixel difference values ​​of all pixel blocks are used to form the third frame difference map.

[0078] In another embodiment, the image detection device can also compare the first frame difference image and the second frame difference image as a whole, that is, directly subtract the pixel values ​​of the first frame difference image from the pixel values ​​of the second frame difference image to obtain the third frame difference image.

[0079] Step S142: Obtain several pixel blocks of the third frame difference image and calculate the pixel value of each pixel block.

[0080] Specifically, the number, size, and shape of pixel blocks in the third frame difference image can be determined by the image detection device based on a preset template or the resolution of the image acquired from the video stream. For example, the preset template can divide the third frame difference image into pixel blocks of 4*4, 8*8, 16*16, etc.; based on the image resolution, the ratio of the number of rows to the number of columns of pixel blocks can be determined according to the ratio of the horizontal resolution to the vertical resolution of the image.

[0081] Further reading is available upon request. Figure 2 To implement the above image detection method, this application also proposes another embodiment. The image detection device first divides the first frame difference image and the second frame difference image into blocks, further obtains several pixel blocks of the third frame difference image, and calculates the pixel value of each pixel block. The specific steps include:

[0082] The image detection device performs block processing on the first frame difference image to obtain several first pixel blocks, and performs block processing on the second frame difference image to obtain several second pixel blocks. Finally, the difference between the first pixel blocks and the second pixel blocks at the same position is calculated to obtain the pixel blocks on the third frame difference image.

[0083] Specifically, the image detection device performs a differential image D on the first frame. n The sub-block set PD is obtained by performing a block division operation on (x,y). ij And the second frame difference map E n The sub-block set PE is obtained by performing a block division operation on (x, y). ij The image detection device further processes the sub-block set PD ij and sub-block set PE ij The difference between sub-blocks at the same position is calculated, and the difference information is obtained by combining the differences of each sub-block.

[0084] The difference between the first pixel block and the second pixel block is used as the pixel value of the pixel block at the same position on the third frame difference map.

[0085] By using a block-based processing method, the image detection device acquires the pixel values ​​of each block for comparison, accurately determining whether the aforementioned differences exist within each pixel block, thereby improving the accuracy of image detection. Even in video stream images with low rainfall, it can still detect accurately. Using pixel blocks as detection units, it is not limited or affected by scene changes, further enhancing the flexibility and sensitivity of image detection.

[0086] Based on the image detection method of step S142 in the above embodiments, in order to further improve the robustness and accuracy of the image detection method and prevent environmental interference, this application also proposes another image detection method for excluding moving objects. Please refer to [the relevant documentation] for details. Figure 2 See alsoFigure 4 , Figure 4 This is a flowchart illustrating the second embodiment proposed in this application. The specific steps are as follows:

[0087] Step S1421: Detect moving objects in the current image based on the video stream to obtain the position information of the moving objects.

[0088] Specifically, the image detection device can capture moving objects in the current image using object detection algorithms or artificial intelligence, thereby obtaining the position information of the moving objects. The specific method for capturing moving objects is arbitrary and not limited here.

[0089] Step S1422: After dividing the third frame difference map into pixel blocks, exclude pixel blocks containing moving objects based on position information to obtain several pixel blocks of the third frame difference map.

[0090] In this embodiment, the image detection device divides the third frame difference image into pixel blocks to obtain several pixel blocks. Then, using the position information of the moving object obtained in step S1421, it analyzes and obtains the pixel blocks containing the moving object, thereby excluding the pixel blocks containing the moving object.

[0091] After excluding moving objects, step S143 is further executed, which can realize the judgment based only on the pixel blocks without moving objects, thereby eliminating the influence of moving objects and improving the robustness and accuracy of image detection.

[0092] Since rain scenes are dynamic processes, their detection can be affected by moving objects. Therefore, this embodiment can effectively eliminate the interference of moving objects in the image by excluding pixel blocks containing moving objects, thereby improving the accuracy of rain scene detection, eliminating the influence of the scene, and adapting to changes in different environments.

[0093] Step S143: Obtain the number of pixel blocks in the third frame difference image whose pixel value is greater than or equal to a preset pixel value threshold.

[0094] Specifically, the image detection device uses the average pixel value, mode, or median of all pixels in each pixel block of the third frame difference image as the pixel value of the pixel block.

[0095] Furthermore, the image detection device compares the pixel value of each pixel block in the third frame difference image with a preset pixel value threshold to count the number of pixel blocks whose pixel value is greater than or equal to the preset pixel value threshold.

[0096] Step S144: Generate difference information using quantity.

[0097] In this embodiment of the application, the image detection device uses the quantity obtained from the comparison in step S143 as difference information to determine the specific scene of the current image. For details, please refer to step S15.

[0098] In other embodiments, the difference information processing includes the number of pixel blocks whose pixel values ​​are greater than or equal to a preset pixel value threshold, and may also include the difference between the pixel value of each pixel block and the preset pixel value threshold, so as to further assist in judging the rain intensity of the rain scene based on determining that the current image is a rain scene.

[0099] Step S15: Determine that the scene of the current image is a rainy scene.

[0100] Specifically, the image detection device obtains the number of pixel blocks with pixel values ​​greater than or equal to a preset pixel value threshold based on the difference information. When the number is greater than or equal to the preset number, the current image scene is determined to be a rain scene.

[0101] Unlike existing technologies, this application uses an image deraining model to process the current image, effectively removing only the rainwater portion of the image for most common scenarios without modifying other image information. Furthermore, the image detection device determines whether the current image scene is rainy by comparing the difference information between the first frame difference image and the second frame difference image. This eliminates the need for capturing very clear raindrops or detecting information within the image itself; the difference information alone is sufficient to accurately determine whether it is rainy. This eliminates interference from other factors in the image background, improves the accuracy of rain detection and recognition, reduces the probability of false positives, and enhances robustness.

[0102] Further, please see Figure 2 After acquiring the scene of each frame of the image, the image detection device can also combine the scenes of multiple frames of images to determine the scene of the video stream.

[0103] Specifically, the image detection device can continue to acquire other images in the video stream, and acquire rain images that are determined to be rain scenes from among the other images. The scene determination of other images can refer to the process of steps S11 to S15 above, and will not be repeated here.

[0104] When multiple consecutive frames of images represent rainy scenes, the image detection device determines that the scene in the video stream is a rainy scene.

[0105] For example, if the number of frames that are determined to be raining within n consecutive frames is greater than a preset threshold, then the scene in the current video stream is determined to be a scene of continuous rain.

[0106] In this embodiment, the image detection device can identify and judge the rain scene by analyzing multiple consecutive frames of images, and can further determine the rain situation within that time period by capturing the target time.

[0107] To implement the above image detection method, this application also includes a pre-processing algorithm module. This module first classifies the current scene. After acquiring the current image from the video stream, the image detection device judges the scene information. By determining whether the scene information is outdoor, it determines whether further scene judgment of the current image is needed. Please refer to [link to relevant documentation]. Figure 2 and Figure 5 , Figure 5 The flowchart of the third embodiment provided in this application shows the specific steps as follows:

[0108] Step S20: Obtain the current scene information of the current image.

[0109] Specifically, the image detection device acquires the current frame from the video stream. This video stream can be acquired in real-time through video surveillance and transmitted over a network, or historical data can be retrieved from storage devices. Scene information is obtained through a scene classification network, specifically as follows:

[0110] The image detection device inputs the current image into a scene classification network. This scene classification network is a multi-label classification network, and the final result for a given scene may have multiple labels. The output layer of its multi-label classification network uses the sigmoid activation function, and the loss function is the binary cross-entropy loss function, as shown in the following formula:

[0111]

[0112]

[0113] Where z is the output layer result of the backbone network. This is the result after applying the sigmoid activation function. y represents the ground truth label value from network training. This is the binary cross-entropy loss function.

[0114] Step S21: When it is determined that the current image is an indoor scene based on the current scene information, continue to acquire the next frame image of the current image in the video stream.

[0115] Specifically, when the scene information is an indoor scene, due to its scene limitations, there is no need to judge it as a rainy scene. Therefore, the image detection device automatically excludes images judged as indoor scenes and continues to acquire the next frame of the current image in the video stream. If the next frame is still an indoor scene, it continues to acquire the next frame of the current image in the video stream until the scene information is no longer indoor information.

[0116] Step S22: When it is determined that the current image is an outdoor scene based on the current scene information, obtain a reference image.

[0117] Specifically, when the image detection device determines that the current scene is an outdoor scene, it further executes the above-mentioned step S12 and subsequent steps to perform rain detection on the current image where the current scene is an outdoor scene. For details, please refer to [link to detailed process]. Figure 1 Steps S12 to S15 of the image detection method shown will not be repeated here.

[0118] In this embodiment, the current scene is first classified. Due to scene limitations, indoor scenes do not need to be judged as rainy scenes. If it is an indoor scene, it is directly judged as a non-rainy scene, which avoids useless calculations, saves computing resources, simplifies the algorithm process, and improves computing efficiency.

[0119] To implement the image detection method in the above embodiments, this application also provides an image detection apparatus. Please refer to [link to relevant documentation]. Figure 6 , Figure 6 This is a schematic diagram of a framework of an embodiment of the image detection device provided in this application.

[0120] The image detection device 500 of this application embodiment includes a processor 51, a memory 52, an input / output device 53, and a bus 54.

[0121] The processor 51, memory 52, and input / output device 53 are respectively connected to the bus 54. The memory 52 stores program data, and the processor 51 is used to execute the program data to implement the image detection method described in the above embodiments.

[0122] In this embodiment, processor 51 can also be referred to as a CPU (Central Processing Unit). Processor 51 may be an integrated circuit chip with signal processing capabilities. Processor 51 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor, or processor 51 can be any conventional processor.

[0123] This application also provides a computer storage medium; please refer to the following: Figure 7 , Figure 7This is a schematic diagram of a computer storage medium according to an embodiment of the present application. The computer storage medium 600 stores a computer program 61, which, when executed by a processor, is used to implement the image detection method of the above embodiment.

[0124] When the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or 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.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. 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.

[0125] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. An image detection method, characterized in that, The image detection method includes: Get the current image in the video stream, and get the reference image; The current image is input into the rain removal model to obtain the processed image after processing by the rain removal model; The first frame difference map between the current image and the reference image, and the second frame difference map between the processed image and the reference image are obtained respectively. Obtain the difference information between the first frame difference map and the second frame difference map, and determine whether the difference information meets the preset conditions; If so, then the scene of the current image is determined to be a rainy scene; The step of obtaining the difference information between the first frame difference map and the second frame difference map includes: Calculate a third frame difference map between the first frame difference map and the second frame difference map; Obtain several pixel blocks of the third frame difference image and calculate the pixel value of each pixel block; In the third frame difference image, the number of pixel blocks whose pixel values ​​are greater than or equal to a preset pixel value threshold is obtained; The difference information is generated using the quantity; The step of determining whether the difference information meets the preset conditions includes: Based on the difference information, the number of pixel blocks whose pixel values ​​are greater than or equal to a preset pixel value threshold is obtained; When the number is greater than or equal to a preset number, the scene of the current image is determined to be a rain scene.

2. The image detection method according to claim 1, characterized in that, The reference image is the previous frame of the current image in the video stream.

3. The image detection method according to claim 1, characterized in that, The step of obtaining several pixel blocks of the third frame difference map and calculating the pixel value of each pixel block includes: The first frame difference map is divided into blocks to obtain several first pixel blocks, and the second frame difference map is divided into blocks to obtain several second pixel blocks. The pixel blocks on the third frame difference map are obtained by subtracting the first pixel block and the second pixel block at the same position. The difference between the first pixel block and the second pixel block is used as the pixel value of the pixel block at the same position on the third frame difference map.

4. The image detection method according to claim 1 or 3, characterized in that, The step of obtaining several pixel blocks of the third frame difference map includes: Based on the video stream, target detection is performed on the moving objects in the current image to obtain the position information of the moving objects; After dividing the third frame difference map into pixel blocks, pixel blocks containing moving objects are excluded based on the position information, resulting in several pixel blocks of the third frame difference map.

5. The image detection method according to claim 1, characterized in that, After determining that the scene of the current image is a rainy scene, the image detection method further includes: Continue acquiring other images from the video stream, and acquire rain images from the other images that are determined to be rainy scenes; When multiple consecutive frames of images are all part of the rain scene, the scene in the video stream is determined to be the rain scene.

6. The image detection method according to claim 1, characterized in that, After acquiring the current image in the video stream, the image detection method further includes: Obtain the current scene information of the current image; When it is determined that the current image is an indoor scene based on the current scene information, the next frame of the current image in the video stream is acquired. When the current image is determined to be an outdoor scene based on the current scene information, a reference image is obtained.

7. An image detection device, characterized in that, The image detection device includes a processor and a memory connected to the processor, wherein... The memory stores program instructions; The processor is used to execute program instructions stored in the memory to implement the image detection method as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, The storage medium stores program instructions, which, when executed, implement the image detection method as described in any one of claims 1-6.