Real-time stroboscopic detection method and device based on scene stable triggering

Through a real-time strobe detection method based on scene stability triggering, G-channel blocked data statistics are used to judge the scene stability and adjust the exposure time, and the adaptability and accuracy of strobe phenomena in the CMOS sensor under the power frequency AC light source is solved, and the automatic detection and correction of strobe is realized.

CN120302164APending Publication Date: 2025-07-11HEFEI JUNZHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410044140.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-11
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The prior art is unable to detect and correct strobe phenomena adaptively when the CMOS sensor is under the power frequency AC light source, especially when the scene changes, which affects the accuracy and viewing of the video content.

Method used

Through a real-time strobe detection method based on scene stability triggering, G-channel blocked data statistics are performed using continuous frame images acquired by the image sensor to judge the scene stability, trigger the strobe detection, and remove the strobe by adjusting the exposure time.

Benefits of technology

The adaptability and accuracy of strobe detection are achieved, the robustness of strobe detection is enhanced, and the exposure time can be automatically adjusted in different scenarios to remove strobe phenomena.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120302164A_ABST
    Figure CN120302164A_ABST
Patent Text Reader

Abstract

The invention provides a real-time stroboscopic detection method and device based on scene stable triggering. The method comprises the following steps: S1, inputting two continuous adjacent frames of raw images acquired by an image sensor; s2, carrying out G-channel block data statistical processing on the continuous frame raw graph, and judging the stable state of the current frame; s3, the stable state of a scene is judged under the condition of the stable state of multiple continuous frames, and stroboscopic detection enabling of the current frame is triggered; s4, performing stroboscopic detection on the current frame based on the stroboscopic detection enabling state; and S5, detecting the stroboscopic stability of the scene by taking the continuous multi-frame stroboscopic state as a condition, and carrying out anti-stroboscopic processing. According to the invention, the scene stability is taken as a triggering condition of stroboscopic detection, so that the adaptability of stroboscopic detection can be realized; and meanwhile, scene stability and scene stroboscopic stability are taken as control conditions, so that the accuracy and robustness of adaptive stroboscopic detection can be enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image processing, and particularly relates to a real-time stroboscopic detection method and device based on scene stable triggering. Background Art

[0002] In the field of image processing, if a CMOS sensor is placed in a power frequency alternating current light source, and there is a mismatch between the rolling shutter exposure time and the power frequency, a regular pattern of bright and dark stripes will be found on the output video, and it will continuously scroll during video preview, looking like it is flickering, which is called stroboscopic. Stroboscopic exists in any alternating current light source, seriously affecting the accuracy and perception of video content, and having a profound impact on all walks of life.

[0003] Currently, most products on the market detect whether there is stroboscopic in the video by manual observation, and then manually control the exposure time to remove the stroboscopic. When the light source or scene used by the product changes, the existing technology does not have the adaptability of stroboscopic detection.

[0004] In view of this, there is an urgent need in the current market for a real-time stroboscopic detection method and correction device based on scene stable triggering, so as to detect and correct different scenes and meet the market demand. Summary of the Invention

[0005] In order to solve the above problems, the purpose of the present application is to provide a real-time stroboscopic detection method and device based on scene stable triggering.

[0006] Specifically, the technical solution of the present invention provides a real-time stroboscopic detection method based on scene stable triggering, and the method includes the following steps:

[0007] S1. Input two consecutive adjacent raw frames collected by an image sensor;

[0008] S2. Perform G-channel block data statistical processing on the consecutive raw frames to judge the stable state of the current frame;

[0009] S3. Based on the stable states of multiple consecutive frames, judge the scene stable state and trigger the stroboscopic detection enable of the current frame;

[0010] S4. Based on the stroboscopic detection enable state, perform stroboscopic detection on the current frame;

[0011] S5. Based on the stroboscopic states of multiple consecutive frames, detect the stability of scene stroboscopic and perform anti-stroboscopic processing.

[0012] According to a preferred embodiment, two consecutive raw frames collected from the image sensor are marked as the first original image data and the second original image data, and step S2 includes the following steps:

[0013] S21. Split the R, G, and B channel pixels of the first original image data and the second original image data, only retain the G channel pixel points, and place them in their original positions to obtain a segmented statistical graph with the same height and a width that is half of the original image, namely the first original image segmented statistical graph and the second original image segmented statistical graph;

[0014] S22. Perform the same segmentation processing on the first original image segmented statistical graph and the second original image segmented statistical graph; calculate the grayscale mean value of each block of the first original image segmented statistical graph and the second original image segmented statistical graph; calculate the mean difference of the corresponding position blocks in the first original image segmented statistical graph and the second original image segmented statistical graph;

[0015] S23. Compare the mean differences of the segmented blocks one by one. If the mean difference is greater than the frame stability threshold, it is considered that the brightness of the currently detected block has changed; the first counter counts the number of blocks with brightness changes, and for each block with a brightness change, the statistical quantity is incremented by one; if the statistical quantity of the counter exceeds the frame stability threshold, it is considered that the current frame is unstable, and the current frame stability flag is set to zero; if the statistical quantity of the counter does not exceed the frame stability threshold, the current frame stability flag is set to the stable state.

[0016] According to a preferred embodiment, step S3 includes the following steps:

[0017] S31. If the current frame stability flag is marked as the stable state, the count of the second counter is incremented by one; if the current frame stability flag is marked as the unstable state, the second counter is set to 0, and the scene stability state flag is set to 0; if the statistical number of the second counter is greater than the scene stability continuous frame number threshold, the scene stability state flag is marked, and S32 is entered; if the statistical number of the second counter is not greater than the scene stability continuous frame number threshold, it is determined that the current scene is unstable, and step S34 is entered;

[0018] Step S32. If the adjacent previous frame is marked with a stroboscopic state flag, the scene stability state flag is set to 0; if the adjacent previous frame is not marked with a stroboscopic state flag, the scene stability state flag obtained in S31 remains unchanged;

[0019] Step S33. If the scene stability state flag is 0, the stroboscopy of the current frame is not detected; if the scene stability state flag is not 0, the stroboscopy of the current frame is detected, and step S4 is entered;

[0020] Step S34. If the scene stability detection result is that the current scene is unstable, the stroboscopic state flag is set to 0, and the stroboscopic state flag of the current scene is updated.

[0021] According to a preferred embodiment, step S4 includes the following steps:

[0022] S41. Detect the value of the scene stability status flag. If it is 0, no stroboscopic detection is performed on the current frame, and the subsequent steps are not continued; if the scene stability status flag is not 0, stroboscopic detection is performed on the current frame;

[0023] S42. Calculate the difference image between the first original image block statistical chart and the second original image block statistical chart; detect the overexposed points of the first original image block statistical chart and the second original image block statistical chart, remove the data at the positions of the overexposed points in the difference image, calculate the row mean value of the difference image, and obtain the one-dimensional row mean matrix of the difference image;

[0024] S43. Perform Gaussian filtering on the one-dimensional row mean matrix of the difference image;

[0025] S44. Determine whether there is stroboscopy in the current frame by detecting the periodicity of the Gaussian filter matrix. According to a preferred embodiment, the step S44 further includes the following steps:

[0026] S441. Draw a curve with the row number as the horizontal axis and the element value of the Gaussian filter matrix as the vertical axis, detect the row numbers where all the peaks and valleys of the Gaussian filter matrix are located, and sort them according to the row number. The start and end points of the curve are not involved in the sorting;

[0027] S442. If the number of sorted rows is less than the minimum extreme value period threshold, it is considered that the curve has no periodicity and there is no stroboscopy in the current frame;

[0028] S443. If the number of sorted rows is not less than the minimum extreme value period threshold, calculate the difference in the row numbers of adjacent extreme values to obtain a one-dimensional matrix;

[0029] S444. Calculate the variance of the one-dimensional matrix; if the variance of the one-dimensional matrix is not less than the period extreme value variance error threshold, there is no stroboscopy in the current frame, and set the frame stroboscopy flag to 0; if the variance of the one-dimensional matrix is less than the period extreme value variance error threshold, there is stroboscopy in the current frame, and set the frame stroboscopy flag to the stroboscopy state.

[0030] According to a preferred embodiment, the S5 further includes the following steps:

[0031] S51. If the frame stroboscopy flag is not set to zero, increment the count of the third counter by one; if the frame stroboscopy flag is zero, set the third counter to zero; if the scene stability status flag is zero, set the third counter to zero; if the third counter is greater than the continuous frame number threshold, it is considered that the scene stroboscopy is continuously stable, and set the stroboscopy status flag;

[0032] S52. If the stroboscopy status flag is set, there is stable stroboscopy in the current scene. Control the rolling shutter exposure time to be an integer multiple of the power frequency period through hardware to achieve the removal of stroboscopy;

[0033] S53. Feed back the stroboscopic state flag to step S32 to control the stroboscopic detection enable of the next frame.

[0034] Specifically, the technical solution of the present invention provides a real-time stroboscopic detection device based on scene stability triggering, and the device includes:

[0035] At least one processor; and

[0036] At least one memory communicatively connected to the processor, wherein:

[0037] The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 6 by invoking the program instructions.

[0038] Therefore, the advantages of this application are as follows: The real-time stroboscopic detection method and device based on scene stability triggering of the present invention can trigger real-time stroboscopic detection and correction based on scene stability, detect changes in scene stability, trigger the stroboscopic detection function, and achieve adaptive removal of stroboscopies by adjusting the exposure time; that is, the advantages of the present invention at least include:

[0039] 1. Using scene stability as the trigger condition for stroboscopic detection can achieve the adaptability of stroboscopic detection;

[0040] 2. Using scene stability and scene stroboscopic stability as control conditions can enhance the accuracy and robustness of adaptive stroboscopic detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and do not limit the present invention.

[0042] Figure 1 It is a schematic flow chart of the real-time stroboscopic detection method based on scene stability triggering of the present invention.

[0043] Figure 2 It is a schematic diagram of G-channel pixel splitting and combination. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] In order to more clearly understand the technical content and advantages of the present invention, the present invention will be further described in detail below with reference to the drawings.

[0045] The following uses specific embodiments to disclose a real-time stroboscopic detection method based on scene stability triggering of the present invention, including the following steps:

[0046] S1. Input two consecutive adjacent frames of raw images collected by CMOS (i.e., the original image data generated by the CMOS image sensor converting the collected light source signal into a digital signal), and label the two frames of raw images as Raw 1 , Rαw 2 ;

[0047] S2. Perform G-channel block data statistical processing on consecutive frames of Raw 1 , Raw 2 to judge the stable state of the current frame;

[0048] S3. Based on the stable state of multiple consecutive frames, judge the scene stable state and trigger the stroboscopic detection enable of the current frame;

[0049] S4. Based on the stroboscopic detection enable state, perform stroboscopic detection on the current frame;

[0050] S5. Based on the stroboscopic state of multiple consecutive frames, detect the stability of scene stroboscopy and perform anti-stroboscopic processing.

[0051] Please participate Figure 1 As shown in, it is a flow schematic diagram of the real-time stroboscopic detection method based on scene stability trigger of the present invention. The so-called scene stability trigger means that if the light is turned on or off or the sensor shakes violently, etc., resulting in a drastic change in the screen brightness, it is not meaningful to detect stroboscopy; taking the brightness change of two consecutive frames as a condition, if the brightness change between the two frames is within the threshold range, the current frame is considered stable; scene stability is used to describe the continuous stability of the frame. If multiple consecutive frames are all stable, the scene is considered stable, and the stroboscopic detection enable is triggered based on this condition.

[0052] Among them, step S1 is the device input link. The device takes two consecutive frames of raw images of the current frame and the previous adjacent frame collected from the CMOS image sensor as input, and labels them as the first original image data Raw 1 and the second original image data Raw 2 , with a size of [H, W] and a data size of 12 bits; assuming that the bayer image type of CMOS is RGGB and the rolling shutter exposure method is adopted.

[0053] Step S2 is to perform G-channel block statistics on the first original image data Raw 1 and the second original image data Raw 2 to perform the stable judgment of the current frame; including the following steps:

[0054] Step S21. In the raw image, since the G-channel accounts for 50%, the G-channel is selected as the data block statistical channel, and the first original image data Raw 1 and the second original image data Raw 2Split the R, G, and B channel pixels, only retain the G channel pixel points, and place them in their original positions. Please refer to Figure 2 As shown in the schematic diagram of the G channel pixel splitting and combination, a block statistical chart with a height of H and a width of W / 2 can be obtained, that is, the first original image block statistical chart G 1 and the second original image block statistical chart G 2 .

[0055] Step S22. Perform the same block processing on the first original image block statistical chart G 1 and the second original image block statistical chart G 2 . The number of blocks is M*N; calculate the average gray value of each block of the first original image block statistical chart G 1 and the second original image block statistical chart G 2 to obtain G 1-bmean , G 2-bmean ; calculate the mean difference of the corresponding position blocks in the first original image block statistical chart G 1 , the second original image block statistical chart G 2 where abs(·) is the absolute value function.

[0056] Step S23. Set the frame stability threshold T diff-bmean , T ratiio-counter , the first counter counter 0 and the current frame stability flag flag0 ∈ {0, 1}; compare the mean differences of the blocks one by one. If the mean difference is greater than the frame stability threshold, that is then it is considered that the brightness of the i-th block currently detected has changed; the first counter counter 0 counts the number of blocks with brightness changes. Every time a block has a brightness change, the statistical quantity is incremented by one, that is If the statistical quantity of the counter exceeds the frame stability threshold, that is, counter 0 > T ratio-counter , it means that the brightness changes violently in two consecutive frames, and the current frame is considered unstable. Set the current frame stability flag to 0, that is, flag0 = 0; if the statistical quantity of the counter does not exceed the frame stability threshold, that is, C ratio-counter <= T ratio-counter , then based on the brightness of the previous frame, the change in the brightness of the current frame is in a stable state. Set the current frame stability flag to 1, that is, flag0 = 1; where counter(·) is the counting function.

[0057] ​Step S3 determines the scene stability state based on the stable state of consecutive multiple frames and triggers the stroboscopic detection enable for the current frame. The stroboscopic detection mentioned herein refers to detecting whether there is a stroboscopic phenomenon in the scene caused by the mismatch between the power frequency and the exposure time of the CMOS sensor. Specifically, it includes the following steps:

[0058] Step S31. Set the threshold T for the number of consecutive stable frames of the scene frame-counter , the scene stability state flag flag1 ∈ {0, 1}, and the second counter counter 1 ; Use the second counter counter 1 to count the consecutive stable frames; if the stable flag of the current frame is marked as the stable state, that is, flag0 = 1, then the count of the second counter is incremented by one, that is, counter 1 = counter 1 + 1; if the stable flag of the current frame is marked as the unstable state, that is, flag0 = 0, then the second counter is set to 0, and the scene stability state flag is set to 0, that is, counter 1 = 0, flag1 = 0; if the count of the second counter is greater than the threshold for the number of consecutive stable frames of the scene, that is, counter 1 > T frame-counter , then it is determined that the current scene is stable, and the scene stability state flag is marked, that is, flag1 = 1, counter 1 = T frame-counter , and enter step S32; if the count of the second counter is not greater than the threshold for the number of consecutive stable frames of the scene, that is, counter 1 ≤ T frame-counter , then it is determined that the current scene is unstable, and enter step S34;

[0059] Step S32. Detect the stroboscopic state flag fliker_flag ∈ {0, 1} of the adjacent previous frame: If the adjacent previous frame is marked with the stroboscopic state flag, that is, fliker_flag = 1, at this time, the scene has been detected as having stable stroboscopics, and the current frame is stable, so the current frame can effectively maintain the stroboscopic state of the previous frame, then set the scene stability state flag to 0, that is, set the scene stability state flag flag1 = 0, and do not trigger the stroboscopic detection enable for the current frame, that is, do not perform stroboscopic detection on the current frame; if the adjacent previous frame is not marked with the stroboscopic state flag, that is, fliker_flag = 0, then there is no stroboscopic in the previous frame, and retain the scene stability state flag obtained in step S31, that is, keep the value of the scene stability state flag flag1 unchanged;

[0060] Step S33. Use the scene stability status flag flag1 as the current frame stroboscopic detection enabling trigger instruction: If the scene stability status flag is zero, i.e., flag1 = 0, then do not detect the stroboscopic of the current frame; if the scene stability status flag is one, i.e., flag1 = 1, then detect the stroboscopic of the current frame;

[0061] Step S34. If the scene stability detection result is that the current scene is unstable, then set the stroboscopic status flag to 0, i.e., fliker_flag = 0, and update the stroboscopic status flag of the current scene. The above scene stability detection result refers to the judgment of whether the current scene detected in step S31 is stable. If the current scenes of multiple consecutive frames are stable, then the current scene is stable; otherwise, the current scene is unstable;

[0062] Among them, step S4 performs stroboscopic detection on the current frame based on the stroboscopic detection enabling status. This step includes the following steps:

[0063] S41. Detect the value of the scene stability status flag flag1. If flag1 = 0, then do not perform stroboscopic detection on the current frame and do not continue to execute the subsequent steps; if the scene stability status flag flag1 = 1, then perform stroboscopic detection on the current frame;

[0064] S42. Calculate the difference image G 1 between the first original image block statistical graph G 2 and the second original image block statistical graph G diff-G = G 1 - G 2 ; Detect the overexposed points of the first original image block statistical graph G 1 and the second original image block statistical graph G 2 , remove the data at the overexposed point positions of the difference image G diff-G in the first original image block statistical graph G 1 and the second original image block statistical graph G 2 , and then calculate the row mean of the difference image G dfff-G to obtain the one-dimensional row mean matrix G diff-G of the difference image G diff-rmean ;

[0065] S43. Perform Gaussian filtering on the one-dimensional row mean matrix G diff-G of the difference image G diff-rmean to smooth the data;

[0066] The above Gaussian filter processing formula is as follows:

[0067]

[0068]

[0069]

[0070] Among them, f(·) is the Gaussian function; k(·) is the weight sum function; 1 / k(·) is the normalized weight coefficient; Ω s is the Gaussian kernel pixel neighborhood of pixel point s; ∑(·) is the accumulation function; exp(·) is the power function with e as the base; σ is the spatial domain filtering coefficient, which controls the filtering intensity of the filter. By adjusting this coefficient, the data smoothing intensity can be controlled. Assume that the spatial position of pixel point p is (p x , p y ), and the spatial position of s is (s x , s y ), then

[0071] S44. Utilize the periodicity of the frame difference between two adjacent consecutive frames with stable stroboscopic, and sample the periodic signal according to the number of rows. Among them, the frame difference is the mean difference of the corresponding position blocks of the first original image block statistical chart and the second original image block statistical chart. According to formula (4), it can be judged whether there is stroboscopic in the current frame:

[0072] D i =A*sin(k*t i +T) (4)

[0073] A is the amplitude; k is the angular frequency; T is the phase; the exposure start time of the i-th row of the n-th frame is t1, and the end time is t2; the exposure start time of the i-th row of the (n + 1)-th frame is t a , and the end time is t4; in the case where the exposure times of the two frames are the same, there is t f =t4 - t2 = t3 - t1, which is the time interval of the same row in two adjacent frames; expt = t4 - t a =t2 - t1, which is the exposure time of the row; the energies obtained respectively during the exposure of the i-th row of the n-th frame and the (n + 1)-th frame are E n,i and E n+1,i ; D i =E n+1,i -E n,i is the energy difference obtained by the i-th row in two consecutive adjacent frames during the exposure; L is the peak value of the AC brightness, and f is the AC operating frequency. Therefore, by detecting the periodicity of the Gaussian filter matrix G gaus-rmean , it can be judged whether there is stroboscopic in the current frame.

[0074] The above step S44 also includes the following steps:

[0075] S441. With the row number as the horizontal axis, the Gaussian filter matrix G gaus-rmeanThe element value is used to draw a waveform curve on the vertical axis to detect the Gaussian filter matrix G gaus-rmean All the row numbers where the wave peaks (local maxima) and wave valleys (local minima) are located, and sort them according to the row numbers to obtain S pos , the starting and ending points of the curve are not involved in the sorting; is the row number where a certain extreme point is located in the curve;

[0076] S442. Set the minimum period threshold T of the extreme value freq , to control the frequency intensity of the detected stroboscopic light; if the stroboscopic period is very large, it can be considered that there is no stroboscopic light in the current frame, that is, if the number of sorted rows is less than the minimum period threshold of the extreme value, that is, |S pos | < T freq , then it is considered that the curve has no periodicity and there is no stroboscopic light in the current frame;

[0077] S443. If the number of sorted rows is not less than the minimum period threshold of the extreme value, that is, |S pos | ≥ T freq , calculate the difference in the number of rows between adjacent extreme values to obtain a one-dimensional matrix

[0078] S444. Calculate the variance of the one-dimensional matrix S diff-pos , denoted as Var(S diff-pos ); set the variance error threshold T of the period extreme value diff-posvar , the stroboscopic light identification flag2 of the current frame; if the variance of the one-dimensional matrix is not less than the variance error threshold of the period extreme value, that is, Var(S diff-pos ) ≥ T diff-posvar , then there is no stroboscopic light in the current frame, and set the frame stroboscopic light identification to zero flag2 = 0; if the variance of the one-dimensional matrix is less than the variance error threshold of the period extreme value, that is, Var(S diff-pos ) < T diff-posvar , then it is considered that there is stroboscopic light in the current frame, and set the frame stroboscopic light identification flag2 = 1; control the stroboscopic light detection intensity through the variance error threshold T of the period extreme value diff-posvar ; Var(·) is the variance calculation function.

[0079] Among them, step S5 is to control the accuracy and robustness of stroboscopic light detection, avoid screen flickering caused by false detection triggering the anti-stroboscopic function, and confirm the stability of scene stroboscopic light based on the stroboscopic light states of multiple consecutive frames. The specific step S5 also includes the following steps:

[0080] S51. Set the third counter counter 2 , the stroboscopic light state flag fliker_flag, and the threshold of the number of consecutive frames is T fliker-counter ; if the frame stroboscopic light identification is set, that is, flag2 = 1, then set the third counter counter 2 = counter 2+1; If the frame stroboscopic flag is zero, i.e., flag2 = 0, then set the third counter to zero, i.e., counter 2 = 0; If the scene stable state flag is zero, i.e., flag1 = 0, then set the third counter to zero, i.e., counter 2 = 0; If the third counter is greater than the continuous frame number threshold, i.e., counter 2 > T fliker-counter , then it is considered that the scene stroboscopy is continuously stable, and set the stroboscopic state flag, i.e., fliker_flag = 1;

[0081] S52. If the stroboscopic state flag is set, i.e., fliker_flag = 1, then the current scene contains stable stroboscopy. By hardware controlling the rolling shutter exposure time expt to be an integer multiple of the power frequency period, the stroboscopy is removed;

[0082] S53. Feed back the stroboscopic state flag fliker-flag to step S32 to control the stroboscopic detection enable of the next frame.

[0083] The present invention also provides a real-time stroboscopic detection device based on scene stability triggering. The device includes: at least one processor; and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor can execute the real-time stroboscopic detection method based on scene stability triggering as described above by invoking the program instructions.

[0084] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, various changes and modifications can be made to the embodiments of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A real-time stroboscopic detection method based on scene-stable triggering, characterized in that It includes the following steps: S1. Input two consecutive adjacent raw images collected by an image sensor; S2. Perform G-channel block data statistical processing on the consecutive raw images to judge the stable state of the current frame; S3. Based on the stable states of multiple consecutive frames, judge the scene stable state and trigger the strobe detection enable of the current frame; S4. Perform strobe detection on the current frame based on the strobe detection enable state; S5. Based on the strobe states of multiple consecutive frames, detect the stability of the scene strobe and perform anti-strobe processing.

2. The real-time stroboscopic detection method based on scene-stable triggering according to claim 1, characterized in that Two consecutive raw images collected from the image sensor are marked as the first original image data and the second original image data. Step S2 includes the following steps: S21. Split the R, G, and B channel pixels of the first original image data and the second original image data, only retain the G-channel pixel points, and place them in the original positions to obtain a block statistical chart with the same height and half the width of the original image, that is, the first original image block statistical chart and the second original image block statistical chart; S22. Perform the same block processing on the first original image block statistical chart and the second original image block statistical chart; calculate the gray mean values of each block of the first original image block statistical chart and the second original image block statistical chart; calculate the mean difference of the corresponding position blocks in the first original image block statistical chart and the second original image block statistical chart; S23. Compare the mean differences of the blocks one by one. If the mean difference is greater than the frame stability threshold, it is considered that the brightness of the currently detected block has changed; the first counter counts the number of blocks with brightness changes, and for each block with brightness change, the statistical quantity is incremented by one; if the counter statistical quantity exceeds the frame stability threshold, it is considered that the current frame is unstable, and the current frame stability flag is set to zero; if the counter statistical quantity does not exceed the frame stability threshold, the current frame stability flag is set to the stable state.

3. A real-time stroboscopic detection method based on scene-stable triggering according to claim 1, wherein The said step S3 includes the following steps: S31. If the current frame stability flag is marked as the stable state, the count of the second counter is incremented by one; if the current frame stability flag is marked as the unstable state, the second counter is set to 0, and the scene stable state flag is set to 0; if the statistical number of the second counter is greater than the scene stable consecutive frame number threshold, mark the scene stable state flag and enter S32; if the statistical number of the second counter is not greater than the scene stable consecutive frame number threshold, it is determined that the current scene is unstable and enter step S34; S32. If the adjacent previous frame is marked with a strobe state flag, the scene stable state flag is set to 0; if the adjacent previous frame is not marked with a strobe state flag, the scene stable state flag obtained in S31 remains unchanged; S33. If the scene stable state flag is 0, the strobe of the current frame is not detected; if the scene stable state flag is not 0, the strobe of the current frame is detected and enter S4; S34. If the scene stable detection result is that the current scene is unstable, the strobe state flag is set to 0 and the strobe state flag of the current scene is updated.

4. A real-time stroboscopic detection method based on scene-stable triggering according to claim 1, characterized in that, The said step S4 includes the following steps: S41. Detect the value of the scene stability status flag. If it is 0, no stroboscopic detection is performed on the current frame, and the subsequent steps are not continued. If the scene stability status flag is not 0, perform stroboscopic detection on the current frame. S42. Calculate the difference image between the first original image block statistical chart and the second original image block statistical chart; Detect the overexposed points of the first original image block statistical chart and the second original image block statistical chart, remove the data at the overexposed point positions of the difference image in the first original image block statistical chart and the second original image block statistical chart, calculate the row mean of the difference image, and obtain the one-dimensional row mean matrix of the difference image. S43. Perform Gaussian filtering on the one-dimensional row mean matrix of the difference image. S44. Determine whether there is stroboscopy in the current frame by detecting the periodicity of the Gaussian filtering matrix.

5. A real-time stroboscopic detection method based on scene-stable triggering according to claim 4, characterized in that, The step S44 further includes the following steps: S441. Make a curve with the row number as the horizontal axis and the element value of the Gaussian filtering matrix as the vertical axis, detect the row numbers where all the peaks and valleys of the Gaussian filtering matrix are located, and sort them according to the row number. The start and end points of the curve are not involved in the sorting. S442. If the number of sorted rows is less than the minimum extreme value period threshold, it is considered that the curve has no periodicity and there is no stroboscopy in the current frame. S443. If the number of sorted rows is not less than the minimum extreme value period threshold, calculate the difference in the number of rows between adjacent extreme values to obtain a one-dimensional matrix. S444. Calculate the variance of the one-dimensional matrix; If the variance of the one-dimensional matrix is not less than the period extreme value variance error threshold, there is no stroboscopy in the current frame, and set the frame stroboscopy flag to 0. If the variance of the one-dimensional matrix is less than the period extreme value variance error threshold, there is stroboscopy in the current frame, and set the frame stroboscopy flag to the stroboscopic state.

6. The real-time stroboscopic detection method based on scene-stable triggering according to claim 1, wherein The S5 further includes the following steps: S51. If the frame stroboscopy flag is not set to zero, increment the count of the third counter by one; If the frame stroboscopy flag is zero, set the third counter to zero; If the scene stability status flag is zero, set the third counter to zero; If the third counter is greater than the continuous frame number threshold, it is considered that the scene stroboscopy is continuously stable, and set the stroboscopic state flag. S52. If the stroboscopic state flag is set, there is stable stroboscopy in the current scene. Control the rolling shutter exposure time to be an integer multiple of the power frequency period through hardware to remove the stroboscopy. S53. Feed back the stroboscopic state flag negatively to step S32 to control the stroboscopic detection enable of the next frame.

7. A real-time stroboscopic detection device based on scene-stable triggering, characterized in that It includes: At least one processor; And At least one memory communicatively connected to the processor, wherein: The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 6 by calling the program instructions.