Program end automatic detection method based on characteristic value comparison
By defining a fixed detection area in program end detection, calculating two-dimensional feature values using gray-level mean and gray-level co-occurrence matrix, and combining Euclidean distance and similarity conversion formula, a multi-level comparison system is constructed, which solves the problems of computational consumption and false positive rate in program end detection, and achieves efficient and accurate program end detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies for program end detection suffer from high computational costs, high detection latency, and high false positive rates, making it difficult to meet the real-time processing requirements of high frame rate videos. Furthermore, they cannot simultaneously detect both low-texture and high-texture targets, limiting their applicability to various scenarios.
By defining a fixed detection area, calculating two-dimensional feature values using the gray-level mean and gray-level co-occurrence matrix, and combining Euclidean distance and similarity conversion formulas, a multi-level comparison system is constructed. The similarity threshold and continuous frame verification rules are dynamically set to achieve accurate and efficient program end detection.
It significantly reduces invalid pixel calculations, lowers hardware computing power consumption, enhances adaptability to different program ending screens, improves detection accuracy, and meets real-time requirements.
Smart Images

Figure CN121865036A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video processing technology, specifically to an automatic program end detection method based on feature value comparison. Background Technology
[0002] In broadcast television, online video, and other fields, accurate detection of program end times is a core technological support for achieving automated program switching, commercial insertion, and content archiving. With the diversification of video content and the development of transmission technologies, both the channel switching needs of traditional television broadcasting and the intelligent content management needs of online video platforms place higher demands on the real-time performance and accuracy of program end detection. Currently, the industry generally achieves program end detection through feature analysis of video frames. This involves identifying unique visual features at the end of a program to determine whether it has entered its final stage, providing trigger signals for subsequent automated operations. This technology has become a crucial link in the automated video content processing system.
[0003] However, traditional program end detection technologies still have significant shortcomings: some solutions use full-frame feature extraction, which requires calculation on all pixels of the video frame, resulting in high computational consumption and high detection latency, making it difficult to adapt to the real-time processing requirements of high frame rate videos; other solutions rely on only a single feature for detection, which cannot meet the detection requirements of both low-texture and high-texture targets, limiting their applicability; at the same time, the similarity judgment of traditional solutions mostly relies on fixed thresholds and single-frame verification, which is easily affected by video noise and image interference, resulting in a high false positive rate, making it difficult to meet the accurate detection requirements of different types of program end scenes, thus restricting the efficiency and reliability of automated video content processing.
[0004] This invention can be widely applied to various practical scenarios, including broadcast television control, online video platform content management, and automated operation of intelligent playback devices. In the broadcast television field, it supports seamless switching between various programs such as news, variety shows, and dramas, avoiding delays or errors caused by manual operation and ensuring the stability of the broadcast process. In online video platforms, it enables automatic archiving and status marking of content such as dramas and short videos, improving platform content management efficiency and optimizing user search experience. In intelligent playback devices, it can trigger subsequent automated functions such as ad insertion and content recommendation, enriching the device's intelligent interactive capabilities and providing strong technical support for the automated and intelligent processing of video content, demonstrating significant practical value and promising prospects for wider application. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and provide an automatic program end detection method based on feature value comparison. This method focuses on a fixed target image at the end of a program, delineates a dedicated detection area, and extracts two-dimensional feature values using the gray-level mean and gray-level co-occurrence matrix contrast calculation formulas to achieve accurate and efficient feature extraction. This method significantly reduces invalid pixel operations, lowers hardware computing power consumption, and enhances the adaptability to different program end images. In addition, it quantifies the feature matching degree through Euclidean distance and similarity conversion formulas, and combines dynamically set similarity thresholds and continuous frame verification rules to construct a multi-level accurate comparison system, effectively filtering single-frame noise, improving detection accuracy, and meeting the real-time requirements of scenarios such as program switching and advertisement insertion.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: an automatic program end detection method based on feature value comparison, the specific steps of which are as follows:
[0007] S1, Target Feature Preset: Determine the fixed target image that appears at the end of the program and delineate its fixed detection area in the video frame; calculate and store the gray mean value of the target image within the fixed detection area and the contrast based on the gray co-occurrence matrix to form a target two-dimensional feature vector.
[0008] S2, Video frame region extraction: Receive the video stream of the program to be monitored in real time, parse the video frame frame by frame according to the video frame rate, and extract the image subframe corresponding to the fixed detection area.
[0009] S3, Real-time feature calculation: Calculate the real-time grayscale mean and real-time contrast of each image subframe to form a real-time two-dimensional feature vector.
[0010] S4, Collaborative Decision: Calculate the Euclidean distance similarity between the real-time two-dimensional feature vector and the target two-dimensional feature vector; preset the corresponding similarity threshold according to the type of the fixed target image; when the similarity of multiple consecutive frames is not lower than its corresponding similarity threshold, determine that the program ends and output the detection result.
[0011] Furthermore, in step S1, the formula for calculating the grayscale mean is: ,in, Indicates the average gray level; This represents the pixel width of the fixed detection area; Indicates the pixel height of the fixed detection area; This represents the grayscale value of the pixel at coordinates (x, y) within the fixed detection area.
[0012] Furthermore, in step S1, the formula for calculating the contrast ratio of the gray-level co-occurrence matrix is: ,in, Indicates contrast; and These represent different gray levels; P(i,j) represents the probability that gray level i and gray level j appear simultaneously in the gray-level co-occurrence matrix.
[0013] Furthermore, the Euclidean distance calculation formula is as follows: The similarity conversion formula is: ,in, represents the Euclidean distance; n represents the feature dimension, where n=2 and corresponds to the gray mean and contrast, respectively. This represents the k-th dimension component of the target eigenvalue; This represents the k-th dimension component of the real-time feature value; This represents the similarity based on Euclidean distance.
[0014] Furthermore, the principle for defining the fixed detection area is as follows: when the fixed target image is a specific icon, the pixel width and height of the fixed detection area are 1.1 to 1.2 times that of the specific icon, respectively; when the fixed target image is a black frame, the fixed detection area is located in the center of the image and avoids the edge areas.
[0015] Furthermore, when using the gray-level co-occurrence matrix contrast calculation formula, the corresponding gray-level co-occurrence matrix parameters are set to a pixel pitch of 1 to 2 pixels and an angle including at least one of 0° and 90°.
[0016] Furthermore, the similarity threshold is a dynamic threshold: when the fixed target image is a black frame, the similarity threshold is set to 0.95 to 0.99; when the fixed target image is a specific icon, the similarity threshold is set to 0.85 to 0.95.
[0017] Furthermore, the decision rule for consecutive frames is as follows: the number of consecutive frames N is set according to the video frame rate. When the video frame rate is 25 to 30 fps, N is a positive integer from 3 to 4. When the video frame rate is 50 to 60 fps, N is a positive integer from 5 to 6. The total verification time corresponding to N frames is no more than 0.2 seconds.
[0018] Furthermore, when capturing image subframes in the real-time processing step, if the resolution of the input video is inconsistent with the resolution of the video frame in the target feature preset step, the coordinates of the captured area are adjusted according to the coordinates and resolution ratio of the fixed detection area, and the coordinates of the captured area are adjusted according to the proportional conversion rule to ensure that the relative position of the captured area and the fixed target image remains consistent.
[0019] Furthermore, after calculating the real-time grayscale mean and real-time contrast in the real-time processing step, the validity of the real-time grayscale mean and real-time contrast is verified: the real-time grayscale mean must be in the range of 0 to 255, and the real-time contrast must be in the range of 0 to 10000; if the real-time feature value exceeds the above range, the image subframe is determined to be invalid and will not participate in the similarity comparison of the subsequent collaborative decision step.
[0020] In the technical solution of this invention, the various steps and core features work together seamlessly to form a highly efficient and accurate detection method. First, a fixed detection area is defined, which reduces unnecessary calculations and the burden on hardware computing power, while also avoiding interference from irrelevant parts of the image. Simultaneously, the extracted grayscale mean and grayscale co-occurrence matrix contrast constitute a two-dimensional feature. These two features complement each other, adapting to both black frames and specific icons, solving the problem of the narrow applicability of single features. Next, the corresponding area of the image is captured and real-time features are calculated to ensure consistency between the real-time features and the target features in the comparison benchmark. Finally, the degree of difference between features is calculated using Euclidean distance and similarity conversion formulas. Combined with a dynamic threshold determined according to the target type and continuous multi-frame verification adjusted with the frame rate, single-frame noise and instantaneous interference can be effectively filtered. These steps and features work together to form a complete process of "limited range - complementary features - accurate judgment," ensuring both detection speed and improved accuracy, solving the problem of balancing these two aspects in existing technologies.
[0021] Compared with existing technologies, this automatic program end detection method based on feature value comparison has the following advantages:
[0022] I. This invention focuses on a fixed target image that always appears at the end of a program and delineates a dedicated fixed detection area. By combining the gray-level mean calculation formula and the gray-level co-occurrence matrix contrast calculation formula, it extracts two-dimensional feature values, achieving both accuracy and efficiency in feature extraction. Compared to existing full-frame feature detection schemes, this invention only performs feature calculations on a fixed area, significantly reducing the amount of computation on invalid pixels and lowering hardware computing power consumption. At the same time, it avoids interference from irrelevant areas in the full frame on the detection results. The combined application of two-dimensional feature values can adapt to target images with low texture features and accurately identify target images with obvious texture features, solving the problem of limited applicability of single feature detection scenarios. It significantly improves the adaptability to different program ending screens and enhances detection stability.
[0023] Second, this invention quantifies the degree of feature matching through Euclidean distance calculation formula and similarity conversion formula. Combined with dynamically set similarity thresholds based on target image type and continuous frame verification rules adapted to video frame rate, it constructs a multi-level, precise comparison system. This system uses scientific mathematical formulas to transform feature differences into intuitively judgeable similarity values, avoiding subjective judgment errors. The setting of dynamic thresholds and adaptive continuous frame verification rules ensures both the rigor of detecting specific types of target images and the flexibility of detecting other types of target images. It also effectively filters out misjudgments caused by single-frame noise, improving detection accuracy. The entire technical solution has a clear process and rigorous logic, achieving real-time detection without complex hardware support, meeting the real-time detection requirements of scenarios such as program switching and advertising insertion.
[0024] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0026] Figure 1 Flowchart of the automatic program end detection method;
[0027] Figure 2 This is a framework diagram for an automatic program end detection method. Detailed Implementation
[0028] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.
[0029] Example 1:
[0030] This embodiment is applied to the automated broadcast control scenario of a provincial television station's prime-time evening news program. The news program ends promptly at 8:00 PM daily, followed by a 3-second black screen, which must then seamlessly transition into a weather forecast program. To avoid delays or errors caused by manual switching, this invention achieves accurate detection of the black screen frame, ensuring the timeliness and stability of program switching.
[0031] The overall detection process in this embodiment is as follows: Figure 1As shown, the fixed target image that will always appear at the end of the program is first determined to be a pure black frame. Considering the 1920×1080 resolution of the television broadcast video frame, to balance detection accuracy and computational efficiency, a fixed detection area of 300×300 pixels is defined with the frame center as the origin. This area avoids signal noise that may appear at the edges of the image, and more accurately captures the core features of the black frame. Then, the grayscale mean is calculated for the black frames within this area using the grayscale mean calculation formula: ,in, Indicates the average gray level; This represents the pixel width of the fixed detection area; Indicates the pixel height of the fixed detection area; This represents the grayscale value of the pixel at coordinates (x, y) within a fixed detection area; simultaneously, the contrast ratio within the area is calculated using the gray-level co-occurrence matrix contrast ratio calculation formula, which is: ,in, Indicates contrast; and These represent different gray levels; P(i,j) represents the probability that gray level i and gray level j appear simultaneously in the gray-level co-occurrence matrix; these two calculation results are used as target feature values and stored together in the feature value database to provide a comparison benchmark for subsequent real-time detection.
[0032] After the target features are preset, the video frame processing stage begins, such as... Figure 2 As shown, the television station's broadcast control system receives live video streams of news programs in real time via an HDMI video capture interface. It then analyzes the received video stream frame by frame at a standard television frame rate of 25fps to ensure that each frame is processed completely. After each frame is analyzed, a subframe corresponding to the frame center is precisely extracted based on a pre-defined 300×300 pixel fixed detection area. This effectively eliminates interference from other areas of the image, such as residual news subtitles or station logos, ensuring that subsequent feature calculations are performed only on the key areas of the black frames.
[0033] For each captured image subframe, the previously determined formulas for calculating the grayscale mean and grayscale co-occurrence matrix contrast are used to calculate the real-time grayscale mean and real-time contrast of the subframe, respectively. During the calculation process, abnormal pixel values caused by signal fluctuations are automatically filtered out to ensure the accuracy of real-time feature values. Finally, real-time feature values corresponding to each frame are formed, preparing for subsequent similarity comparison.
[0034] Finally, the Euclidean distance calculation formula and similarity conversion formula are used to compare the real-time feature value of each frame with the stored target feature value of the black frame to obtain the similarity value of each frame. The Euclidean distance calculation formula is as follows: The similarity conversion formula is: ,in, represents the Euclidean distance; n represents the feature dimension, where n=2 and corresponds to the gray mean and contrast, respectively. This represents the k-th dimension component of the target eigenvalue; This represents the k-th dimension component of the real-time feature value; This represents the Euclidean distance similarity. Considering the stable and texture-free characteristics of black frames, a similarity threshold of 0.95 is preset for this scene. Simultaneously, based on a frame rate of 25fps, the value of N for consecutive N frames is set to 3. This setting avoids false positives caused by single-frame noise while ensuring real-time detection. When three consecutive image subframes are detected with a similarity of at least 0.95, the news program is immediately determined to have ended, and the detection result is output to the broadcast control system. Upon receiving the signal, the control system automatically triggers a program switching command, seamlessly switching the image to the weather forecast program. The entire detection process takes less than 0.1 seconds, with no image stuttering or switching delays, fully meeting the broadcast requirements of the television station.
[0035] In summary, in the detection of the end of news programs in traditional broadcast television scenarios, this invention focuses on a fixed target image—the black frame—delineates a fixed detection area adapted to television resolution, extracts target feature values by combining the gray-level mean calculation formula and the gray-level co-occurrence matrix contrast calculation formula, and then achieves feature comparison using the Euclidean distance calculation formula and the similarity conversion formula. The entire process avoids noise interference at the image edges and filters out single-frame anomalies through continuous frame verification, ultimately completing the detection and triggering program switching in less than 0.1 seconds. This application effectively solves the delay and error problems of manual switching, balancing detection accuracy and real-time performance, fully adapting to the seamless transition needs of prime-time programs in television stations, and providing reliable technical support for the automated broadcast control of traditional broadcast television.
[0036] Example 2:
[0037] This embodiment is applied to the automated management scenario of online drama content on a short video platform. When each episode of multiple online dramas launched on the platform ends, a special "End of Episode" icon will appear in the lower right corner of the screen for 2 seconds. The platform needs to detect this icon and automatically add an archive mark to the completed drama content to facilitate user retrieval and platform content management.
[0038] The overall detection process in this embodiment is as follows: Figure 1As shown, the end credits of the target web series were first analyzed to confirm that the "End of Series" icon was the only fixed target image at the end of the program. This icon consists of white text with a blue border, and its position in the end credits is fixed and its features are obvious. Considering that most videos on the platform have a 1080×1920 vertical screen resolution, the specific display position of the icon was determined by manual annotation. The pixel width and height of the fixed detection area were then set to 1.1 times the icon size. This size setting ensures that the icon is completely contained within the detection area without introducing too many irrelevant image elements due to an excessively large area. Next, the grayscale mean of the icon within the area was calculated using the grayscale mean calculation formula, and the contrast within the area was calculated using the grayscale co-occurrence matrix contrast calculation formula. The focus was on capturing the texture differences between the icon text and the border. These two feature values were used as target feature values and stored in the platform's feature value database to provide a comparison standard for subsequent real-time detection.
[0039] After the target features are preset, the real-time video stream processing stage begins, such as... Figure 2 As shown, the platform's content monitoring system receives the live video stream of the online drama in real time via the RTSP video capture interface. It then analyzes the video stream frame by frame at the common 30fps frame rate for online videos, ensuring that no frame potentially containing the target icon is missed. After each frame is analyzed, the system precisely extracts the image subframe corresponding to the lower right corner of the screen based on a previously defined fixed detection area. Since the end credits of the online drama may contain background changes such as fade-in black screens and scrolling subtitles, extracting only the area where the icon is located effectively avoids background interference, ensuring that the subframe contains only the image elements relevant to the detection.
[0040] For each captured image subframe, the previously determined formulas for calculating the grayscale mean and grayscale co-occurrence matrix contrast are sequentially called to calculate the real-time grayscale mean and real-time contrast of the subframe, respectively. During the calculation process, the system automatically adapts to changes in image quality under different lighting conditions, such as grayscale fluctuations caused by some users adjusting brightness. Dynamic calibration ensures the stability of real-time feature values, ultimately generating real-time feature values for each frame, providing reliable data for similarity comparison.
[0041] Finally, the Euclidean distance calculation formula and similarity conversion formula are used to compare the real-time feature value of each frame with the stored target feature value of the "End of Episode" icon to obtain the similarity of each frame. Considering that the icon may have slight edge blurring due to compression algorithms, the similarity threshold for this scenario is preset to 0.9, and the N value for N consecutive frames is set to 4 in combination with the 30fps frame rate. This setting can effectively filter out single-frame feature anomalies caused by image compression and network fluctuations, ensuring the accuracy of the detection results. When the similarity of 4 consecutive image subframes is not lower than 0.9, the single episode of the web series is immediately determined to be over, and the detection result is output to the platform's content management system. After receiving the signal, the management system automatically adds a "Completed" archive mark to the content of the episode and updates it synchronously to the episode details page on the user's end, making it convenient for users to quickly identify the completed episode. The entire detection process does not require manual intervention and can process thousands of episodes of web series content every day, which greatly improves the platform's content management efficiency and avoids the problems of missed or incorrect marking that may occur with manual marking.
[0042] In summary, in the context of online drama archiving on online video platforms, this invention targets the "Final Episode" icon, sets a reasonable detection area based on the characteristics of vertical screen videos, accurately captures icon features using a dual-feature value calculation formula, and combines dynamic thresholds and continuous frame verification rules to successfully filter out interference factors such as image compression and network fluctuations. The detection results automatically trigger content archiving marking, allowing for the processing of thousands of online drama episodes daily without manual intervention. This avoids missed or incorrect marking and significantly improves the platform's content management efficiency. This application fully demonstrates the adaptability of this invention to online video scenarios, providing an efficient solution for automated content management on short video platforms and meeting the dual needs of user retrieval and platform operation.
[0043] Experimental verification
[0044] To further verify the synergistic effect and overall superiority of the technical solution of this invention, a control experiment was designed. The test set included 500 program ending segments (of which 250 segments ended with a black frame and 250 segments ended with a specific icon), and 200 non-ending segments containing interference such as transient noise, image fading, and subtitle residue. All video resolutions covered 1080P and 4K, and frame rates included 25fps, 30fps, and 60fps. The experimental environment was a regular PC (CPU: Intel i5-10400F, GPU: NVIDIA GTX1650). The comparison scheme and results are shown in the table below:
[0045] Experimental protocol Detection accuracy False alarm rate Average single frame processing time Scheme A (full frame + single gray level feature + single frame decision) 81.2% 16.8% 13.5 ms Scheme B (fixed area + single gray level feature + continuous decision) 87.5% 9.3% 2.3 ms Scheme C (fixed area + double feature + single frame decision) 93.8% 6.7% 2.6 ms Invention scheme (fixed area + double feature + dynamic threshold + continuous decision) 99.1% 1.2% 2.6 ms
[0046] As can be seen from the experimental data above, this scheme performs best in both detection accuracy and false alarm rate, without increasing computational power consumption, maintaining its high-efficiency processing characteristics. Scheme B, which only uses a fixed region, significantly improves processing speed, but lacks the complementary effect of dual features, resulting in insufficient recognition accuracy for icon-type targets. Scheme C, although combining a fixed region and dual features, lacks a continuous frame decision mechanism, making it difficult to filter out false triggers caused by single-frame noise. The reason why this scheme can achieve such comprehensive performance lies in the synergistic effect of four key elements: fixed detection region, dual-dimensional feature vector, dynamic threshold, and continuous frame verification. This not only solves the problem of wasted computational power caused by full-frame computation, but also makes up for the shortcomings of single features, fixed thresholds, and single-frame decisions in terms of adaptability and stability. This fully demonstrates that the four key elements must be organically integrated and none can be missing in order to achieve the comprehensive effect of "low computational power, high accuracy, and low false alarm".
[0047] Further
[0048] The technical solution of this invention includes the following preferred implementation ideas, providing support for adaptation to different scenarios and subsequent technical expansion:
[0049] Rationale for Feature Selection: The combination of gray-level mean and gray-level co-occurrence matrix (GLCM) contrast has been specifically selected, as the two possess complementary and sensitive characteristics. Gray-level mean is sensitive to the overall brightness distribution of the image, quickly capturing the uniformity features of low-texture targets such as black frames, unaffected by local details; GLCM contrast, on the other hand, focuses on the differential distribution of pixel gray levels, accurately depicting the edge texture features of specific icons and other targets, resisting the impact of overall brightness fluctuations. The combination of the two can comprehensively cover the core features of different types of program ending frames, with significantly better adaptability than single features or other feature combinations.
[0050] Anti-interference variant: For complex scenarios such as semi-transparent effects and dynamic background overlays in some program end icons, an enhanced strategy of multi-template matching and feature fusion can be used to optimize the recognition. Multiple template features of the icon under different transparency and backgrounds are pre-stored, and HSV color space features and edge detection features are fused to further improve the anti-interference ability of target recognition and ensure the detection stability in complex environments.
[0051] Device Concept: The hardware device implementing this method can include five core modules: a video acquisition module adapted to multiple interfaces such as HDMI and RTSP, responsible for real-time video stream reception; a preprocessing module to complete video frame parsing, resolution adaptation, and region cropping operations; a feature calculation module to perform parallel calculations of grayscale mean and GLCM contrast; a comparison and decision module to perform Euclidean distance calculation, dynamic threshold matching, and continuous frame counting verification; and an output control module to output the detection results and trigger subsequent program switching, archiving, and other operations. Each module can be integrated into an embedded chip or industrial computer, providing a standardized hardware adaptation solution for different carriers such as broadcast television equipment, network video servers, and smart playback terminals.
[0052] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. An automatic program end detection method based on feature value comparison, characterized in that, The specific steps of this method are as follows: S1, Target Feature Preset: Determine the fixed target image that appears at the end of the program and delineate its fixed detection area in the video frame; calculate and store the gray mean value of the target image within the fixed detection area and the contrast based on the gray co-occurrence matrix to form a target two-dimensional feature vector. S2, Video frame region extraction: Receive the video stream of the program to be monitored in real time, parse the video frame frame by frame according to the video frame rate, and extract the image subframe corresponding to the fixed detection area. S3, Real-time feature calculation: Calculate the real-time grayscale mean and real-time contrast of each image subframe to form a real-time two-dimensional feature vector. S4, Collaborative Decision: Calculate the Euclidean distance similarity between the real-time two-dimensional feature vector and the target two-dimensional feature vector; preset the corresponding similarity threshold according to the type of the fixed target image; when the similarity of multiple consecutive frames is not lower than its corresponding similarity threshold, determine that the program ends and output the detection result.
2. The automatic program end detection method based on feature value comparison according to claim 1, characterized in that, The formula for calculating the average gray level is: ,in, Indicates the average gray level; Indicates the pixel width of the fixed detection area; Indicates the pixel height of the fixed detection area; This represents the grayscale value of the pixel at coordinates (x, y) within the fixed detection area.
3. The automatic program end detection method based on feature value comparison according to claim 1, characterized in that, The formula for calculating the contrast of the gray-level co-occurrence matrix is: ,in, Indicates contrast; and These represent different gray levels; P(i,j) represents the probability that gray level i and gray level j appear simultaneously in the gray-level co-occurrence matrix.
4. The automatic program end detection method based on feature value comparison according to claim 1, characterized in that, The Euclidean distance calculation formula is as follows: The similarity conversion formula is: ,in, represents the Euclidean distance; n represents the feature dimension, where n=2 and corresponds to the gray mean and contrast, respectively. This represents the k-th dimension component of the target eigenvalue; This represents the k-th dimension component of the real-time feature value; This represents the similarity based on Euclidean distance.
5. The automatic program end detection method based on feature value comparison according to claim 1, characterized in that, The principle for defining the fixed detection area is as follows: when the fixed target image is a specific icon, the pixel width and height of the fixed detection area are 1.1 to 1.2 times that of the specific icon, respectively; when the fixed target image is a black frame, the fixed detection area is located in the center of the image and avoids the edge areas.
6. The automatic program end detection method based on feature value comparison according to claim 1 or 3, characterized in that, When using the gray-level co-occurrence matrix contrast calculation formula, the corresponding gray-level co-occurrence matrix parameters are set to a pixel pitch of 1 to 2 pixels and an angle including at least one of 0° and 90°.
7. The automatic program end detection method based on feature value comparison according to claim 1, characterized in that, The similarity threshold is a dynamic threshold: when the fixed target image is a black frame, the similarity threshold is set to 0.95 to 0.99; when the fixed target image is a specific icon, the similarity threshold is set to 0.85 to 0.
95.
8. The automatic program end detection method based on feature value comparison according to claim 1, characterized in that, The decision rule for consecutive frames is as follows: the number of consecutive frames N is set according to the video frame rate. When the video frame rate is 25 to 30 fps, N is a positive integer from 3 to 4. When the video frame rate is 50 to 60 fps, N is a positive integer from 5 to 6. The total verification time corresponding to N frames is not greater than 0.2 seconds.
9. The automatic program end detection method based on feature value comparison according to claim 1, characterized in that, When capturing image subframes in the real-time processing step, if the resolution of the input video is inconsistent with the resolution of the video frame in the target feature preset step, the coordinates of the captured area are adjusted according to the coordinates and resolution ratio of the fixed detection area, and the coordinates of the captured area are adjusted according to the proportional conversion rule to ensure that the relative position of the captured area and the fixed target image remains consistent.
10. The automatic program end detection method based on feature value comparison according to claim 1, characterized in that, After calculating the real-time grayscale mean and real-time contrast in the real-time processing step, the validity of the real-time grayscale mean and real-time contrast is verified: the real-time grayscale mean must be in the range of 0 to 255, and the real-time contrast must be in the range of 0 to 10000. If the real-time feature value exceeds the above range, the image subframe is determined to be invalid and will not participate in the similarity comparison of subsequent collaborative decision steps.