Method for detecting quiet frame, electronic device and storage medium

The still frame detection method, which combines inter-frame difference and optical flow algorithms, solves the problem of low accuracy in existing still frame detection technologies, and achieves accurate identification of small-amplitude and small-area moving targets, thereby improving the security and stability of video surveillance and broadcast television.

CN115423795BActive Publication Date: 2026-01-23SHENZHEN SKYWORTH RGB ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211153932.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2026-01-23
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of still frame detection in video signals is low, especially when the motion amplitude is small or the moving target is small, which can easily lead to misjudgment, resulting in safety hazards and low detection efficiency.

Method used

The first moving target in the typing state is detected by the inter-frame difference algorithm, and the second moving target not in the typing state is detected by the optical flow algorithm. The accuracy is ensured by combining historical detection results and signal-to-noise ratio.

Benefits of technology

It improves the accuracy of still frame detection, effectively identifies small-amplitude and small-area motion changes, reduces false judgments, and enhances the security and stability of video surveillance and broadcast television.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115423795B_ABST
    Figure CN115423795B_ABST
Patent Text Reader

Abstract

The application discloses a still frame detection method, an electronic device and a storage medium. The still frame detection method comprises the following steps: acquiring a to-be-detected image and a first reference image located in a previous frame of the to-be-detected image; if a first moving target is detected according to an inter-frame difference algorithm, the to-be-detected image and the first reference image, determining whether the first moving target is in a typing state according to a first moving direction of the first moving target; if it is determined that the first moving target is not in the typing state, detecting a second moving target according to an optical flow algorithm, the to-be-detected image and the first reference image; and if no second moving target is detected in the to-be-detected image, determining that a current display picture is a still frame picture. The application solves the technical problem of low accuracy of the prior art still frame detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image display, in particular to a still frame detection method, an electronic device and a storage medium. BACKGROUND

[0002] With the rapid development of the broadcast television and video monitoring industries, the degree of video digitization is accelerating, and the requirements for accurate, safe and continuous video playback are becoming higher and higher. In the process of video playback, it is necessary to detect whether there is object movement in the video image, that is, to determine whether the video signal has a still phenomenon, so as to take timely remedial measures to ensure the completeness and stability of television program broadcasting and the real-time and safety of video monitoring. For example, in the field of video monitoring, security personnel need to observe multiple display screens one by one to ensure that no dangerous situation appears in the video. If there are too many display screens, the security personnel will inevitably be unable to handle them, and if the video is still during this process, the dangerous situation will not be discovered in time, which will bring great security risks. Artificial detection of whether the video appears in a still state has a high risk and is prone to cause fatigue of the staff and failure to discover abnormal situations in time. The current detection method for still frames in a video signal mainly detects the whole picture, determines the number of still frame partitions by partitioning the image, and determines that the still frame partition number is greater than a threshold value as a still image. However, this method is prone to misjudgment in the case of small motion amplitude or small moving targets, resulting in a decrease in the accuracy of still frame detection. SUMMARY

[0003] The main purpose of the present application is to provide a still frame detection method, an electronic device and a storage medium, which aims to solve the technical problem of low accuracy of the prior art still frame detection.

[0004] To achieve the above-mentioned purpose, the present application provides a still frame detection method, which comprises:

[0005] obtaining a to-be-detected image and a first reference image located in a previous frame of the to-be-detected image;

[0006] if a first moving target is detected according to an inter-frame difference algorithm, the to-be-detected image and the first reference image, determining whether the first moving target is in a typing state according to a first moving direction of the first moving target;

[0007] if it is determined that the first moving target is not in the typing state, detecting a second moving target according to an optical flow algorithm, the to-be-detected image and the first reference image;

[0008] if no second moving target is detected in the to-be-detected image, determining that the current display picture is a still frame picture.

[0009] Optionally, the step of determining that the image to be detected is a still frame if no second moving target is detected in the image to be detected includes:

[0010] If no second moving target is detected in the image to be detected, the currently displayed image is determined to be a suspected still frame.

[0011] Obtain the historical detection results of suspected still frames corresponding to historical images to be detected that are a preset first number of frames prior to the image to be detected;

[0012] If the number of times a suspected still frame is identified as a still frame in the historical detection results of each of the aforementioned suspected still frames is greater than or equal to a preset threshold, then the currently displayed frame is determined to be a still frame.

[0013] Optionally, the optical flow algorithm includes a sparse optical flow algorithm, and the step of detecting a second moving target based on the optical flow algorithm, the image to be detected, and the first reference image includes:

[0014] Detect the first corner point in the first reference image;

[0015] According to the sparse optical flow algorithm, a second corner point that matches the first corner point is determined from the image to be detected, and the matching first and second corner points form a corner point pair;

[0016] Based on the relative positional relationship of the corner point pairs, it is determined whether there is a second moving target in the image to be detected.

[0017] Optionally, the step of determining whether a second moving target exists in the image to be detected based on the relative positional relationship of corner point pairs includes:

[0018] On the preset canvas, determine the positions of the first and second corner points in each of the aforementioned corner point pairs;

[0019] Connect the first and second corner points in each of the corner point pairs to obtain the corner point pair connection line;

[0020] If the corner point pair connection line is detected in the preset non-edge area of ​​the canvas, it is determined that there is a second moving target in the image to be detected.

[0021] Optionally, the optical flow algorithm includes a dense optical flow algorithm, and the step of detecting a second moving target based on the optical flow algorithm, the image to be detected, and the first reference image includes:

[0022] Based on the optical flow algorithm, the image to be detected, and the first reference image, the optical flow vector corresponding to each pixel in the image to be detected is determined;

[0023] An optical flow image is generated based on the optical flow modulus and optical flow direction of the optical flow vector;

[0024] If a moving image is detected in the optical flow image, then a second moving target is determined to exist in the image to be detected.

[0025] Optionally, the step of determining the presence of a second moving target in the image to be detected if a moving image is detected in the optical flow image includes:

[0026] The optical flow image is converted to grayscale to obtain an optical flow grayscale image;

[0027] The optical flow grayscale image is adaptively binarized to obtain the image to be detected;

[0028] The second contour of the moving image in the image to be detected is determined according to the contour discovery algorithm;

[0029] If a second contour is detected in a preset non-edge region of the image to be detected, then a second moving target is determined to exist in the image to be detected.

[0030] Optionally, the step of determining whether the first moving target is in a typing state based on the first direction of movement of the first moving target includes:

[0031] Based on the contour discovery algorithm, the target contour corresponding to each of the first moving targets is determined;

[0032] Determine the largest target contour from among all the target contours;

[0033] Determine the minimum bounding rectangle of the maximum target contour;

[0034] If the minimum bounding rectangle is determined to be in a horizontal or vertical state based on its tilt angle, then the first moving target is determined to be in a typing state.

[0035] Optionally, after the step of determining that the currently displayed image is a still frame, the method further includes:

[0036] Acquire a second reference image located a preset second number of frames prior to the image to be detected;

[0037] Determine the first peak signal-to-noise ratio corresponding to the image to be detected, and the average signal-to-noise ratio of the second peak signal-to-noise ratio corresponding to each of the second reference images;

[0038] If the difference between the first peak signal-to-noise ratio and the average signal-to-noise ratio is greater than or equal to a preset difference threshold, then the still frame is determined to be subject to noise interference.

[0039] If the difference between the first peak signal-to-noise ratio and the average signal-to-noise ratio is less than a preset difference threshold, then the still frame is determined to be a completely still frame.

[0040] This application also provides an electronic device, which is a physical device, comprising: a memory, a processor, and a program of the still frame detection method stored in the memory and executable on the processor. When the program of the still frame detection method is executed by the processor, it can implement the steps of the still frame detection method as described above.

[0041] This application also provides a storage medium, which is a computer-readable storage medium, on which a program implementing a still frame detection method is stored. When the program implementing the still frame detection method is executed by a processor, it implements the steps of the still frame detection method as described above.

[0042] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the still frame detection method described above.

[0043] This application provides a still frame detection method, electronic device, and storage medium. By acquiring an image to be detected and a first reference image located in the frame preceding the image to be detected, if a first moving target is detected according to the inter-frame difference algorithm, the image to be detected, and the first reference image, then based on the first movement direction of the first moving target, it is determined whether the first moving target is in a typing state. This achieves the detection of whether the first moving target in the two frames is in a typing state using the inter-frame difference algorithm. Furthermore, if it is determined that the first moving target is not in a typing state, a second moving target is detected according to the optical flow algorithm, the image to be detected, and the first reference image. This achieves the detection of the second moving target not in a typing state using the optical flow algorithm. Finally, if no second moving target is detected in the image to be detected, the current display screen is determined to be a still frame, thus achieving still frame detection. Because the changes in pixels in the overall image are very small during typing, they are difficult to detect using still frame partitioning detection or optical flow methods, or are easily judged as noise or error, leading to misjudgment of still frames. This application can quickly detect typing by using an inter-frame difference algorithm. For second moving targets that are not in typing, optical flow can be used for accurate detection. Compared with still frame partitioning detection, it has higher accuracy in detecting subtle pixel movements such as cursor movement, thus effectively improving the accuracy of still frame detection and overcoming the technical problem of low accuracy in still frame detection in existing technologies. Attached Figure Description

[0044] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0045] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a schematic diagram of the electronic device structure of the hardware operating environment involved in the still frame detection method in this application embodiment;

[0047] Figure 2 This is a schematic diagram of the cursor movement scenario in an embodiment of this application;

[0048] Figure 3 This is a flowchart illustrating an embodiment of the still frame detection method of this application;

[0049] Figure 4 This is a schematic diagram of a scenario with a tilt angle in an embodiment of this application;

[0050] Figure 5 This is a schematic diagram illustrating a scenario of image storage format conversion in one possible implementation of this application;

[0051] Figure 6 This is a flowchart illustrating another embodiment of the still frame detection method of this application.

[0052] Explanation of icon numbers:

[0053] Reference Name Reference Name 1 Position of previous frame 2 Current position 3 Minimum bounding rectangle 4 Horizontal line 5 Vertical line 6 Angle of inclination

[0054] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0055] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0056] With the rapid development of industries such as broadcasting, television, and video surveillance, the digitization of video is accelerating, and the requirements for accurate, secure, and continuous video playback are becoming increasingly stringent. Detecting moving objects in the video image during playback—that is, determining whether the video signal is static—allows for timely remedial measures to ensure the integrity and stability of television program broadcasts and the real-time performance and security of video surveillance. For example, in the field of video surveillance, security personnel need to observe multiple displays one by one to ensure that no dangerous situations appear in the video. If there are too many displays, security personnel will inevitably be overwhelmed. If the video freezes during this process, and dangerous situations are not detected in time, it will pose a significant security risk. Manually checking for static video is highly risky and prone to staff fatigue, making it difficult to detect anomalies promptly. Current methods for detecting still frames in video signals mainly rely on the similarity between consecutive frames or the pixel distribution within a frame to determine whether a still frame has appeared. For example, a weighted sum of each frame is obtained by weighted summing of pixel YUV values, and then the weighted sums are compared. However, this method involves a large amount of pixel data, and the weighted summing calculation will inevitably bring a lot of computational overhead. The algorithm is relatively complex, consumes a lot of resources, and the detection results are not accurate. Another method is to detect the entire screen by dividing the image into partitions and determining the number of still frame partitions. Images with a number of still frame partitions greater than a threshold are judged as still images. However, this method is prone to misjudgment when the motion amplitude is small or the moving target is small, which leads to a decrease in the accuracy of still frame detection.

[0057] This application uses an inter-frame difference algorithm to quickly detect the first moving target in the typing state, and uses optical flow to detect the second moving target not in the typing state. For small amplitude and small area changes caused by typing, the inter-frame difference algorithm can quickly determine the direction of motion and perform accurate identification. For other small amplitude and small area changes, such as cursor movement, especially subtle changes in complex backgrounds, although the visible changes in the image are small, the process of change is not insignificant. Figure 1 , Figure 1 The cursor moved from position 1 in the previous frame to position 2 in the current frame. No pixels were added or removed in the overall image, and the background itself was quite complex. Therefore, this movement of the cursor was difficult to detect. It should be noted that... Figure 1 The text color in the background is lightened to highlight the change of the cursor. In the actual image used for detection, the change of the cursor is more difficult to detect. However, if its movement trajectory from position 1 in the previous frame to the current position 2 can be visualized, it is easy to detect. Therefore, this application detects the movement trajectory of moving targets by optical flow method, which can more accurately detect moving targets with small amplitude and small area changes.

[0058] Reference Figure 2 ,Figure 2 This is a schematic diagram of the electronic device structure of the hardware operating environment involved in the still frame detection method in this application embodiment. The electronic device in this disclosure embodiment may include, but is not limited to, a television, an OLED display, an LCD (Liquid Crystal Display), an LED (light-emitting diode) display, etc.

[0059] like Figure 2 As shown, the electronic device further includes: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a network interface 1003, and a memory 1004. The communication bus 1002 is used to enable communication between these components. The network interface 1003 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1004 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1004 may also optionally be a storage device independent of the aforementioned processor 1001.

[0060] Optionally, the terminal may also include a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, a WiFi module, and so on. Sensors may include light sensors, motion sensors, and other sensors. Specifically, light sensors may include ambient light sensors and proximity sensors. The ambient light sensor can adjust the display brightness according to the ambient light level, while the proximity sensor can turn off the display and / or backlight when the mobile terminal is moved to the ear. As a type of motion sensor, a gravity accelerometer can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity, and can be used for applications that identify the mobile terminal's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition functions (such as pedometers, taps), etc. Of course, the mobile terminal may also be equipped with other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, which will not be elaborated here.

[0061] Those skilled in the art will understand that Figure 2 The structure shown does not constitute a limitation on the operating equipment and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0062] like Figure 2As shown, the memory 1004, which serves as a storage medium, may include an operating system, a data storage module, a network communication module, and a still frame detection program.

[0063] exist Figure 2 In the illustrated operating device, the network interface 1003 is mainly used for data communication with other devices. The processor 1001 and memory 1004 in the operating device of this invention can be located within the operating device. The operating device calls the still frame detection program stored in the memory 1004 through the processor 1001 and performs the following operations:

[0064] Acquire the image to be detected and a first reference image located in the frame preceding the image to be detected;

[0065] If a first moving target is detected based on the inter-frame difference algorithm, the image to be detected, and the first reference image, then it is determined whether the first moving target is in a typing state based on the first movement direction of the first moving target.

[0066] If it is determined that the first moving target is not in a typing state, then a second moving target is detected based on the optical flow algorithm, the image to be detected, and the first reference image;

[0067] If no second moving target is detected in the image to be detected, the currently displayed image is determined to be a still frame.

[0068] Furthermore, the processor 1001 can call the still frame detection program stored in the memory 1004 and also perform the following operations:

[0069] If no second moving target is detected in the image to be detected, the currently displayed image is determined to be a suspected still frame.

[0070] Obtain the historical detection results of suspected still frames corresponding to historical images to be detected that are a preset first number of frames prior to the image to be detected;

[0071] If the number of times a suspected still frame is identified as a still frame in the historical detection results of each of the aforementioned suspected still frames is greater than or equal to a preset threshold, then the currently displayed frame is determined to be a still frame.

[0072] Furthermore, the processor 1001 can call the still frame detection program stored in the memory 1004 and also perform the following operations:

[0073] Detect the first corner point in the first reference image;

[0074] According to the sparse optical flow algorithm, a second corner point that matches the first corner point is determined from the image to be detected, and the matching first and second corner points form a corner point pair;

[0075] Based on the relative positional relationship of the corner point pairs, it is determined whether there is a second moving target in the image to be detected.

[0076] Furthermore, the processor 1001 can call the still frame detection program stored in the memory 1004 and also perform the following operations:

[0077] On the preset canvas, determine the positions of the first and second corner points in each of the aforementioned corner point pairs;

[0078] Connect the first and second corner points in each of the corner point pairs to obtain the corner point pair connection line;

[0079] If the corner point pair connection line is detected in the preset non-edge area of ​​the canvas, it is determined that there is a second moving target in the image to be detected.

[0080] Furthermore, the processor 1001 can call the still frame detection program stored in the memory 1004 and also perform the following operations:

[0081] Based on the optical flow algorithm, the image to be detected, and the first reference image, the optical flow vector corresponding to each pixel in the image to be detected is determined;

[0082] An optical flow image is generated based on the optical flow modulus and optical flow direction of the optical flow vector;

[0083] If a moving image is detected in the optical flow image, then a second moving target is determined to exist in the image to be detected.

[0084] Furthermore, the processor 1001 can call the still frame detection program stored in the memory 1004 and also perform the following operations:

[0085] The optical flow image is converted to grayscale to obtain an optical flow grayscale image;

[0086] The optical flow grayscale image is adaptively binarized to obtain the image to be detected;

[0087] The second contour of the moving image in the image to be detected is determined according to the contour discovery algorithm;

[0088] If a second contour is detected in a preset non-edge region of the image to be detected, then a second moving target is determined to exist in the image to be detected.

[0089] Furthermore, the processor 1001 can call the still frame detection program stored in the memory 1004 and also perform the following operations:

[0090] Based on the contour discovery algorithm, the target contour corresponding to each of the first moving targets is determined;

[0091] Determine the largest target contour from among all the target contours;

[0092] Determine the minimum bounding rectangle of the maximum target contour;

[0093] If the minimum bounding rectangle is determined to be in a horizontal or vertical state based on its tilt angle, then the first moving target is determined to be in a typing state.

[0094] Furthermore, the processor 1001 can call the still frame detection program stored in the memory 1004 and also perform the following operations:

[0095] Acquire a second reference image located a preset second number of frames prior to the image to be detected;

[0096] Determine the first peak signal-to-noise ratio corresponding to the image to be detected, and the average signal-to-noise ratio of the second peak signal-to-noise ratio corresponding to each of the second reference images;

[0097] If the difference between the first peak signal-to-noise ratio and the average signal-to-noise ratio is greater than or equal to a preset difference threshold, then the still frame is determined to be subject to noise interference.

[0098] If the difference between the first peak signal-to-noise ratio and the average signal-to-noise ratio is less than a preset difference threshold, then the still frame is determined to be a completely still frame.

[0099] This application provides a still frame detection method. In the first embodiment of the still frame detection method of this application, refer to... Figure 3 The still frame detection method includes the following steps:

[0100] Step S10: Obtain the image to be detected and the first reference image located in the frame preceding the image to be detected;

[0101] In this embodiment, it should be noted that the still frame detection method is applied to a display device, which may include, but is not limited to, a television or a monitor linearly connected to a user device, such as an OLED monitor, LCD, or LED monitor. The monitor may be linearly connected to the user device via an HDMI (High Definition Multimedia Interface), VGA (Video Graphics Array), or DP (DisplayPort) interface, thereby receiving and outputting video signals transmitted by the user device. The user device may include portable terminal devices such as laptops, computers, tablets, and mobile phones.

[0102] A still frame refers to a situation where the image of the current frame has not changed compared to the previous frame. When the video data played by the display device is still frame video data, it indicates that there is a playback abnormality in the video data played by the display device. The cause of the abnormality may be a hardware abnormality, a software abnormality, or an abnormality in the transmission of video data bitstream. If still frames appear continuously, it may damage the display screen.

[0103] Specifically, a frame image is obtained from the video as the image to be detected, and the previous frame image of the image to be detected is obtained as the first reference image. The method of obtaining the image to be detected includes obtaining it from the video stream, taking a screenshot, or taking a picture.

[0104] In one feasible approach, the specification adjustment is performed by cropping a portion of the screenshot image corresponding to the area to be detected. The area to be detected can be determined according to actual needs. For example, it can be determined based on the position of the information prompt pop-up on the screen. Such information prompt pop-ups usually appear in the four edges of the screen. Therefore, the area to be detected can be a part of the center of the screenshot image, or it can be the area above the nth row of pixels from the bottom up in the screenshot image, etc. When the user device is not in use, a pop-up message may appear. Such messages are usually unrelated to whether the user device is being operated. If the display detects a static image entering the screen saver, the electronic device determines that the image is dynamic due to the message and exits the screen saver. At this time, since the screen saver is not released due to user operation, it may re-enter the screen saver after a period of time. That is, the process of exiting the screen saver due to the message is actually an invalid operation, and it also consumes the device's computing power and power. By pre-removing areas that may cause erroneous operations by cropping the area to be detected, not only can the amount of computation required for subsequent moving target detection be reduced, but the above-mentioned invalid exit of the screen saver can also be effectively avoided.

[0105] In this embodiment, by adjusting the specifications and grayscale, the computational load of subsequent moving target detection can be effectively reduced, thereby improving the detection efficiency of still frame detection.

[0106] Step S20: If a first moving target is detected based on the inter-frame difference algorithm, the image to be detected, and the first reference image, then determine whether the first moving target is in a typing state based on the first movement direction of the first moving target.

[0107] In this embodiment, the grayscale values ​​of the image to be detected and the first reference image are differentially analyzed using an inter-frame difference algorithm. The absolute value of the grayscale difference between the two frames is calculated. If the absolute value of the grayscale difference at a certain point is 0 or less than or equal to a preset threshold, it can be considered that no moving object has passed through that point. If the absolute value of the grayscale difference at a certain point is not 0 or greater than the preset threshold, it can be considered that a moving object has passed through that point. In one feasible implementation, the k-th frame and the (k+1)-th frame image f k (x,y), f k+1 The change between (x, y) is represented by a binary difference image D(x, y), where D(x, y = 1, if |f k+1 (x,y)-f k (x,y)|>T,else,0.

[0108] If, based on the inter-frame difference algorithm, the image to be detected, and the first reference image, no first moving target is detected in the image to be detected, it indicates that the two frames are almost completely overlapping, that is, the screen is in a static state, and the currently displayed screen is determined to be a still frame.

[0109] If a first moving target is detected from the image to be detected based on the inter-frame difference algorithm, the image to be detected, and the first reference image, then the first contour of the first moving target is determined. Based on the first contour, the first movement direction of the first moving target is determined by image recognition technology or the tilt angle of the circumscribed rectangle, etc., and then the first movement direction is matched with a preset typing movement direction. If the first movement direction matches the preset typing movement direction, then the first moving target is determined to be in a typing state. If the first movement direction does not match the preset typing movement direction, then the first moving target is determined not to be in a typing state. The preset typing movement direction can be a horizontal or vertical direction. Other movement states generally do not exhibit regular horizontal or vertical movements. Therefore, it is possible to quickly and easily determine whether the first moving target is in a typing state based on whether the first movement direction is horizontal or vertical.

[0110] In one feasible approach, the step of determining the first contour of the first moving target includes: acquiring an initial contour obtained after inter-frame difference algorithm operation, and enlarging the initial contour using morphological operations to obtain the first contour of the first moving target. The morphological operations include dilation, erosion followed by dilation, or dilation followed by erosion. When detecting an object using the inter-frame difference algorithm, if the object almost completely overlaps in two frames, it cannot be detected, meaning the image is static. If a moving target can be detected, its contour will be obtained. However, the moving target may contain voids. Therefore, dilation, erosion, etc., can be used to obtain a more accurate boundary contour. Especially for a first moving target with a small amplitude of motion, the initial contour obtained by the inter-frame difference algorithm may be small. Defining the size of the structuring element and then using dilation to enlarge the initial contour can make the first moving target more clearly and accurately displayed in the image.

[0111] In one feasible approach, the step of determining the first contour of the first moving target includes: determining a binary image of the first moving target through adaptive binarization, and extracting contours from the binary image using a contour discovery algorithm to obtain the first contour of the first moving target. Through adaptive binarization, a binarization threshold for the region is adaptively determined based on the distribution characteristics of the image pixel neighborhood blocks, and the foreground and background are automatically segmented using the binarization threshold. The foreground is the contour of the moving target. The adaptive binarization includes a Gaussian weighted sum algorithm, which calculates the distance from the center point to the pixels surrounding the center point in the region using a Gaussian function, effectively covering scenes with varying pixel values.

[0112] Optionally, the step of determining whether the first moving target is in a typing state based on the first direction of movement of the first moving target includes:

[0113] Step A10: Determine the target contour corresponding to each of the first moving targets according to the contour discovery algorithm;

[0114] In this embodiment, a binary difference image generated after the inter-frame difference algorithm is obtained, and the target contour corresponding to each of the first moving targets is extracted from the binary difference image according to the contour discovery algorithm.

[0115] Step A20: Determine the largest target contour with the largest area from all the target contours;

[0116] In this embodiment, the area of ​​each target contour is compared, and the target contour with the largest area is determined as the largest target contour.

[0117] In one feasible approach, the step of determining the largest target contour from among the target contours includes: determining any one target contour as the largest target contour, traversing the area of ​​all target contours, and if there is a second target contour with a larger area than the largest target contour, determining the second target contour as the largest target contour, until all target contours have been traversed, thereby determining the largest target contour.

[0118] Step A30: Determine the minimum bounding rectangle of the maximum target contour;

[0119] Step A40: If the minimum bounding rectangle is determined to be in a horizontal or vertical state based on its tilt angle, then the first moving target is determined to be in a typing state.

[0120] In this embodiment, the minimum bounding rectangle of the maximum target contour is determined. The sides of the minimum bounding rectangle are compared with a horizontal or vertical line to determine the tilt angle of the minimum bounding rectangle. For example, referring to... Figure 4 The angle between the width of the minimum bounding rectangle 3 and the horizontal line 4 can be defined as the tilt angle 6, or the angle between the width of the minimum bounding rectangle 3 and the vertical line 5 can be defined as the tilt angle (not shown in the figure). Based on whether the tilt angle is within a preset angle range, it is determined whether the minimum bounding rectangle is in a horizontal or vertical state. If the tilt angle is within the preset angle range, the minimum bounding rectangle is determined to be in a horizontal or vertical state, and the first moving target is determined to be in a typing state. If the tilt angle is not within the preset angle range, the minimum bounding rectangle is determined to be neither horizontal nor vertical, and the first moving target is determined not to be in a typing state. Here, the tilt angle is the size of the angle formed between the longer or shorter side of the minimum bounding rectangle and the horizontal or vertical line. Since the longer side of the minimum bounding rectangle detected in the typing state may be horizontal or vertical, the preset angle range can be 0 degrees or 90 degrees, or a certain error range can be set, that is, the preset angle range can be 0 to 5 degrees or 85 to 90 degrees, such as 0 degrees, 3 degrees, 5 degrees, 85 degrees, 88 degrees, 90 degrees, etc.

[0121] Step S30: If it is determined that the first moving target is not in a typing state, then the second moving target is detected according to the optical flow algorithm, the image to be detected, and the first reference image;

[0122] In this embodiment, it should be noted that although the inter-frame difference algorithm has a fast calculation speed, its detection accuracy is low when the motion amplitude is small or the moving target is small. If the inter-frame difference algorithm determines that the first moving target is not in the typing state, the detected first moving target may be generated by dynamic scenes or noise generated by still frames. Therefore, further judgment is required.

[0123] Specifically, if it is determined that the first moving target is not in a typing state, then the second moving target in the image to be detected and the first reference image is detected according to the optical flow algorithm, wherein the optical flow algorithm includes dense optical flow algorithm and sparse optical flow algorithm, etc.

[0124] If it is determined that the first moving target is in a typing state, then the currently displayed screen is determined to be a dynamic screen.

[0125] It should be noted that the number of first moving targets detected in the image to be detected may be 0, 1, or more. The more first moving targets there are, the longer it takes to determine the typing state, and there is a risk of false positives due to noise. Therefore, if more than one first moving target is detected, it can be determined whether each first moving target is in a typing state based on its corresponding first movement direction. If any first moving target is determined to be in a typing state, the current display screen is considered a dynamic screen. If none of the first moving targets are determined to be in a typing state, a second moving target is detected based on the optical flow algorithm, the image to be detected, and the first reference image. If more than one first moving target is detected, a preset number (e.g., 1, 2, etc.) of first moving targets can be selected from the first moving targets, and the determination of each first moving target's typing state can be made based on its corresponding first movement direction. The method involves determining whether the first moving target to be detected is in a typing state. If any one of the first moving targets is determined to be in a typing state, the current display screen is considered a dynamic screen. If none of the first moving targets are determined to be in a typing state, a second moving target is detected based on the optical flow algorithm, the image to be detected, and the first reference image. The method of selecting a preset number of first moving targets from each of the first moving targets can be based on the contour area, position, etc., of each first moving target. For example, a first moving target with a contour area greater than a preset area threshold can be selected as a first moving target to be detected, or a first moving target located in a preset non-edge region can be selected as a first moving target to be detected. First moving targets with a contour area less than the preset area threshold or located in the edge region of the image may be generated by noise or detection errors. Pre-filtering can not only reduce the amount of computation but also improve the detection accuracy.

[0126] Optionally, the optical flow algorithm includes a dense optical flow algorithm, and the step of detecting a second moving target based on the optical flow algorithm, the image to be detected, and the first reference image includes:

[0127] Step B10: Determine the optical flow vector corresponding to each pixel in the image to be detected based on the optical flow algorithm, the image to be detected, and the first reference image;

[0128] In this embodiment, it should be noted that optical flow refers to the change in grayscale values ​​between pixels in a video image, i.e., the instantaneous velocity of a moving object. The optical flow method studies the optical flow field of a video image sequence and uses the difference between the optical flow information of the moving object in the image and the optical flow information of the background to determine the position of the moving object, thereby detecting the moving target. The dense optical flow algorithm uses two adjacent frames to estimate the optical flow vector of the object. Its implementation method is as follows: first, a polynomial expansion method is used to approximate the neighborhood of each pixel using a quadratic polynomial. Then, by analyzing the polynomial expansion coefficients of the pixels in the two frames, the displacement vector of the optical flow field is estimated. This method calculates the instantaneous velocity of all pixels in the image, with high accuracy, high robustness and reliability, meeting the actual needs of video still frame detection.

[0129] Specifically, based on the dense optical flow algorithm, each pixel in the image to be detected and the first reference image is compared to determine the optical flow field corresponding to the image to be detected, and the optical flow vector corresponding to each pixel in the optical flow field is determined. It should be noted that the optical flow vector corresponding to the pixel that has changed has an optical flow magnitude and an optical flow direction, while the optical flow vector corresponding to the pixel that has not changed has an optical flow magnitude of 0 or a minimum value, and the optical flow vector at this time is a point.

[0130] In one feasible approach, if the image to be detected and / or the first reference image is an image stored in RGBA format, since the transparency of the A channel has little impact on still frame detection and introduces additional computational overhead, the image to be detected and / or the first reference image in RGBA format can be converted to RGB format. (Refer to...) Figure 5 The method of converting the image to be detected and / or the first reference image in RGBA storage format into RGB storage format includes: extracting single-channel data of R channel, G channel and B channel from the image data in RGBA storage format at intervals of four positions, merging the single-channel data of R channel, G channel and B channel corresponding to each pixel to obtain an image in RGB storage format.

[0131] In one feasible approach, before the step of determining the optical flow vector corresponding to each pixel in the image to be detected based on the optical flow algorithm, the image to be detected, and the first reference image, the method may further include: converting the image to be detected and the first reference image to grayscale to reduce the computational load.

[0132] In one feasible approach, before the step of determining the optical flow vector corresponding to each pixel in the image to be detected based on the optical flow algorithm, the image to be detected, and the first reference image, the method may further include: compressing the image to be detected and the first reference image to reduce the computational load by reducing the image size or reducing the image quality.

[0133] Step B20: Generate an optical flow image based on the optical flow modulus and optical flow direction of the optical flow vector;

[0134] In this embodiment, specifically, the optical flow components in the x-direction and y-direction of each pixel are determined. Based on the magnitude and direction of the optical flow components in the x-direction and y-direction, the coordinates of the optical flow components in the x-direction and y-direction can be converted from Cartesian coordinates to polar coordinates. This allows the determination of the optical flow magnitude and direction of the optical flow vector corresponding to each pixel in the image to be detected. The optical flow direction is represented in radians, and the optical flow direction is used as hue information, while the optical flow magnitude is used as saturation information. The brightness information is determined to a preset value, or the optical flow magnitude is normalized and used as brightness information, allowing the brightness of the optical flow image to fluctuate within a certain range. This allows the determination of the color in the HSV color space corresponding to each optical flow vector, resulting in an optical flow image. In the optical flow image, the non-moving parts are almost identical, and therefore present almost identical colors, which can be used as the background color of the optical flow image. The moving parts, due to their different speeds, present different colors, thus forming a corresponding motion image on the background color.

[0135] Step B30: If a moving image is detected in the optical flow image, then a second moving target is determined to exist in the image to be detected.

[0136] In this embodiment, specifically, motion images in the optical flow image are identified using image recognition technology, contour recognition algorithms, etc. If a motion image is detected in the optical flow image, a second moving target is determined to exist in the image to be detected; if no motion image is detected in the optical flow image, a second moving target is determined to not exist in the image to be detected.

[0137] Optionally, the step of determining the presence of a second moving target in the image to be detected if a moving image is detected in the optical flow image includes:

[0138] Step B41: Convert the optical flow image to grayscale to obtain an optical flow grayscale image;

[0139] Step B42: Adaptive binarization is performed on the optical flow grayscale image to obtain the image to be detected;

[0140] Step B43: Determine the second contour of the moving image in the image to be detected according to the contour discovery algorithm;

[0141] Step B44: If a second contour is detected in a preset non-edge region of the image to be detected, then it is determined that a second moving target exists in the image to be detected.

[0142] In this embodiment, specifically, the optical flow image is converted to grayscale to obtain an optical flow grayscale image. The optical flow grayscale image is then adaptively binarized to obtain a detection image. Contour extraction is performed on the detection image according to a contour discovery algorithm. If no second contour can be extracted, it is determined that a second moving target does not exist in the detection image. If at least one second contour of a moving image can be extracted, each second contour is sequentially traversed, and it is detected whether the position of each second contour is within a preset non-edge region of the detection image. If a second contour is detected in the preset non-edge region of the detection image, it is determined that a second moving target exists in the detection image. If no second contour is detected in the preset non-edge region of the detection image, it is determined that a second moving target does not exist in the detection image. The binarized grayscale image contains only image blocks with moving pixels, and other areas besides the moving pixels are black backgrounds. The preset non-edge region can be a region in the image that is greater than or equal to a preset number of pixels (e.g., 20 pixels, 30 pixels, etc.) away from the image edge.

[0143] In one feasible approach, the step of detecting whether each of the second contours is located in a preset non-edge region of the binarized image includes: traversing all the second contours, drawing the minimum bounding rectangle of each of the second contours respectively, determining the coordinates of the center point of each minimum bounding rectangle, and determining whether the coordinates of each center point are located in a preset non-edge region of the binarized image.

[0144] In actual development, it was found that noise interference exists at the edges of images, which is not conducive to the judgment of still frames. Filtering out moving targets at the edges of images can effectively reduce noise interference.

[0145] Step S40: If no second moving target is detected in the image to be detected, the currently displayed image is determined to be a still frame.

[0146] In this embodiment, if no second moving target is detected in the image to be detected, the currently displayed image is determined to be a still frame; if a second moving target is detected in the image to be detected, the currently displayed image is determined to be a dynamic frame.

[0147] Optionally, the step of determining that the image to be detected is a still frame if no second moving target is detected in the image to be detected includes:

[0148] Step S41: If no second moving target is detected in the image to be detected, the currently displayed image is determined to be a suspected still frame.

[0149] Step S42: Obtain the historical detection results of suspected still frames corresponding to historical images to be detected that are a preset first number of frames prior to the image to be detected;

[0150] Step S43: If the number of times a suspected still frame is determined to be a still frame is greater than or equal to a preset threshold in the historical detection results of each suspected still frame, then the currently displayed frame is determined to be a still frame.

[0151] In this embodiment, specifically, if no second moving target is detected in the image to be detected, the current display screen is determined to be a suspected still frame. The historical detection results of suspected still frames corresponding to historical images to be detected that are a preset first number of frames prior to the image to be detected are obtained. The number of times each of the historical detection results of suspected still frames is determined to be a suspected still frame is determined. If the number of times it is determined to be a suspected still frame is greater than or equal to a preset threshold, the current display screen is determined to be a still frame. If the number of times it is determined to be a suspected still frame is less than the preset threshold, the current display screen is determined to be a moving image. Increasing the number of determinations can effectively reduce false determinations and improve the accuracy of the detection results.

[0152] In one feasible approach, the preset number threshold is half of the preset first number. That is, if the number of times a suspected still frame is determined to be a still frame is greater than or equal to half of the preset first number, then the currently displayed image is determined to be a still frame. For example, if the preset first number is 4, then a total of 4 historical detection results of suspected still frames can be obtained. If the number of times a suspected still frame is determined to be a still frame is greater than or equal to 2, since the current image to be detected is determined to be a suspected still frame, at least 3 suspected still frames are detected out of the 5 determination results, which is more than half. That is, in the historical detection results and the current detection results, more than half of the determination results are suspected still frames, so the current displayed image can be determined to be a still frame.

[0153] Optionally, after the step of determining that the currently displayed image is a still frame, the method further includes:

[0154] Step S50: Obtain a second reference image located a preset second number of frames prior to the image to be detected;

[0155] Step S60: Determine the first peak signal-to-noise ratio corresponding to the image to be detected, and the average signal-to-noise ratio of the second peak signal-to-noise ratio corresponding to each of the second reference images;

[0156] Step S70: If the difference between the first peak signal-to-noise ratio and the average signal-to-noise ratio is greater than or equal to a preset difference threshold, then it is determined that the still frame image is subject to noise interference.

[0157] Step S80: If the difference between the first peak signal-to-noise ratio and the average signal-to-noise ratio is less than a preset difference threshold, then the still frame is determined to be a completely still frame.

[0158] In this embodiment, specifically, a second reference image located a preset second number of frames preceding the image to be detected is acquired. A first peak signal-to-noise ratio (PSNR) corresponding to the image to be detected and the average PSNR of each of the second reference images are determined. The difference between the first PSNR and the average PSNR is calculated. If the difference is greater than or equal to a preset difference threshold, the still frame is determined to be subject to noise interference. In one feasible approach, noise warning information can be further generated to remind the user that the current detection result may be subject to noise interference. If the difference is less than the preset difference threshold, the still frame is determined to be a completely still frame. The preset second number may be the same as or different from the preset first number. The PSNR represents the ratio of the maximum possible power of the signal to the destructive noise power that affects its representation accuracy. It can be used to determine the similarity between two images. The larger the PSNR value between the images, the more similar they are. In this embodiment, the PSNR corresponding to the image to be detected refers to the PSNR between the image to be detected and its previous frame image.

[0159] In one feasible approach, after determining that the still frame is affected by noise, it is possible to temporarily refrain from determining whether the currently displayed image is a still frame and return to the execution steps: acquiring the image to be detected and a first reference image located in the frame preceding the image to be detected, and acquiring the next frame image as the image to be detected, thereby increasing the number of samples and reducing the impact of noise or misjudgment on the final detection result.

[0160] In one possible implementation, after the step of determining that the currently displayed screen is a dynamic screen, the method further includes:

[0161] Obtain a third reference image located a preset third number of frames prior to the image to be detected;

[0162] Determine the first peak signal-to-noise ratio corresponding to the image to be detected, and the average signal-to-noise ratio of the second peak signal-to-noise ratio corresponding to each of the second reference images;

[0163] If the difference between the first peak signal-to-noise ratio and the average signal-to-noise ratio is greater than or equal to a preset difference threshold, then the dynamic scene is determined to be a dynamic scene with large changes.

[0164] If the difference between the first peak signal-to-noise ratio and the average signal-to-noise ratio is less than a preset difference threshold, then the dynamic image is determined to be a small-amplitude dynamic image.

[0165] In this embodiment, specifically, a third reference image located a preset third number of frames preceding the image to be detected is acquired. A first peak signal-to-noise ratio (SNR) corresponding to the image to be detected and the average SNR of the third peak SNR corresponding to each of the third reference images are determined. The difference between the first peak SNR and the average SNR of the third peak SNR are calculated. If the difference between the first peak SNR and the average SNR of the third peak SNR is greater than or equal to a preset difference threshold, the dynamic scene is determined to be a dynamic scene with large changes. If the difference between the first peak SNR and the average SNR of the third peak SNR is less than the preset difference threshold, the dynamic scene is determined to be a dynamic scene with small changes. The preset third number may be the same as or different from the preset first number or the preset second number.

[0166] In this embodiment, by acquiring the image to be detected and a first reference image located in the frame preceding the image to be detected, if a first moving target is detected according to the inter-frame difference algorithm, the image to be detected, and the first reference image, then based on the first movement direction of the first moving target, it is determined whether the first moving target is in a typing state. This achieves the detection of whether the first moving target in the two frames of images is in a typing state using the inter-frame difference algorithm. Furthermore, if it is determined that the first moving target is not in a typing state, then a second moving target is detected according to the optical flow algorithm, the image to be detected, and the first reference image. This achieves the detection of the second moving target that is not in a typing state using the optical flow algorithm. Finally, if no second moving target is detected in the image to be detected, then the current display screen is determined to be a still frame, thus achieving still frame detection. Because the changes in pixels in the overall image are very small during typing, they are difficult to detect using still frame partitioning detection or optical flow methods, or are easily judged as noise or error, leading to misjudgment of still frames. This application can quickly detect typing by using an inter-frame difference algorithm. For second moving targets that are not in typing, optical flow can be used for accurate detection. Compared with still frame partitioning detection, it has higher accuracy in detecting subtle pixel movements such as cursor movement, thus effectively improving the accuracy of still frame detection and overcoming the technical problem of low accuracy in still frame detection in existing technologies.

[0167] Furthermore, in another embodiment of the still frame detection method of this application, referring to Figure 5 The optical flow algorithm includes a sparse optical flow algorithm, and the step of detecting a second moving target based on the optical flow algorithm, the image to be detected, and the first reference image includes:

[0168] Step C10: Detect the first corner point in the first reference image;

[0169] In this embodiment, a corner point in the first reference image is detected by a corner detector, including a Shi-Tomasi corner detector, etc. Specifically, a fixed window can be slid in any direction on the first reference image, and the degree of change in pixel grayscale in the fixed window before and after the sliding is compared. If the change in grayscale value in the window exceeds a preset grayscale threshold when the fixed window is slid in any direction, then a corner point can be considered to exist in the window. Thus, the position of the corner point in the first reference image can be obtained, and an initial position list of corner points can be generated.

[0170] In one possible implementation, prior to the step of detecting the first corner point in the first reference image, the method may further include: converting the image to be detected and the first reference image to grayscale.

[0171] Step C20: According to the sparse optical flow algorithm, determine the second corner point that matches the first corner point from the image to be detected, and the matching first corner point and second corner point form a corner point pair;

[0172] In this embodiment, specifically, the sparse optical flow algorithm is used to track each first corner point to determine the new corner point position of each first corner point in the image to be detected. Based on the new corner point position, a second corner point matching the first corner point is determined from the image to be detected. The matching first corner point and the second corner point form a corner point pair. It should be noted that the new corner point position corresponding to each first corner point determined by the sparse optical flow algorithm may exceed the image range of the image to be detected. For new corner point positions that exceed the image range, they disappear from the image to be detected. Therefore, a matching second corner point cannot be determined from the image to be detected.

[0173] Step C30: Determine whether a second moving target exists in the image to be detected based on the relative positional relationship of the corner point pairs.

[0174] In this embodiment, specifically, the presence of a second moving target in the image to be detected can be determined based on whether the position of the second corner point in the corner point pair changes relative to the position of the first corner point in the same corner point pair. If the position of the second corner point in the corner point pair changes relative to the position of the first corner point in the same corner point pair, it is determined that a second moving target exists in the image to be detected. If the position of the second corner point in the corner point pair does not change relative to the position of the first corner point in the same corner point pair, it is determined that a second moving target does not exist in the image to be detected.

[0175] Optionally, the step of determining whether a second moving target exists in the image to be detected based on the relative positional relationship of corner point pairs includes:

[0176] Step C31: On the preset canvas, determine the positions of the first corner point and the second corner point in each of the corner point pairs;

[0177] Step C32: Connect the first corner point and the second corner point in each of the corner point pairs to obtain the corner point pair connection line;

[0178] Step C33: If the corner point pair connection line is detected in the preset non-edge area of ​​the canvas, it is determined that there is a second moving target in the image to be detected.

[0179] In this embodiment, specifically, a new canvas is created, and the first and second corner points of each corner point pair are drawn on the canvas according to their respective positions. The first and second corner points of each corner point pair are connected to obtain corner point pair lines. It is determined whether each corner point pair line is located in a preset non-edge area of ​​the canvas. If the corner point pair line is detected in the preset non-edge area of ​​the canvas, it is determined that there is a second moving target in the image to be detected; if the corner point pair line is not detected in the preset non-edge area of ​​the canvas, it is determined that there is no second moving target in the image to be detected.

[0180] In one feasible approach, the canvas can be a black canvas, and the corner point pairs can be drawn as white lines. Therefore, if a white motion trajectory curve is detected on the canvas according to the color tracking algorithm, it can be determined that there is a second moving target in the image to be detected.

[0181] In this embodiment, sparse optical flow does not require point-by-point calculation for every pixel of the image. It only needs to specify a set of feature points for tracking. In this embodiment, corner points in the image are used to represent image features. The method of representing features locally greatly saves computational overhead and effectively improves the running speed of still frame detection.

[0182] Furthermore, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the still frame detection method described above.

[0183] The computer program product provided in this application solves the technical problem of low accuracy in still frame detection in existing technologies. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiments of this invention are the same as the beneficial effects of the still frame detection method provided in the above embodiments, and will not be repeated here.

[0184] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any 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 scope of this application.

Claims

1. A still frame detection method, characterized in that, The still frame detection method includes the following steps: Acquire the image to be detected and a first reference image located in the frame preceding the image to be detected; If a first moving target is detected based on the inter-frame difference algorithm, the image to be detected, and the first reference image, then it is determined whether the first moving target is in a typing state based on the first movement direction of the first moving target. If it is determined that the first moving target is not in a typing state, then a second moving target is detected based on the optical flow algorithm, the image to be detected, and the first reference image; If no second moving target is detected in the image to be detected, the currently displayed image is determined to be a still frame.

2. The still frame detection method as described in claim 1, characterized in that, The step of determining that the image to be detected is a still frame if no second moving target is detected in the image to be detected includes: If no second moving target is detected in the image to be detected, the currently displayed image is determined to be a suspected still frame. Obtain the historical detection results of suspected still frames corresponding to historical images to be detected that are a preset first number of frames prior to the image to be detected; If the number of times a suspected still frame is identified as a still frame in the historical detection results of each of the aforementioned suspected still frames is greater than or equal to a preset threshold, then the currently displayed frame is determined to be a still frame.

3. The still frame detection method as described in claim 1, characterized in that, The optical flow algorithm includes a sparse optical flow algorithm, and the step of detecting the second moving target based on the optical flow algorithm, the image to be detected, and the first reference image includes: Detect the first corner point in the first reference image; According to the sparse optical flow algorithm, a second corner point that matches the first corner point is determined from the image to be detected, and the matching first and second corner points form a corner point pair; Based on the relative positional relationship of the corner point pairs, it is determined whether there is a second moving target in the image to be detected.

4. The still frame detection method as described in claim 3, characterized in that, The step of determining whether a second moving target exists in the image to be detected based on the relative positional relationship of corner point pairs includes: On the preset canvas, determine the positions of the first and second corner points in each of the aforementioned corner point pairs; Connect the first and second corner points in each of the corner point pairs to obtain the corner point pair connection line; If the corner point pair connection line is detected in the preset non-edge area of ​​the canvas, it is determined that there is a second moving target in the image to be detected.

5. The still frame detection method as described in claim 1, characterized in that, The optical flow algorithm includes a dense optical flow algorithm, and the step of detecting a second moving target based on the optical flow algorithm, the image to be detected, and the first reference image includes: Based on the optical flow algorithm, the image to be detected, and the first reference image, the optical flow vector corresponding to each pixel in the image to be detected is determined; An optical flow image is generated based on the optical flow modulus and optical flow direction of the optical flow vector; If a moving image is detected in the optical flow image, then a second moving target is determined to exist in the image to be detected.

6. The still frame detection method as described in claim 5, characterized in that, The step of determining the presence of a second moving target in the image to be detected if a moving image is detected in the optical flow image includes: The optical flow image is converted to grayscale to obtain an optical flow grayscale image; The optical flow grayscale image is adaptively binarized to obtain the image to be detected; The second contour of the moving image in the image to be detected is determined according to the contour discovery algorithm; If a second contour is detected in a preset non-edge region of the image to be detected, then a second moving target is determined to exist in the image to be detected.

7. The still frame detection method as described in claim 1, characterized in that, The step of determining whether the first moving target is in a typing state based on the first direction of movement of the first moving target includes: Based on the contour discovery algorithm, the target contour corresponding to each of the first moving targets is determined; Determine the largest target contour from among all the target contours; Determine the minimum bounding rectangle of the maximum target contour; If the minimum bounding rectangle is determined to be in a horizontal or vertical state based on its tilt angle, then the first moving target is determined to be in a typing state.

8. The still frame detection method as described in claim 1, characterized in that, After the step of determining that the currently displayed image is a still frame, the method further includes: Acquire a second reference image located a preset second number of frames prior to the image to be detected; Determine the first peak signal-to-noise ratio corresponding to the image to be detected, and the average signal-to-noise ratio of the second peak signal-to-noise ratio corresponding to each of the second reference images; If the difference between the first peak signal-to-noise ratio and the average signal-to-noise ratio is greater than or equal to a preset difference threshold, then the still frame is determined to be subject to noise interference. If the difference between the first peak signal-to-noise ratio and the average signal-to-noise ratio is less than a preset difference threshold, then the still frame is determined to be a completely still frame.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the steps of the still frame detection method according to any one of claims 1 to 8.

10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and the computer-readable storage medium stores a program that implements the still frame detection method. The program that implements the still frame detection method is executed by a processor to implement the steps of the still frame detection method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Moving object rapid detection method based on video sequence

    CN106846359A

  • System and Method(s) for Determining Projectile Impact Location

    US20190180470A1