Screen detection method, device, computer equipment and readable storage medium
By dividing the KVM images output by the server BMC, the multi-window specifications and processing of template image block correlations, the problem of inaccurate screen defect detection in the prior art is solved, and higher detection accuracy and BMC fault resolution efficiency are achieved. .
Patent Information
- Application Number
- CN202211187228.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-09-28
AI Technical Summary
In the prior art, when detecting the defect of KVM image screen output by the server BMC, the results are inaccurate, resulting in the inability to effectively identify and solve the BMC failure problem.
By acquiring the detection screen image of the target device, dividing the image using a variety of different window specifications, multiple detection image blocks are obtained, and correlation processing is performed with the template image blocks in the template screen image to determine the abnormal detection result of the image.
It improves the detection accuracy of whether there are abnormal defects and screen defects in the screen image on the BMC display interface, enhances the detection performance of KVM, promptly solves BMC failure problems, saves human resource costs, and avoids manual errors.
Smart Images

Figure CN115578329B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a screen detection method, device, computer equipment and readable storage medium. Background Art
[0002] The console display switching (Keyboard Video Mouse, KVM) function supported by the server baseboard management controller (Baseboard Management Controller, BMC) has the functions of stress testing and performance testing, and can realize remote access to computer devices such as personal computers, servers or other electronic devices on the local computer side. After the BMC function is activated, the desktop of the remote computer device can be viewed on the monitor. Among them, the test results displayed by KVM during stress testing may have a distorted screen defect.
[0003] In the related art, the KVM image output by the server BMC is mainly detected by deep learning algorithm, and whether there is a screen defect in the KVM image is determined according to the target detection result. However, the use of related technology will lead to inaccurate screen defect detection results. Summary of the invention
[0004] Based on this, it is necessary to provide a screen detection method, device, computer equipment and readable storage medium to address the above technical problems, which can improve the accuracy of screen defect detection results.
[0005] In a first aspect, the present application provides a screen detection method, the method comprising:
[0006] Get the detection screen image of the currently monitored target device;
[0007] The detection screen image is divided by using a plurality of different window specifications to obtain a plurality of detection image blocks;
[0008] Based on correlation processing between multiple detection image blocks and multiple template image blocks in a template screen image, an abnormality detection result of the detection screen image is determined; the template screen image is an image of a screen without abnormalities of the target device.
[0009] The screen detection method provided in the embodiment of the present application can obtain the detection screen image of the target device currently monitored, divide the detection screen image through a plurality of different window specifications to obtain a plurality of detection image blocks, and perform correlation processing based on the plurality of detection image blocks and a plurality of template image blocks in the template screen image to determine the abnormal detection result of the detection screen image; the method takes the image pixel level into consideration, divides the detection screen image through different window specifications to obtain a smaller detection image block in the detection screen image, and implements screen detection through the smaller detection image block and the template image block in the template screen image, thereby not only improving the accuracy of whether there are abnormal defects in the screen image displayed on the display interface of the BMC, but also improving the accuracy of whether there are flower screen defects in the screen image displayed on the display interface of the BMC, thereby improving the accuracy of the BMC detection. The invention can improve the detection performance of KVM of C, and can solve the fault problem of BMC in time and quickly based on the screen detection result, so as to avoid affecting the normal use of BMC; at the same time, the method does not need manual participation in screen detection, so as to save the human resource cost of screen detection processing, avoid manual participation errors, and improve the accuracy of screen detection processing results; in addition, the method does not need manual participation in processing, so as to perform screen detection on large-size detection screen images, so as to increase the flexibility of screen detection processing; in addition, the method realizes screen detection through a set of computer processing algorithms, avoids the use of deep learning networks to realize screen detection, so as to save the training time of deep learning networks and the time of loading deep learning networks when applying, so as to improve the efficiency of screen detection and shorten the duration of screen detection.
[0010] In one embodiment, the plurality of different window specifications include a first window specification and a second window specification; the detection screen image is divided by the plurality of different window specifications to obtain a plurality of detection image blocks, including:
[0011] According to the first window specification, the detection screen image is divided to obtain a plurality of images to be detected; the size of the images to be detected is the same as the size of the template screen image;
[0012] Acquire a target detection image that meets a preset detection condition from a plurality of images to be detected; the preset detection condition is the image to be detected that has the greatest similarity with the template screen image;
[0013] According to the second window specification, the target detection image is divided into multiple detection image blocks.
[0014] The screen detection method provided in the embodiment of the present application can divide the detection screen image according to the first window specification to obtain multiple images to be detected, obtain a target detection image that meets the preset detection conditions from the multiple images to be detected, and divide the target detection image according to the second window specification to obtain multiple detection image blocks; the method can perform two-layer division processing on the detection screen image to introduce the pixel level of the detection screen image into the screen detection processing, thereby further improving the accuracy of the screen detection result.
[0015] In one embodiment, the method further comprises:
[0016] For each image to be detected, the square difference matching method is used to perform similarity processing on the image to be detected and the template screen image to obtain the similarity between the image to be detected and the template screen image;
[0017] If there is an image to be detected among the images to be detected whose similarity with the template screen image is greater than a preset similarity threshold, a step of acquiring a target detection image that meets the preset detection conditions from the multiple images to be detected is performed.
[0018] The embodiment of the present application can obtain the similarity between the image to be detected and the template screen image, and determine the abnormal detection result of the detection screen image based on the similarity between the image to be detected and the template screen image. When it is preliminarily determined that the abnormal detection result of the detection screen image is that there is no abnormal defect, it may be necessary to further process the image to be detected to ensure the correctness of the abnormal detection result of the detection screen image.
[0019] In one embodiment, the abnormal detection result includes the presence of an abnormal defect; and the method further includes:
[0020] If the similarities between each image to be detected and the template screen image are less than or equal to the preset similarity threshold, the abnormal detection result of the detection screen image is determined to be an abnormal defect, and the screen detection process is terminated.
[0021] The embodiment of the present application can determine that the abnormal detection result of the detection screen image is the existence of abnormal defects based on the similarity between each image to be detected and the template screen image, that is, determine that there are abnormal defects in the detection screen image, and then end the screen detection and processing flow, thereby reducing the amount of screen detection processing calculations and shortening the processing time of screen detection.
[0022] In one embodiment, the plurality of different windows include a second window specification, and determining an abnormality detection result of the detection screen image based on correlation processing between the plurality of detection image blocks and the plurality of template image blocks in the template screen image includes:
[0023] According to the second window specification, the template screen image is divided to obtain a plurality of template image blocks;
[0024] Respectively obtain a first grayscale image of each pixel channel corresponding to the detection image block, and obtain a second grayscale image of each pixel channel corresponding to each template image block;
[0025] Performing histogram processing on each first grayscale image to obtain a corresponding first grayscale histogram, and performing histogram processing on each second grayscale image to obtain a corresponding second grayscale histogram;
[0026] The abnormality detection result of the detection screen image is determined by performing correlation processing on each first grayscale histogram and each second grayscale histogram.
[0027] The screen detection method provided in the embodiment of the present application can divide the template screen image according to the second window specification to obtain multiple template image blocks, respectively obtain the first grayscale image of each pixel channel corresponding to the detection image block, and obtain the second grayscale image of each pixel channel corresponding to each template image block, perform histogram processing on each first grayscale image to obtain the corresponding first grayscale histogram, and perform histogram processing on each second grayscale image to obtain the corresponding second grayscale histogram, and determine the abnormal detection result of the detection screen image by performing correlation processing on each first grayscale histogram and each second grayscale histogram; based on the preliminary determination that the abnormal detection result of the detection screen image is that there is no abnormal defect, the method can further process each detection image block and the image block in the template screen image, that is, realize the pixel-level processing between the detection screen image and the template screen image to determine the final abnormal detection result of the detection screen image, so that the final abnormal detection result of the detection screen image can be determined more accurately, the accuracy of the screen detection result can be improved, and the problem of abnormal maintenance of BMC due to inaccurate screen detection results can be avoided, thereby reducing the maintenance cost of BMC.
[0028] In one embodiment, the abnormality detection result includes the absence of abnormal defects; performing correlation processing on each first grayscale histogram and each second grayscale histogram to determine the abnormality detection result of the detection screen image includes:
[0029] For any first grayscale histogram, performing correlation processing on the first grayscale histogram and the corresponding second grayscale histogram to obtain a correlation value between the first grayscale histogram and the corresponding second grayscale histogram;
[0030] If all correlation values are greater than or equal to a preset correlation threshold, it is determined that there is no abnormal defect in the detected image block;
[0031] If there are no abnormal defects in each detection image block, it is determined that the abnormal detection result of the detection screen image is that there are no abnormal defects.
[0032] The screen detection method provided in the embodiment of the present application can calculate the corresponding correlation between the grayscale images corresponding to each pixel channel between the detection image block and the template image block, so as to perform correlation processing on the target detection image and the template screen image based on each pixel channel, that is, it can analyze the correlation between the target detection image and the template screen image from the image pixel level, so that the correlation processing result is more accurate, and determine the abnormal detection result of the detection screen image based on the correlation processing result, so as to make the screen detection result more accurate.
[0033] In one embodiment, the method further comprises:
[0034] If there is a value whose correlation among the correlation values is less than the correlation threshold, it is determined that the abnormal detection result of the detection screen image is that an abnormal defect exists; and the abnormal defect is a flower screen defect.
[0035] When the embodiment of the present application determines that the correlation value between the first grayscale histogram and the corresponding second grayscale histogram is less than a preset correlation threshold, it can directly determine that the abnormal detection result of the screen image is an abnormal defect. This method can not only ensure the problem of missed detection and improve the accuracy of the screen detection result, but also when it is determined that the correlation value between a first grayscale histogram and the corresponding second grayscale histogram is less than a preset correlation threshold, it can directly detect that the abnormal detection result of the screen image is an abnormal defect. At this time, the screen detection processing flow can be terminated, thereby improving the screen detection speed and reducing the screen detection time to a certain extent.
[0036] In a second aspect, the present application provides a screen detection device, the device comprising:
[0037] A screen image acquisition module is used to acquire the detection screen image of the currently monitored target device;
[0038] An image division module is used to divide the detection screen image into multiple detection image blocks by using a plurality of different window specifications;
[0039] The correlation processing module is used to perform correlation processing on the multiple detection image blocks and the multiple template image blocks in the template screen image to determine the abnormality detection result of the detection screen image; the template screen image is an image of the normal screen of the target device.
[0040] In a third aspect, the present application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method of any one of the embodiments of the first aspect when executing the computer program.
[0041] In a fourth aspect, the present application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method of any one of the embodiments of the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flow chart of a screen detection method in one embodiment;
[0043] Figure 2 is a flow chart of a screen detection method in another embodiment;
[0044] Figure 3 is a flow chart of a screen detection method in another embodiment;
[0045] Figure 4 is a flow chart of a screen detection method in another embodiment;
[0046] Figure 5 is a flow chart of a screen detection method in another embodiment;
[0047] Figure 6 is a structural block diagram of a screen detection device in one embodiment;
[0048] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0050] In BMC monitoring technology, the output image of the target device is mainly monitored remotely, so that the user can log in to the BMC Web locally, turn on the KVM function in the BMC Web, and then view the output image of the target device on the BMC display interface. However, when there is a problem with the BMC data transmission, the BMC display interface will have abnormal defects, which will cause the user to be unable to view the output image of the target device.
[0051] The related technology uses a deep learning algorithm to detect the collected BMC detection screen image, and determines whether there is a target in the detection screen image to determine whether there is a screen defect in the detection screen image. However, the related technology does not process the detection screen image at the pixel level to determine whether there is a screen defect in the detection screen image, resulting in inaccurate detection results of the screen defect.
[0052] Based on this, an embodiment of the present application provides a screen detection method to improve the accuracy of the detection results of flower screen defects. The screen detection method can be applicable to a screen detection system, which includes a BMC, a target device and a processor. Optionally, the target device can be a computer device, a server and / or other electronic device, and the BMC and the target device are physically connected. Among them, the BMC has a KVM function, through which the image output by the display interface of the target device can be monitored. The screen detection method is described below with the processor as the execution subject.
[0053] like Figure 1 The figure is a flow chart of a screen detection method provided by an embodiment of the present application. The screen detection method may include the following steps:
[0054] S100: Acquire a detection screen image of a currently monitored target device.
[0055] Specifically, the processor can obtain the detection screen image of the target device currently monitored after the BMC turns on the KVM function. The detection screen image can be an image displayed on the display interface of the BMC when the user views the display interface of the BMC. Optionally, the target device can be one or more. The acquired detection screen image can be a black and white image or a color image, which is not limited in the embodiments of the present application. In addition, the size of the detection screen image can be larger than the size of the display interface of the target device.
[0056] The method of acquiring the detection screen image may be an image acquired after the BMC turns on the KVM function. Optionally, the image acquired after the KVM function of the BMC is turned on may be a detection screen image, or may be an image containing the detection screen image. If the image containing the detection screen image is acquired after the KVM function of the BMC is turned on, the image containing the detection screen image may be cropped to obtain the detection screen image.
[0057] It should be noted that before executing the above S100, the BMC must be turned on first, and then the KVM function of the BMC must be entered to perform the operation of monitoring the display interface of the target device. Among them, the method of entering the KVM function of the BMC through the BMC, that is, the method of monitoring the display image of the display interface of the target device through the BMC can be to automatically open the web through Selenium first, and the user enters the account and password for logging in to the web, and then automatically enters the KVM after the login is successful. It should be noted that after entering the KVM, the display interface of the BMC can display the image displayed on the display interface of the target device.
[0058] The BMC can also call the information package to simulate the mouse and keyboard, so as to trigger the BMC display interface before the BMC display interface outputs the image displayed on the target device display interface, so as to ensure that the BMC display interface displays normally. Optionally, the above information package can be an interface package encoded in different languages, such as a python package (pyautogui).
[0059] S200, dividing the detection screen image by using a plurality of different window specifications to obtain a plurality of detection image blocks.
[0060] The above window specifications can be understood as the sliding window specifications for cutting multiple small images from the detected screen image, and the specifications of the sliding window are also the specifications of the small images. Among them, the above window specifications can be information such as the size of the sliding window, the moving direction of the sliding window when cutting adjacent small images, and the moving step of the sliding window. Optionally, the window specifications can be user-defined, or can be determined based on the empirical value of the sliding window specifications in the historical screen detection process.
[0061] In an embodiment of the present application, the size of the sliding window may be smaller than the size of the detection screen image. Since the detection screen image is a two-dimensional image, the moving direction of the sliding window may be along the length direction or the width direction of the detection screen image, or may be first along the length direction in the detection screen image and then along the width direction in the detection screen image. Of course, it may also be in an "S"-shaped direction in the detection screen image. The moving step length of the above-mentioned sliding window may be one pixel or multiple pixels in the detection screen image. In an embodiment of the present application, the smaller the size and step length of the sliding window, the higher the accuracy of the screen detection result.
[0062] Exemplarily, for a certain sliding window, the sliding window is moved based on a certain row in the length direction of the detection screen image. After the sliding window moves to the last sliding position of the current row, the sliding window is moved along the next row of the row or multiple rows in the length direction of the detection screen image. After the sliding window moves to the last moving position of the current row, the sliding window is moved along the next row of the row or multiple rows in the length direction of the detection screen image. By analogy, the sliding window is moved along different rows in the length direction of the detection screen image. Naturally, the moving trajectory of the sliding window can be called the "S"-shaped moving direction of the sliding window. Each time the sliding window moves to a corresponding position in the detection screen image, the regional image at the corresponding position is called a corresponding detection image block.
[0063] It should be noted here that the computer device can pre-set a variety of different window specifications, and then divide the detection screen image based on each set window specification to obtain multiple detection image blocks, or sort the multiple different window specifications from large to small according to the size of the window, and then divide the detection screen image according to the largest window specification to obtain multiple first detection image blocks, and then divide each first detection image block according to the next window specification to obtain multiple second detection image blocks, and then divide the multiple detection image blocks obtained last time in turn according to different window specifications each time until the division process is completed through the smallest window specification. Among them, multiple detection image blocks can be obtained by dividing the detection screen image based on each different window specification, and the corresponding multiple detection image blocks obtained with the same window specification have the same size, that is, the size of different detection image blocks is the same as the size of the corresponding sliding window.
[0064] In the division process, an image coordinate system can be first established, and the origin of the image coordinate system is used as the origin of the sliding window, that is, the division reference point, to divide the detection screen image or the detection image block. In an embodiment of the present application, the pixel point in the upper left corner of the detection screen image or the detection image block is determined as the origin of the image coordinate system or the origin of the sliding window.
[0065] Exemplarily, if the size of the detection screen image is 6*8, and the step size of the sliding window is 1, the moving direction of the sliding window is the length direction of the detection screen image, then the first pixel point (1, 1) at the top of the detection screen image is determined as the origin of the image coordinate system during division, and the first pixel point (1, 1) is also determined as the first division reference point. When the second division is performed after the first division, the pixel point (1, 2) in the detection screen image is determined as the second division reference point. When the third division is performed after the second division, the pixel point (1, 3) in the detection screen image is determined as the third division reference point, and so on until the entire division process is completed.
[0066] Based on the previous example, if the step size of the sliding window is 2, when performing the division process, the pixel point (1, 1) in the detection screen image is determined as the first division reference point, the pixel point (1, 3) in the detection screen image is determined as the second division reference point, and the pixel point (1, 5) in the detection screen image is determined as the third division reference point, and so on until the entire division process is performed. In the embodiment of the present application, the method of determining each division reference point when performing the division process according to other sliding directions is also similar, and this will not be repeated.
[0067] S300, determining an abnormality detection result of the detection screen image based on correlation processing between multiple detection image blocks and multiple template image blocks in a template screen image; the template screen image is an image of a normal screen of the target device.
[0068] The template screen image can be an image obtained by obtaining the display interface of the target device after turning on the KVM function of the BMC. The template screen image can be understood as an image displayed on the display interface of the target device when the user views the display interface of the target device, and the size of the template screen image is the same as the size of the image displayed on the display interface of the target device. In the embodiment of the present application, the template screen image is an image without abnormalities displayed on the display interface of the target device, that is, an image of a screen without abnormalities.
[0069] Optionally, the size of each template image block in the template screen image is the same as the size of the detection image block. Specifically, the template screen image can be divided into multiple template image blocks based on the corresponding window specifications of the detection image blocks. The total number of the detection image blocks is the same as the total number of the template image blocks.
[0070] For example, based on the correlation processing between multiple detection image blocks and multiple template image blocks in the template screen image, the correlation between each detection image block and the corresponding template image block can be found in the mapping relationship table, and then the abnormality detection result of the detection screen image is determined based on the correlation found. The mapping relationship table includes each detection image block, each template image block, and the correlation between the detection image block and the template image block.
[0071] For another example, correlation processing is performed based on multiple detection image blocks and multiple template image blocks in the template screen image. It is also possible to use correlation, mean value, standard deviation, correlation coefficient, regression line or least squares method to calculate the correlation between each detection image block and the corresponding template image block in the template screen image, and determine the abnormal detection result of the detection screen image based on each correlation.
[0072] The above abnormal detection result may be the presence or absence of abnormal defects in the detection screen image. Optionally, the abnormal defect may be the presence of abnormal stripes, spots, or color blocks in the detection screen image, or the position of the detection screen image may be reversed or disordered, or of course, the detection screen image may be distorted or distorted.
[0073] In an embodiment of the present application, when there are no abnormal defects in the detection screen image, the detection screen image includes, in addition to the image displayed on the display interface of the target device, also the BMC's functional test (such as screenshot, screen recording, voice switching, mounting, etc.) controls or / views of the target device.
[0074] The screen detection method provided in the embodiment of the present application can obtain the detection screen image of the target device currently monitored, divide the detection screen image through a plurality of different window specifications to obtain a plurality of detection image blocks, and perform correlation processing based on the plurality of detection image blocks and a plurality of template image blocks in the template screen image to determine the abnormal detection result of the detection screen image; the method takes the image pixel level into consideration, divides the detection screen image through different window specifications to obtain a smaller detection image block in the detection screen image, and implements screen detection through the smaller detection image block and the template image block in the template screen image, thereby not only improving the accuracy of whether there are abnormal defects in the screen image displayed on the display interface of the BMC, but also improving the accuracy of whether there are flower screen defects in the screen image displayed on the display interface of the BMC, thereby improving the accuracy of the BMC detection. The invention can improve the detection performance of KVM of C, and can solve the fault problem of BMC in time and quickly based on the screen detection result, so as to avoid affecting the normal use of BMC; at the same time, the method does not need manual participation in screen detection, so as to save the human resource cost of screen detection processing, avoid manual participation errors, and improve the accuracy of screen detection processing results; in addition, the method does not need manual participation in processing, so as to perform screen detection on large-size detection screen images, so as to increase the flexibility of screen detection processing; in addition, the method realizes screen detection through a set of computer processing algorithms, avoids the use of deep learning networks to realize screen detection, so as to save the training time of deep learning networks and the time of loading deep learning networks when applying, so as to improve the efficiency of screen detection and shorten the duration of screen detection.
[0075] The following is a description of the process of dividing the detection screen image by a plurality of different window specifications in the above step S200 to obtain a plurality of detection image blocks. Figure 2 As shown, the above-mentioned multiple different window specifications include a first window specification and a second window specification; the steps in S200 above can be implemented by the following steps:
[0076] S210 . Divide the detection screen image according to the first window specification to obtain a plurality of images to be detected; the size of the images to be detected is the same as the size of the template screen image.
[0077] In an embodiment of the present application, two window specifications are set, namely a first window specification and a second window specification. The detection screen image obtained in the previous step is divided based on the set first window specification to obtain a plurality of images to be detected. Optionally, the total number of images to be detected obtained may be less than or equal to the maximum number of images to be detected obtained by dividing based on the first window specification.
[0078] In addition, in the embodiment of the present application, since the present embodiment needs to compare the image to be detected with the template screen image without abnormal defects, the size of the image to be detected obtained by division needs to be the same as the size of the template screen image. Among them, the first window specification includes the size of the first window and the moving step of the first window, and the size of the first window is the same as the size of the image to be detected.
[0079] The following is an explanation of the manner in which the detection screen image is divided according to the first window specification in the above steps. For example, the computer device may be pre-trained with an algorithm model, and the detection screen image and the first window specification obtained in the above steps are input into the algorithm model, and the model divides the detection screen image according to the first window specification and outputs a plurality of images to be detected.
[0080] For another example, the computer device may also directly divide the detection screen image according to the first window specification to obtain a plurality of images to be detected.
[0081] S220, obtaining a target detection image that meets a preset detection condition from a plurality of images to be detected; the preset detection condition is the image to be detected having the greatest similarity with the template screen image.
[0082] Among them, the computer device can screen out the target detection image that meets the preset detection conditions from multiple images to be detected based on the preset detection conditions. Specifically, the pixel points in each image to be detected and the template screen image can be compared respectively to determine the similarity between each image to be detected and the template screen image, and then the image to be detected with the greatest similarity between the image to be detected and the template screen image is selected, and the selected image to be detected is determined as the target detection image. Optionally, at least one image to be detected among all the images to be detected is an image that meets the preset detection conditions, that is, the target detection image. In an embodiment of the present application, the target detection image can also be understood as the partial image in the detection screen image that has the highest matching degree with the template screen image.
[0083] S230. Divide the target detection image into multiple detection image blocks according to the second window specification.
[0084] Based on the target detection image obtained in the above steps, the target detection image obtained in the previous steps can be divided according to the preset second window specification to obtain multiple detection image blocks. Optionally, the total number of detection image blocks obtained can be less than or equal to the maximum number of detection image blocks obtained by division based on the second window specification. The second window specification includes the size of the second window and the moving step of the second window, and the size of the second window is the same as the size of the detection image block.
[0085] The following is an explanation of the manner in which the target detection image is divided according to the second window specification in the above steps. For example, the computer device may be pre-trained with an algorithm model, and the target detection image and the second window specification obtained in the above steps are input into the algorithm model, and the model divides the target detection image according to the second window specification and outputs a plurality of detection image blocks.
[0086] For another example, the computer device may also directly divide the target detection image according to the second window specification to obtain a plurality of detection image blocks.
[0087] The screen detection method provided in the embodiment of the present application can divide the detection screen image according to the first window specification to obtain multiple images to be detected, obtain a target detection image that meets the preset detection conditions from the multiple images to be detected, and divide the target detection image according to the second window specification to obtain multiple detection image blocks; the method can perform two-layer division processing on the detection screen image to introduce the pixel level of the detection screen image into the screen detection processing, thereby further improving the accuracy of the screen detection result.
[0088] In one embodiment, before executing the step in S220 above, Figure 3 As shown, the screen detection method may further include:
[0089] S240 , for each image to be detected, use a square difference matching method to perform similarity processing on the image to be detected and the template screen image to obtain the similarity between the image to be detected and the template screen image.
[0090] It is understandable that, for each image to be detected, a similarity algorithm can be used to perform similarity processing on the image to be detected and the template screen image to obtain the similarity between the image to be detected and the template screen image. The similarity algorithm can be a Jaccard similarity coefficient, a cosine similarity and / or a Pearson correlation coefficient, etc., but in the embodiment of the present application, the similarity algorithm is a square difference matching method.
[0091] Specifically, the process of using the square difference matching method to perform similarity processing on the image to be detected and the template screen image to obtain the similarity can be expressed by formula (1) as follows:
[0092]
[0093] Among them, R in formula (1) TI represents the similarity between the image to be detected and the template screen image, T(x i ,y i ) represents the pixel point (x i ,y i ) pixel value, I(x i ,yi ) represents the pixel point (x i ,y i ), x i Represents the horizontal coordinate of the pixel point in the image to be detected, y i represents the ordinate of the pixel point in the image to be detected, l represents the total number of pixels in the image to be detected, m represents the abscissa of the division reference point corresponding to the image to be detected, and n represents the ordinate of the division reference point corresponding to the image to be detected.
[0094] In an embodiment of the present application, the similarity between the image to be detected and the template screen image can be understood as the error value between the pixel values of corresponding pixel points between the image to be detected and the template screen image. Naturally, the smaller the error value, the greater the similarity between the image to be detected and the template screen image, and the larger the error value, the smaller the similarity between the image to be detected and the template screen image.
[0095] S250: If there is an image to be detected among the images to be detected whose similarity with the template screen image is greater than a preset similarity threshold, a step of acquiring a target detection image that meets a preset detection condition from the multiple images to be detected is executed.
[0096] For all the images to be detected, when the similarity between any image to be detected and the template screen image is greater than the preset similarity threshold, it can be preliminarily determined that the abnormal detection result of the detection screen image is that there is no abnormal defect. However, in order to improve the accuracy of the abnormal detection result of the detection screen image, further processing is required to determine whether the abnormal detection result of the detection screen image is the result of the absence of abnormal defects or the result of the presence of abnormal defects. At this time, the steps in the above S220 can continue to be executed.
[0097] The embodiment of the present application can obtain the similarity between the image to be detected and the template screen image, and determine the abnormal detection result of the detection screen image based on the similarity between the image to be detected and the template screen image. When it is preliminarily determined that the abnormal detection result of the detection screen image is that there is no abnormal defect, it may be necessary to further process the image to be detected to ensure the correctness of the abnormal detection result of the detection screen image.
[0098] In addition, in one embodiment, after the above step S240, the above screen detection method may further include: if the similarity between each image to be detected and the template screen image is less than or equal to a preset similarity threshold, then determining that the abnormal detection result of the detection screen image is an abnormal defect, and ending the screen detection process.
[0099] Based on the similarities between the images to be detected and the template screen image obtained as mentioned above, if the computer device determines that the similarities between the images to be detected and the template screen image are less than or equal to the preset similarity threshold, it can be determined that the abnormal detection result of the detection screen image is an abnormal defect. At this time, the screen detection processing flow can be directly terminated without executing other steps.
[0100] The embodiment of the present application can determine that the abnormal detection result of the detection screen image is the existence of abnormal defects based on the similarity between each image to be detected and the template screen image, that is, determine that there are abnormal defects in the detection screen image, and then end the screen detection and processing flow, thereby reducing the amount of screen detection processing calculations and shortening the processing time of screen detection.
[0101] In some scenarios, in order to improve the accuracy of the screen detection results, after initially determining that the abnormal detection result of the screen image does not contain abnormal defects, further processing is required. The specific process of further processing will be described below. In one embodiment, the plurality of different windows includes a second window specification; Figure 4 As shown, the process of performing correlation processing on the multiple detection image blocks and the multiple template image blocks in the template screen image in the above S300 to determine the abnormality detection result of the detection screen image may include the following steps:
[0102] S310. Divide the template screen image into a plurality of template image blocks according to the second window specification.
[0103] In order to compare the detection image block with the template screen image, the template screen image needs to be divided into image blocks of the same size as the detection image block. Therefore, in an embodiment of the present application, the template screen image obtained in the previous step can be divided based on the set second window specification to obtain multiple template image blocks. Optionally, the total number of template image blocks obtained can be less than or equal to the maximum number of template image blocks obtained by dividing based on the second window specification, but in this embodiment, the total number of template image blocks obtained is equal to the total number of detection image blocks obtained.
[0104] The following is an explanation of the manner in which the template screen image is divided according to the second window specification in the above steps to obtain multiple template image blocks. For example, the computer device may be pre-trained with an algorithm model, and the template screen image and the second window specification obtained in the above steps are input into the algorithm model, and the model divides the template screen image according to the second window specification and outputs multiple template image blocks.
[0105] For another example, the computer device may also directly divide the template screen image according to the second window specification to obtain a plurality of template image blocks.
[0106] S320, respectively obtain a first grayscale image of each pixel channel corresponding to the detection image block, and obtain a second grayscale image of each pixel channel corresponding to each template image block.
[0107] A pixel point in any image includes three pixel channels, namely, an R channel, a G channel and a B channel. Correspondingly, each pixel channel corresponding to the detection image block and the template image block is an R channel, a G channel and a B channel.
[0108] Among them, each pixel in each detection image block has a corresponding pixel value, then the first grayscale image of the R channel corresponding to each detection image block obtained is an image composed of the R pixel value of each pixel in each detection image block, the first grayscale image of the G channel corresponding to each detection image block obtained is an image composed of the G pixel value of each pixel in each detection image block, and the first grayscale image of the B channel corresponding to each detection image block obtained is an image composed of the B pixel value of each pixel in each detection image block.
[0109] At the same time, the second grayscale image of the R channel corresponding to each template image block obtained is an image composed of the R pixel value of each pixel in each template image block, the second grayscale image of the G channel corresponding to each template image block obtained is an image composed of the G pixel value of each pixel in each template image block, and the second grayscale image of the B channel corresponding to each template image block obtained is an image composed of the B pixel value of each pixel in each template image block.
[0110] S330, performing histogram processing on each first grayscale image to obtain a corresponding first grayscale histogram, and performing histogram processing on each second grayscale image to obtain a corresponding second grayscale histogram.
[0111] Specifically, based on the first grayscale images corresponding to the detection image blocks obtained above, a first histogram processing algorithm is used to perform histogram processing on the first grayscale images to obtain a corresponding first grayscale histogram. At the same time, based on the second grayscale images corresponding to the template image blocks obtained above, a second histogram processing algorithm is used to perform histogram processing on the second grayscale images to obtain a corresponding second grayscale histogram.
[0112] Optionally, the first histogram processing algorithm and the second histogram processing algorithm can both be a histogram equalization algorithm or a histogram specification algorithm, etc. In the embodiment of the present application, in order to reduce the complexity of the screen detection processing algorithm, the first histogram processing algorithm is the same as the second histogram processing algorithm, and the histogram processing can be understood as a process of counting the total number of identical pixel values in all pixel points in the grayscale image.
[0113] For example, a detection image block T′ w The first grayscale image of the R channel corresponding to (x, y) is represented by T′wr (x, y), the first grayscale image of the corresponding G channel is represented as T′ wg (x, y), the corresponding first grayscale image of the B channel is represented as T′ wb (x, y), corresponding to the template image block T w The first grayscale image of the R channel corresponding to (x, y) is represented by T wr (x, y), the first grayscale image of the corresponding G channel is represented as T wg (x, y), the corresponding first grayscale image of the B channel is represented as T wb (x, y). In the embodiment of the present application, T′ wr (x, y) as an example, the histogram is processed in the following way, specifically:
[0114]
[0115] Wherein, P in formula (2) represents the pixel value, Represents T′ wr The pixel value in (x, y) is P k The total number of all pixels, the P k Can be equal to 0~255, k represents T' wr The total number of different pixel values in (x, y), i.e. 256, naturally, T′ wr The first histogram corresponding to (x, y) can be a 1*256 vector. is just a one-dimensional vector in the first histogram. Correspondingly, the first grayscale image T′ wg (x, y) and T′ wb (x, y), and the second grayscale image T wr (x, y), T wg (x, y) and T wb The second histogram corresponding to (x, y) may be a 1*256 vector.
[0116] S340, performing correlation processing on each first grayscale histogram and each second grayscale histogram to determine an abnormality detection result of the detection screen image.
[0117] Among them, based on each first grayscale histogram and each second grayscale histogram obtained in the previous steps, for each first grayscale histogram, correlation processing can be performed on the first grayscale histogram and any second grayscale histogram, and the correlation processing result can be processed to determine the abnormal detection result of the detection screen image.
[0118] However, in the embodiment of the present application, each detection image block has a corresponding template image block, and naturally, each first grayscale histogram has a corresponding second grayscale histogram. In order to reduce the amount of calculation, for each first grayscale histogram, a correlation algorithm can be used to perform correlation processing on the first grayscale histogram and the corresponding second grayscale histogram, and the correlation processing result is processed to determine the abnormal detection result of the detection screen image.
[0119] In an embodiment of the present application, in order to improve the correlation processing result, before executing the above S340, each first grayscale histogram and each second grayscale histogram can be normalized first, and then each normalized first grayscale histogram and each normalized second grayscale histogram are obtained.
[0120] Continuing with the previous example, if the first grayscale image T′ wr (x, y), T′ wg (x, y) and T′ wb The first grayscale histogram corresponding to (x, y) is represented by H′ wr (P), H′ wg (P) and H′ wb (P), the second grayscale image T wr (x, y), T wg (x, y) and T wb The second grayscale histogram corresponding to (x, y) is expressed as H wr (P), H wg (P) and H wb (P), here, H′ wr (P) is used as an example to illustrate the normalization process. wr (P) corresponds to the first grayscale histogram H′ after normalization wrn (P) can be expressed by formula (3):
[0121]
[0122] In formula (3), min(H′ wr (P)) represents H′ wr (P k ), max(H′ wr (P)) represents H′ wr (P k ), usually by default max is equal to 1 and min is equal to 0.
[0123] The screen detection method provided in the embodiment of the present application can divide the template screen image according to the second window specification to obtain multiple template image blocks, respectively obtain the first grayscale image of each pixel channel corresponding to the detection image block, and obtain the second grayscale image of each pixel channel corresponding to each template image block, perform histogram processing on each first grayscale image to obtain the corresponding first grayscale histogram, and perform histogram processing on each second grayscale image to obtain the corresponding second grayscale histogram, and determine the abnormal detection result of the detection screen image by performing correlation processing on each first grayscale histogram and each second grayscale histogram; based on the preliminary determination that the abnormal detection result of the detection screen image is that there is no abnormal defect, the method can further process each detection image block and the image block in the template screen image, that is, realize the pixel-level processing between the detection screen image and the template screen image to determine the final abnormal detection result of the detection screen image, so that the final abnormal detection result of the detection screen image can be determined more accurately, the accuracy of the screen detection result can be improved, and the problem of abnormal maintenance of BMC due to inaccurate screen detection results can be avoided, thereby reducing the maintenance cost of BMC.
[0124] The following is a description of the process of determining the abnormal detection result of the detection screen image by performing correlation processing on each first grayscale histogram and each second grayscale histogram in the above step S340. In one embodiment, the abnormal detection result includes the absence of abnormal defects; Figure 5 As shown, the steps in S340 above can be implemented by the following steps:
[0125] S341. For any first grayscale histogram, perform correlation processing on the first grayscale histogram and the corresponding second grayscale histogram to obtain a correlation value between the first grayscale histogram and the corresponding second grayscale histogram.
[0126] In the embodiment of the present application, for any first grayscale histogram, correlation processing is performed on the first grayscale histogram and the corresponding second grayscale histogram. wrn (P) and H wrn (P) is used as an example to illustrate the correlation processing. The specific process is expressed as follows:
[0127]
[0128] In formula (4) equal
[0129] S342: If all correlation values are greater than or equal to a preset correlation threshold, it is determined that no abnormal defect exists in the detected image block.
[0130] In the embodiment of the present application, if Cor(H′ wrn(P), H wrn The value of (P)) is 1, indicating that H′ wrn (P) and H wrn (P) is exactly the same, that is, the detected image block is exactly the same as the template image block; if Cor(H′ wrn (P), H wrn The smaller the value of (P)), the higher the H′ wrn (P) and H wrn (P)The greater the difference between the two.
[0131] Based on the correlation value between each first grayscale histogram and the corresponding second grayscale histogram obtained in the above steps, for each first grayscale histogram, determine whether the correlation value between the first grayscale histogram and the corresponding second grayscale histogram is greater than or equal to a preset correlation threshold; if it is determined that the correlation value between each first grayscale histogram and the corresponding second grayscale histogram is greater than or equal to the preset correlation threshold, it is determined that there is no abnormal defect in the detection image block corresponding to the first grayscale histogram.
[0132] S343. If there are no abnormal defects in each detection image block, determine that the abnormal detection result of the detection screen image is that there are no abnormal defects.
[0133] When there are no abnormal defects in each detection image block determined based on the previous steps, it is determined that there are no abnormal defects in each detection image block in the detection screen image, that is, it is determined that the abnormal detection result of the detection screen image is that there are no abnormal defects. In the actual processing process, it is necessary to determine that each correlation value is greater than or equal to a preset correlation threshold value to determine that there are no abnormal defects at any position in the detection screen image, that is, the abnormal detection result of the detection screen image is that there are no abnormal defects, which ensures that screen detection is performed on any position in the detection screen image, thereby improving the accuracy of the screen detection result.
[0134] At the same time, after the above step S341, the above screen detection method also includes: if there is a correlation value less than the correlation threshold value among the correlation values, then determining that the abnormal detection result of the screen image is an abnormal defect; the abnormal defect is a flower screen defect.
[0135] Based on the correlation value between each first grayscale histogram and the corresponding second grayscale histogram obtained in the above steps, for each first grayscale histogram, determine in turn whether the correlation value between the first grayscale histogram and the corresponding second grayscale histogram is less than the preset correlation threshold. If it is determined that the correlation value between the first grayscale histogram and the corresponding second grayscale histogram is less than the preset correlation threshold, the judgment can be stopped, and it is determined that there is an abnormal defect in the area where a certain detection image block in the detection screen image is located, that is, it is determined that the abnormal detection result of the detection screen image is that there is an abnormal defect.
[0136] In practical applications, if the correlation value between the first grayscale histogram and the corresponding second grayscale histogram is determined to be less than a preset correlation threshold value during the first judgment, it is necessary to continue to perform other judgment processes, and the abnormal detection result of the screen image can be directly determined as the presence of an abnormal defect, which can greatly reduce the amount of screen detection calculations. In the embodiment of the present application, the screen detection process is described by taking the abnormal defect as a flower screen defect as an example.
[0137] When the embodiment of the present application determines that the correlation value between the first grayscale histogram and the corresponding second grayscale histogram is less than a preset correlation threshold, it can directly determine that the abnormal detection result of the screen image is an abnormal defect. This method can not only ensure the problem of missed detection and improve the accuracy of the screen detection result, but also when it is determined that the correlation value between a first grayscale histogram and the corresponding second grayscale histogram is less than a preset correlation threshold, it can directly detect that the abnormal detection result of the screen image is an abnormal defect. At this time, the screen detection processing flow can be terminated, thereby improving the screen detection speed and reducing the screen detection time to a certain extent.
[0138] The screen detection method provided in the embodiment of the present application can calculate the corresponding correlation between the grayscale images corresponding to each pixel channel between the detection image block and the template image block, so as to perform correlation processing on the target detection image and the template screen image based on each pixel channel, that is, it can analyze the correlation between the target detection image and the template screen image from the image pixel level, so that the correlation processing result is more accurate, and determine the abnormal detection result of the detection screen image based on the correlation processing result, so as to make the screen detection result more accurate.
[0139] To facilitate the understanding of those skilled in the art, the screen detection method provided by the present application is introduced by taking a computer device as an example. Specifically, the method includes:
[0140] (1) Obtain the detection screen image of the currently monitored target device.
[0141] (2) According to the first window specification, the detection screen image is divided to obtain a plurality of images to be detected; the size of the images to be detected is the same as the size of the template screen image.
[0142] (3) For each image to be detected, the square difference matching method is used to perform similarity processing on the image to be detected and the template screen image to obtain the similarity between the image to be detected and the template screen image.
[0143] (4) If there is an image to be detected among the images to be detected whose similarity with the template screen image is greater than a preset similarity threshold, a target detection image that meets a preset detection condition is obtained from the multiple images to be detected; the preset detection condition is the image to be detected with the greatest similarity between the image to be detected and the template screen image.
[0144] (5) According to the second window specification, the target detection image is divided into multiple detection image blocks.
[0145] (6) Determine an abnormality detection result of the detection screen image based on correlation processing between the multiple detection image blocks and the multiple template image blocks in the template screen image; the template screen image is an image of a screen without abnormalities of the target device.
[0146] (7) If the similarity between each image to be detected and the template screen image is less than or equal to the preset similarity threshold, the abnormal detection result of the detection screen image is determined to be an abnormal defect, and the screen detection process is terminated.
[0147] (8) According to the second window specification, the template screen image is divided into a plurality of template image blocks.
[0148] (9) Obtain a first grayscale image of each pixel channel corresponding to the detection image block, and obtain a second grayscale image of each pixel channel corresponding to each template image block.
[0149] (10) Performing histogram processing on each first grayscale image to obtain a corresponding first grayscale histogram, and performing histogram processing on each second grayscale image to obtain a corresponding second grayscale histogram.
[0150] (11) For any first grayscale histogram, correlation processing is performed on the first grayscale histogram and the corresponding second grayscale histogram to obtain a correlation value between the first grayscale histogram and the corresponding second grayscale histogram.
[0151] (12) If all correlation values are greater than or equal to a preset correlation threshold, it is determined that there is no abnormal defect in the detected image block.
[0152] (13) If there are no abnormal defects in each detection image block, the abnormal detection result of the detection screen image is determined to be that there are no abnormal defects.
[0153] (14) If there is a value in each correlation value that is less than the correlation threshold, it is determined that the abnormal detection result of the detection screen image is an abnormal defect; the abnormal defect is a flower screen defect.
[0154] The execution process of the above (1) to (14) can be specifically referred to the description of the above embodiment. The implementation principles and technical effects are similar and will not be repeated here.
[0155] It should be understood that although Figure 1-5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-5 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0156] In one embodiment, Figure 6 As shown, a screen detection device is provided, comprising: a screen image acquisition module 11, an image division module 12 and a correlation processing module 13, wherein:
[0157] The screen image acquisition module 11 is used to acquire the detection screen image of the currently monitored target device;
[0158] An image division module 12 is used to divide the detection screen image into a plurality of different window specifications to obtain a plurality of detection image blocks;
[0159] The correlation processing module 13 is used to perform correlation processing on the multiple detection image blocks and the multiple template image blocks in the template screen image to determine the abnormality detection result of the detection screen image; the template screen image is an image of the normal screen of the target device.
[0160] The screen detection device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0161] In one embodiment, the plurality of different window specifications include a first window specification and a second window specification; the image segmentation module 12 includes: a first segmentation unit, a template detection image acquisition unit, and a second segmentation unit, wherein:
[0162] A first dividing unit is used to divide the detection screen image according to the first window specification to obtain a plurality of images to be detected; the size of the images to be detected is the same as the size of the template screen image;
[0163] A template detection image acquisition unit is used to acquire a target detection image that meets a preset detection condition from a plurality of images to be detected; the preset detection condition is the image to be detected that has the greatest similarity with the template screen image;
[0164] The second division unit is used to divide the target detection image into multiple detection image blocks according to the second window specification.
[0165] The screen detection device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0166] In one embodiment, the image segmentation module 12 further includes: a similarity processing unit and a determination execution unit, wherein:
[0167] A similarity processing unit is used to perform similarity processing on each image to be detected by using a square difference matching method to obtain the similarity between the image to be detected and the template screen image;
[0168] The determination execution unit is used to determine the step of acquiring a target detection image that meets the preset detection conditions from multiple images to be detected when there is an image to be detected whose similarity with the template screen image is greater than a preset similarity threshold among the images to be detected.
[0169] The screen detection device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0170] In one embodiment, the abnormal detection result includes the presence of an abnormal defect; the image segmentation module 12 further includes: a first detection result determination unit, wherein:
[0171] The first detection result determination unit is used to determine that the abnormal detection result of the detection screen image is an abnormal defect when the similarity between each image to be detected and the template screen image is less than or equal to a preset similarity threshold, and end the screen detection process.
[0172] The screen detection device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0173] In one embodiment, the plurality of different windows include a second window size; the correlation processing module 13 includes: a third division unit, a grayscale image acquisition unit, a histogram processing unit and a correlation processing unit, wherein:
[0174] A third dividing unit, configured to divide the template screen image into a plurality of template image blocks according to the second window specification;
[0175] A grayscale image acquisition unit, used to respectively acquire a first grayscale image of each pixel channel corresponding to the detection image block, and to acquire a second grayscale image of each pixel channel corresponding to each template image block;
[0176] A histogram processing unit, configured to perform histogram processing on each first grayscale image to obtain a corresponding first grayscale histogram, and to perform histogram processing on each second grayscale image to obtain a corresponding second grayscale histogram;
[0177] The correlation processing unit is used to perform correlation processing on each first grayscale histogram and each second grayscale histogram to determine an abnormality detection result of the detection screen image.
[0178] The screen detection device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0179] In one embodiment, the abnormality detection result includes the absence of abnormal defects; the correlation processing unit includes: a correlation processing subunit, a first determination subunit and a second determination subunit, wherein:
[0180] A correlation processing subunit, for performing correlation processing on any first grayscale histogram and a corresponding second grayscale histogram, to obtain a correlation value between the first grayscale histogram and the corresponding second grayscale histogram;
[0181] A first determination subunit is used to determine that there is no abnormal defect in the detection image block when all correlation values are greater than or equal to a preset correlation threshold;
[0182] The second determining subunit is used to determine that the abnormal detection result of the detection screen image is that there is no abnormal defect when there is no abnormal defect in each detection image block.
[0183] The screen detection device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0184] For the specific definition of the screen detection device, please refer to the definition of the screen detection method above, which will not be repeated here. Each module in the above screen detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0185] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store detection screen images and template screen images. The network interface of the computer device is used to communicate with an external endpoint through a network connection. When the computer program is executed by the processor, a screen detection method is implemented.
[0186] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0187] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0188] Get the detection screen image of the currently monitored target device;
[0189] The detection screen image is divided by using a plurality of different window specifications to obtain a plurality of detection image blocks;
[0190] Based on correlation processing between multiple detection image blocks and multiple template image blocks in a template screen image, an abnormality detection result of the detection screen image is determined; the template screen image is an image of a screen without abnormalities of the target device.
[0191] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0192] Get the detection screen image of the currently monitored target device;
[0193] The detection screen image is divided by using a plurality of different window specifications to obtain a plurality of detection image blocks;
[0194] Based on correlation processing between multiple detection image blocks and multiple template image blocks in a template screen image, an abnormality detection result of the detection screen image is determined; the template screen image is an image of a screen without abnormalities of the target device.
[0195] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0196] Get the detection screen image of the currently monitored target device;
[0197] The detection screen image is divided by using a plurality of different window specifications to obtain a plurality of detection image blocks;
[0198] Based on correlation processing between multiple detection image blocks and multiple template image blocks in a template screen image, an abnormality detection result of the detection screen image is determined; the template screen image is an image of a screen without abnormalities of the target device.
[0199] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0200] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0201] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A screen detection method, characterized in that: The method comprises: Get the detection screen image of the currently monitored target device; According to the first window specification, the detection screen image is divided into a plurality of images to be detected, and the similarity between each of the images to be detected and the template screen image is processed by a square difference matching method to obtain the similarity between each of the images to be detected and the template screen image; the size of the images to be detected is the same as the size of the template screen image; the template screen image is an image of a normal screen of the target device; If there is an image to be detected among the images to be detected whose similarity with the template screen image is greater than a preset similarity threshold, a target detection image that meets a preset detection condition is obtained from the multiple images to be detected, the target detection image is divided according to a second window specification to obtain a plurality of detection image blocks, and correlation processing is performed based on the plurality of detection image blocks and a plurality of template image blocks in the template screen image to determine an abnormality detection result of the detection screen image; the preset detection condition is the image to be detected having the greatest similarity with the template screen image; If the similarities between each of the images to be detected and the template screen image are less than or equal to the preset similarity threshold, the abnormal detection result of the detection screen image is determined to be an abnormal defect, and the screen detection process is terminated.
2. The method according to claim 1, characterized in that: The determining of the abnormality detection result of the detection screen image based on the correlation processing between the plurality of detection image blocks and the plurality of template image blocks in the template screen image comprises: According to the second window specification, the template screen image is divided to obtain a plurality of template image blocks; Respectively acquiring a first grayscale image of each pixel channel corresponding to the detection image block, and acquiring a second grayscale image of each pixel channel corresponding to each template image block; Performing histogram processing on each first grayscale image to obtain a corresponding first grayscale histogram, and performing histogram processing on each second grayscale image to obtain a corresponding second grayscale histogram; The abnormality detection result of the detection screen image is determined by performing correlation processing on each first grayscale histogram and each second grayscale histogram.
3. The method according to claim 2, characterized in that The abnormality detection result includes the absence of abnormal defects; the correlation processing of each first grayscale histogram and each second grayscale histogram to determine the abnormality detection result of the detection screen image includes: For any first grayscale histogram, performing correlation processing on the first grayscale histogram and the corresponding second grayscale histogram to obtain a correlation value between the first grayscale histogram and the corresponding second grayscale histogram; If each of the correlation values is greater than or equal to a preset correlation threshold, it is determined that there is no abnormal defect in the detected image block; If there is no abnormal defect in each of the detection image blocks, it is determined that the abnormal detection result of the detection screen image is that there is no abnormal defect.
4. The method according to claim 3, characterized in that: The method further comprises: If there is a value whose correlation among the correlation values is less than the correlation threshold, it is determined that the abnormal detection result of the detection screen image is an abnormal defect; the abnormal defect is a screen defect.
5. A screen detection device, characterized in that: The device comprises: A screen image acquisition module is used to acquire the detection screen image of the currently monitored target device; An image division module, used for dividing the detection screen image by a plurality of different window specifications to obtain a plurality of detection image blocks; a correlation processing module, configured to perform correlation processing on the detection image blocks and the template image blocks in the template screen image to determine an abnormality detection result of the detection screen image; the template screen image is an image of a screen without abnormalities of the target device; The plurality of different window specifications include a first window specification and a second window specification; and the image segmentation module includes: A first dividing unit, used for dividing the detection screen image according to the first window specification to obtain a plurality of images to be detected; a similarity processing unit, used for performing similarity processing on each of the images to be detected and the template screen image by using a square difference matching method to obtain the similarity between each of the images to be detected and the template screen image; the size of the image to be detected is the same as the size of the template screen image; the size of the image to be detected is the same as the size of the template screen image; a determination execution unit, configured to determine the template detection image acquisition unit to execute the next step when there is an image to be detected whose similarity with the template screen image is greater than a preset similarity threshold among the images to be detected; The template detection image acquisition unit is used to acquire a target detection image that meets a preset detection condition from the multiple images to be detected; the preset detection condition is the image to be detected that has the greatest similarity with the template screen image; A second dividing unit, configured to divide the target detection image according to the second window specification to obtain the plurality of detection image blocks; The first detection result determination unit is used to determine that the abnormal detection result of the detection screen image is an abnormal defect when the similarity between each of the images to be detected and the template screen image is less than or equal to the preset similarity threshold, and end the screen detection process.
6. The device according to claim 5, characterized in that The correlation processing module includes: A third dividing unit, configured to divide the template screen image according to the second window specification to obtain a plurality of template image blocks; A grayscale image acquisition unit, used to respectively acquire a first grayscale image of each pixel channel corresponding to each of the detection image blocks, and to acquire a second grayscale image of each pixel channel corresponding to each of the template image blocks; a histogram processing unit, configured to perform histogram processing on each of the first grayscale images to obtain a corresponding first grayscale histogram, and to perform histogram processing on each of the second grayscale images to obtain a corresponding second grayscale histogram; A correlation processing unit is used to perform correlation processing on each of the first grayscale histograms and each of the second grayscale histograms to determine an abnormality detection result of the detection screen image.
7. The device according to claim 6, characterized in that The abnormality detection result includes the absence of abnormal defects; and the correlation processing unit includes: A correlation processing subunit, configured to perform correlation processing on any first grayscale histogram and a corresponding second grayscale histogram to obtain a correlation value between the first grayscale histogram and the corresponding second grayscale histogram; A first determination subunit, configured to determine that no abnormal defect exists in the detection image block when each of the correlation values is greater than or equal to a preset correlation threshold; The second determining subunit is used to determine that the abnormal detection result of the detection screen image is that there is no abnormal defect when there is no abnormal defect in each of the detection image blocks.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the screen detection method according to any one of claims 1 to 4 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the screen detection method according to any one of claims 1 to 4 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Image detection method and device, computer equipment and storage medium
CN111047558A
Industrial product defect detection method and device, terminal equipment and storage medium
CN112734691A
Screen defect detection method and device and computer readable storage medium
CN115018797A