Screen Color Detection Method, Device, Equipment and Storage Medium

By dividing and contrast calculation of OLED screen images, the normal area and defect areas of the screen are automatically determined, which solves the problem of inaccurate detection caused by artificial determination of normal area of the screen, and achieves more efficient and accurate color defect detection.

CN114359166BActive Publication Date: 2025-07-08SUZHOU LINGYUN VISION INTELLIGENT EQUIP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111522861.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2025-07-08
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

In the prior art, it is artificially determined that there is a color abnormality in the normal area of the screen, resulting in inaccurate detection of color defects in OLED screens.

Method used

By obtaining the screen image to be tested, dividing its area into sub-regions according to the preset division rules, determining the first area using the RGB mean and contrast algorithm, constructing a background image and calculating the contrast image, and finally detecting the color defect area through the threshold segmentation algorithm.

Benefits of technology

Improve the accuracy and efficiency of screen color defect detection, reduce human intervention, and enhance the automation and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359166B_ABST
    Figure CN114359166B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a method, apparatus, device, and storage medium for screen color detection. Among them, the method includes: obtaining an image of the screen to be measured, dividing the image of the screen to be measured into region according to a preset division rule to obtain at least one sub-region of the image to be measured; determining a first region of the image of the screen to be measured based on the RGB mean values of at least one sub-region of the image to be measured and a first contrast determination algorithm for the preset sub-region of the image to be measured; determining a background image of the image of the screen to be measured according to the first image information of the first region and the second image information of the image of the screen to be measured; obtaining a contrast image of the image of the screen to be measured based on the RGB values of the pixel points of the image of the screen to be measured and the background image and a preset second contrast determination algorithm; determining a second region from the contrast image as the color defect region of the screen to be measured according to a preset threshold segmentation algorithm, so as to complete the color detection of the screen.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of image processing, and in particular, to a method, device, equipment and storage medium for screen color detection. Background Art

[0002] In recent years, the number of electronic products using OLED (Organic Light-Emitting Diode) screens has been increasing day by day. For example, OLED screens can be applied to various electronic products such as smart phones, tablet computers or liquid crystal TVs. Compared with other types of screens, OLED screens have the characteristics of low power consumption, high color gamut and being thinner and lighter.

[0003] In the process of detecting color defects of the screen, it is usually necessary to artificially pre-determine the normal area of the screen in advance, and compare the color temperature and other differences between the normal area of the screen and other areas, so as to detect whether there are color defects on the screen. However, there is a problem that the artificially determined normal area of the screen has color abnormalities and cannot accurately detect the color defects of the screen. Summary of the Invention

[0004] The embodiments of the present application provide a method, device, equipment and storage medium for screen color detection to improve the accuracy and detection efficiency of screen color defect detection.

[0005] In a first aspect, the embodiments of the present application provide a method for screen color detection, and the method includes:

[0006] Obtain a to-be-detected screen image, and divide the to-be-detected screen image into at least one to-be-detected image sub-region according to a preset division rule;

[0007] Determine a first region of the to-be-detected screen image based on a first contrast determination algorithm of the to-be-detected image sub-region preset according to the RGB means of at least one to-be-detected image sub-region;

[0008] Determine a background image of the to-be-detected screen image according to the first image information of the first region and the second image information of the to-be-detected screen image;

[0009] Obtain a contrast image of the to-be-detected screen image based on a second contrast determination algorithm preset according to the RGB pixel values of the to-be-detected screen image and the background image;

[0010] Determine a second region from the contrast image as a color defect region of the to-be-detected screen according to a preset threshold segmentation algorithm, so as to complete the color detection of the screen.

[0011] In a second aspect, the embodiments of the present application further provide a device for screen color detection, and the device includes:

[0012] An image sub-region acquisition module, configured to acquire an image of a screen to be measured, divide the image of the screen to be measured according to a preset division rule, and obtain at least one sub-region of the image to be measured;

[0013] A first region determination module, configured to determine a first region of the screen image to be measured based on the RGB mean values of at least one sub-region of the image to be measured and based on a first contrast determination algorithm for the sub-regions of the image to be measured;

[0014] A background image determination module, configured to determine a background image of the screen image to be measured according to first image information of the first region and second image information of the screen image to be measured;

[0015] A contrast image determination module, configured to obtain a contrast image of the screen image to be measured based on the RGB values of the pixel points of the screen image to be measured and the background image and based on a preset second contrast determination algorithm;

[0016] A second region determination module, according to a preset threshold segmentation algorithm, determines a second region from the contrast image as a color defect region of the screen to be measured, so as to complete the color detection of the screen.

[0017] In a third aspect, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, the screen color detection method described in any one of the embodiments of the present application is implemented.

[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the program is executed by a processor, the screen color detection method described in any one of the embodiments of the present application is implemented.

[0019] In the solution of the embodiment of the present application, by obtaining the screen image to be measured, dividing the screen image to be measured into region according to a preset division rule to obtain at least one sub-region of the image to be measured; according to the RGB mean values of at least one sub-region of the image to be measured, based on the first contrast determination algorithm of the preset sub-region of the image to be measured, determining the first region of the screen image to be measured, realizing the automatic determination of the first region, improving the determination accuracy and determination efficiency of the first region; according to the first image information of the first region and the second image information of the screen image to be measured, determining the background image of the screen image to be measured; according to the RGB values of the pixel points of the screen image to be measured and the background image, based on the preset second contrast determination algorithm, obtaining the contrast image of the screen image to be measured; according to the preset threshold segmentation algorithm, determining the second region from the contrast image as the color defect region of the screen to be measured, so as to complete the color detection of the screen. The above solution solves the problem that in the process of detecting the color defect of the screen, it is necessary to manually determine the first region of the screen in advance, improves the determination accuracy of the first region, and thus improves the detection accuracy and detection efficiency of the color defect region of the screen to be measured. Description of the Drawings

[0020] Figure 1 is a schematic flowchart of a screen color detection method in Embodiment 1 of the present application;

[0021] Figure 2A is a schematic flowchart of a screen color detection method in Embodiment 2 of the present application;

[0022] Figure 2B is a flowchart of region determination of the first region of the screen image to be measured in Embodiment 2 of the present application;

[0023] Figure 3 is a schematic diagram of the detection process of a screen color detection method in Embodiment 3 of the present application;

[0024] Figure 4 is a structural block diagram of a screen color detection device in Embodiment 4 of the present application;

[0025] Figure 5 is a schematic structural diagram of an electronic device in Embodiment 5 of the present application. Detailed Embodiment

[0026] The present application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, rather than limiting the present application. In addition, it should be noted that for the sake of description, only part of the structures related to the present application are shown in the drawings, rather than all of them.

[0027] Embodiment 1

[0028] Figure 1The flowchart shows a method for detecting the screen color provided in the first embodiment of the present application. This embodiment is applicable to the situation of detecting whether there are color defects in the screen. This method can be executed by a screen color detection device, which can be implemented in software and / or hardware, such as Figure 1 shown. The specific steps of this method are as follows:

[0029] S101. Obtain an image of the screen to be measured, and divide the image of the screen to be measured into regions according to a preset division rule to obtain at least one sub-region of the image to be measured.

[0030] The image of the screen to be measured can be an image of the screen to be subjected to color defect detection; the image of the screen to be measured can be obtained through an image acquisition device. For example, the image acquisition device can be a CCD (Charge Coupled Device) camera or a CMOS (Complementary Metal Oxide Semiconductor) camera. It should be noted that there may be noise regions in the image of the screen to be measured obtained through the image acquisition device. Among them, the noise region can be other regions in the screen region to be measured except for the screen region that needs to be subjected to color defect detection. Specifically, if there is a noise region in the image of the screen to be measured acquired through the image acquisition device, then image preprocessing can be performed on the image of the screen to be measured with the noise region through techniques such as image threshold extraction or image edge extraction, the noise region can be removed, and the image after removing the noise region is used as the image of the screen to be measured.

[0031] The image of the screen to be measured can also be obtained by loading an existing image of the screen display area. Among them, the existing image of the screen display area can be an existing image of the mobile phone screen display area or an existing image of the tablet screen display area, etc. The existing screen display area can be obtained in an offline manner and can be directly used without any image processing.

[0032] Among them, the sub-region of the image to be measured can be a partial region in the image of the screen to be measured determined according to a preset division rule. The division rule of the image of the screen to be measured can be preset by relevant technical personnel. Specifically, it can be determined in advance whether to divide the image to be measured equally. If the image of the screen to be measured is divided equally, then the division ratio of the preset equal division is set; if the image of the screen to be measured is not divided equally, then the division shape and the size of the division region are preset.

[0033] Exemplarily, if the division rule of equal division is adopted to divide the screen image to be measured, the division ratio of the screen image to be measured can be preset in advance, and the screen image to be measured is divided according to the division ratio. For example, the division ratio of the screen image to be measured can be 5×5, and the screen image to be measured is equally divided into 25 sub-regions of the image to be measured according to the division ratio of 5×5; the larger the number of sub-regions of the image to be measured divided, the more accurate the division of the screen to be measured. The division ratio of the screen image to be measured can also be set according to the image shape, image size of the screen image to be measured, or the actual requirements for the division accuracy of the screen image to be measured. For example, if the image shape of the screen image to be measured is a rectangle, the division ratio of the screen image to be measured can be set to 5×10, and the screen image to be measured is equally divided into 50 sub-regions of the image to be measured according to the division ratio of 5×10.

[0034] Exemplarily, if the division rule of non-equal division is adopted to divide the screen image to be measured, the division shape and the size of the division region of the screen image to be measured can be preset in advance, and the screen image to be measured is divided according to the division shape and the size of the division region. For example, the division shape of the screen image to be measured can be a rectangle, a circle, a triangle or any shape; the size of the division region can be set by those skilled in the art according to actual requirements. For example, if the division shape of the screen image to be measured is a rectangle, the values of the length and width corresponding to the rectangle can be set.

[0035] Exemplarily, the screen image to be measured is obtained by an image acquisition device. According to the preset division rule, it is determined whether to perform equal division on the screen image to be measured. If so, the division ratio of the equal division is determined; if not, the division shape and the size of the division region of the non-equal division are determined. According to the determination result of whether to perform equal division on the screen image to be measured, at least one sub-region of the image to be measured is divided.

[0036] S102. Based on the first contrast determination algorithm of the preset sub-region of the image to be measured, determine the first region of the screen image to be measured according to the RGB average value of at least one sub-region of the image to be measured.

[0037] Among them, the RGB average value of the sub-region of the image to be measured can be obtained by summing up the RGB values of each pixel point in the sub-region of the image to be measured and taking the average value; specifically, it can be to sum up and take the average value of the R-channel values of each pixel point in the sub-region of the image to be measured, sum up and take the average value of the G-channel values, and sum up and take the average value of the B-channel values. For example, there are pixel point A, pixel point B, and pixel point C in the sub-region of the image to be measured. The RGB value corresponding to pixel point A is (100, 100, 100), the RGB value corresponding to pixel point B is (150, 150, 150), and the RGB value corresponding to pixel point C is (50, 20, 200). Then the RGB average value of the sub-region of the image to be measured is (100, 90, 150).

[0038] The first contrast determination algorithm can be determined in advance by those skilled in the art. For example, the contrast determination algorithm can be the CIEDE2000 color difference algorithm or the CIE94 color difference algorithm, etc. Exemplarily, based on the RGB means of at least one sub-region of the image to be measured, the CIE (International Commission on Illumination) contrast between at least two sub-regions of the image to be measured can be calculated according to a preset first contrast determination algorithm. A contrast threshold is preset, and each CIE contrast is compared with the contrast threshold. At least one sub-region of the image to be measured with a CIE contrast less than the preset contrast threshold is merged, and the merged image region is used as the first region of the image of the screen to be measured. Among them, the contrast threshold can be preset by those skilled in the art. For example, the contrast threshold can be 4; the first region can be the normal region without color defects corresponding to the image of the screen to be measured. Optionally, different contrast thresholds can be set based on different scenario requirements, or different contrast thresholds can be set based on different human eye sensory requirements.

[0039] Exemplarily, if the image of the screen to be measured is divided into at least two sub-regions of the image to be measured, any two sub-regions of the image to be measured are randomly selected from the at least two sub-regions of the image to be measured. According to the RGB means respectively corresponding to the two randomly selected sub-regions of the image to be measured, the CIE contrast between the two randomly selected sub-regions of the image to be measured is calculated based on the CIEDE2000 color difference algorithm. If the CIE contrast is less than the preset contrast threshold, the two randomly selected sub-regions of the image to be measured are merged. The merged region can be used as a new sub-region of the image to be measured, and the CIE contrast between this new sub-region of the image to be measured and the other sub-regions of the image to be measured except the two merged sub-regions of the image to be measured is calculated; if the CIE contrast is not less than the preset contrast threshold, the two randomly selected sub-regions of the image to be measured are continuously used to calculate the CIE contrast with the other sub-regions of the image to be measured and perform contrast comparison. After pairwise contrast calculation and contrast comparison are performed between all sub-regions of the image to be measured, the largest sub-region of the image to be measured obtained is used as the first region.

[0040] S103. Determine the background image of the image of the screen to be measured according to the first image information of the first region and the second image information of the image of the screen to be measured.

[0041] Among them, the first image information can be the image information corresponding to the first region. For example, the first image information can include the RGB mean of the first region. The second image information can be the image information corresponding to the image of the screen to be measured. For example, the second image information can include the size of the image of the screen to be measured. The background image can be an image with the same size and RGB mean as the image of the screen to be measured.

[0042] In an alternative embodiment, determining the background image of the screen image to be measured according to the first image information of the first region and the second image information of the screen image to be measured includes: determining the size of the background image according to the size of the screen image to be measured; determining the RGB values of the background image according to the RGB average value of the first region.

[0043] The size of the background image is the same as that of the screen image to be measured, with the same unit. Exemplarily, if the size of the screen image to be measured is 20×20 cm, then the size of the background image is also 20×20 cm. The RGB value corresponding to each pixel of the background image is the same as the RGB average value corresponding to the first region. Exemplarily, if the RGB average value of the first region is (128, 128, 128), then the RGB value of each corresponding pixel in the background image is (128, 128, 128), that is, the background image is a solid-color image determined according to the RGB average value corresponding to the first region image. In this alternative embodiment, the size of the background image is determined according to the size of the screen image to be measured; the RGB values of the background image are determined according to the RGB average value of the first region, realizing the accurate determination of the size and RGB values of the background image, thereby improving the accuracy of determining the contrast image corresponding to the subsequent screen image to be measured, and further improving the accuracy of detecting the color defects of the subsequent screen image to be measured.

[0044] S104. Obtain the contrast image of the screen image to be measured based on a preset second contrast determination algorithm according to the RGB values of the pixel points of the screen image to be measured and the background image.

[0045] Among them, the image size of the screen image to be measured is the same as that of the background image, that is, the number of pixels of the screen image to be measured is the same as that of the background image, and the pixel arrangement positions are the same. For example, if the image size of the screen image to be measured is 200×200 pixels, that is, the screen image to be measured has 200 pixel points in both the horizontal and vertical directions. Correspondingly, the image size of the background image is also 200×200 pixels, and it has 200 pixel points in both the horizontal and vertical directions.

[0046] Among them, the second contrast determination algorithm is used to calculate the contrast between the screen image to be measured and the background image point by point, and specifically can be calculated according to the RGB values of the pixel points corresponding one by one between the screen image to be measured and the background image. For example, the second contrast determination algorithm can be any calculation formula capable of calculating the contrast.

[0047] The contrast image can be used to measure the scale of the brightness difference between the bright areas and the dark areas in the image. Exemplarily, according to the RGB values of the pixel points corresponding one by one between the image to be measured and the background image, and according to a preset second contrast determination algorithm, the contrast between the image to be measured and the background image is calculated point by point; based on the contrast calculated point by point, a contrast image corresponding to the screen image to be measured is constructed.

[0048] In an alternative embodiment, according to the RGB values of the pixel points of the screen image to be measured and the background image, and based on a preset second contrast determination algorithm, obtaining the contrast image of the screen image to be measured includes: according to the RGB values of the pixel points of the screen image to be measured and the background image, and based on a preset second contrast determination algorithm, obtaining the CIE contrast between the screen image to be measured and the background image; according to the CIE contrast, obtaining the contrast image of the screen image to be measured.

[0049] Among them, the second contrast determination algorithm may be the CIEDE2000 color difference algorithm. Correspondingly, the CIE contrast is the contrast calculated based on the CIEDE2000 color difference algorithm. Exemplarily, based on the CIEDE2000 color difference algorithm, according to the RGB values corresponding to the pixel points of the screen image to be measured and the background image, the CIE contrast between the screen image to be measured and the background image is calculated point by point; based on the CIE contrast calculated point by point, a contrast image of the screen image to be measured is constructed.

[0050] Exemplarily, the value range of the CIE contrast calculated point by point through the CIEDE2000 color difference formula is [0, +∞), and the calculated CIE contrast value may be a floating point number. Optionally, the CIE contrast with a floating point number type obtained can be converted into an integer type. For example, it can be obtained by rounding up or rounding down; the contrast image can be constructed using the CIE contrast of the integer type.

[0051] In this alternative embodiment, according to the RGB values of the pixel points of the screen image to be measured and the background image, and based on a preset second contrast determination algorithm, the CIE contrast between the screen image to be measured and the background image is obtained; according to the CIE contrast, the contrast image of the screen image to be measured is obtained. The above solution constructs the contrast image by calculating the CIE contrast between the screen image to be measured and the background image, reducing the probability of inconsistency between the human eye perception and the color evaluation measurement data, thereby reducing the influence of subsequent human eye perception on the detection result of the screen color defect, and solving the problem of inconsistency with the human eye perception in detecting the screen color defect using detection benchmarks such as color temperature in the prior art.

[0052] S105. According to a preset threshold segmentation algorithm, determine a second region from the contrast image as the color defect region of the screen to be measured, so as to complete the color detection of the screen.

[0053] Among them, the threshold segmentation algorithm can utilize the difference in grayscale of the image to classify the pixel points in the image by setting an appropriate threshold, thereby realizing the segmentation of the image. The second region can be the region with color defects in the screen to be measured.

[0054] Based on the threshold segmentation algorithm, by setting appropriate threshold segmentation conditions, the contrast image can be segmented, thereby determining the second region from the comparison image.

[0055] In an optional embodiment, determining the second region from the contrast image according to a preset threshold segmentation algorithm includes: determining the pixel value of any pixel point in the contrast image, and searching for the region in the contrast image where the pixel value satisfies the preset threshold segmentation condition as the second region.

[0056] Among them, the threshold segmentation condition can be preset by those skilled in the art. For example, the threshold segmentation condition can be to judge whether the value of each pixel point in the contrast image exceeds the pixel point threshold according to the characteristic attributes of the pixel point, so as to judge whether the pixel point belongs to the second region. Specifically, judge whether the pixel value of each pixel point in the contrast image exceeds the preset pixel point threshold. If so, it is determined that the pixel point is located in the second region, that is, all pixel points exceeding the pixel point threshold can form the second region. Therefore, the determination accuracy of the second region is related to the selection of the pixel point threshold in the threshold segmentation condition. The more accurate the selection of the pixel point threshold, the higher the determination accuracy of the second region; the more ambiguous the selection of the pixel point threshold, the lower the determination accuracy of the second region.

[0057] The pixel point threshold can be determined specifically in the following ways: manual experience selection method, histogram selection method, maximum inter-class variance method, or adaptive threshold method, etc. The characteristic attributes of the pixel point can include attributes such as pixel point grayscale value and pixel point coordinates.

[0058] Exemplarily, the characteristic attributes of any pixel point in the contrast image can be determined. Based on the preset pixel point threshold requirement, judge whether the characteristic attributes of each pixel point in the contrast image meet the pixel point threshold requirement. If so, determine the pixel point as a pixel point in the second region; if not, determine the pixel point as a pixel point in other regions except the second region in the contrast image; according to the judgment result, determine the second region from the contrast image.

[0059] In this optional embodiment, by determining the pixel value of any pixel point in the contrast image and finding the area in the contrast image where the pixel value meets the preset threshold segmentation condition as the second area, the determination of the second area in the contrast image is achieved. By using the method of judging whether the pixel value of the contrast image meets the preset threshold segmentation condition, the accuracy of determining the second area is improved, thereby improving the accuracy of color defect detection for the screen.

[0060] In an optional embodiment, after determining the pixel value of any pixel point in the contrast image and finding the area in the contrast image where the pixel value meets the preset threshold segmentation condition as the second area, it further includes: judging whether the image area of the second area is greater than or equal to a preset area threshold; if so, determining the second area as the color defect area of the screen to be tested to complete the color detection of the screen.

[0061] Among them, the area threshold can be preset by relevant technicians; the area threshold can be used to determine whether there is a color defect in the image of the screen to be tested. Exemplarily, if the image area of the second area is greater than or equal to the preset area threshold, it can be considered that there is a color defect in the image of the screen to be tested, and the second area is the area of the color defect in the screen to be tested; if the image area of the second area is less than the preset area threshold, it can be considered that there is no color defect in the image of the screen to be tested.

[0062] Exemplarily, the image area of the second area can be determined through an image analysis tool, and whether there is a color defect in the image of the screen to be tested can be determined based on the image area of the second area. Specifically, after determining the image area of the second area, judge whether the image area of the second area is greater than or equal to the preset area threshold. If so, determine the second area as the color defect area of the screen to be tested to complete the color detection of the screen; if not, it can be considered that there is no color defect in the image of the screen to be tested to complete the color detection of the screen.

[0063] Optionally, a Blob analysis tool can be used to analyze the contrast image. Blob analysis can perform operations such as image segmentation, denoising, connectivity analysis, and eigenvalue calculation on the image. Specifically, using the Blob analysis tool, the image of the screen to be tested can be segmented into the second area and other areas except the second area; the second area is converted from the pixel level to the connected component level, and feature quantity calculation is performed on the second area to obtain features such as the area, perimeter, and centroid coordinates of the second area. Based on the preset area threshold, judge whether the image area of the second area is greater than or equal to the preset area threshold. If so, determine the second area as the color defect area of the screen to be tested to complete the color detection of the screen; if not, it can be considered that there is no color defect in the image of the screen to be tested.

[0064] In this optional embodiment, by determining whether the image area of the second region is greater than or equal to a preset area threshold, the determination of whether there is a color defect in the screen image to be measured is realized; if there is a color defect in the screen image to be measured, the second region is determined as the color defect region of the screen to be measured, so as to complete the color detection of the screen; by setting the area threshold, the further determination of whether there is a color defect in the screen to be measured is realized, and the flexibility and accuracy of determining whether there is a color defect in the screen to be measured are improved.

[0065] The solution of the embodiment of the present application obtains the screen image to be measured, divides the screen image to be measured into at least one sub-region to be measured according to a preset division rule; determines the first region of the screen image to be measured based on the RGB mean values of at least one sub-region to be measured and a first contrast determination algorithm for the sub-region to be measured preset, realizing the automatic determination of the first region and improving the determination accuracy and efficiency of the first region; determines the background image of the screen image to be measured according to the first image information of the first region and the second image information of the screen image to be measured; obtains the contrast image of the screen image to be measured based on the RGB values of the pixel points of the screen image to be measured and the background image and a preset second contrast determination algorithm; determines the second region from the contrast image according to a preset threshold segmentation algorithm as the color defect region of the screen to be measured, so as to complete the color detection of the screen. The above solution solves the problem that it is necessary to manually determine the first region of the screen in advance during the detection of the screen color defect, improves the determination accuracy of the first region, and thus improves the detection accuracy and detection efficiency of the color defect region of the screen to be measured.

[0066] Embodiment 2

[0067] Figure 2A It is a flowchart of a screen color detection method provided by Embodiment 2 of the present application. On the basis of the above technical solutions, this embodiment is optimized and improved.

[0068] Further, the step of "determining the first region of the to-be-tested screen image according to the RGB mean value of at least one to-be-tested image sub-region and based on the preset first contrast determination algorithm for the to-be-tested image sub-region" is refined to "determining a target to-be-tested sub-region and candidate to-be-tested sub-regions from at least one to-be-tested image sub-region according to the arrangement order of the to-be-tested image sub-regions in the to-be-tested screen image; wherein, the candidate to-be-tested sub-regions are the to-be-tested image sub-regions other than the target to-be-tested image sub-region among the to-be-tested image sub-regions; determining the CIE contrast between the target to-be-tested sub-region and any one of the candidate to-be-tested sub-regions according to the RGB mean value of the target to-be-tested sub-region and the RGB mean value of any one of the candidate to-be-tested sub-regions and based on the preset first contrast determination algorithm for the to-be-tested image sub-region; judging whether the CIE contrast is less than a preset contrast threshold; if so, putting the target to-be-tested sub-region and the candidate to-be-tested sub-region into the set of regions to be merged corresponding to the target to-be-tested sub-region; determining the third region after merging the target to-be-tested sub-region and the candidate to-be-tested sub-region in the set of regions to be merged; and determining the first region of the to-be-tested screen image from the third region according to the preset first region screening condition." to improve the determination method of the first region of the to-be-tested screen image.

[0069] As Figure 2A shown, the method includes the following specific steps:

[0070] S201. Obtain the to-be-tested screen image, and divide the to-be-tested screen image into regions according to a preset division rule to obtain at least one to-be-tested image sub-region.

[0071] S202. Determine a target to-be-tested sub-region and candidate to-be-tested sub-regions from at least one to-be-tested image sub-region according to the arrangement order of the to-be-tested image sub-regions in the to-be-tested screen image; wherein, the candidate to-be-tested sub-regions are the to-be-tested image sub-regions other than the target to-be-tested image sub-region among the to-be-tested image sub-regions.

[0072] Among them, the arrangement order may be the region serial number order of the to-be-tested image sub-regions arranged by rows and columns in the to-be-tested screen image. For example, if the to-be-tested screen image is divided into 2×2 to-be-tested image sub-regions, the to-be-tested image sub-region located in the first row and the first column may be denoted as region No. 1, that is, the corresponding region serial number is 1, the to-be-tested image sub-region located in the first row and the second column may be denoted as region No. 2, the to-be-tested image sub-region located in the second row and the first column may be denoted as region No. 3, and the to-be-tested image sub-region located in the second row and the second column may be denoted as sequence No. 4; correspondingly, the arrangement order of the to-be-tested image sub-regions in the to-be-tested screen image may be region No. 1, region No. 2, region No. 3, and region No. 4 respectively. The arrangement order of the to-be-tested image sub-regions in the to-be-tested screen image may be preset by those skilled in the relevant art, and this embodiment does not limit this.

[0073] Continuing with the previous example, the target sub-region to be measured can be the sub-region of the image to be measured that is ranked in Region 1 in the image to be measured on the screen. Correspondingly, the candidate sub-regions to be measured can be the sub-regions of the image to be measured that are ranked in Region 2, Region 3, or Region 4 in the image to be measured on the screen.

[0074] S203. Based on the RGB means of the target sub-region to be measured and any one of the candidate sub-regions to be measured, and based on a preset first contrast determination algorithm for the sub-regions of the image to be measured, determine the CIE contrast between the target sub-region to be measured and any one of the candidate sub-regions to be measured.

[0075] Among them, the first contrast determination algorithm can be the CIEDE2000 color difference algorithm. Determine the RGB means of the target sub-region to be measured and any one of the candidate sub-regions to be measured; based on the determined RGB means of the target sub-region to be measured and any one of the candidate sub-regions to be measured, and based on the preset first contrast determination algorithm, calculate the CIE contrast between the target sub-region to be measured and any one of the candidate sub-regions to be measured.

[0076] Exemplarily, if the target sub-region to be measured is the sub-region of the image to be measured that is ranked as Region 1 in the image to be measured on the screen, and the arbitrarily selected candidate sub-region to be measured is the sub-region of the image to be measured that is ranked as Region 2 in the image to be measured on the screen; then determine the RGB mean of the sub-region of the image to be measured ranked as Region 1, and the RGB mean of the sub-region of the image to be measured ranked as Region 2. Based on the determined RGB means and the CIEDE2000 color difference algorithm, determine the CIE contrast between the sub-region of the image to be measured ranked as Region 1 in the image to be measured on the screen and the sub-region of the image to be measured ranked as Region 2 in the image to be measured on the screen.

[0077] S204. Determine whether the CIE contrast is less than a preset contrast threshold.

[0078] Among them, the contrast threshold can be preset by relevant technicians, and the contrast threshold can be specifically customized according to the actual application scenario or the requirements of human eye sensory detection.

[0079] Determine the CIE contrast between the target sub-region to be measured and any one of the candidate sub-regions to be measured, and determine whether the CIE contrast is less than the preset contrast threshold. If so, it can be determined that the conditions for region merging are met between the target sub-region to be measured and the candidate sub-region to be measured, and region merging of the target sub-region to be measured and the candidate sub-region to be measured can be performed; if not, it can be determined that the conditions for region merging are not met between the target sub-region to be measured and the candidate sub-region to be measured, and region merging is not performed.

[0080] S205. If so, put the target sub-region to be measured and the candidate sub-region to be measured into the set of regions to be merged corresponding to the target sub-region to be measured.

[0081] Among them, a set of regions to be merged for the target sub-region to be measured is preset. Before performing CIE contrast comparison between the target sub-region to be measured and any candidate sub-region to be measured, the set of regions to be merged for the target sub-region to be measured is an empty set. The number of sets of regions to be merged is the same as the number of sub-regions of the image to be measured in the screen image to be measured; each sub-region of the image to be measured can correspond to a set of regions to be merged as the target sub-region to be measured. The set elements in the set of regions to be merged may include the region serial number of the target sub-region to be measured and the region serial numbers of candidate sub-regions to be measured that meet the conditions for merging with the target sub-region to be measured.

[0082] If the CIE contrast between the target sub-region to be measured and any candidate sub-region to be measured is less than the preset contrast threshold, then put the candidate sub-region to be measured into the set of regions to be merged of the target sub-region to be measured. If the CIE contrast between the target sub-region to be measured and any candidate sub-region to be measured is not less than the preset contrast threshold, then there is no need to put the candidate sub-region to be measured into the set of regions to be merged of the target sub-region to be measured.

[0083] S206. Determine the third region after merging the target sub-region to be measured and the candidate sub-region to be measured in the set of regions to be merged.

[0084] Merge the target sub-region to be measured and the candidate sub-region to be measured in the set of regions to be merged, and use the merged region as the third region. Among them, the third region can be the candidate first region in the screen image to be measured.

[0085] Exemplarily, each sub-region of the image to be measured in the screen region to be measured can be used as the target sub-region to be measured and each corresponds to a third region. Exemplarily, if there are 4 sub-regions of the image to be measured in the screen region to be measured, then after each sub-region of the image to be measured is merged with the candidate sub-region to be measured, each corresponds to a third region, that is, the number of determined third regions can be the same as the number of sub-regions of the image to be measured.

[0086] In a specific embodiment, the screen image to be measured is divided into 2×3 sub-regions to be measured, and the corresponding region numbers of each sub-region to be measured are 1 to 6 respectively. After calculating the CIE contrast of each sub-region to be measured with its corresponding candidate sub-region to be measured as the target sub-region to be measured, the following results are obtained: the set of regions to be merged of the sub-region to be measured with region number 1 can be {1, 2, 5}, and the third region is obtained by merging the sub-regions to be measured with region numbers 1, 2, and 5; the set of regions to be merged of the sub-region to be measured with region number 2 can be {2, 1}, and the third region is obtained by merging the sub-regions to be measured with region numbers 2 and 1; the set of regions to be merged of the sub-region to be measured with region number 3 can be {3, 4, 5, 6}, and the third region is obtained by merging the sub-regions to be measured with region numbers 3, 4, 5, and 6; the set of regions to be merged of the sub-region to be measured with region number 4 can be {4, 3, 6}, and the third region is obtained by merging the sub-regions to be measured with region numbers 4, 3, and 6; the set of regions to be merged of the sub-region to be measured with region number 5 can be {5, 1, 3}, and the third region is obtained by merging the sub-regions to be measured with region numbers 5, 1, and 3; the set of regions to be merged of the sub-region to be measured with region number 6 can be {6, 3, 4}, and the third region is obtained by merging the sub-regions to be measured with region numbers 6, 3, and 4.

[0087] S207. Determine the first region of the screen image to be measured from the third region according to the preset first region screening condition.

[0088] Among them, the first region screening condition can be determined in advance by those skilled in the relevant art; for example, the first region screening condition can be to use the third region with the largest number of elements in the set of regions to be merged as the first region, or to use the third region with the largest area as the first region.

[0089] Exemplarily, select the set with the largest number of set elements from at least one set of regions to be merged, and merge the sub-regions to be measured corresponding to the region numbers in the selected set; the merged image is used as the first region of the screen image to be measured.

[0090] In an alternative embodiment, determining the first region of the screen image to be measured from the third region according to the preset first region screening condition includes: determining the area of the third region corresponding to the set of regions to be merged of any target sub-region to be measured; comparing the area of the third region corresponding to the set of regions to be merged of any target sub-region to be measured to determine whether there is a target third region area that meets the preset area comparison condition; merging the target sub-region to be measured in the set of regions to be merged corresponding to the target third region area with the candidate sub-region to be measured to obtain the target third region, and using the target third region as the first region of the screen image to be measured.

[0091] Merge the sub-regions to be measured corresponding to the region numbers in the set of regions to be merged of at least one target sub-region to be measured, to obtain the area of the third region corresponding to the set of regions to be merged of any target sub-region to be measured. Compare the area of the third region corresponding to the set of regions to be merged of any target sub-region to be measured, and determine whether there is a target third region area that meets the preset area comparison condition. Among them, the preset area comparison condition may be that the area of the third region of any target sub-region to be measured meets the preset area threshold, then the area of this third region is the target third region area; the preset area threshold can be set in advance by relevant technicians. Optionally, the preset area comparison condition may also be that in the set of regions to be merged of any target sub-region to be measured, the largest area in the third region is used as the target third region area.

[0092] If there is a target third region area that meets the preset area comparison condition, then use the third region corresponding to the target third region area as the target third region. If there is no target third region area that meets the preset area comparison condition, relevant technicians can intervene to manually determine the target third region. Use the target third region as the first region of the screen image to be measured.

[0093] In this optional embodiment, by determining the area of the third region corresponding to the set of regions to be merged of any target sub-region to be measured; comparing the area of the third region corresponding to the set of regions to be merged of any target sub-region to be measured, and determining whether there is a target third region area that meets the preset area comparison condition; merging the target sub-regions to be measured in the set of regions to be merged corresponding to the target third region area with the candidate sub-regions to be measured, to obtain the target third region, and using the target third region as the first region of the screen image to be measured. The above solution determines the target third region area by determining whether it meets the preset area comparison condition, improving the accuracy of determining the target third region area, and thus improving the accuracy of determining the first region of the screen image to be measured.

[0094] S208. Determine the background image of the screen image to be measured according to the first image information of the first region and the second image information of the screen image to be measured.

[0095] S209. Based on the RGB values of the pixel points of the screen image to be measured and the background image, and based on a preset second contrast determination algorithm, obtain the contrast image of the screen image to be measured.

[0096] S210. According to a preset threshold segmentation algorithm, determine a second region from the contrast image as the color defect region of the screen to be measured, so as to complete the color detection of the screen.

[0097] In an optional embodiment, the first region of the screen image to be measured can also be determined in the following manner: Figure 2BFlowchart for determining the region of the first region of the screen image to be measured. The screen image to be measured is divided into M sub-regions to be measured, denoted as the region set M; arbitrarily select 1 sub-region to be measured from the M sub-regions to be measured, denoted as A, as the target sub-region to be measured; the sub-regions to be measured in the set M other than A are used as candidate sub-regions to be measured, and the set composed of the candidate sub-regions to be measured is denoted as the region set N; if there is a candidate sub-region to be measured C among the sub-regions to be measured other than A, and when C is used as the target sub-region to be measured, the contrast calculation has been performed between C and A, then A can be deleted from the corresponding set N of C. Arbitrarily select a sub-region to be measured from the set N, denoted as B; calculate the corresponding RGB means of the sub-region to be measured A and the sub-region to be measured B respectively, and calculate the CIE contrast between the two regions using the RGB mean of the sub-region to be measured A and the RGB mean of the sub-region to be measured B; if the CIE contrast is less than the preset contrast threshold, then merge the sub-region to be measured A and the sub-region to be measured B; if the CIE contrast is not less than the preset contrast threshold, then continue to select other unselected sub-regions to be measured from the set N and continue to calculate the CIE contrast with the sub-region to be measured A. Until all the sub-regions to be measured in the set N have been cycled through and compared with the CIE contrast of the sub-region to be measured A, then continue to select other sub-regions to be measured in the region set M other than the sub-region to be measured A and repeat the above cycle until all the elements of the region set M have been cycled through and the cycle of the region set M ends. The region with the largest area among the at least one merged region obtained by the cycle is used as the first region.

[0098] The scheme of this embodiment determines the target sub-region to be tested and the candidate sub-region to be tested from at least one sub-region of the image to be tested according to the arrangement order of the sub-regions of the image to be tested in the screen image to be tested; determines the CIE contrast between the target sub-region to be tested and any candidate sub-region to be tested based on the preset first contrast determination algorithm of the sub-region of the image to be tested according to the RGB mean of the target sub-region to be tested and the RGB mean of any candidate sub-region to be tested; determines whether the CIE contrast is less than the preset contrast threshold; if so, puts the target sub-region to be tested and the candidate sub-region to be tested into the set of regions to be merged corresponding to the target sub-region to be tested; determines the third region after the target sub-region to be tested and the candidate sub-region to be tested are merged in the set of regions to be merged; determines the first region of the screen image to be tested from the third region according to the preset first region screening condition. The above scheme improves the accuracy of the first region by putting those that meet the preset contrast threshold condition into the set of regions to be merged, and determines the first region of the screen image to be tested from the third region according to the first region screening condition and the set of regions to be merged, thereby improving the detection accuracy of the subsequent color defect detection of the screen image to be tested. At the same time, by automatically determining the first area of ​​the screen image to be tested, the detection efficiency of color defects of the screen image to be tested is improved.

[0099] Embodiment 3

[0100] Figure 3 This is a schematic diagram of the detection process of a screen color detection method provided in Example 3 of the present application. This embodiment of the present application provides a preferred implementation method based on the technical solutions of the above embodiments.

[0101] like Figure 3 As shown, the screen image to be tested should be a color image with a uniform RGB value of 128 when there is no color defect, but there is a color defect on the left side of the current screen image to be tested.

[0102] S1: Acquisition of the screen image to be tested: The screen image to be tested can be obtained through various means, such as by shooting with a CCD or CMOS camera, or by using the result of other image preprocessing as the screen image to be tested, etc.;

[0103] S2: Background image construction: by automatically extracting a normal area, i.e., a first area, from the screen image to be tested, a background image having the same size as the screen image to be tested and having all pixel grayscale values ​​the same as the RGB mean of the normal area is formed;

[0104] S2.1: normal area (first area) acquisition: obtained by dividing the image to be tested into sub-areas and merging the sub-areas;

[0105] S2.1.1: Sub-region division: Divide the screen image to be measured into several sub-regions to be measured. Specifically, various methods such as equal division or unequal division can be adopted, and the shape of the sub-regions to be measured can also be arbitrary;

[0106] S2.1.2: Sub-region merging: Select one sub-region from the divided sub-regions to be measured (denoted as set M) and denote it as A, and select a sub-region from the remaining regions except sub-region A (denoted as set N) and denote it as B. Calculate the RGB mean values of the two regions, and calculate the CIE contrast between the two sub-regions using the RGB mean values of the two sub-regions. If the CIE contrast is less than the specified threshold, perform region merging; otherwise, jump to the next sub-region in set N until all sub-regions in sets M and N are traversed. Take the region with the largest area after merging and denote it as the normal region (the first region); where Figure 3 The right dotted line part of the picture of sub-region merging is the normal region (the first region).

[0107] S2.2: Calculate the background image: Calculate the RGB mean value of the normal region (the first region), and create a background image with the same size as the screen image to be measured and all pixel gray values the same as the RGB mean value of the normal region (the first region);

[0108] S3: Calculate the contrast image: Calculate the CIE contrast at the corresponding position points of the screen image to be measured and the background image to form a contrast image;

[0109] S4: Defect extraction: Perform operations such as threshold segmentation and Blob analysis on the contrast image to obtain the required color type defects, where Figure 3 In the picture of color defect extraction, the dark part on the left is the area with color defects, that is, the second region.

[0110] Embodiment 4

[0111] Figure 4 This is a schematic structural diagram of a screen color detection device provided in Embodiment 4 of the present application. A screen color detection device provided in an embodiment of the present application is applicable to detecting whether there are color defects on the screen, and the device can be implemented in software and / or hardware manners. As Figure 4 shown, the device specifically includes: an image sub-region acquisition module 401, a first region determination module 402, a background image determination module 403, a contrast image determination module 404, and a second region determination module 405. Where

[0112] The image sub-region acquisition module 401 is configured to acquire the screen image to be measured, and divide the screen image to be measured according to a preset division rule to obtain at least one sub-region to be measured;

[0113] The first region determination module 402 is configured to determine the first region of the to-be-tested screen image based on the RGB means of at least one sub-region of the to-be-tested image and a preset first contrast determination algorithm for the sub-regions of the to-be-tested image;

[0114] The background image determination module 403 is configured to determine the background image of the to-be-tested screen image according to the first image information of the first region and the second image information of the to-be-tested screen image;

[0115] The contrast image determination module 404 is configured to obtain the contrast image of the to-be-tested screen image based on the RGB values of the pixel points of the to-be-tested screen image and the background image and a preset second contrast determination algorithm;

[0116] The second region determination module 405 determines a second region from the contrast image according to a preset threshold segmentation algorithm as the color defect region of the to-be-tested screen, so as to complete the color detection of the screen.

[0117] In the solution of the embodiment of the present application, by obtaining the to-be-tested screen image, dividing the to-be-tested screen image into regions according to a preset division rule to obtain at least one sub-region of the to-be-tested image; determining the first region of the to-be-tested screen image based on the RGB means of at least one sub-region of the to-be-tested image and a preset first contrast determination algorithm for the sub-regions of the to-be-tested image, the automatic determination of the first region is realized, and the determination accuracy and determination efficiency of the first region are improved; determining the background image of the to-be-tested screen image according to the first image information of the first region and the second image information of the to-be-tested screen image; obtaining the contrast image of the to-be-tested screen image based on the RGB values of the pixel points of the to-be-tested screen image and the background image and a preset second contrast determination algorithm; determining a second region from the contrast image according to a preset threshold segmentation algorithm as the color defect region of the to-be-tested screen, so as to complete the color detection of the screen. The above solution solves the problem that in the process of detecting the color defects of the screen, it is necessary to manually determine the first region of the screen in advance, improves the determination accuracy of the first region, and thus improves the detection accuracy and detection efficiency of the color defect region of the to-be-tested screen.

[0118] Optionally, the first region determination module 402 includes:

[0119] The to-be-tested sub-region determination unit is configured to determine a target to-be-tested sub-region and a candidate to-be-tested sub-region from at least one to-be-tested image sub-region according to the arrangement order of the to-be-tested image sub-regions in the to-be-tested screen image; wherein, the candidate to-be-tested sub-region is the to-be-tested image sub-region other than the target to-be-tested image sub-region among the to-be-tested image sub-regions;

[0120] A first contrast determination unit, configured to determine the CIE contrast between the target sub-region to be measured and any one of the candidate sub-regions to be measured based on the RGB means of the target sub-region to be measured and any one of the candidate sub-regions to be measured and a first contrast determination algorithm for sub-regions of the image to be measured preset.

[0121] A first contrast judgment unit, configured to judge whether the CIE contrast is less than a preset contrast threshold.

[0122] A region set determination unit, configured to, if the CIE contrast is less than the preset contrast threshold, put the target sub-region to be measured and the candidate sub-region to be measured into a region set to be merged corresponding to the target sub-region to be measured.

[0123] A third region determination unit, configured to determine a third region after merging the target sub-region to be measured and the candidate sub-region to be measured in the region set to be merged.

[0124] A first region determination unit, configured to determine a first region of the image of the screen to be measured from the third region according to a preset first region screening condition.

[0125] Optionally, the first region determination unit includes:

[0126] A third region area determination subunit, configured to determine the area of the third region corresponding to the region set to be merged of any one of the target sub-regions to be measured.

[0127] A target third region area judgment subunit, configured to compare the areas of the third regions corresponding to the region sets to be merged of any one of the target sub-regions to be measured and determine whether there is a target third region area that meets a preset area comparison condition.

[0128] A first region determination subunit, configured to merge the target sub-region to be measured and the candidate sub-region to be measured in the region set to be merged corresponding to the target third region area to obtain a target third region, and use the target third region as the first region of the image of the screen to be measured.

[0129] Optionally, the first image information includes the RGB mean of the first region, and the second image information includes the size of the image of the screen to be measured.

[0130] Correspondingly, the background image determination module 403 includes:

[0131] A background image size determination unit, configured to determine the size of the background image according to the size of the image of the screen to be measured.

[0132] A background image RGB value determination unit, configured to determine the RGB value of the background image according to the RGB mean of the first region.

[0133] Optionally, the contrast image determination module 404 includes:

[0134] A second contrast determination unit, configured to obtain the CIE contrast between the to-be-tested screen image and the background image based on the RGB values of the pixel points of the to-be-tested screen image and the background image and a preset second contrast determination algorithm;

[0135] A contrast image determination unit, configured to obtain the contrast image of the to-be-tested screen image according to the CIE contrast.

[0136] Optionally, the second area determination module 405 includes:

[0137] A second area determination unit, configured to determine the pixel value of any pixel point in the contrast image, and find, from the contrast image, an area where the pixel value meets a preset threshold segmentation condition as the second area.

[0138] Optionally, the device further includes:

[0139] An image area judgment module, configured to, after determining the pixel value of any pixel point in the contrast image and finding, from the contrast image, an area where the pixel value meets a preset threshold segmentation condition as the second area, judge whether the image area of the second area is greater than or equal to a preset area threshold;

[0140] A defect area determination module, configured to, if the image area of the second area is greater than or equal to the preset area threshold, determine the second area as the color defect area of the to-be-tested screen, so as to complete the color detection of the screen.

[0141] The above screen color detection device can execute the screen color detection method provided in any embodiment of the present application, and has corresponding function modules and beneficial effects for executing each screen color detection method.

[0142] Embodiment 5

[0143] Figure 5 It is a schematic structural diagram of an electronic device provided in Embodiment 5 of the present application. Figure 5 It shows a block diagram of an exemplary electronic device 500 suitable for implementing the embodiments of the present application. Figure 5 The shown electronic device 500 is only an example, and should not bring any limitation to the functions and usage scope of the embodiments of the present application.

[0144] As Figure 5As shown, the electronic device 500 is presented in the form of a general-purpose computing device. The components of the electronic device 500 may include, but are not limited to: one or more processors or processing units 501, a system memory 502, and a bus 503 that connects different system components (including the system memory 502 and the processing unit 501).

[0145] The bus 503 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus structures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0146] The electronic device 500 typically includes a variety of computer system-readable media. These media can be any available media that can be accessed by the electronic device 500, including volatile and non-volatile media, removable and non-removable media.

[0147] The system memory 502 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 504 and / or cache memory 505. The electronic device 500 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 506 can be used for reading and writing on non-removable, non-volatile magnetic media ( Figure 5 not shown, commonly referred to as a "hard disk drive"). Although Figure 5 not shown in the figure, a disk drive for reading and writing on removable non-volatile disks (such as a "floppy disk") and an optical disk drive for reading and writing on removable non-volatile optical disks (such as CD-ROM, DVD-ROM, or other optical media) can be provided. In these cases, each drive can be connected to the bus 503 through one or more data media interfaces. The memory 502 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the embodiments of the present application.

[0148] A program / utility 508 having a set (at least one) of program modules 507 can be stored, for example, in the memory 502. Such program modules 507 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. The program modules 507 generally execute the functions and / or methods in the embodiments described in the present application.

[0149] The electronic device 500 can also communicate with one or more external devices 509 (such as a keyboard, a pointing device, a display 510, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 500, and / or communicate with any device that enables the electronic device 500 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 511. Moreover, the electronic device 500 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 512. As shown in the figure, the network adapter 512 communicates with other modules of the electronic device 500 through the bus 503. It should be understood that although Figure 5 not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0150] The processing unit 501 executes various functional applications and data processing by running the programs stored in the system memory 502, for example, implementing a method for detecting the screen color provided in the embodiments of the present application.

[0151] Embodiment Six

[0152] Embodiment Six of the present application also provides a storage medium containing computer-executable instructions, on which a computer program is stored. When the program is executed by a processor, it implements the screen color detection method provided in the embodiments of the present application, including: obtaining a to-be-tested screen image, dividing the to-be-tested screen image into regions according to a preset division rule to obtain at least one to-be-tested image sub-region; determining a first region of the to-be-tested screen image according to the RGB means of at least one to-be-tested image sub-region and based on a first contrast determination algorithm of the preset to-be-tested image sub-region; determining a background image of the to-be-tested screen image according to the first image information of the first region and the second image information of the to-be-tested screen image; obtaining a contrast image of the to-be-tested screen image according to the pixel point RGB values of the to-be-tested screen image and the background image and based on a preset second contrast determination algorithm; determining a second region from the contrast image according to a preset threshold segmentation algorithm as the color defect region of the to-be-tested screen to complete the color detection of the screen.

[0153] The computer storage medium of the embodiments of the present application may adopt any combination of one or more computer-readable media. The computer-readable media may be computer-readable signal media or computer-readable storage media. The computer-readable storage media may, for example, but not be limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples (a non-exhaustive list) of the computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage media may be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, device, or component.

[0154] The computer-readable signal media may include data signals propagated in a baseband or as part of a carrier wave, which carry computer-readable program codes. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal media may also be any computer-readable media other than the computer-readable storage media, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or component.

[0155] The program codes contained on the computer-readable media may be transmitted by any appropriate media, including but not limited to wireless, wire, optical fiber cable, RF, etc., or any suitable combination of the above.

[0156] The computer program codes for performing the operations of the present application may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program codes may be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0157] Note that the above is only the preferred embodiment of the present application and the applied technical principles. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments only. Without departing from the concept of the present application, more other equivalent embodiments can be included, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A method for detecting screen color, characterized in that, Including: Obtain a screen image to be measured, divide the screen image to be measured according to a preset division rule to obtain at least one sub-region of the image to be measured; Determine a target sub-region to be measured and candidate sub-regions to be measured from at least one sub-region of the image to be measured according to the arrangement order of the sub-regions of the image to be measured in the screen image to be measured; wherein, the candidate sub-regions to be measured are the sub-regions of the image to be measured other than the target sub-region to be measured; Based on the RGB mean value of the target sub-region to be measured and the RGB mean value of any one of the candidate sub-regions to be measured, determine the CIE contrast between the target sub-region to be measured and any one of the candidate sub-regions to be measured according to a preset first contrast determination algorithm for the sub-regions of the image to be measured; Judge whether the CIE contrast is less than a preset contrast threshold; If so, put the target sub-region to be measured and the candidate sub-regions to be measured into the set of regions to be merged corresponding to the target sub-region to be measured; Determine a third region after merging the target sub-region to be measured and the candidate sub-regions to be measured in the set of regions to be merged; Determine a first region of the screen image to be measured from the third region according to a preset first region screening condition; Determine the background image of the screen image to be measured according to the first image information of the first region and the second image information of the screen image to be measured; Based on the RGB values of the pixel points of the screen image to be measured and the background image, obtain a contrast image of the screen image to be measured according to a preset second contrast determination algorithm; Determine a second region from the contrast image as the color defect region of the screen to be measured according to a preset threshold segmentation algorithm, so as to complete the color detection of the screen.

2. The method according to claim 1, characterized in that, Determine a first region of the screen image to be measured from the third region according to a preset first region screening condition, including: Determine the area of the third region corresponding to the set of regions to be merged of any one of the target sub-regions to be measured; Compare the areas of the third regions corresponding to the sets of regions to be merged of any one of the target sub-regions to be measured, and determine whether there is a target third region area that meets the preset area comparison condition; Merge the target sub-region to be measured and the candidate sub-regions to be measured in the set of regions to be merged corresponding to the target third region area to obtain a target third region, and use the target third region as the first region of the screen image to be measured.

3. The method according to claim 1, characterized in that The first image information includes the RGB mean value of the first region, and the second image information includes the size of the screen image to be measured; Correspondingly, determine the background image of the screen image to be measured according to the first image information of the first region and the second image information of the screen image to be measured, including: Determine the size of the background image according to the size of the screen image to be measured; Determine the RGB value of the background image according to the RGB mean value of the first region.

4. The method according to claim 1, wherein Based on the RGB values of the pixel points of the screen image to be measured and the background image, obtain a contrast image of the screen image to be measured according to a preset second contrast determination algorithm, including: Based on the RGB values of the pixel points of the screen image to be measured and the background image, and based on a preset second contrast determination algorithm, obtain the CIE contrast between the screen image to be measured and the background image; Based on the CIE contrast, obtain the contrast image of the screen image to be measured.

5. The method according to claim 1, wherein According to a preset threshold segmentation algorithm, determine a second region from the contrast image, including: Determine the pixel value of any pixel point in the contrast image, and find the region in the contrast image whose pixel value satisfies the preset threshold segmentation condition as the second region.

6. The method according to claim 5, characterized in that, After determining the pixel value of any pixel point in the contrast image and finding the region in the contrast image whose pixel value satisfies the preset threshold segmentation condition as the second region, it further includes: Judge whether the image area of the second region is greater than or equal to a preset area threshold; If so, determine the second region as the color defect region of the screen to be measured to complete the color detection of the screen.

7. A screen color detection device, characterized in that, It includes: An image sub-region acquisition module, configured to acquire a screen image to be measured, and divide the screen image to be measured into regions according to a preset division rule to obtain at least one image sub-region to be measured; A first region determination module, configured to determine the first region of the screen image to be measured based on the RGB means of at least one image sub-region to be measured and based on a preset first contrast determination algorithm for the image sub-region to be measured; A background image determination module, configured to determine the background image of the screen image to be measured according to the first image information of the first region and the second image information of the screen image to be measured; A contrast image determination module, configured to obtain the contrast image of the screen image to be measured based on the RGB values of the pixel points of the screen image to be measured and the background image and based on a preset second contrast determination algorithm; A second region determination module, according to a preset threshold segmentation algorithm, determines a second region from the contrast image as the color defect region of the screen to be measured to complete the color detection of the screen; Among them, the first region determination module includes: An image sub-region to be measured determination unit, configured to determine a target image sub-region to be measured and a candidate image sub-region to be measured from at least one image sub-region to be measured according to the arrangement order of the image sub-regions to be measured in the screen image to be measured; wherein, the candidate image sub-region to be measured is the image sub-region to be measured other than the target image sub-region to be measured; A first contrast determination unit, configured to determine the CIE contrast between the target image sub-region to be measured and any candidate image sub-region to be measured based on the RGB means of the target image sub-region to be measured and the RGB means of any candidate image sub-region to be measured and based on a preset first contrast determination algorithm for the image sub-region to be measured; A first contrast judgment unit, configured to judge whether the CIE contrast is less than a preset contrast threshold; A region set determination unit, configured to, if the CIE contrast is less than the preset contrast threshold, put the target image sub-region to be measured and the candidate image sub-region into the mergeable region set corresponding to the target image sub-region to be measured; A third region determination unit, configured to determine a third region after merging the target sub-region to be measured and the candidate sub-region to be measured in the set of regions to be merged; A first region determination unit, configured to determine a first region of the screen image to be measured from the third region according to a preset first region screening condition.

8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the screen color detection method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the screen color detection method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Screen defect detection method, detection device, system and storage medium

    CN109119009A

  • Screen defect detection method and device and head-mounted display equipment

    CN111612781A