Video data jam detection method, device, equipment and storage medium
1. A video data jam detection method is characterized by comprising the following steps:
acquiring video data to be detected, performing frame taking processing on the video data according to preset interval time, acquiring multi-frame pictures, and storing the multi-frame pictures according to the frame taking sequence of the multi-frame pictures;
acquiring a stored first picture and a second picture adjacent to the first picture;
according to the first picture and the second picture, determining an interesting ROI (region of interest) of the first picture and an ROI of the second picture, wherein the position of the ROI of the first picture in the first picture is the same as the position of the ROI of the second picture in the second picture;
calculating the similarity between the ROI of the first picture and the ROI of the second picture;
and if the similarity between the ROI of the first picture and the ROI of the second picture is larger than a first threshold value, determining that the first picture is a stuck abnormal picture.
2. The method of claim 1, further comprising:
and updating the stored second picture into a first picture, updating the next picture of the first picture into a second picture, and re-executing the steps of acquiring the stored first picture and the second picture adjacent to the first picture until the first picture is determined to be a stuck abnormal picture in a multi-frame picture stored according to the frame taking sequence until the last stored picture is determined to be the first picture if the similarity between the ROI area of the first picture and the ROI area of the second picture is greater than a first threshold.
3. The method of claim 1, wherein the calculating the similarity between the ROI area of the first picture and the ROI area of the second picture comprises:
circularly acquiring a first image value of a first pixel point of an ROI (region of interest) of a first picture, wherein the first image value is at least one channel value in R, G, B channels of the first pixel point;
acquiring a first image value of a second pixel point of the ROI area of a second picture at the same position as the first pixel point;
calculating a difference value between the first image value of the first pixel point and the first image value of the second pixel point;
if the difference value between the first image value of the first pixel point and the first image value of the second pixel point is smaller than a second threshold value, determining the first pixel point as a similar pixel point, and updating the next pixel point of the first pixel point of the ROI area of the first picture as the first pixel point of the ROI area of the first picture until whether each pixel point of the ROI area of the first picture is determined to be a similar pixel point or not;
determining the number of similar pixel points in the ROI area of the first picture;
and calculating the similarity between the ROI of the first picture and the ROI of the second picture according to the number of similar pixel points in the ROI of the first picture and the total number of all pixel points in the ROI of the first picture.
4. The method of claim 3, wherein the first image value comprises: channel value of G channel.
5. The method of claim 1, wherein the preset interval time comprises 1/24 seconds.
6. The method according to claim 1, wherein before the acquiring the video data to be detected, performing frame fetching on the video data according to a preset interval time, acquiring multiple frames of pictures, and storing the multiple frames of pictures according to a frame fetching sequence, the method further comprises:
receiving a recording screen signal and starting recording;
and receiving a recording screen ending signal, stopping recording, and obtaining the video data to be detected.
7. The method of claim 2, further comprising:
and if the N continuous pictures are all abnormal pictures in the Kanton, determining that the video data is abnormal in screen fixing, wherein N is an integer larger than 1.
8. A video data stuck detection apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring video data to be detected, carrying out frame taking processing on the video data according to preset interval time, acquiring multi-frame pictures and storing the multi-frame pictures according to the frame taking sequence of the multi-frame pictures;
the acquisition unit is further used for acquiring a stored first picture and a second picture adjacent to the first picture;
the determining unit is further configured to determine, according to the first picture and the second picture, an ROI region of interest of the first picture and an ROI region of the second picture, where a position of the ROI region of the first picture in the first picture is the same as a position of the ROI region of the second picture in the second picture;
the calculating unit is also used for calculating the similarity between the ROI of the first picture and the ROI of the second picture;
the determining unit is further configured to determine that the first picture is a stuck abnormal picture if the similarity between the ROI area of the first picture and the ROI area of the second picture is greater than a first threshold.
9. An electronic device, comprising: comprising a processor and a memory, the memory storing a computer program that, when executed, causes the electronic device to perform the method of any of claims 1-7.
10. A computer-readable storage medium, comprising a stored program, wherein the program, when executed, controls an apparatus on which the computer-readable storage medium resides to perform the method of any one of claims 1-7.
Background
With the rapid development of media technologies, the user has higher and higher requirements on the user experience degree of video files (e.g., videos, advertisements, live broadcasts, audio and video calls, etc.), wherein the fluency of video playing is a problem that the user pays more attention to. When playing a video file, if a jam occurs, the video file is generally poor, and the frame rate of the source file is insufficient.
Currently, the detection of video files for stuck or fixed screen is checked by a tester in real time. The detection mode has the advantages of low efficiency, high investment success and poor accuracy.
Disclosure of Invention
In view of this, the present application provides a video data jam detection method, apparatus, device and storage medium, so as to solve the problems of low efficiency, high input success and poor accuracy in manual video file jam detection or screen fixing in the prior art.
In a first aspect, an embodiment of the present application provides a video data stuck detection method, including:
acquiring video data to be detected, performing frame taking processing on the video data according to preset interval time, acquiring multi-frame pictures, and storing the multi-frame pictures according to the frame taking sequence of the multi-frame pictures;
acquiring a stored first picture and a second picture adjacent to the first picture;
according to the first picture and the second picture, determining an interesting ROI (region of interest) of the first picture and an ROI of the second picture, wherein the position of the ROI of the first picture in the first picture is the same as the position of the ROI of the second picture in the second picture;
calculating the similarity between the ROI of the first picture and the ROI of the second picture;
and if the similarity between the ROI of the first picture and the ROI of the second picture is larger than a first threshold value, determining that the first picture is a stuck abnormal picture.
Preferably, the method further comprises the following steps:
and updating the stored second picture into a first picture, updating the next picture of the first picture into a second picture, and re-executing the steps of acquiring the stored first picture and the second picture adjacent to the first picture until the first picture is determined to be a stuck abnormal picture in a multi-frame picture stored according to the frame taking sequence until the last stored picture is determined to be the first picture if the similarity between the ROI area of the first picture and the ROI area of the second picture is greater than a first threshold.
Preferably, the calculating the similarity between the ROI region of the first picture and the ROI region of the second picture comprises:
circularly acquiring a first image value of a first pixel point of an ROI (region of interest) of a first picture, wherein the first image value is at least one channel value in R, G, B channels of the first pixel point;
acquiring a first image value of a second pixel point of the ROI area of a second picture at the same position as the first pixel point;
calculating a difference value between the first image value of the first pixel point and the first image value of the second pixel point;
if the difference value between the first image value of the first pixel point and the first image value of the second pixel point is smaller than a second threshold value, determining the first pixel point as a similar pixel point, and updating the next pixel point of the first pixel point of the ROI area of the first picture as the first pixel point of the ROI area of the first picture until whether each pixel point of the ROI area of the first picture is determined to be a similar pixel point or not;
determining the number of similar pixel points in the ROI area of the first picture;
and calculating the similarity between the ROI of the first picture and the ROI of the second picture according to the number of similar pixel points in the ROI of the first picture and the total number of all pixel points in the ROI of the first picture.
Preferably, the first image value comprises: channel value of G channel.
Preferably, the preset interval time comprises 1/24 seconds.
Preferably, before the acquiring the video data to be detected, performing frame fetching processing on the video data according to a preset interval time, acquiring multiple frames of pictures, and storing the multiple frames of pictures according to a frame fetching sequence, the method further includes:
receiving a recording screen signal and starting recording;
and receiving a recording screen ending signal, stopping recording, and obtaining the video data to be detected.
Preferably, the method further comprises:
and if the N continuous pictures are all abnormal pictures in the Kanton, determining that the video data is abnormal in screen fixing, wherein N is an integer larger than 1.
In a second aspect, an embodiment of the present application provides a video data stuck detection apparatus, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring video data to be detected, carrying out frame taking processing on the video data according to preset interval time, acquiring multi-frame pictures and storing the multi-frame pictures according to the frame taking sequence of the multi-frame pictures;
the acquisition unit is further used for acquiring a stored first picture and a second picture adjacent to the first picture;
the determining unit is further configured to determine, according to the first picture and the second picture, an ROI region of interest of the first picture and an ROI region of the second picture, where a position of the ROI region of the first picture in the first picture is the same as a position of the ROI region of the second picture in the second picture;
the calculating unit is also used for calculating the similarity between the ROI of the first picture and the ROI of the second picture;
the determining unit is further configured to determine that the first picture is a stuck abnormal picture if the similarity between the ROI area of the first picture and the ROI area of the second picture is greater than a first threshold.
In a third aspect, an embodiment of the present application provides an electronic device, including: comprising a processor and a memory, said memory storing a computer program that, when executed, causes the electronic device to perform the method of any of the above first aspects.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium includes a stored program, where the program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform the method according to any one of the above first aspects.
By adopting the scheme provided by the embodiment of the application, the video data can be disassembled into the multi-frame pictures according to the preset time interval. The method comprises the steps of obtaining a first picture and a second picture adjacent to the first picture, determining an ROI (region of interest) of the first picture and an ROI of the second picture, and calculating the similarity between the ROI of the first picture and the ROI of the second picture, so that whether the first picture is a stuck abnormal picture or not is determined according to the similarity. Through the method and the device, whether the picture in the video is the abnormal picture of the card pause or not can be automatically detected, real-time detection of a tester is not needed, the accuracy of the card pause detection is improved, the input cost is reduced, and the efficiency of the abnormal detection can be improved. In addition, in the method and the device, only the similarity between the ROI area of the first picture and the ROI area of the second picture needs to be calculated, the similarity of all areas of the first picture and the second picture does not need to be calculated, the calculated amount is reduced, and the detection efficiency is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic flowchart illustrating a video data stuck detection method according to an embodiment of the present disclosure;
fig. 2 is an exemplary diagram of an ROI region of a first picture and an ROI region of a second picture according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another video data glitch detection method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of another video data pause detection apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another video data pause detection apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another video data pause detection apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For better understanding of the technical solutions of the present application, the following detailed descriptions of the embodiments of the present application are provided with reference to the accompanying drawings.
It should be understood that the embodiments described are only a few embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of associative relationship that describes an associated object, meaning that three types of relationships may exist, e.g., A and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
In the prior art, in order to ensure the fluency of video playing, a video file needs to be tested to detect whether a phenomenon of blocking or screen fixing exists. At present, whether a person is blocked or a screen is fixed is mainly detected by watching a video file through a tester, and the efficiency is low.
In the application, the video data can be disassembled into the multi-frame pictures according to the preset time interval. The method comprises the steps of obtaining a first picture and a second picture adjacent to the first picture, determining an ROI (region of interest) of the first picture and an ROI of the second picture, and calculating the similarity between the ROI of the first picture and the ROI of the second picture, so that whether the first picture is a stuck abnormal picture or not is determined according to the similarity. Through the method and the device, whether the picture in the video is the abnormal picture of the card pause or not can be automatically detected, real-time detection of a tester is not needed, the accuracy of the card pause detection is improved, the input cost is reduced, and the efficiency of the abnormal detection can be improved. In addition, in the method and the device, only the similarity between the ROI area of the first picture and the ROI area of the second picture needs to be calculated, the similarity of all areas of the first picture and the second picture does not need to be calculated, the calculated amount is reduced, and the detection efficiency is further improved.
Fig. 1 is a schematic flow chart of a video data pause detection method according to an embodiment of the present application. As shown in fig. 1, the method includes:
s101, video data to be detected are obtained, frame taking processing is carried out on the video data according to preset interval time, multi-frame pictures are obtained, and storage is carried out according to the frame taking sequence of the multi-frame pictures.
In this embodiment of the application, the video data stuck detection device may obtain video data to be detected first, disassemble the video data to be detected, disassemble the multiple frames of pictures, and in order to improve the detection efficiency, the video data stuck detection device may perform frame fetching processing according to a preset time interval in the video data to be detected, so as to obtain multiple frames of pictures, and store the multiple frames of pictures in the storage medium according to the order of fetching the frames.
It should be noted that the preset time interval is a preset time interval for taking out a frame picture from the video data. For example, 1/8 seconds, 1/16 seconds, etc. can be set according to actual requirements, and the method is not limited by itself.
Further, the preset interval time includes 1/24 seconds. Due to the afterimage phenomenon of human eyes, the human eyes cannot distinguish as long as the switching time of the two frames of pictures is faster than 1/24 seconds. Therefore, the preset time interval can be set to 1/24 seconds, so that one frame of picture can be taken out of the video data every 1/24 seconds, the video data does not need to be analyzed frame by frame, and the calculation amount is greatly reduced.
Step S102, a stored first picture and a second picture adjacent to the first picture are obtained.
Specifically, a first picture is selected from the stored multiple pictures, and a next picture adjacent to the first picture is a second picture. For example, when a first picture is selected from the stored multiple pictures for the first time, a first picture in the stored multiple pictures may be determined as the first picture, and at this time, a second picture may be determined as the second picture.
Step S103, determining a Region Of Interest (ROI) Of the first picture and a Region Of Interest (ROI) Of the second picture according to the first picture and the second picture.
And the position of the ROI area of the first picture in the first picture is the same as the position of the ROI area of the second picture in the second picture.
In the embodiment of the present application, the multiple frames of pictures disassembled from the video data may include an ROI region and a non-ROI region. The ROI is an image region of a target object in the picture, where the target object is an object focused by the user, the target object may be a person or a vehicle, and the ROI is an image region focused by the user. The non-ROI region is an additional image region in the picture except for the target object, i.e., a background region, which is a region of the picture that is of little interest to the user. The first picture may be divided into n x n regions, such that the ROI region may be determined in the n x n regions. Similarly, the ROI area of the second picture is determined in the second picture. The position of the ROI area of the second picture in the second picture is the same as the position of the ROI area of the first picture in the first picture. Namely, the first picture is divided into n × n regions, the ROI region is determined in the n × n regions, the second picture is also divided into n × n regions, and a region at the same position as the ROI region of the first picture is selected from the n × n regions as the ROI region of the second picture. Wherein n is an integer greater than 0.
For example, assuming that the first picture is divided into 3 × 3 regions, a picture region corresponding to a first row and a first column position, a picture region corresponding to a third row and a third column position, a picture region corresponding to a second row and a second column position, a picture region corresponding to a third row and a first column position, and a picture region corresponding to a third row and a third column position in the 3 × 3 region may be determined as the ROI region of the first picture. Similarly, the second picture is also divided into 3 × 3 regions, and a picture region corresponding to a first row and a first column position, a picture region corresponding to a third row and a third column position, a picture region corresponding to a second row and a second column position, a picture region corresponding to a third row and a first column position, and a picture region corresponding to a third row and a third column position in the 3 × 3 regions may be determined as the ROI region of the second picture, as shown in fig. 2.
And step S104, calculating the similarity between the ROI of the first picture and the ROI of the second picture.
In this embodiment, after the video data stuck detection device determines the ROI of the first picture and the ROI of the second picture, the similarity between the ROI of the first picture and the ROI of the second picture can be calculated according to the gray values of the pixels in the ROI of the first picture and the gray values of the pixels in the ROI of the second picture. Specifically, a first gray value of a first pixel point in the ROI area of the first picture is obtained, and a second gray value of a second pixel point at the same position as the first pixel point in the ROI area of the second picture is obtained. And calculating the difference between the first gray value and the second gray value. And if the difference value between the first gray value and the second gray value is smaller than a preset gray threshold, determining that the first pixel point is similar to the second pixel point, and determining the first pixel point as a similar pixel point. And updating the next pixel point of the first pixel point in the ROI area of the first picture to be the first pixel point, and re-determining whether the updated first pixel point is the similar pixel point through the steps until whether each pixel point in the ROI area of the first picture is the similar pixel point is determined. And counting the number of the similar pixel points, and taking the ratio of the number of the similar pixel points to the total number of the pixel points in the ROI area of the first picture as the similarity between the ROI area of the first picture and the ROI area of the second picture.
Further, the above process is to calculate the similarity between the ROI of the first picture and the ROI of the second picture according to the gray-level values of the pixels in the ROI of the first picture and the gray-level values of the pixels in the ROI of the second picture, and may also calculate the similarity between the ROI of the first picture and the ROI of the second picture according to other parameters, which is specifically described as follows.
Calculating the similarity between the ROI area of the first picture and the ROI area of the second picture comprises:
and circularly obtaining a first image value of a first pixel point of the ROI area of the first picture. And acquiring a first image value of a second pixel point in the ROI area of the second picture at the same position as the first pixel point. And calculating the difference value between the first image value of the first pixel point and the first image value of the second pixel point. And if the difference value between the first image value of the first pixel point and the first image value of the second pixel point is smaller than the second threshold value, determining the first pixel point as a similar pixel point, and updating the next pixel point of the first pixel point of the ROI area of the first picture as the first pixel point of the ROI area of the first picture until the first image value of each pixel point of the ROI area of the first picture is obtained. Wherein the first image value is at least one channel value of the R, G, B channels of the first pixel point.
And determining the number of similar pixel points of the ROI area of the first picture.
And calculating the similarity between the ROI area of the first picture and the ROI area of the second picture according to the number of similar pixel points of the ROI area of the first picture and the total number of all pixel points in the ROI area of the first picture.
Specifically, the video data stuck detection device needs to acquire a first image value of a first pixel point of the ROI region of the first picture, and at this time, when the video data stuck detection device acquires the first image value of the first pixel point of the ROI region of the first picture for the first time, the first pixel point can be used as the first pixel point, and at this time, the video data stuck detection device directly acquires the first image value of the first pixel point of the ROI region of the first picture. Wherein the first image value may be at least one of the R, G, B channels. And acquiring a first image value of a second pixel point at the same position as the first pixel point in the ROI area of the second picture. And subtracting the first image value of the first pixel point in the ROI region of the first picture from the first image value of the second pixel point in the ROI region of the second picture to obtain the difference value between the first image value of the first pixel point in the first picture and the first image value of the second pixel point in the second picture. Comparing the difference value between the first image value of the first pixel point in the first picture and the first image value of the second pixel point in the second picture with a preset second threshold value, if the difference value between the first image value of the first pixel point in the first picture and the first image value of the second pixel point in the second picture is smaller than the second threshold value, the first image value of the first pixel point in the first picture is similar to the first image value of the second pixel point in the second picture, so that the first pixel point in the first picture can be determined to be similar to the second pixel point in the second picture, and the first pixel point of the first picture is determined to be a similar pixel point. If the difference value between the first image value of the first pixel point in the first picture and the first image value of the second pixel point in the second picture is not smaller than the second threshold, the first pixel point in the first picture and the first image value of the second pixel point in the second picture are not similar, the first pixel point in the first picture and the second pixel point in the second picture can be determined to be dissimilar, and the first pixel point of the first picture is determined to be not a similar pixel point. And continuously determining whether other pixel points in the first picture are similar pixel points. At this time, the first pixel point is updated to be the second pixel point of the ROI in the first picture, that is, the next pixel point of the first pixel point of the ROI in the first picture is updated to be the first pixel point. The first image value of a first pixel point in the ROI area of the first picture can be obtained again, the first image value of a second pixel point in the ROI area of the second picture, which is at the same position as the first pixel point, is obtained again, the difference value between the first image value of the first pixel point and the first image value of the second pixel point is calculated again, and when the difference value between the first image value of the first pixel point and the first image value of the second pixel point is smaller than a second threshold value, the fact that the first pixel point in the first picture is similar to the first image value of the second pixel point in the second picture is indicated, the fact that the first pixel point in the first picture is similar to the second pixel point in the second picture can be determined, and the first pixel point of the first picture is determined to be a similar pixel point. If the difference value between the first image value of the first pixel point in the first picture and the first image value of the second pixel point in the second picture is not smaller than the second threshold, the first pixel point in the first picture and the first image value of the second pixel point in the second picture are not similar, the first pixel point in the first picture and the second pixel point in the second picture can be determined to be dissimilar, and the first pixel point of the first picture is determined to be not a similar pixel point. And continuously determining whether other pixel points in the first picture are similar pixel points. And continuously updating the first pixel point, namely updating the first pixel point to be a third pixel point of the ROI area in the first picture, namely updating the next pixel point of the first pixel point of the ROI area in the first picture to be the first pixel point. And determining whether the current first pixel point is a similar pixel point or not by the method until whether the similar pixel point is determined by each pixel point in the ROI area of the first picture or not. After whether similar pixel points are determined for each pixel point in the ROI region of the first picture, the number of the similar pixel points can be counted, the ratio between the number of the similar pixel points and the total number of the pixel points contained in the ROI region of the first picture is calculated, and the ratio between the number of the similar pixel points and the total number of the pixel points contained in the ROI region of the first picture is determined as the similarity between the ROI region of the first picture and the ROI region of the second picture.
Further, the sensitivity of the optic nerve of the human eye to light of various wavelengths is not the same. Most sensitive to green light and less sensitive to red and blue light, so the first image values comprise: channel value of G channel. Therefore, when the similarity between the ROI of the first picture and the ROI of the second picture is calculated, only the difference value between the channel values of the G channels of the pixels at the corresponding positions in the ROI of the first picture and the ROI of the second picture can be calculated, and compared with the calculation of the difference value between the gray values of the pixels at the corresponding positions in the ROI of the first picture and the ROI of the second picture, the calculation amount is greatly reduced, and the detection efficiency is improved.
Step S105, if the similarity between the ROI of the first picture and the ROI of the second picture is larger than a first threshold value, determining that the first picture is a Canton abnormal picture.
In this embodiment of the application, after calculating the similarity between the ROI region of the first picture and the ROI region of the second picture, the video data stuck detection device may compare the similarity between the ROI region of the first picture and the ROI region of the second picture with a preset first threshold, and if the similarity between the ROI region of the first picture and the ROI region of the second picture is greater than the first threshold, determine that the first picture is a stuck abnormal picture.
Further, if the similarity between the ROI area of the first picture and the ROI area of the second picture is not larger than a first threshold value, the first picture is judged to be a normal picture.
Whether the first picture is the stuck abnormal picture or not can be determined through the steps. Real-time detection by a tester is not needed, the accuracy of the stuck detection is improved, the input cost is reduced, and the efficiency of the abnormal detection can be improved.
Further, the above steps S102 to S105 may determine whether the first picture is a stuck abnormal picture. The first picture is one of the stored multi-frame pictures, and the first picture can be updated when whether other stored pictures are abnormal pictures. The method comprises the following specific steps:
and updating the stored second picture into a first picture, updating the next picture of the first picture into a second picture, and re-executing the step of acquiring the stored first picture and the second picture adjacent to the first picture until the step of determining the first picture as the stuck abnormal picture if the similarity between the ROI area of the first picture and the ROI area of the second picture is greater than a first threshold value, until the last stored picture is determined as the first picture in the multi-frame pictures stored according to the frame taking sequence.
That is, after the current first picture is determined to be the stuck abnormal picture, a picture next to the stored current first picture may be updated to the first picture. That is, the next picture of the first picture is updated to the first picture. Since the second picture is the next picture of the first picture, the second picture can be directly updated to the first picture, and the next picture adjacent to the first picture can be updated to the second picture. After the first picture is updated, the stored first picture and the second picture adjacent to the first picture are obtained in step S102, and if the similarity between the ROI area of the first picture and the ROI area of the second picture is greater than the first threshold in step S105, the first picture is determined to be a stuck abnormal picture until the last picture of the multiple pictures stored according to the frame taking sequence is determined to be the first picture.
Further, after determining whether the stored multiple frames of pictures are abnormal pictures, if all the N consecutive pictures are abnormal pictures, determining that the video data is abnormal for screen fixing. Wherein N is an integer greater than 1. That is, if the consecutive pictures are all the katon abnormal pictures, the video data to be detected can be the video data with abnormal fixed screen.
It should be noted that the value of N is preset by the user according to actual requirements, and the present application is not limited to this.
Fig. 3 is a schematic flowchart illustrating another video data glitch detection method according to an embodiment of the present application. As shown in fig. 3, the method includes:
and S301, receiving a screen recording signal and starting recording.
Specifically, during the process of online video playing, local video playing or video call in the video data pause detection device, when a screen recording signal is received, a recording function is started to record a screen.
And S302, receiving a screen recording ending signal, and stopping recording to obtain video data to be detected.
Specifically, after the video data pause detection device receives the screen recording end signal, the screen recording function can be stopped, and the recorded video file is stored in the storage medium as the video data to be detected.
Step S303, acquiring video data to be detected, performing frame taking processing on the video data according to preset interval time, acquiring multi-frame pictures, and storing the multi-frame pictures according to the frame taking sequence of the multi-frame pictures.
Specifically, reference to step S101 is not repeated herein.
Step S304, a stored first picture and a second picture adjacent to the first picture are obtained.
Specifically, the step S102 may be referred to and will not be described herein again.
Step S305, determining the ROI of the first picture and the ROI of the second picture according to the first picture and the second picture.
And the position of the ROI area of the first picture in the first picture is the same as the position of the ROI area of the second picture in the second picture.
Specifically, it is not described herein with reference to step S103.
And S306, calculating the similarity between the ROI of the first picture and the ROI of the second picture.
Specifically, reference to step S104 is not repeated herein.
Step S307, if the similarity between the ROI of the first picture and the ROI of the second picture is greater than the first threshold, determining that the first picture is a katon abnormal picture.
Specifically, reference to step S105 is not repeated herein.
Step 308, determining whether the last stored picture is determined as the first picture in the multi-frame pictures stored according to the frame taking sequence. If not, the stored second picture is updated to the first picture, the next picture of the first picture is updated to the second picture, and the steps S303 to S308 are executed again. If yes, the process is ended.
Specifically, the video data stuck detection apparatus needs to determine whether all the multiple frames of pictures disassembled in step S303 are stuck abnormal pictures, and therefore, it needs to determine whether each stored picture is a stuck abnormal picture, and therefore, after determining whether one of the stored pictures is a stuck abnormal picture, it needs to determine the next picture, and therefore, after determining whether the first picture is a stuck abnormal picture, it is possible to update the next picture of the stored first picture to the first picture, that is, update the second picture to the first picture, update the next picture of the updated first picture to the second picture in the stored multiple frames of pictures, and execute steps S303 to S308 again until each stored picture is determined whether it is a stuck abnormal picture.
In the application, the video data can be disassembled into the multi-frame pictures according to the preset time interval. The method comprises the steps of obtaining a first picture and a second picture adjacent to the first picture, determining an ROI (region of interest) of the first picture and an ROI of the second picture, and calculating the similarity between the ROI of the first picture and the ROI of the second picture, so that whether the first picture is a stuck abnormal picture or not is determined according to the similarity. Through the method and the device, whether the picture in the video is the abnormal picture of the card pause or not can be automatically detected, real-time detection of a tester is not needed, the accuracy of the card pause detection is improved, the input cost is reduced, and the efficiency of the abnormal detection can be improved. In addition, in the method and the device, only the similarity between the ROI area of the first picture and the ROI area of the second picture needs to be calculated, the similarity of all areas of the first picture and the second picture does not need to be calculated, the calculated amount is reduced, and the detection efficiency is further improved. And when the similarity between the ROI area of the first picture and the ROI area of the second picture is calculated, the similarity can be determined by calculating the difference value between the channel values of the single channels of the pixels, so that the calculation amount is further reduced, and the detection efficiency is improved.
Fig. 4 is a schematic structural diagram of a video data pause detection apparatus according to an embodiment of the present application. As shown in fig. 4, the apparatus includes:
the acquiring unit 401 is configured to acquire video data to be detected, perform frame fetching processing on the video data according to a preset interval time, acquire multiple frames of pictures, and store the multiple frames of pictures according to a frame fetching sequence of the multiple frames of pictures.
Further, the preset interval time includes 1/24 seconds.
The obtaining unit 401 is further configured to obtain a stored first picture and a second picture adjacent to the first picture.
The determining unit 402 is further configured to determine, according to the first picture and the second picture, an ROI area of interest of the first picture and an ROI area of the second picture.
Wherein the position of the ROI area of the first picture in the first picture is the same as the position of the ROI area of the second picture in the second picture.
The calculating unit 403 is further configured to calculate a similarity between the ROI region of the first picture and the ROI region of the second picture.
Specifically, the calculating unit 403 is specifically configured to cyclically obtain a first image value of a first pixel point of the ROI region of the first picture. And acquiring a first image value of a second pixel point in the ROI area of the second picture at the same position as the first pixel point. And calculating the difference value between the first image value of the first pixel point and the first image value of the second pixel point. And if the difference value between the first image value of the first pixel point and the first image value of the second pixel point is smaller than the second threshold value, determining the first pixel point as a similar pixel point, and updating the next pixel point of the first pixel point of the ROI area of the first picture as the first pixel point of the ROI area of the first picture until whether each pixel point of the ROI area of the first picture is determined to be a similar pixel point.
Determining the number of similar pixel points in the ROI area of the first picture; and calculating the similarity between the ROI area of the first picture and the ROI area of the second picture according to the number of similar pixel points of the ROI area of the first picture and the total number of all pixel points in the ROI area of the first picture.
Wherein the first image value is at least one channel value of the R, G, B channels of the first pixel point.
Further, the first image value comprises: channel value of G channel.
The determining unit 402 is further configured to determine that the first picture is a katon abnormal picture if the similarity between the ROI area of the first picture and the ROI area of the second picture is greater than a first threshold.
Further, as shown in fig. 5, the video data pause detection apparatus further includes:
the processing unit 404 is configured to update the stored second picture to a first picture, update a next picture of the first picture to the second picture, and trigger re-execution of the steps of acquiring the stored first picture and the second picture adjacent to the first picture until the first picture is determined to be a stuck abnormal picture if the similarity between the ROI area of the first picture and the ROI area of the second picture is greater than a first threshold, until the last stored picture is determined to be the first picture in multiple pictures stored according to the frame fetching sequence.
Further, as shown in fig. 6, the video data pause detection apparatus further includes:
and a recording unit 405, configured to receive a radio screen signal and start recording.
The obtaining unit 401 is further configured to receive a radio screen end signal, stop recording, and obtain video data to be detected.
Further, the determining unit 402 is further configured to determine that the video data is abnormal for screen fixing if the N consecutive pictures are all abnormal pictures.
Wherein N is an integer greater than 1.
In the application, the video data can be disassembled into the multi-frame pictures according to the preset time interval. The method comprises the steps of obtaining a first picture and a second picture adjacent to the first picture, determining an ROI (region of interest) of the first picture and an ROI of the second picture, and calculating the similarity between the ROI of the first picture and the ROI of the second picture, so that whether the first picture is a stuck abnormal picture or not is determined according to the similarity. Through the method and the device, whether the picture in the video is the abnormal picture of the card pause or not can be automatically detected, real-time detection of a tester is not needed, the accuracy of the card pause detection is improved, the input cost is reduced, and the efficiency of the abnormal detection can be improved. In addition, in the method and the device, only the similarity between the ROI area of the first picture and the ROI area of the second picture needs to be calculated, the similarity of all areas of the first picture and the second picture does not need to be calculated, the calculated amount is reduced, and the detection efficiency is further improved. And when the similarity between the ROI area of the first picture and the ROI area of the second picture is calculated, the similarity can be determined by calculating the difference value between the channel values of the single channels of the pixels, so that the calculation amount is further reduced, and the detection efficiency is improved.
Corresponding to the embodiment, the application further provides the electronic equipment. Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 700 may include: a processor 701, a memory 702, and a communication unit 703. The components communicate over one or more buses, and those skilled in the art will appreciate that the configuration of the servers shown in the figures are not meant to limit embodiments of the present invention, and may be in the form of buses, stars, more or fewer components than those shown, some components in combination, or a different arrangement of components.
The communication unit 703 is configured to establish a communication channel, so that the storage device can communicate with other devices. Receiving the user data sent by other devices or sending the user data to other devices.
The processor 701, which is a control center of the storage device, connects various parts of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device and/or processes data by operating or executing software programs and/or modules stored in the memory 702 and calling data stored in the memory. The processor may be composed of Integrated Circuits (ICs), for example, a single packaged IC, or a plurality of packaged ICs connected to the same or different functions. For example, the processor 701 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
The memory 702 is used for storing instructions executed by the processor 701, and the memory 702 may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
The execution of the instructions in memory 702, when executed by processor 701, enables electronic device 700 to perform some or all of the steps in the embodiment shown in fig. 3.
In a specific implementation, the present invention further provides a computer storage medium, where the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments of the video data stuck detection method provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts in the various embodiments in this specification may be referred to each other. Especially, as for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the description in the method embodiment.