EPG image missing detection method and system, electronic device and storage medium
By performing grayscale processing, blur processing and edge detection on the EPG image to determine image missing, the deficiencies in image missing detection of the EPG system in the existing technology are solved, achieving more efficient detection and improving user experience.
Patent Information
- Application Number
- CN202311312349.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-10
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-10-10
AI Technical Summary
The existing EPG system cannot detect and repair images in real time and accurately when network failure or other problems cause image loss, which affects the user's browsing experience.
By performing grayscale processing, Gaussian blur processing and edge detection on the target EPG image, the continuous edge contour is determined and reverse edge detection is performed. Based on the pixel ratio of the reverse edge contour, it is judged whether there is any missing image.
It improves the real-time and accuracy of EPG image missing detection, quickly starts the troubleshooting process, and improves the user's browsing experience.
Smart Images

Figure CN117392075B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an EPG image missing detection method and system, an electronic device and a storage medium. Background Art
[0002] The electronic program guide (EPG) is applied to the set-top box, realizing the presentation of basic contents such as on-demand and live broadcast of the set-top box, providing page browsing and navigation services for users, and providing support services for SP templates. The interface of the EPG system is similar to that of a Web page. The EPG interface generally provides various menus, buttons, links and other components that users can click directly when selecting programs; the EPG interface can also contain various dynamic or static multimedia contents for users to browse.
[0003] Due to network reasons or other failures, EPG interfaces often have problems with missing images, such as inaccessible pages or inability to display some multimedia content. Existing EPG systems often rely on user reports or operator maintenance to detect EPG image missing, which is inefficient and cannot actively detect EPG image missing in real time and accurately for timely repair, affecting the user's browsing experience. The above technical problems need to be solved urgently. Summary of the invention
[0004] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.
[0005] Therefore, an object of an embodiment of the present invention is to provide an EPG image missing detection method, which improves the real-time, accuracy and efficiency of EPG image missing detection and also improves the browsing experience of users.
[0006] Another object of an embodiment of the present invention is to provide an EPG image missing detection system.
[0007] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present invention include:
[0008] On the one hand, an embodiment of the present invention provides an EPG image missing detection method, comprising the following steps:
[0009] Acquire a target EPG image, and perform grayscale processing on the target EPG image to obtain a first EPG image;
[0010] Performing Gaussian blur processing on the first EPG image to obtain a second EPG image, and performing edge detection on the second EPG image to obtain edge image information;
[0011] Determine a plurality of continuous edge contours according to the edge image information, and perform reverse edge detection on the second EPG image according to the continuous edge contours to obtain a plurality of reverse edge contours;
[0012] It is determined whether the target EPG image has image missing according to the pixel ratio of the reverse edge contour.
[0013] Further, in one embodiment of the present invention, the step of graying the target EPG image to obtain the first EPG image specifically includes:
[0014] Processing the target EPG image by any one of a floating point algorithm, an integer method, a shift method, an average method, and a green-only method to obtain a first grayscale value of each pixel of the target EPG image;
[0015] Performing color gamut conversion on each pixel of the target EPG image according to the first grayscale value to obtain the first EPG image.
[0016] Further, in one embodiment of the present invention, the step of performing Gaussian blur processing on the first EPG image to obtain the second EPG image specifically includes:
[0017] Obtain a preset Gaussian filter, and determine a corresponding window size and weight matrix according to the Gaussian filter;
[0018] Determine the filter window area of each pixel in the first EPG image according to the window size, and perform weighted average processing on the grayscale value of each pixel in the filter window area according to the weight matrix to obtain the Gaussian blurred grayscale value of the corresponding pixel;
[0019] The second EPG image is obtained by performing grayscale value conversion on the first EPG image according to the Gaussian blur grayscale value.
[0020] Further, in one embodiment of the present invention, the step of performing edge detection on the second EPG image to obtain edge image information specifically includes:
[0021] Obtaining a preset Canny operator, performing edge detection on the second EPG image by using the Canny operator, and obtaining a gradient amplitude and a gradient direction of a grayscale change of each pixel point;
[0022] For each target pixel of the second EPG image, determine a plurality of first pixel points within a preset area, the gradient direction of the first pixel points being the same as the gradient direction of the target pixel points, and then determine whether the gradient amplitude of the target pixel points is greater than the gradient amplitude of the first pixel points;
[0023] When the gradient amplitude of the target pixel point is greater than the gradient amplitude of the first pixel point, determining the target pixel point as a candidate edge pixel point;
[0024] Double-threshold screening is performed on the candidate edge pixel points to obtain strong edge pixel points and virtual edge pixel points, and the edge image information is determined according to the strong edge pixel points and the virtual edge pixel points.
[0025] Further, in one embodiment of the present invention, the step of performing double threshold screening on the candidate edge pixels to obtain strong edge pixels and virtual edge pixels, and determining the edge image information according to the strong edge pixels and the virtual edge pixels specifically includes:
[0026] Acquire a preset first amplitude threshold and a second amplitude threshold, wherein the first amplitude threshold is greater than the second amplitude threshold;
[0027] If the gradient amplitude of the candidate edge pixel point is greater than or equal to the first amplitude threshold, the candidate edge pixel point is determined to be a strong edge pixel point; if the gradient amplitude of the candidate edge pixel point is less than the first amplitude threshold and greater than the second amplitude threshold, the candidate edge pixel point is determined to be a virtual edge pixel point;
[0028] If the virtual edge pixel point is connected to the strong edge pixel point, the virtual edge pixel point is retained; if the virtual edge pixel point is not connected to the strong edge pixel point, the virtual edge pixel point is determined to be a weak edge pixel point and is removed;
[0029] The edge image information is determined according to the strong edge pixel points and the retained virtual edge pixel points.
[0030] Further, in one embodiment of the present invention, the step of determining a plurality of continuous edge contours according to the edge image information, and performing reverse edge detection on the second EPG image according to the continuous edge contours to obtain a plurality of reverse edge contours specifically includes:
[0031] determining a plurality of first edge contours according to the edge image information;
[0032] When the pixel points of the first edge contour are continuous, determining the first edge contour as a continuous edge contour;
[0033] When the pixel points of the first edge contour are discontinuous, closing the first edge contour according to the shape of the first edge contour to obtain a continuous edge contour;
[0034] Determining a plurality of first closed areas in the second EPG image according to the continuous edge contour, and performing reverse selection on the first closed areas to obtain a plurality of second closed areas;
[0035] An edge contour of the second closed area is determined as the reverse edge contour.
[0036] Further, in one embodiment of the present invention, the step of judging whether the target EPG image has image missing according to the pixel ratio of the reverse edge contour specifically includes:
[0037] Determine a first total number of pixels surrounded by the reverse edge contour, and determine a second total number of pixels of all pixels in the target EPG image;
[0038] Determining a pixel point ratio of the reverse edge contour according to a ratio of the first total number of pixel points to the second total number of pixel points;
[0039] When the pixel ratio is greater than or equal to a preset third threshold, it is determined that there is image missing in the target EPG image.
[0040] On the other hand, an embodiment of the present invention provides an EPG image missing detection system, comprising:
[0041] A grayscale processing module, used for acquiring a target EPG image, and performing grayscale processing on the target EPG image to obtain a first EPG image;
[0042] an edge detection module, configured to perform Gaussian blur processing on the first EPG image to obtain a second EPG image, and perform edge detection on the second EPG image to obtain edge image information;
[0043] A reverse edge contour determining module, used for determining a plurality of continuous edge contours according to the edge image information, and performing reverse edge detection on the second EPG image according to the continuous edge contours to obtain a plurality of reverse edge contours;
[0044] The image missing judgment module is used to judge whether there is image missing in the target EPG image according to the pixel ratio of the reverse edge contour.
[0045] On the other hand, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein the program, when executed by the processor, realizes the EPG image missing detection method as described above.
[0046] On the other hand, an embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium used for computer-readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the EPG image missing detection method as described above.
[0047] The advantages and beneficial effects of the present invention will be partly given in the following description, partly become apparent from the following description, or be understood through the practice of the present invention:
[0048] The embodiment of the present invention obtains a target EPG image, performs grayscale processing on the target EPG image to obtain a first EPG image, then performs Gaussian blur processing on the first EPG image to obtain a second EPG image, and performs edge detection on the second EPG image to obtain edge image information, and then determines a number of continuous edge contours based on the edge image information, and performs reverse edge detection on the second EPG image based on the continuous edge contours to obtain a number of reverse edge contours, and then determines whether the target EPG image has image loss according to the pixel point ratio of the reverse edge contour. The embodiment of the present invention can reduce the noise of the target EPG image through grayscale processing and Gaussian blur processing, so that the image edge of the multimedia content is more obvious; the continuous edge contour of the multimedia content is obtained through edge detection and the reverse edge contour is determined through reverse edge detection, so that the pixel point ratio of the non-multimedia content area to the target EPG image can be determined, and then it can be determined whether the target EPG image has image loss, and when there is image loss, the troubleshooting process can be quickly started, thereby improving the real-time, accuracy and efficiency of EPG image loss detection, and also improving the user's browsing experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solution in the embodiments of the present invention, the following introduction is made to the drawings required for use in the embodiments of the present invention. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solution of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 A flowchart of the steps of the EPG image missing detection method provided by an embodiment of the present invention;
[0051] Figure 2 A flow chart of step S101 provided in an embodiment of the present invention;
[0052] Figure 3 A flow chart of step S102 provided in an embodiment of the present invention;
[0053] Figure 4 A schematic diagram of the filtering process of Gaussian blur processing provided by an embodiment of the present invention;
[0054] Figure 5 Another flow chart of step S102 provided in an embodiment of the present invention;
[0055] Figure 6 A flow chart of step S1027 provided in an embodiment of the present invention;
[0056] Figure 7 A flow chart of step S103 provided in an embodiment of the present invention;
[0057] Figure 8 A flow chart of step S104 provided in an embodiment of the present invention;
[0058] Fig. 9 A schematic diagram of the structure of an EPG image missing detection system provided by an embodiment of the present invention;
[0059] Fig.10 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0060] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limitations on the present application. It should be noted that, although the functional module division is performed in the system schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order from the module division in the system schematic diagram or the flow chart. For the step numbers in the following embodiments, they are only set for the convenience of explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0061] In the description of the present invention, the meaning of "a plurality" is two or more. If there is a description of the first or the second, it is only for the purpose of distinguishing the technical features, and it cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features. In addition, unless otherwise defined, all technical and scientific terms used in this document have the same meaning as those commonly understood by technicians in the technical field of this application. The terms used in this document are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0062] The EPG image missing detection method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a set-top box, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the EPG image missing detection method, etc., but is not limited to the above forms.
[0063] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0064] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0065] like Figure 1 FIG. 1 is a flow chart showing a method for detecting missing EPG images according to an embodiment of the present invention. Figure 1 The embodiment of the present invention provides an EPG image missing detection method, which specifically includes the following steps:
[0066] S101 , obtaining a target EPG image, and performing grayscale processing on the target EPG image to obtain a first EPG image.
[0067] Specifically, the embodiment of the present invention uses a set-top box crawler program to periodically traverse important columns such as the EPG homepage and secondary pages, live broadcast, playback, movies, and TV series to obtain a target EPG image.
[0068] A grayscale image is an image without color, with all RGB color components being equal. Grayscale refers to the color depth in a black-and-white image, generally ranging from 0 to 255, with white being 255 and black being 0, so a black-and-white image is also called a grayscale image. In the embodiment of the present invention, the acquired target EPG image to be detected is grayscaled to obtain a first EPG image, which facilitates subsequent edge contour recognition and detection.
[0069] like Figure 2 FIG. 1 is a flow chart of step S101 provided in an embodiment of the present invention, referring to FIG. Figure 2 As an optional implementation, the step of graying the target EPG image to obtain the first EPG image specifically includes:
[0070] S1021, processing the target EPG image by any one of a floating point algorithm, an integer method, a shift method, an average method, and a green-only method to obtain a first grayscale value of each pixel of the target EPG image;
[0071] S1022: Perform color gamut conversion on each pixel of the target EPG image according to the first grayscale value to obtain a first EPG image.
[0072] Specifically, the embodiment of the present invention can grayscale the target EPG image by one of the following methods:
[0073] 1. Floating point algorithm: Gray = R0.3 + G0.59 + B0.11
[0074] 2. Integer method: Gray = (R30 + G59 + B11) / 100
[0075] 3. Shift method: Gray = (R28 + G151 + B * 77) >> 8
[0076] 4. Average value method: Gray = (R + G + B) / 3
[0077] 5. Take only green: Gray = G
[0078] After obtaining Gray (i.e., grayscale value) by any of the above methods, R, G, and B in the colors (R, G, B) of each pixel of the target EPG image are uniformly replaced with Gray to form a new color RGB (Gray, Gray, Gray), thereby obtaining the first EPG image.
[0079] S102 , performing Gaussian blur processing on the first EPG image to obtain a second EPG image, and performing edge detection on the second EPG image to obtain edge image information.
[0080] Specifically, the embodiment of the present invention uses Gaussian distribution as a filter function, which is mainly used to reduce image noise and image details; Gaussian blur can count the pixel color values around a certain point according to the Gaussian curve, and use the mathematical weighted average calculation method to obtain the color value of this curve. The so-called "blur" can be understood as each pixel taking the average value of the surrounding pixels. Convolution of the image with the circular box blur will generate a more accurate out-of-focus imaging effect. Since the Fourier transform of the Gaussian function is another Gaussian function, the Gaussian blur is a low-pass filter for the image.
[0081] For the second EPG image obtained by Gaussian blur processing, the Canny operator is used to perform edge detection on it to obtain the corresponding edge image information.
[0082] Canny operator edge detection is a method of detecting edges using a multi-level edge detection algorithm. Edge detection is mainly the measurement, detection and positioning of grayscale changes in images. The goal of Canny is to find an optimal edge detection algorithm. The meaning of optimal edge detection is:
[0083] (1) Optimal detection: The algorithm can identify as many actual edges in the image as possible, and the probability of missing a real edge and the probability of falsely detecting a non-edge are as small as possible;
[0084] (2) Optimal positioning criterion: the position of the detected edge point is closest to the position of the actual edge point, or the degree to which the detected edge deviates from the actual edge of the object due to noise is minimized;
[0085] (3) One-to-one correspondence between detection points and edge points: The edge points detected by the operator should correspond to the actual edge points. To meet these requirements, Canny used the calculus of variations, which is a method for finding functions that optimize specific functions. The optimal detection is represented by four exponential function terms, but it is very close to the first-order derivative of the Gaussian function.
[0086] like Figure 3 FIG. 1 is a flow chart of step S102 provided in an embodiment of the present invention, referring to FIG. Figure 3 As an optional implementation, the step of performing Gaussian blur processing on the first EPG image to obtain the second EPG image specifically includes:
[0087] S1021, obtaining a preset Gaussian filter, and determining a corresponding window size and weight matrix according to the Gaussian filter;
[0088] S1022, determining a filter window area for each pixel in the first EPG image according to the window size, and performing weighted average processing on the grayscale value of each pixel in the filter window area according to a weight matrix to obtain a Gaussian blurred grayscale value of the corresponding pixel;
[0089] S1023 , converting the grayscale value of the first EPG image according to the Gaussian blur grayscale value to obtain a second EPG image.
[0090] Specifically, the embodiment of the present invention applies Gaussian filtering to smooth the image in order to remove noise. Since the edge of the image is very susceptible to interference from noise, in order to avoid detecting erroneous edge information, it is usually necessary to filter the image to remove noise. The purpose of filtering is to smooth some non-edge areas with weak textures in order to obtain more accurate edges. In the actual processing process, Gaussian filtering is usually used to remove noise in the image.
[0091] like Figure 4 The figure shows a schematic diagram of the filtering process of the Gaussian blur processing provided by an embodiment of the present invention, that is, the process of using the Gaussian filter T to filter the pixel point with a pixel value of 226 in the original image O to obtain the value of the point in the filtering result image D.
[0092] It is understandable that, during the filtering process, the weighted average value is calculated for all pixels in the filter window area corresponding to the target pixel through the filter to obtain the final filtering result. For the Gaussian filter T, the closer the point is to the center, the greater the weight.
[0093] like Figure 4 As shown, for the pixel point with a pixel value of 226 in image O, the calculation process and result of filtering using filter T are: result = 1 / 56×(197×1+25×1+106×2+156×1+159×1+149×1+40×1+107×4+5×3+71×1+163×2+198×4+226×8+223×4+156×2+222×1+37×3+68×4+193×3+157×1+42×1+72×1+250×2+41×1+75×1)=138.
[0094] Usually, the Gaussian filter (Gaussian kernel) is not fixed, and the size of the filter is also variable. The size of the Gaussian kernel plays an important role in the effect of edge detection. The larger the kernel of the filter, the lower the sensitivity of the edge information to noise. However, the larger the kernel, the greater the positioning error of edge detection. In the embodiment of the present invention, a Gaussian kernel of 5×5 size is used to perform Gaussian blur processing on the first EPG image. The specific weight matrix can be set according to the actual situation, and the embodiment of the present invention is not limited here.
[0095] like Figure 5 FIG. 1 is another flow chart of step S102 provided in an embodiment of the present invention, referring to FIG. Figure 5 As an optional implementation, the step of performing edge detection on the second EPG image to obtain edge image information specifically includes:
[0096] S1024, obtaining a preset Canny operator, performing edge detection on the second EPG image by using the Canny operator, and obtaining the gradient amplitude and gradient direction of the grayscale change of each pixel point;
[0097] S1025, for each target pixel of the second EPG image, determine a plurality of first pixel points within a preset area, the gradient direction of the first pixel points being the same as the gradient direction of the target pixel points, and then determine whether the gradient amplitude of the target pixel points is greater than the gradient amplitude of the first pixel points;
[0098] S1026: When the gradient amplitude of the target pixel is greater than the gradient amplitude of the first pixel, determine the target pixel as a candidate edge pixel;
[0099] S1027 , performing double threshold screening on the candidate edge pixels to obtain strong edge pixels and virtual edge pixels, and determining edge image information according to the strong edge pixels and the virtual edge pixels.
[0100] Specifically, the direction of the gradient is perpendicular to the direction of the edge, and usually the nearest value is 8 different directions such as horizontal (left, right), vertical (upper, lower), diagonal (upper right, upper left, lower left, lower right). When the second EPG image is edge detected by the Canny operator, two values of the gradient amplitude and angle (representing the direction of the gradient) are obtained.
[0101] The embodiment of the present invention uses non-maximum suppression technology to eliminate false edge detection. After obtaining the amplitude and direction of the gradient, traverse the pixel points in the image and remove all non-edge points. In the specific implementation, traverse the pixel points one by one to determine whether the current pixel point is the maximum gradient amplitude of the surrounding pixel points with the same gradient direction, and decide whether to suppress the point based on the judgment result. From the above description, it can be seen that this step is the process of edge refinement. For each pixel point:
[0102] (1) If the point is a local maximum in the positive / negative gradient direction, then keep the point.
[0103] (2) If not, suppress the point (reset to zero).
[0104] After the above processing, the pixels that remain are candidate edge pixels. The embodiment of the present invention uses a double threshold method to screen the candidate edge pixels to obtain strong edge pixels and virtual edge pixels, thereby further determining edge image information.
[0105] like Figure 6 FIG. 1 is a flow chart of step S1027 provided in an embodiment of the present invention, referring to FIG. Figure 6 As an optional implementation, the step of performing double threshold screening on the candidate edge pixels to obtain strong edge pixels and virtual edge pixels, and determining edge image information based on the strong edge pixels and virtual edge pixels specifically includes:
[0106] S10271. Obtain a preset first amplitude threshold and a second amplitude threshold, where the first amplitude threshold is greater than the second amplitude threshold;
[0107] S10272: if the gradient amplitude of the candidate edge pixel is greater than or equal to the first amplitude threshold, determine that the candidate edge pixel is a strong edge pixel; if the gradient amplitude of the candidate edge pixel is less than the first amplitude threshold and greater than the second amplitude threshold, determine that the candidate edge pixel is a virtual edge pixel;
[0108] S10273, if the virtual edge pixel is connected to the strong edge pixel, retain the virtual edge pixel; if the virtual edge pixel is not connected to the strong edge pixel, determine the virtual edge pixel to be a weak edge pixel and remove it;
[0109] S10274. Determine edge image information based on strong edge pixels and retained virtual edge pixels.
[0110] Specifically, after completing non-maximum suppression, the strong edges of the image are already in the currently acquired edge image. However, some virtual edges may also be in the edge image. These virtual edges may be generated by the real image or by noise. Virtual edges generated by noise must be removed.
[0111] Therefore, the embodiment of the present invention sets two thresholds, namely a high threshold (first amplitude threshold) and a low threshold (second amplitude threshold). According to the relationship between the gradient amplitude of the current edge pixel and the two thresholds, the edge attribute is judged, and the specific steps are as follows:
[0112] ① If the gradient amplitude of the current edge pixel is greater than or equal to the high threshold, the current edge pixel is marked as a strong edge pixel (need to be retained).
[0113] ② If the gradient amplitude of the current edge pixel is between the high threshold and the low threshold, the current edge pixel is marked as a virtual edge pixel (further judgment is required).
[0114] ③ If the gradient amplitude of the current edge pixel is less than or equal to the low threshold, the current edge pixel is suppressed (needs to be discarded). The embodiment of the present invention determines which case the virtual edge pixel belongs to by judging whether the virtual edge pixel is connected to the strong edge pixel. Generally, if a virtual edge pixel is connected to a strong edge pixel (directly or through other virtual edge pixels), the virtual edge pixel is retained; otherwise, the virtual edge pixel is marked as a weak edge pixel and suppressed.
[0115] After the above processing, the complete edge image information can be obtained according to the strong edge pixels and the retained virtual edge pixels.
[0116] S103: Determine a plurality of continuous edge contours according to the edge image information, and perform reverse edge detection on the second EPG image according to the continuous edge contours to obtain a plurality of reverse edge contours.
[0117] Specifically, the result obtained through edge detection is the part of the EPG page containing multimedia content, and then the reverse edge contour is obtained through reverse edge detection, that is, the edge contour of the part without multimedia content is screened out.
[0118] like Figure 7 FIG. 1 is a flow chart of step S103 provided in an embodiment of the present invention, referring to FIG. Figure 7 As an optional implementation, a plurality of continuous edge contours are determined according to the edge image information, and a step of performing reverse edge detection on the second EPG image according to the continuous edge contours to obtain a plurality of reverse edge contours specifically includes:
[0119] S1031, determining a plurality of first edge contours according to edge image information;
[0120] S1032: When the pixel points of the first edge contour are continuous, determine that the first edge contour is a continuous edge contour;
[0121] S1033, when the pixel points of the first edge contour are discontinuous, closing the first edge contour according to the shape of the first edge contour to obtain a continuous edge contour;
[0122] S1034, determining a plurality of first closed areas in the second EPG image according to the continuous edge contour, and performing reverse selection on the first closed areas to obtain a plurality of second closed areas;
[0123] S1035: Determine that the edge contour of the second closed area is a reverse edge contour.
[0124] Specifically, the edge image information includes continuous edge contours (i.e., closed edge contours) and discontinuous edge contours. For discontinuous edge contours, the edges are supplemented according to their shapes (rectangle, triangle, circle, ellipse, etc.) to form closed contours, thereby obtaining continuous edge contours. It can be understood that in the EPG page, the presentation contours of multimedia content are basically regular shapes such as rectangles, triangles, circles, ellipses, etc., and their shapes can be detected / predicted through Hough transform, thereby completing the closing process of discontinuous edge contours.
[0125] According to the continuous edge contour, several first closed areas (ie multimedia content areas) can be determined in the second EPG image. By reverse selection, a second closed area without multimedia content can be obtained. The edge contour of the second closed area is the reverse edge contour.
[0126] S104 , judging whether there is image missing in the target EPG image according to the pixel ratio of the reverse edge contour.
[0127] like Figure 8 FIG. 1 is a flow chart of step S104 provided in an embodiment of the present invention, referring to FIG. Figure 8 As an optional implementation, the step of judging whether there is image missing in the target EPG image according to the pixel ratio of the reverse edge contour specifically includes:
[0128] S1041, determining a first total number of pixels surrounded by the reverse edge contour, and determining a second total number of pixels of all pixels in the target EPG image;
[0129] S1042, determining a pixel point ratio of a reverse edge contour according to a ratio of a first total number of pixel points to a second total number of pixel points;
[0130] S1043: When the pixel ratio is greater than or equal to a preset third threshold, it is determined that there is image missing in the target EPG image.
[0131] Specifically, if there is image loss in the target EPG image, a corresponding content-free area will be obtained after reverse edge detection, and the pixel ratio of the content-free area in the entire target EPG image will be determined. When the pixel ratio exceeds a preset third threshold (such as 30 percent), it indicates that there is image loss in the target EPG image.
[0132] The embodiment of the present invention periodically traverses the EPG homepage and secondary pages, live broadcast, playback, movies, TV series and other important columns before presenting the EPG page to the user, performs image missing detection based on the original result pictures of the traversal, and determines whether there is a picture missing situation. If this situation occurs, it is necessary to solve the abnormal problem first, and then present the result to the user, thereby improving the user experience.
[0133] The above is an explanation of the method steps of the embodiment of the present invention. It can be understood that the embodiment of the present invention can reduce the noise of the target EPG image through grayscale processing and Gaussian blur processing, making the image edge of the multimedia content more obvious; the continuous edge contour of the multimedia content is obtained through edge detection and the reverse edge contour is determined through reverse edge detection, so that the pixel ratio of the non-multimedia content area to the target EPG image can be determined, and then it can be determined whether there is image missing in the target EPG image. When there is image missing, the troubleshooting process can be quickly started, which improves the real-time, accuracy and efficiency of EPG image missing detection and also improves the user's browsing experience.
[0134] It should be recognized that the embodiments of the present invention can be applied to the set-top box EPG system to periodically traverse the EPG homepage and secondary pages, live broadcasts, replays, movies, TV series and other important columns, and issue alarms for monitored abnormal events (such as inaccessible pages and missing pictures), so as to promptly discover and handle EPG page abnormalities and improve the browsing experience of set-top box users.
[0135] like Fig. 9 FIG. 1 is a schematic diagram of the structure of the EPG image missing detection system provided by an embodiment of the present invention, referring to FIG. Fig. 9 The embodiment of the present invention provides an EPG image missing detection system, comprising:
[0136] A grayscale processing module, used for acquiring a target EPG image, and performing grayscale processing on the target EPG image to obtain a first EPG image;
[0137] An edge detection module, used for performing Gaussian blur processing on the first EPG image to obtain a second EPG image, and performing edge detection on the second EPG image to obtain edge image information;
[0138] A reverse edge contour determination module, used to determine a plurality of continuous edge contours according to the edge image information, and to perform reverse edge detection on the second EPG image according to the continuous edge contours to obtain a plurality of reverse edge contours;
[0139] The image missing judgment module is used to judge whether there is image missing in the target EPG image according to the pixel ratio of the reverse edge contour.
[0140] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0141] The embodiment of the present invention also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned EPG image missing detection method. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0142] like Fig.10 FIG. 1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention, referring to FIG. Fig.10 , an embodiment of the present invention provides an electronic device, including:
[0143] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention;
[0144] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the EPG image missing detection method of the embodiment of the present invention;
[0145] Input / output interface 1003, used to implement information input and output;
[0146] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0147] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );
[0148] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .
[0149] An embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned EPG image missing detection method.
[0150] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0151] The embodiment of the present invention also discloses a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 The method shown.
[0152] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the above-mentioned boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0153] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified to the contrary, one or more of the above-mentioned functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0154] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0155] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0156] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the above-mentioned program is printed, since the above-mentioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.
[0157] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0158] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0159] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0160] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A method for detecting missing EPG images, It is characterized in that The following steps are involved: Acquire a target EPG image, and perform grayscale processing on the target EPG image to obtain a first EPG image; Performing Gaussian blur processing on the first EPG image to obtain a second EPG image, and performing edge detection on the second EPG image to obtain edge image information; Determine a plurality of continuous edge contours according to the edge image information, and perform reverse edge detection on the second EPG image according to the continuous edge contours to obtain a plurality of reverse edge contours; Determining whether the target EPG image has image missing according to the pixel ratio of the reverse edge contour; The step of performing edge detection on the second EPG image to obtain edge image information specifically includes: Obtaining a preset Canny operator, performing edge detection on the second EPG image by using the Canny operator, and obtaining a gradient amplitude and a gradient direction of a grayscale change of each pixel point; For each target pixel of the second EPG image, determine a plurality of first pixel points within a preset area, the gradient direction of the first pixel points being the same as the gradient direction of the target pixel points, and then determine whether the gradient amplitude of the target pixel points is greater than the gradient amplitude of the first pixel points; When the gradient amplitude of the target pixel point is greater than the gradient amplitude of the first pixel point, determining the target pixel point as a candidate edge pixel point; Performing double-threshold screening on the candidate edge pixel points to obtain strong edge pixel points and virtual edge pixel points, and determining the edge image information according to the strong edge pixel points and the virtual edge pixel points; The step of performing double threshold screening on the candidate edge pixels to obtain strong edge pixels and virtual edge pixels, and determining the edge image information according to the strong edge pixels and the virtual edge pixels specifically includes: Acquire a preset first amplitude threshold and a second amplitude threshold, wherein the first amplitude threshold is greater than the second amplitude threshold; If the gradient amplitude of the candidate edge pixel point is greater than or equal to the first amplitude threshold, the candidate edge pixel point is determined to be a strong edge pixel point; if the gradient amplitude of the candidate edge pixel point is less than the first amplitude threshold and greater than the second amplitude threshold, the candidate edge pixel point is determined to be a virtual edge pixel point; If the virtual edge pixel point is connected to the strong edge pixel point, the virtual edge pixel point is retained; if the virtual edge pixel point is not connected to the strong edge pixel point, the virtual edge pixel point is determined to be a weak edge pixel point and is removed; The edge image information is determined according to the strong edge pixel points and the retained virtual edge pixel points.
2. The EPG image missing detection method according to claim 1, It is characterized in that The step of graying the target EPG image to obtain the first EPG image specifically includes: Processing the target EPG image by any one of a floating point algorithm, an integer method, a shift method, an average method, and a green-only method to obtain a first grayscale value of each pixel of the target EPG image; Performing color gamut conversion on each pixel of the target EPG image according to the first grayscale value to obtain the first EPG image.
3. The EPG image missing detection method according to claim 1, It is characterized in that The step of performing Gaussian blur processing on the first EPG image to obtain the second EPG image specifically includes: Obtain a preset Gaussian filter, and determine a corresponding window size and weight matrix according to the Gaussian filter; Determine the filter window area of each pixel in the first EPG image according to the window size, and perform weighted average processing on the grayscale value of each pixel in the filter window area according to the weight matrix to obtain the Gaussian blurred grayscale value of the corresponding pixel; The second EPG image is obtained by performing grayscale value conversion on the first EPG image according to the Gaussian blur grayscale value.
4. The EPG image missing detection method according to claim 1, It is characterized in that The step of determining a plurality of continuous edge contours according to the edge image information, and performing reverse edge detection on the second EPG image according to the continuous edge contours to obtain a plurality of reverse edge contours specifically includes: determining a plurality of first edge contours according to the edge image information; When the pixel points of the first edge contour are continuous, determining the first edge contour as a continuous edge contour; When the pixel points of the first edge contour are discontinuous, closing the first edge contour according to the shape of the first edge contour to obtain a continuous edge contour; Determining a plurality of first closed areas in the second EPG image according to the continuous edge contour, and performing reverse selection on the first closed areas to obtain a plurality of second closed areas; An edge contour of the second closed area is determined as the reverse edge contour.
5. A method for detecting EPG image missing according to any one of claims 1 to 4, It is characterized in that The step of judging whether the target EPG image has image missing according to the pixel ratio of the reverse edge contour specifically includes: Determine a first total number of pixels surrounded by the reverse edge contour, and determine a second total number of pixels of all pixels in the target EPG image; Determining a pixel point ratio of the reverse edge contour according to a ratio of the first total number of pixel points to the second total number of pixel points; When the pixel ratio is greater than or equal to a preset third threshold, it is determined that there is image missing in the target EPG image.
6. An EPG image missing detection system, It is characterized in that include: A grayscale processing module, used for acquiring a target EPG image, and performing grayscale processing on the target EPG image to obtain a first EPG image; an edge detection module, configured to perform Gaussian blur processing on the first EPG image to obtain a second EPG image, and perform edge detection on the second EPG image to obtain edge image information; A reverse edge contour determining module, used for determining a plurality of continuous edge contours according to the edge image information, and performing reverse edge detection on the second EPG image according to the continuous edge contours to obtain a plurality of reverse edge contours; An image missing judgment module, used for judging whether the target EPG image has image missing according to the pixel ratio of the reverse edge contour; The step of performing edge detection on the second EPG image to obtain edge image information specifically includes: Obtaining a preset Canny operator, performing edge detection on the second EPG image by using the Canny operator, and obtaining a gradient amplitude and a gradient direction of a grayscale change of each pixel point; For each target pixel of the second EPG image, determine a plurality of first pixel points within a preset area, the gradient direction of the first pixel points being the same as the gradient direction of the target pixel points, and then determine whether the gradient amplitude of the target pixel points is greater than the gradient amplitude of the first pixel points; When the gradient amplitude of the target pixel point is greater than the gradient amplitude of the first pixel point, determining the target pixel point as a candidate edge pixel point; Performing double-threshold screening on the candidate edge pixel points to obtain strong edge pixel points and virtual edge pixel points, and determining the edge image information according to the strong edge pixel points and the virtual edge pixel points; The step of performing double threshold screening on the candidate edge pixels to obtain strong edge pixels and virtual edge pixels, and determining the edge image information according to the strong edge pixels and the virtual edge pixels specifically includes: Acquire a preset first amplitude threshold and a second amplitude threshold, wherein the first amplitude threshold is greater than the second amplitude threshold; If the gradient amplitude of the candidate edge pixel point is greater than or equal to the first amplitude threshold, the candidate edge pixel point is determined to be a strong edge pixel point; if the gradient amplitude of the candidate edge pixel point is less than the first amplitude threshold and greater than the second amplitude threshold, the candidate edge pixel point is determined to be a virtual edge pixel point; If the virtual edge pixel point is connected to the strong edge pixel point, the virtual edge pixel point is retained; if the virtual edge pixel point is not connected to the strong edge pixel point, the virtual edge pixel point is determined to be a weak edge pixel point and is removed; The edge image information is determined according to the strong edge pixel points and the retained virtual edge pixel points.
7. An electronic device, It is characterized in that The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the EPG image missing detection method as described in any one of claims 1 to 5 are realized.
8. A storage medium, the storage medium being a computer-readable storage medium, for computer-readable storage, It is characterized in that The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the EPG image missing detection method according to any one of claims 1 to 5.
