Screen detection method and device, equipment and storage medium
By taking the first image when the screen of the device to be tested is turned off, and taking the second image when displaying the preset image for pixel restoration, the misjudgment problem of dust stains and display defects in the prior art is solved, and a more accurate evaluation of screen display effect is achieved.
Patent Information
- Application Number
- CN202311323370.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-12
- Publication Date
- 2025-04-15
AI Technical Summary
When the prior art detects abnormal display of the screen of the equipment to be tested, it is difficult to effectively distinguish between dust stains and display defects of the screen itself, resulting in repaired image misjudgment and misrepair.
The first image is taken when the screen of the device to be tested is turned off to determine the spot position, then the second image is taken when the preset image is displayed on the screen, and the pixel points of the second image are restored according to the spot position determined by the first image to repair the true spot position.
In this way, only the real stain position is repaired to avoid repairing the abnormal display area of the screen itself, thereby more accurately evaluating the display effect of the screen of the device to be tested.
Smart Images

Figure CN119831919A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a screen detection method, device, equipment and computer-readable storage medium. Background Art
[0002] In the related art, if it is necessary to detect whether the screen of the device under test displays abnormalities, the screen of the device under test can be made to display a preset image first, and then the screen can be photographed by a detection device to evaluate the display effect of the screen.
[0003] However, the screen of the device to be tested is inevitably contaminated with dust, and this dust will exist as stains in the image taken by the testing equipment, affecting the evaluation of the screen.
[0004] In the related art, the influence of dust can be avoided by directly identifying stains on the image obtained after shooting by the detection device, and then eliminating or compensating the identified stains. However, this repair directly based on the image obtained after shooting may also cause the display defects of the screen itself to be misjudged as stains and eliminated or compensated together. For example, an abnormal area of the screen that originally displayed darker is mistakenly identified as a stain, so that the abnormal display area is compensated. This method may cause the repaired image to be quite different from the image of the shot screen, resulting in a misjudgment of the screen display effect. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the present disclosure provides a screen detection method, device, equipment and computer-readable storage medium, which can solve the above problems.
[0006] According to a first aspect of an embodiment of the present disclosure, there is provided a screen detection method, which is executed by a detection device, wherein the detection device is used to detect whether the screen of a device under test displays an abnormality, and the method comprises: when the screen of the device under test is off, photographing the screen to obtain a first image; determining a spot position on the screen according to the first image; when the screen displays a preset image, photographing the screen to obtain a second image; and restoring pixels corresponding to the spot position on the second image according to the spot position, wherein the restored second image is used to evaluate the display effect of the screen of the device under test on the preset image.
[0007] According to a second aspect of an embodiment of the present disclosure, there is provided a screen detection device, which is configured on a detection device, and the detection device is used to detect whether the screen of the device under test displays an abnormality, and the device comprises: a first shooting unit, configured to shoot the screen to acquire a first image when the screen of the device under test is turned off; a determination unit, configured to determine a spot position on the screen according to the first image; a second shooting unit, configured to shoot the screen to acquire a second image when the screen displays a preset image; and a restoration unit, configured to restore the pixel points corresponding to the spot position on the second image according to the spot position, wherein the restored second image is used to evaluate the display effect of the screen of the device under test on the preset image.
[0008] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the screen detection method as described in the first aspect by calling the computer program.
[0009] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the screen detection method as described in the first aspect is implemented.
[0010] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0011] The present invention first captures and acquires a first image when the screen of the device to be tested is turned off, and determines the location of the stain through the first image. Then, when the screen displays a preset image, the second image is captured and acquired, and the pixel points corresponding to the location of the stain in the second image are restored through the location of the stain determined by the first image, so that only the location where the actual stain is located is repaired, and the area of the screen itself with abnormal display is not repaired, so that the restored second image can more realistically reflect the effect of the screen displaying the preset image, and can make the evaluation of the display effect of the screen of the device to be tested more accurate.
[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0014] Figure 1 is a schematic flow chart of a screen detection method according to an exemplary embodiment of the present disclosure.
[0015] Figure 2 It is a schematic diagram showing a method for determining a stain position according to an embodiment of the present disclosure.
[0016] Figure 3 is a schematic flow chart of a screen detection method according to an exemplary embodiment of the present disclosure.
[0017] Figure 4 is a schematic diagram showing a method of restoring a second image according to an embodiment of the present disclosure.
[0018] Figure 5 It is a block diagram of a screen detection device according to an exemplary embodiment of the present disclosure.
[0019] Figure 6 It is a schematic block diagram of a screen detection device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0021] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0022] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0023] In the related art, the image obtained after shooting can be processed to remove noise, dust, etc. in the image through an image processing algorithm, thereby improving the quality and clarity of the image.
[0024] However, in the field of screen detection, it is necessary to obtain the display status of the screen of the device to be tested in order to evaluate the display effect of the screen. In this field, the image processing algorithm in the relevant technology cannot well distinguish the stain area where the real dust is located and the abnormal area caused by the display problem of the screen, which may cause the display problem of the screen to be removed in the subsequent process of optimizing the image using the image processing algorithm, resulting in an erroneous evaluation of the screen display effect.
[0025] In order to solve the above technical problems, the present disclosure proposes a screen detection method.
[0026] Figure 1 The present invention is a schematic flow chart of a screen detection method according to an embodiment of the present invention, which can be performed by a detection device. The detection device is used to detect whether the screen of the device under test displays abnormalities, and the device under test includes but is not limited to mobile phones, tablet computers, wearable devices, sensors, IoT devices and other communication devices.
[0027] like Figure 1 As shown, the screen detection method includes:
[0028] In step S101, when the screen of the device under test is turned off, the screen is photographed to obtain a first image;
[0029] In step S102, the location of the stain on the screen is determined according to the first image;
[0030] In step S103, when the screen displays a preset image, the screen is photographed to obtain a second image;
[0031] In step S104, the pixel points on the second image corresponding to the stain position are restored according to the stain position, wherein the restored second image is used to evaluate the display effect of the screen of the device under test on the preset image.
[0032] In some embodiments, the detection device may capture a screen of the device under test that displays a preset image, and compare the captured image with the preset image to evaluate the display effect of the screen.
[0033] For example, the display effect of the screen can be judged by comparing the brightness, color difference and other factors between the captured image and the preset image. The closer the captured image is to the preset image, the better the display effect of the screen; the greater the difference between the captured image and the preset image, the worse the display effect of the screen.
[0034] In some embodiments, when the screen is manufactured, it is necessary to use a detection device to detect whether it is qualified, or if uneven display occurs during the use of the screen, the detection device can be used to detect and correct it for convenience.
[0035] In some embodiments, the detection device may send screen-off indication information to the device under test to instruct the device under test to turn off the screen; when the screen of the device under test is turned off, the detection device captures the screen to obtain a first image.
[0036] In some embodiments, a light source is provided on the detection device. When the screen of the device to be tested is off, the detection device can use a uniform surface light source to illuminate the off screen and photograph the screen to obtain a first image.
[0037] When the screen is off, sufficient lighting is required to clearly display the dust on the screen. At this time, a uniform surface light source can be used to illuminate the screen to avoid uneven lighting causing differences in different areas of the screen on the first image.
[0038] Providing a light source on the detection device can enable the detection device to automatically complete steps such as lighting and photographing the screen, thereby reducing the user's workload.
[0039] In some embodiments, in the acquired first image, there is a difference between the location of the stain on the screen and other locations on the screen without stains, and the location of the stain on the screen can be determined based on the difference.
[0040] The screen surface can be cleaned before testing, but cleaning cannot completely remove all dust on the screen surface, and there are differences in the images captured by the testing equipment between the dusty and dust-free areas of the screen surface. For example, if the screen is illuminated by a uniform surface light source when it is off, the stain position in the formed image will be brighter than other parts of the screen.
[0041] In some embodiments, the determined stain position may be the relative coordinates of the stain on the screen, or the absolute coordinates of the stain on the first image.
[0042] In some embodiments, the position of the dust on the screen will not change significantly in a short period of time, so the device to be tested in the first image can be determined first, and then the relative position of the stain and the edge of the device to be tested can be determined to form relative coordinates. In other embodiments, the device to be tested is in a fixed position, and the detection device can take a picture of the device to be tested in the fixed position, so that the position of the device to be tested will not change in the image captured by the detection device. In this case, the stain can be an absolute coordinate on the first image, and in multiple images captured by the detection device of the device to be tested whose position does not change, the stain is in the same position in the image.
[0043] In some embodiments, step S103 may be performed before step S102 , or before step S101 .
[0044] In fact, the detection device needs to obtain two images of the screen of the device to be tested, one in the off state and the other in the state of displaying a preset image. There is no requirement for the order in which the two images are obtained. Only in the image processing process, the stain position is first determined through the first image, and then the second image is restored according to the determined stain position. Therefore, in terms of execution order, the first image and the second image can be obtained by shooting first, and then the first image and the second image can be processed separately, or the first image can be obtained first and processed, and then the second image can be obtained and processed. The present disclosure does not limit this, and the present disclosure does not limit the order in which the detection device obtains the first image and the second image.
[0045] In some embodiments, the preset image may be a solid color image or an image with multiple colors and patterns.
[0046] For example, the preset image may be a pure blue image, or may be a preset image of blue sky, white clouds and grass.
[0047] In some embodiments, the screen of the device to be tested may display a plurality of preset images, and the detection device may shoot the plurality of preset images to obtain a corresponding plurality of second images.
[0048] Multiple different images can be preset to perform various tests on the display effect of the screen. For example, one preset image can be used to detect whether the contrast of the screen display is abnormal, and another preset image can be used to detect whether the brightness of the screen display is abnormal. When processing the multiple acquired second images, the pixel points corresponding to the stain positions on the multiple second images also need to be restored.
[0049] In some embodiments, after the location of the stain on the screen is determined by the first image, the pixel points corresponding to the location of the stain on the second image are restored according to the location of the stain.
[0050] Since the first image and the second image are both the results of shooting the screen of the same device under test, the dust on the screen is in the same position, and the second image can be restored with the help of the stain position determined in the first image, so as to avoid the situation where the abnormal display area of part of the screen is mistakenly restored as the stain position when processing the second image, resulting in the processed image losing the abnormal display information on the screen. The method disclosed in the present invention can ensure that when restoring the pixel points on the second image, only the stain position caused by the dust is removed, without affecting the display abnormal area caused by the display effect of the screen itself, so that the restored second image can more accurately show the display effect of the screen on the preset image.
[0051] In some embodiments, determining the location of the stain on the screen based on the first image includes: performing region division and binarization processing on the first image to obtain a processed first image; and performing connected region analysis on the processed first image to determine the location of the stain.
[0052] Since dust does not exist in every area on the screen in the first image, if the first image where the entire screen is located is subsequently processed, the amount of calculation may be increased, affecting the processing speed.
[0053] By dividing the first image into regions and performing binarization processing, subsequent image processing can be performed only on regions with stains in the first image, thereby reducing the amount of image processing calculations.
[0054] In some embodiments, the first image is divided into regions.
[0055] The first image is divided into a plurality of regions, and subsequent image processing for stains can be performed only in the partial regions including the stains.
[0056] In some embodiments, the first image is binarized.
[0057] Through the binarization process, the detection device can identify the stain position and the non-stain screen portion in the first image, which is also convenient for subsequent morphological operations.
[0058] In some embodiments, the first image after region division may be binarized.
[0059] According to the result of image segmentation, the segmented first image is converted into a binary image. For example, the pixel value of each pixel in the segmented first image is obtained, and when the pixel value is greater than a preset threshold, the pixel is determined to correspond to a first value (1), and the position corresponding to the point is the stain position, and when the pixel value is not greater than the preset threshold, the pixel is determined to correspond to a second value (0), and the position corresponding to the point is the non-stain position.
[0060] In some embodiments, connected region analysis may be performed on the first image after the binarization process.
[0061] Connected region analysis can group adjacent pixels with the same pixel value into sets. Therefore, when connected region analysis is performed on the first binarized image, all adjacent first values will form a first set, corresponding to the stain positions on the screen, and adjacent second values will form a second set, corresponding to the stain-free positions on the screen.
[0062] For example, the bwconncomp function may be used to analyze the core connected regions of the first image after the binarization process to obtain the edge coordinates of the stain position.
[0063] Figure 2 It is a schematic diagram showing a method for determining a stain position according to an embodiment of the present disclosure.
[0064] like Figure 2 As shown, the segmented first image 210 is binarized to obtain a binarized matrix 220. In the binarized matrix 220, a connected region analysis is performed to form a first set 230 of adjacent first values in the matrix, i.e., the positions where the stains are located, and the remaining positions are the positions where the non-stains are located.
[0065] In some embodiments, the method further includes: before performing the connected component analysis on the processed first image, performing a morphological operation on the processed first image to remove noise points on the processed first image.
[0066] Morphological operations may be performed on the first image after the binarization process, so that smaller noise points in the image may be removed, thereby making the processed image clearer.
[0067] In some embodiments, the first image is a grayscale image, and the region division and binarization processing of the first image to obtain the processed first image includes: determining the grayscale value of each pixel on the first image after region division; if the grayscale value is greater than a preset threshold, determining the pixel corresponding to the grayscale value as the first value; wherein the pixel determined as the first value is the pixel where the stain on the screen is located; if the grayscale value is less than the preset threshold, determining the pixel corresponding to the grayscale value as the second value.
[0068] The first image is a grayscale image, which may be the first image captured by the detection device in the form of a grayscale image, or the first image captured by the detection device may be converted into a grayscale image.
[0069] After the first image is divided into regions, the grayscale value of each pixel is determined, and the corresponding pixel is determined to be the first value or the second value according to the grayscale value.
[0070] In some embodiments, the first value may be 1, which represents stain, and the second value may be 0, which represents no stain.
[0071] Figure 3 is a schematic flow chart of a screen detection method according to an embodiment of the present disclosure.
[0072] like Figure 3 As shown, the restoring the pixel points corresponding to the stain position on the second image according to the stain position includes:
[0073] In step S301, a target pixel point at a corresponding position on the second image is determined according to the stain position;
[0074] In step S302, the pixel values of the adjacent pixels corresponding to the target pixel and not located at the stain position are determined;
[0075] In step S303, the pixel value of the target pixel is determined according to the determined pixel values of the adjacent pixel points, so as to remove the stain on the second image.
[0076] After the stain position is determined through the first image, the pixel points corresponding to the stain position on the second image are restored according to the stain position.
[0077] In some embodiments, the target pixel point at the corresponding position on the second image may be determined according to the stain position.
[0078] If the angle at which the detection device takes the second image and the device to be tested have not changed, the corresponding position is the same position on the second image as the stain position on the first image; if the angle at which the detection device takes the second image or the device to be tested has changed, the relative coordinates between the stain position and the device to be tested can be determined in the first image, and then the device to be tested can be determined in the second image, and the target pixel point can be determined based on the device to be tested and the relative coordinates in the second image.
[0079] In some embodiments, pixel values of neighboring pixels corresponding to the target pixel and not located at the stain position are determined.
[0080] For example, if the coordinates of the target pixel point are (x, y), the coordinates of the adjacent pixel points can be (x-1, y), (x+1, y), (x, y-1), (x, y+1), etc. After determining the coordinates of the target pixel point, the adjacent pixel points that are not at the stain position will be determined from other coordinates adjacent to the target pixel point coordinates.
[0081] Figure 4 is a schematic diagram showing a method of restoring a second image according to an embodiment of the present disclosure.
[0082] like Figure 4 As shown, the target pixel point 420 at the corresponding position on the second image 410 can be determined according to the stain position determined in the first image. Figure 4 There are 6 target pixels, with the upper left corner of the second image 410 as the coordinate origin. The coordinates from top to bottom and from left to right are (3,2), (2,3), (3,3), (4,3), (2,4), and (3,4).
[0083] Taking the target pixel point with the restoration coordinates (3,2) as an example, the adjacent pixels corresponding to the pixel point and not located at the stain position are (3,1), (2,2), and (4,2). The pixel values of these three adjacent pixels can be determined, and then the pixel value of the target pixel point (3,2) can be determined based on the pixel values of these three adjacent pixels. For example, the pixel value of the target pixel point (3,2) can be the average of the pixel values of the three adjacent pixels, or the maximum value of the pixel values of the three adjacent pixels, or the pixel value of the adjacent pixel point (3,1) above the target pixel point (3,2) can be preferentially selected for replacement, thereby realizing the restoration of the target pixel point (3,2).
[0084] In some embodiments, when all the first neighboring pixels around the target pixel are at the stain position, the second neighboring pixels that are adjacent to these first neighboring pixels and are not at the stain position can be determined, and the second neighboring pixels can also be used as the neighboring pixels of the target pixel; alternatively, the target pixel can be restored after the first neighboring pixels at the stain position are restored.
[0085] For example, in Figure 4 In the example, the four neighboring pixels around the target pixel (3,3) are all at the stain position. Then, the pixel value of the pixel adjacent to the four neighboring pixels that are not at the stain position can be used for restoration. Alternatively, the target pixel (3,3) can be restored based on the restored four neighboring pixels after the four neighboring pixels around the target pixel (3,3) are restored.
[0086] In some embodiments, the pixel value of the target pixel is determined according to the determined pixel values of the adjacent pixels, so as to remove the stain on the second image and restore the pixel corresponding to the stain position on the second image.
[0087] In some embodiments, the target pixel point may be filled with the determined pixel values of the adjacent pixel points, so that the pixel value of the target pixel point is equal to the pixel value of the adjacent pixel points.
[0088] By filling the target pixel with the pixel values of adjacent pixels, the pixel at the stain position of the second image can have the same color as other pixels around the pixel, so that the dust or stain in the second image disappears.
[0089] In some embodiments, the pixel values of the determined adjacent pixels may be calculated using a preset algorithm to determine the pixel value to be filled, and the pixel value to be filled may be used as the pixel value of the target pixel.
[0090] For example, in order to achieve a gradual change in the color of the second image, a specific transformation may be performed on the pixel values of adjacent pixels in a fixed direction to obtain the pixel value to be filled. For example, if the adjacent pixels above and below the target pixel are both non-stain positions, the pixel value of the target pixel may be the average of the pixel values of the adjacent pixels above and below the pixel.
[0091] In some embodiments, determining the pixel value of the target pixel point based on the pixel values of the determined adjacent pixel points includes: screening out adjacent pixel points that meet preset conditions from the determined adjacent pixel points, and using their pixel values as the pixel values of the target pixel point; or, performing weighted calculation on the pixel values of the determined adjacent pixel points, and using the calculation result as the pixel value of the target pixel point.
[0092] When there is at least one neighboring pixel point around the target pixel point, a neighboring pixel point that meets a preset condition may be screened out from the at least one neighboring pixel point, and the pixel value of the neighboring pixel point may be used as the pixel value of the target pixel point.
[0093] A preset weighted calculation may also be performed on the pixel values of the determined adjacent pixel points, and the calculation result is used as the pixel value of the target pixel point.
[0094] In some embodiments, the preset conditions include: being in a preset direction of the target pixel point and having a maximum pixel value among multiple adjacent pixel points.
[0095] For example, it can be preset that when a target pixel has adjacent pixels in four directions of up, down, left, and right, the priority order for determining the pixel values of the adjacent pixels is that the upper adjacent pixels take precedence over the left adjacent pixels which take precedence over the lower adjacent pixels which take precedence over the right adjacent pixels.
[0096] Alternatively, when there is at least one adjacent pixel point, the largest pixel value corresponding to the at least one adjacent pixel point may be selected.
[0097] The present disclosure does not limit the specific form of the preset condition.
[0098] In some embodiments, restoring the pixel points on the second image corresponding to the stain position according to the stain position includes: restoring the pixel points on the second image corresponding to the stain position in batches according to the stain position; wherein the target pixel points restored in the current batch are adjacent pixel points of the target pixel points of the next batch.
[0099] In the second image, the target pixel is the pixel corresponding to the stain position, and the target pixel is also the pixel that needs to be restored. However, some of the pixels adjacent to the target pixel are also at the stain position. For these target pixels, the restoration can be performed after the pixels adjacent to these target pixels at the stain position are restored.
[0100] For example, if the pixel points corresponding to the stain position are a 10×10 square, the first batch can restore the outermost pixel points of the square, and fill them with the pixel values of other pixels outside the square that are not at the stain position. After the restoration is completed, the 10×10 square is reduced to 8×8, and then the outermost pixel points of the 8×8 square of the second batch are restored. This continues until all the pixel points at the stain position are restored.
[0101] The present disclosure does not limit the specific form of batching. According to actual needs, it is also possible to choose to traverse the pixel points corresponding to the stain position and fill them using the traversal method to eliminate the stain position in the second image.
[0102] In some embodiments, the detection device is connected to the device under test and can send a first instruction and a second instruction to the device under test, wherein the first instruction is used to indicate that the screen of the device under test is in an off state, and the second instruction is used to indicate that the screen of the device under test displays a preset image.
[0103] Users can avoid operating the device under test and can achieve the screen detection function by only operating the detection device.
[0104] In some embodiments, the method proposed in the present disclosure may also be applied to other application scenarios where dust removal processing is required on captured images.
[0105] The method proposed in the present disclosure can effectively remove dust or stains in an image, improve image quality, and improve the performance of a shooting system and user experience.
[0106] A specific code implementation of the disclosed method is given below.
[0107] The detection device respectively captures and obtains a first image and a second image when the screen is in an off state and a preset image display state.
[0108] Read the first image. The implementation code can be:
[0109] img = imread('image.jpg');
[0110] Convert the first image to a grayscale image. The implementation code can be:
[0111] gray_img = rgb2gray(img);
[0112] Perform image segmentation on the grayscale image obtained by converting the first image. The implementation code may be:
[0113] threshold=graythresh(gray_img);
[0114] bw_img=im2bw(gray_img,threshold);
[0115] Perform morphological operations on the segmented binary image to remove small noise points. The implementation code can be:
[0116] se = strel('disk',5);
[0117] bw_img = imopen(bw_img,se);
[0118] Perform connected region analysis on the binary image to find the location of dust or stains. The implementation code can be:
[0119] cc = bwconncomp(bw_img);
[0120] stats=regionprops(cc,'Centroid');
[0121] In the second image, the target pixel points corresponding to the positions of the dust or stains in the first image are filled, and the implementation code may be:
[0122] for i=1:length(stats)
[0123] x=round(stats(i).Centroid(1));
[0124] y=round(stats(i).Centroid(2));
[0125] img(y,x,:)=img(y-1,x-1,:);
[0126] end
[0127] After the above processing of the second image, the processed second image can also be displayed, and the implementation code can be:
[0128] imshow(img);
[0129] The detection device can evaluate the display effect of the screen of the device to be tested by comparing the processed second image with the preset image.
[0130] Corresponding to the embodiments of the screen detection method of the present disclosure, the present disclosure also provides embodiments of corresponding screen detection devices.
[0131] See also Figure 5 , Figure 5 FIG. 1 is a block diagram of a screen detection device in one embodiment of the present disclosure. Figure 5 As shown, the screen detection device is configured on the detection device, and the detection device is used to detect whether the screen of the device to be tested displays abnormalities. The device includes:
[0132] A first photographing unit 510 is configured to photograph the screen of the device under test to obtain a first image when the screen of the device under test is turned off;
[0133] A determination unit 520 is configured to determine a stain position on the screen according to the first image;
[0134] The second shooting unit 530 is configured to shoot the screen to obtain a second image when the screen displays a preset image.
[0135] The restoration unit 540 is configured to restore the pixel points corresponding to the stain position on the second image according to the stain position, wherein the restored second image is used to evaluate the display effect of the screen of the device under test on the preset image.
[0136] In some embodiments, determining the location of the stain on the screen based on the first image includes: performing region division and binarization processing on the first image to obtain a processed first image; and performing connected region analysis on the processed first image to determine the location of the stain.
[0137] In some embodiments, the apparatus is further configured to: before performing connected component analysis on the processed first image, perform a morphological operation on the processed first image to remove noise points on the processed first image.
[0138] In some embodiments, the first image is a grayscale image, and the region division and binarization processing of the first image to obtain the processed first image includes: determining the grayscale value of each pixel on the first image after region division; if the grayscale value is greater than a preset threshold, determining the pixel corresponding to the grayscale value as the first value; wherein the pixel determined as the first value is the pixel where the stain on the screen is located; if the grayscale value is less than the preset threshold, determining the pixel corresponding to the grayscale value as the second value.
[0139] In some embodiments, restoring the pixel points corresponding to the stain position on the second image according to the stain position includes: determining the target pixel point at the corresponding position on the second image according to the stain position; determining the pixel value of the adjacent pixel points that correspond to the target pixel point and are not at the stain position; and determining the pixel value of the target pixel point according to the pixel values of the determined adjacent pixel points, so as to eliminate the stain on the second image.
[0140] In some embodiments, determining the pixel value of the target pixel point based on the pixel values of the determined adjacent pixel points includes: screening out adjacent pixel points that meet preset conditions from the determined adjacent pixel points, and using their pixel values as the pixel values of the target pixel point; or, performing weighted calculation on the pixel values of the determined adjacent pixel points, and using the calculation result as the pixel value of the target pixel point.
[0141] In some embodiments, the preset conditions include: being in a preset direction of the target pixel point and having a maximum pixel value among multiple adjacent pixel points.
[0142] In some embodiments, restoring the pixel points on the second image corresponding to the stain position according to the stain position includes: restoring the pixel points on the second image corresponding to the stain position in batches according to the stain position; wherein the target pixel points restored in the current batch are adjacent pixel points of the target pixel points of the next batch.
[0143] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0144] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the delay mitigation method as described in any of the above embodiments by calling the computer program.
[0145] An embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for alleviating delay as described in any of the above embodiments is implemented.
[0146] Figure 6 6 is a schematic block diagram of a screen detection device 600 according to an embodiment of the present disclosure. For example, the device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0147] Reference Figure 6 , the device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0148] The processing component 602 generally controls the overall operation of the device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned information receiving method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0149] The memory 604 is configured to store various types of data to support operations on the device 600. Examples of such data include instructions for any application or method operating on the device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0150] The power supply component 606 provides power to the various components of the device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 600.
[0151] The multimedia component 608 includes a screen that provides an output interface between the device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0152] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the device 600 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0153] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0154] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the device 600. For example, the sensor assembly 614 can detect the open / closed state of the device 600, the relative positioning of components, such as the display and keypad of the device 600, and the sensor assembly 614 can also detect the position change of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, the orientation or acceleration / deceleration of the device 600, and the temperature change of the device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0155] The communication component 616 is configured to facilitate wired or wireless communication between the device 600 and other devices. The device 600 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G LTE, 5G NR, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0156] In an exemplary embodiment, the device 600 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned information receiving method.
[0157] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of the device 600 to complete the above-mentioned information receiving method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0158] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0159] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
[0160] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprises a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0161] The method and device provided in the embodiments of the present disclosure are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core idea. At the same time, for those skilled in the art, according to the idea of the present disclosure, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
Claims
1. A screen detection method, characterized in that: The method is performed by a detection device, the detection device is used to detect whether the screen of the device to be tested displays abnormality, and the method includes: When a screen of the device under test is turned off, photographing the screen to acquire a first image; determining a stain position on the screen according to the first image; When the screen displays a preset image, photographing the screen to obtain a second image; The pixel points on the second image corresponding to the stain position are restored according to the stain position, wherein the restored second image is used to evaluate the display effect of the screen of the device under test on the preset image.
2. The method according to claim 1, characterized in that The step of determining the stain position on the screen according to the first image comprises: Performing region division and binarization processing on the first image to obtain a processed first image; A connected region analysis is performed on the processed first image to determine the location of the stain.
3. The method according to claim 2, characterized in that The method further comprises: Before performing connected component analysis on the processed first image, a morphological operation is performed on the processed first image to remove noise points on the processed first image.
4. The method according to claim 2, characterized in that: The first image is a grayscale image, and the performing of region division and binarization processing on the first image to obtain a processed first image includes: Determine the grayscale value of each pixel on the first image after the region division; If the grayscale value is greater than a preset threshold, the pixel point corresponding to the grayscale value is determined as a first value; wherein the pixel point determined as the first value is the pixel point where the stain on the screen is located; If the grayscale value is less than the preset threshold, the pixel point corresponding to the grayscale value is determined as the second value.
5. The method according to claim 1, characterized in that The restoring the pixel points on the second image corresponding to the stain position according to the stain position includes: Determine a target pixel point at a corresponding position on the second image according to the stain position; Determine the pixel value of the adjacent pixel corresponding to the target pixel and not located at the stain position; The pixel value of the target pixel is determined according to the determined pixel values of the adjacent pixel points, so as to remove the stain on the second image.
6. The method according to claim 5, characterized in that The step of determining the pixel value of the target pixel point according to the determined pixel values of the adjacent pixel points includes: Filtering out adjacent pixel points that meet preset conditions from the determined adjacent pixel points, and using the pixel values thereof as the pixel values of the target pixel point; or, A weighted calculation is performed on the pixel values of the determined adjacent pixel points, and the calculation result is used as the pixel value of the target pixel point.
7. The method according to claim 6, characterized in that The preset conditions include: The pixel value is the largest among multiple adjacent pixels in the preset direction of the target pixel.
8. The method according to claim 5, characterized in that The restoring the pixel points on the second image corresponding to the stain position according to the stain position includes: Restoring the pixel points corresponding to the stain position on the second image in batches according to the stain position; The target pixels restored in the current batch are the adjacent pixels of the target pixels in the next batch.
9. A screen detection device, characterized in that: The device is configured in a detection device, the detection device is used to detect whether the screen of the device under test displays abnormality, and the device includes: A first shooting unit is configured to shoot the screen of the device under test to acquire a first image when the screen of the device under test is turned off; a determining unit, configured to determine a stain position on the screen according to the first image; The second shooting unit is configured to shoot the screen to obtain a second image when the screen displays a preset image. The restoration unit is configured to restore the pixel points corresponding to the stain position on the second image according to the stain position, wherein the restored second image is used to evaluate the display effect of the screen of the device under test on the preset image.
10. An electronic device, characterized in that: include: Processor, memory; The memory is used to store computer programs; The processor is used to execute the screen detection method according to any one of claims 1 to 8 by calling the computer program.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the screen detection method described in any one of claims 1 to 8 is implemented.