Image analysis method, device, computer equipment and computer readable storage medium
Patent Information
- Application Number
- CN202211482685.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-24
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2042-11-24
AI Technical Summary
现有通常采用算法对图像的色彩进行评估,此种方式虽然能够提高图像的色彩评估效率,但依赖参数设定,需要人工经验或者标注,且无法对图像的色彩相近程度进行量化
[0045] The beneficial effects of the present invention are as follows: the initial color difference value is determined based on the first clustering result and the second clustering result, and the target color difference value between the test image and the reference image is determined based on the initial color difference value and the first clustering result. This can quantify the color difference similarity between the test image and the reference image, and does not rely on parameter settings or human experience or annotation.
Smart Images

Figure CN118115417B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image analysis technology, specifically to an image analysis method, apparatus, computer device, and computer-readable storage medium. Background Technology
[0002] Picture quality (PQ) is a crucial factor in evaluating display devices. Pre-market picture quality testing helps manufacturers identify problems promptly. Display device picture quality evaluation typically assesses dimensions such as color, brightness, noise, and motion compensation. Color accuracy is the most important indicator of human visual perception; therefore, image color evaluation is of great significance for display device picture quality assessment. Current methods often use algorithms to evaluate image color. While this improves the efficiency of color evaluation, it relies on parameter settings, requires human experience or annotation, and cannot quantify the similarity of colors within an image.
[0003] Therefore, existing technologies still need improvement and development. Summary of the Invention
[0004] This application provides an image analysis method, apparatus, computer device, and computer-readable storage medium that can quantify the color similarity between a test image and a reference image, and the color quantification does not rely on parameter settings or human experience or annotation.
[0005] The technical solution adopted by this invention to solve the problem is as follows:
[0006] On the one hand, this application provides an image analysis method, including:
[0007] The first clustering result is determined based on the test image, and the second clustering result is determined based on the reference image;
[0008] Based on the first and second clustering results, the initial color difference value between the test image and the reference image is determined;
[0009] Based on the initial color difference value and the first clustering result, the target color difference value between the test image and the reference image is determined.
[0010] In some embodiments of this application, determining a first clustering result based on a test image and determining a second clustering result based on a reference image includes:
[0011] The test image is color space converted to obtain the first target image, and the reference image is color space converted to obtain the second target image;
[0012] Color clustering is performed on the first target image to obtain the first clustering result, and color clustering is performed on the second target image to obtain the second clustering result.
[0013] In some embodiments of this application, an initial color difference value between the test image and the reference image is determined based on the first clustering result and the second clustering result, including:
[0014] Based on the first clustering result, determine the first target color channel parameter corresponding to each first clustering result in the first clustering result, and based on the second clustering result, determine the second target color channel parameter corresponding to each second clustering result in the second clustering result;
[0015] Based on the parameters of the first target color channel and the second target color channel, the initial color difference value between the test image and the reference image is determined.
[0016] In some embodiments of this application, the first target color channel parameter corresponding to each first clustering result in the first clustering result is determined based on the first clustering result, including:
[0017] Based on the color channel parameters of all pixels in each first cluster result in each color channel, calculate the average color channel parameters of each first cluster result in each color channel.
[0018] The average color channel parameters of each first cluster result in each color channel are determined as the first target color channel parameters corresponding to each first cluster result.
[0019] In some embodiments of this application, the second target color channel parameters corresponding to each second clustering result are determined based on the second clustering results, including:
[0020] Based on the color channel parameters of all pixels in each second cluster result in each color channel, calculate the average color channel parameters of each second cluster result in each color channel.
[0021] The average color channel parameters of each second clustering result under each color channel are determined as the second target color channel parameters corresponding to each second clustering result.
[0022] In some embodiments of this application, an initial color difference value between a test image and a reference image is determined based on first target color channel parameters and second target color channel parameters, including:
[0023] Based on the first target color channel parameters and the second target color channel parameters, several color channel parameter groups are determined;
[0024] Based on several color channel parameter groups, the initial color difference value between the test image and the reference image is determined.
[0025] In some embodiments of this application, based on the first target color channel parameters and the second target color channel parameters, several color channel parameter groups are determined, including:
[0026] Based on the parameters of the first target color channel and the parameters of the second target color channel, several candidate color difference values are determined.
[0027] Based on several candidate color difference values, several color channel parameter groups are determined.
[0028] In some embodiments of this application, the target color difference value between the test image and the reference image is determined based on the initial color difference value and the first clustering result, including:
[0029] Based on the first clustering result, determine the color difference weight corresponding to each initial color difference value in the initial color difference values;
[0030] Based on the initial color difference value and color difference weight, the target color difference value between the test image and the reference image is determined.
[0031] In some embodiments of this application, based on the first clustering result, the color difference weight corresponding to each initial color difference value in the initial color difference values is determined, including:
[0032] Based on the number of pixels contained in each first cluster result, determine the proportion of pixels contained in each first cluster result;
[0033] Based on the quantity ratio, determine the color difference weight corresponding to each initial color difference value in the initial color difference values.
[0034] In some embodiments of this application, the image analysis method further includes:
[0035] The display device's image quality is evaluated based on the target color difference value.
[0036] Secondly, embodiments of the present invention also provide an image analysis device, comprising:
[0037] The first determining unit is used to determine the first clustering result based on the test image and the second clustering result based on the reference image;
[0038] The second determining unit is used to determine the initial color difference value between the test image and the reference image based on the first clustering result and the second clustering result;
[0039] The image analysis unit is used to determine the target color difference value between the test image and the reference image based on the initial color difference value and the first clustering result.
[0040] Thirdly, this application also provides a computer device, which includes:
[0041] One or more processors;
[0042] Memory; and
[0043] One or more applications, wherein the applications are stored in memory and configured to be executed by a processor to implement the image analysis method of any one of the first aspects.
[0044] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps of the image analysis method of any one of the first aspects.
[0045] The beneficial effects of the present invention are as follows: the initial color difference value is determined based on the first clustering result and the second clustering result, and the target color difference value between the test image and the reference image is determined based on the initial color difference value and the first clustering result. This can quantify the color difference similarity between the test image and the reference image, and does not rely on parameter settings or human experience or annotation. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a flowchart illustrating the image analysis method provided in an embodiment of the present invention;
[0048] Figure 2 This is a flowchart of a specific embodiment of the image analysis method provided by the present invention;
[0049] Figure 3 This is an example diagram of a reference image provided in an embodiment of the present invention;
[0050] Figure 4 Yes Figure 3 The image obtained by increasing the hue of the reference image by 10;
[0051] Figure 5 Yes Figure 3 The image obtained by increasing the hue of the reference image shown by 20;
[0052] Figure 6 Yes Figure 3 The image obtained by increasing the hue of the reference image shown by 40;
[0053] Figure 7 Yes Figure 3The image obtained by increasing the hue of the reference image by 50;
[0054] Figure 8 Yes Figure 3 The image obtained by increasing the hue of the reference image shown by 60;
[0055] Figure 9 Yes Figure 3 The image obtained by increasing the hue of the reference image shown by 70;
[0056] Figure 10 Yes Figure 3 The image obtained by increasing the hue of the reference image shown by 80;
[0057] Figure 11 Yes Figure 3 The image obtained by increasing the hue of the reference image shown by 90;
[0058] Figure 12 Yes Figure 3 The image obtained by increasing the hue of the reference image by 100 is shown.
[0059] Figure 13 This is a schematic block diagram of the image analysis device provided in an embodiment of the present invention;
[0060] Figure 14 This is a schematic diagram of an embodiment of the computer device provided in this invention. Detailed Implementation
[0061] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0062] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, the terms "first," "second," "third," and "fourth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first," "second," "third," and "fourth" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, and "several" means one or more, unless otherwise explicitly specified.
[0063] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0064] It should be noted that since the method in this application embodiment is executed in a computer device, the processing objects of each computer device exist in the form of data or information, such as time, which is essentially time information. It is understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data that exist so that the computer device can process them. Specific details will not be elaborated here.
[0065] Image quality evaluation of display devices is generally divided into two types: objective scene image quality evaluation under standard laboratory conditions and subjective scene image quality evaluation. Subjective scene image quality evaluation is closer to the user's home viewing environment. Subjective scene image quality evaluation typically assesses dimensions such as color, brightness, noise, and dynamic compensation. Since color accuracy is the most important indicator of human visual perception, image color evaluation is crucial for image quality evaluation. Existing image color evaluation methods include manual evaluation and algorithmic evaluation. Manual evaluation lacks unified standards, leading to different evaluation conclusions from different personnel, and is also time-consuming. While algorithmic evaluation can improve the efficiency of image color evaluation, it relies on parameter settings, requires human experience or standards, and cannot quantify the similarity of colors in an image.
[0066] Based on this, in this embodiment, a first clustering result is determined based on the test image, and a second clustering result is determined based on the reference image; based on the first and second clustering results, an initial color difference value between the test image and the reference image is determined; based on the initial color difference value and the first clustering result, a target color difference value between the test image and the reference image is determined. This application determines the initial color difference value based on the first and second clustering results, and determines the target color difference value between the test image and the reference image based on the initial color difference value and the first clustering result. This can quantify the color similarity between the test image and the reference image, and does not rely on parameter settings, manual experience, or annotation.
[0067] The content of this application will be further explained below with reference to the accompanying drawings and the description of the embodiments.
[0068] This embodiment provides an image analysis method, such as Figure 1 As shown, the method includes:
[0069] Step S10: Determine the first clustering result based on the test image, and determine the second clustering result based on the reference image.
[0070] Specifically, the test image can be an image captured by the imaging module of the electronic device itself on the display image of the display device a under test, or an image captured by the imaging module of another electronic device on the display image of display device a via network, Bluetooth, infrared, or other means. Similarly, the reference image can be an image captured by the imaging module of the electronic device itself on the display image of display device b, or an image captured by the imaging module of another electronic device on the display image of display device b via network, Bluetooth, infrared, or other means. In one specific implementation of this embodiment, the test image is an image captured by the imaging module of the electronic device itself on the display image of display device a, and the reference image is an image captured by the imaging module of the electronic device itself on the display image of display device b. To improve the accuracy of color evaluation, the imaging module needs to maintain a consistent shooting environment when capturing the display image of display device a and the display image of display device b, including lighting, shooting distance, and shooting height. For example, to evaluate the color of TV a, TV a can be used as the test TV and TV b as the reference TV. The same image can be played on both TV a and TV b at the same time. The test image can be obtained by taking a picture of the image displayed on TV a with an SLR camera, and the reference image can be obtained by taking a picture of the image displayed on TV b with an SLR camera.
[0071] The first clustering result is obtained by color clustering of pixels in the test image. Multiple first clustering results are generated, each containing several pixels with similar color channel parameters. Similarly, the second clustering result is obtained by color clustering of pixels in the reference image. Multiple second clustering results are also generated, each containing several pixels with similar color channel parameters. In this embodiment, after obtaining the test image and the reference image, the first and second clustering results are determined based on the test image and the reference image, respectively, so that the color difference between the test image and the reference image can be determined in subsequent steps based on the first and second clustering results.
[0072] In one specific embodiment, step S10 includes:
[0073] Step S11: Perform color space conversion on the test image to obtain the first target image, and perform color space conversion on the reference image to obtain the second target image;
[0074] Step S12: Perform color clustering on the first target image to obtain the first clustering result, and perform color clustering on the second target image to obtain the second clustering result.
[0075] Color space conversion refers to converting an image from the RGB color space to the LAB color space. The first target image is the test image obtained by converting the RGB color space to the LAB color space, and the second target image is the reference image obtained by converting the RGB color space to the LAB color space. The RGB color space is based on three primary colors: red (R), green (G), and blue (B), which are superimposed to varying degrees to produce a rich and wide range of colors. The LAB color space represents color using three parameters: L (lightness), a (color a), and b (color b). A (color a) represents the range from yellow to blue, and b (color b) also represents the range from yellow to blue. The LAB color space is a uniform color space, capable of accurately determining differences that conform to human visual perception. Images captured by current cameras are generally in the RGB color space. Due to the non-uniformity of the RGB color space, it is generally necessary to convert the color space of the images captured by the camera from the RGB color space to the LAB color space.
[0076] In this embodiment, when determining the first clustering result and the second clustering result based on the acquired test image and reference image, the color space of the test image and the reference image are first converted. The test image is converted from RGB color space to LAB color space to obtain the first target image, and the reference image is converted from RGB color space to LAB color space to obtain the second target image. Then, color clustering is performed on the first target image and the second target image to obtain the first clustering result and the second clustering result.
[0077] For example, such as Figure 2 As shown, after obtaining images a and b, the existing Python OpenCV toolkit can be used to convert images a and b from RGB color space to LAB color space respectively. Then, the kmeans clustering algorithm is used to perform LAB clustering on images a and b after color space conversion, to obtain the first clustering result and the second clustering result.
[0078] In one specific implementation of this embodiment, the number of the first clustering result and the second clustering result can be set as needed, and the number of the first clustering result and the second clustering result are the same. The first clustering result can be represented as A = <setA i The second clustering result can be represented as B = <setB i >, where i = 1, 2, ..., n, where n is the number of the first clustering result and the second clustering result. For example, if the pixels of the first target image and the pixels of the second target image are both clustered into 8 categories, then n is 8.
[0079] S20. Based on the first clustering result and the second clustering result, determine the initial color difference value between the test image and the reference image.
[0080] The initial color difference value is determined based on the first and second clustering results. The initial color difference value corresponds to the first clustering result. For example, if the first pixel set is A = <setA i The initial color difference value is ΔE. i Where i = 1, 2, ..., n, and n is the number of the first clustering results. In this embodiment, after determining the first clustering result and the second clustering result, an initial color difference value between the test image and the reference image is determined based on the first clustering result and the second clustering result, so that the color difference between the test image and the reference image can be determined based on the initial color difference value in subsequent steps.
[0081] In one specific embodiment, step S20 includes:
[0082] S21. Based on the first clustering result, determine the first target color channel parameter corresponding to each first clustering result in the first clustering result, and based on the second clustering result, determine the second target color channel parameter corresponding to each second clustering result in the second clustering result;
[0083] S22. Based on the first target color channel parameters and the second target color channel parameters, determine the initial color difference value between the test image and the reference image.
[0084] Each first clustering result contains several pixels, and each pixel has a corresponding color channel parameter. The first target color channel parameter is the average color channel parameter of all pixels in each first clustering result across all color channels. Each second clustering result contains several pixels, and each pixel has a corresponding color channel parameter. The second target color channel parameter is the average color channel parameter of all pixels in each second clustering result across all color channels. In this embodiment, when determining the initial color difference value based on the first and second clustering results, the first target color channel parameter corresponding to each first clustering result is first determined based on the first clustering result, and the second color channel parameter corresponding to each second clustering result is determined based on the second clustering result. Then, based on the first and second target color channel parameters, the initial color difference value between the test image and the reference image is determined. For example, if the first clustering result is A = ... <setA i The second clustering result is B = <setB i > where i = 1, 2, ..., n, n is the number of the first clustering result and the number of the second clustering result, then based on the first clustering result setA i The parameters of the first target color channel can be determined. Based on the second clustering result setB i The parameters of the second target color channel can be determined.
[0085] In one specific implementation, step S21, which determines the first target color channel parameters corresponding to each first clustering result based on the first clustering result, includes:
[0086] S211. Based on the color channel parameters of all pixels contained in each first clustering result in each color channel, calculate the average color channel parameters of each first clustering result in each color channel.
[0087] S212. The average color channel parameters of each first clustering result under each color channel are determined as the first target color channel parameters corresponding to each first clustering result.
[0088] Color channels are channels that store color information in an image. Each image has one or more color channels. The number of color channels is determined by the image's color space. For example, when an image uses the RGB color space, it has three color channels: Red (R), Green (G), and Blue (B). When an image uses the LAB color space, it has three color channels: L (luminance), a (color), and b (color). Color channel parameters are the parameter values for each color channel. For example, when the image uses the RGB color space, the color channel parameters are the parameter values for the R, G, and B color channels; when the image uses the LAB color space, the color channel parameters are the parameter values for the L, a, and b color channels. The average color channel parameter for each first cluster result is the average of the color channel parameters for all pixels in each first cluster result across all color channels. For example, if the first clustering result includes three pixels, and the channel parameters of these three pixels are (L1, B1, A1), (L2, B2, A2), and (L3, B3, A3), then the average color channel parameters of this first clustering result in each color channel are:
[0089] In this embodiment, when determining the first target color channel parameters corresponding to each first clustering result based on the first clustering results, the average color channel parameters of each first clustering result in each color channel are first calculated based on the color channel parameters of all pixels included in each first clustering result in each color channel. Then, the average color channel parameters of each first clustering result in each color channel are determined as the first target color channel parameters corresponding to each first clustering result. For example, the average color channel parameters of the first clustering result in each color channel are... When the first clustering result corresponds to the first target color channel parameter, then the parameter is...
[0090] In one specific implementation, step S21, which determines the second target color channel parameters corresponding to each second clustering result based on the second clustering result, includes:
[0091] Step S213: Based on the color channel parameters of all pixels contained in each second clustering result in each color channel, calculate the average color channel parameters of each second clustering result in each color channel.
[0092] Step S214: Determine the average color channel parameters of each second clustering result in each color channel as the second target color channel parameters corresponding to each second clustering result.
[0093] The average color channel parameter of each second cluster result across all color channels is the average of the color channel parameters of all pixels in each color channel of the second cluster result. For example, if the second cluster result includes three pixels, and the channel parameters of these three pixels are (L4, B4, A4), (L5, B5, A5), and (L6, B6, A6), then the average color channel parameter of the first cluster result across all color channels is:
[0094] Similar to the method for determining the first target color channel parameters, this embodiment determines the second target color channel parameters corresponding to each second clustering result based on the second clustering results. First, based on the color channel parameters of all pixels included in each second clustering result under each color channel, the average color channel parameter of each second clustering result under each color channel is calculated. Then, the average color channel parameter of each second clustering result under each color channel is determined as the second target color channel parameter corresponding to each second clustering result. For example, the average color channel parameter of the second clustering result under each color channel is... When the second clustering result corresponds to the second target color channel parameter, then the second target color channel parameter is:
[0095] In one specific embodiment, step S22 includes:
[0096] S221. Based on the first target color channel parameters and the second target color channel parameters, determine several color channel parameter groups;
[0097] S222. Based on several color channel parameter groups, determine several initial color difference values between the test image and the reference image.
[0098] A color channel parameter group is a combination of parameters determined based on a first target color channel parameter and a second target color channel parameter. Each color channel parameter group includes one first target color channel parameter and one second target color channel parameter, and the color difference between the first target color channel parameter and the second target color channel parameter in each color channel parameter group is less than the color difference between the first target color channel parameter and other second target color channel parameters among a plurality of second target color channel parameters. For example, the first target color channel parameter is... The parameters for the second target color channel are: Where i = 1, 2, ..., n, n is the number of first clustering results and second clustering results, when the color channel parameter group is hour, and The color difference value is less than and Color difference values, etc.
[0099] In this embodiment, when determining the initial color difference value based on the first target color channel parameters and the second target color channel parameters, several color channel parameter groups are first determined based on the first target color channel parameters and the second target color channel parameters. Then, the color difference value between the first target color channel parameters and the second target color channel parameters contained in each of the several color channel parameter groups is calculated, and the color difference value between the first target color channel parameters and the second target color channel parameters contained in each color channel parameter group is determined as the initial color difference value between the test image and the reference image. For example, as... Figure 2 As shown, after obtaining the first clustering result corresponding to image a and the second clustering result corresponding to image b through LAB clustering, the first target color channel parameter corresponding to each first clustering result and the second target color channel parameter corresponding to each second clustering result are determined. Then, the initial color difference value is determined based on the first target color channel parameter and the second target color channel parameter.
[0100] For example, based on the parameters of the first target color channel Second target color channel parameters Where i = 1, 2, ..., 8, several color channel parameter groups are determined as follows:
[0101] Then, based on the CIEDE2000 color difference calculation formula, the color difference values between the first target color channel parameters and the second target color channel parameters contained in Group1, Group2...Group8 are calculated respectively to obtain the color difference values ΔE1, ΔE2...ΔE8. Finally, ΔE1, ΔE2...ΔE8 are determined as the initial color difference values between the test image and the reference image.
[0102] In one specific embodiment, step S221 includes:
[0103] S2211. Based on the parameters of the first target color channel and the parameters of the second target color channel, determine several candidate color difference values;
[0104] S2212. Based on several candidate color difference values, determine several color channel parameter groups.
[0105] Several candidate color difference values are the color difference between the first target color channel parameter corresponding to each first clustering result and the second target color channel parameter corresponding to each second clustering result. For example, the first target color channel parameter is... The parameters for the second target color channel are: Where i = 1, 2...8, and several candidate color difference values are... and The color difference value, and Color difference value... and The color difference value, that is, when the number of parameters of the first target color channel is m and the number of parameters of the second target color channel is n, can determine m*n candidate color difference values.
[0106] In this embodiment, when determining several color channel parameter groups, firstly, based on the first target color channel parameter and the second target color channel parameter, several candidate color difference values are determined. Then, based on the several candidate color difference values, the second target color channel parameter corresponding to each first target color channel parameter is selected from several second target color channel parameters. Finally, each first target color channel parameter and its corresponding second target color channel parameter are combined to form a color channel parameter group. For example, based on the CIEDE2000 color difference calculation formula, setA1 and... The color difference value, when and The color difference value is less than and When the color difference value is equal, and Form a color channel parameter group.
[0107] Step S30: Based on the initial color difference value and the first clustering result, determine the target color difference value between the test image and the reference image.
[0108] The target color difference value is used to measure the color difference between the test image and the reference image. Generally, the smaller the target color difference value, the smaller the color difference between the test image and the reference image. In this embodiment, after determining the initial color difference value between the test image and the reference image, the target color difference value between the test image and the reference image is further determined based on the initial color difference value and the first clustering result. For example, the test image is obtained by taking a picture of the image displayed on TV a using a DSLR camera, and the reference image is obtained by taking a picture of the image displayed on TV b using a DSLR camera. Based on the target color difference value, the image quality difference between TV a and TV b can be detected, thereby providing a reference for the development and optimization of the image quality engine for TV a.
[0109] In one specific embodiment, step S30 includes:
[0110] Step S31: Based on the first clustering result, determine the color difference weight corresponding to each initial color difference value in the initial color difference values;
[0111] Step S32: Based on the initial color difference value and color difference weight, determine the target color difference value between the test image and the reference image.
[0112] The color difference weight is the weight corresponding to each initial color difference value in the initial color difference values, used to characterize the contribution of each initial color difference value to the overall color difference between the test image and the reference image. In this embodiment, when determining the target color difference value based on the initial color difference values and the first clustering result, the color difference weight corresponding to each initial color difference value is first determined based on the first clustering result. Then, based on the initial color difference values and the color difference weights corresponding to each initial color difference value, the target color difference value between the test image and the reference image is determined. The formula for calculating the target color difference value is: Where ΔE is the target color difference value, and n is the number of initial color difference values, ΔE i Let pa be the i-th initial color difference value. i Let be the color difference weight corresponding to the i-th initial color difference value.
[0113] In one specific embodiment, step S31 includes:
[0114] S311. Based on the number of pixels contained in each first clustering result, determine the proportion of pixels contained in each first clustering result;
[0115] S312. Based on the quantity ratio, determine the color difference weight corresponding to each initial color difference value in the initial color difference values.
[0116] The proportion of pixels contained in each first cluster result is the ratio of the number of pixels contained in each first cluster result to the total number of pixels in the first cluster result. Each initial color difference value corresponds one-to-one with a first cluster result, and the color difference weight corresponding to each initial color difference value is the proportion of pixels contained in the first cluster result corresponding to that initial color difference value. In this embodiment, when determining the color difference weight corresponding to each initial color difference value based on the first cluster results, the proportion of pixels contained in each first cluster result is first determined based on the number of pixels contained in each first cluster result. Then, the proportion of pixels contained in each first cluster result is used to determine the color difference weight corresponding to each initial color difference value for each first cluster result, thereby determining the color difference weight corresponding to each initial color difference value. For example, the first cluster result setA... i The number of pixels contained is S i The number of pixels contained in the first clustering result is S. 总 The first clustering result is setA i The corresponding initial color difference value is ΔE i Then the first clustering result setA i The proportion of pixels contained Initial color difference value ΔE i The corresponding color difference weight is Pa. i .
[0117] In one specific embodiment, the image analysis method further includes:
[0118] S40. Evaluate the image quality of the display device based on the target color difference value.
[0119] When testing the color accuracy of a display device, you can choose another display device of the same type as the one being tested as a reference device. For example, the display device being tested is TV a, and the reference device is TV b.
[0120] The imaging module captures images of the display device under test and the reference device separately to obtain test and reference images. To improve the accuracy of color evaluation, the imaging module needs to maintain a consistent shooting environment when capturing images of the display device under test and the reference device separately. The shooting environment includes factors such as lighting, shooting distance, and shooting height. For example, if the display device under test is TV a and the reference device is TV b, the same image is played simultaneously on both TV a and TV b. Then, the image displayed on TV a is captured using a DSLR camera to obtain the test image, and the image displayed on TV b is captured using a DSLR camera to obtain the reference image.
[0121] After acquiring the test image and the reference image, the target color difference value between the test image and the reference image can be determined according to the above steps S10 to S30. Then, the image quality of the display device to be tested is evaluated based on the target color difference value to determine the image quality difference between the display device to be tested and the reference device, thereby providing a reference for the development and optimization of the display device image quality engine.
[0122] For example, a color difference threshold can be preset to measure the color difference between the display device under test and the reference device. After determining the target color difference value, the target color difference value can be compared with the color difference threshold. When the target color difference value is less than the color difference threshold, it means that the color difference between the display device under test and the reference device is small, and the display parameters (such as color saturation, brightness, contrast, etc.) of the display device under test do not need to be adjusted. Conversely, when the target color difference value is not less than the color difference threshold, it means that the color difference between the display device under test and the reference device is large, and the display parameters of the display device under test need to be adjusted according to the target color difference value.
[0123] To verify the color difference evaluation effect of the image analysis method provided in this embodiment of the invention, the inventors used Photoshop to... Figure 3 The hue of the reference image shown is changed to obtain the following: Figures 4 to 12 The image shown, in which, Figure 4 The image shown is a pair Figure 3 The image obtained by increasing the hue of the reference image by 10 is shown. Figure 5 The image shown is a pair Figure 3 The image obtained by increasing the hue of the reference image shown by 20 is Figure 6 The image shown is a pair Figure 3 The image obtained by increasing the hue of the reference image by 40 is shown. Figure 7 The image shown is a pair Figure 3 The image obtained by increasing the hue of the reference image shown by 50 is Figure 8 The image shown is a pair Figure 3 The image obtained by increasing the hue of the reference image shown by 60 is Figure 9 The image shown is a pair Figure 3 The image obtained by increasing the hue of the reference image by 70 is shown. Figure 10 The image shown is a pair Figure 3 The image obtained by increasing the hue of the reference image shown by 80 is Figure 11 The image shown is a pair Figure 3 The image obtained by increasing the hue of the reference image by 90 is shown. Figure 12 The image shown is a pair Figure 3 The image shown is obtained by increasing the hue of the reference image by 100. Then, the image analysis method provided in this embodiment of the invention is used to calculate... Figure 3 and Figures 3 to 12 The target color difference values were calculated, and the color difference results are shown in Table 1. As can be seen from Table 1, as the image hue increases, the target color difference value calculated using the image analysis method provided in this embodiment of the invention gradually increases, which is in line with expectations.
[0124] Table 1 Figure 3 and Figures 3 to 12 Target color difference value between
[0125]
[0126] To better implement the image analysis method in the embodiments of this application, an image analysis device is also provided in the embodiments of this application, such as... Figure 13 As shown, the image analysis device includes:
[0127] The first determining unit 410 is used to determine a first clustering result based on the test image and a second clustering result based on the reference image;
[0128] The second determining unit 420 is used to determine the initial color difference value between the test image and the reference image based on the first clustering result and the second clustering result;
[0129] Image analysis unit 430 is used to determine the target color difference value between the test image and the reference image based on the initial color difference value and the first clustering result.
[0130] In this embodiment, an initial color difference value is determined based on the first clustering result and the second clustering result, and a target color difference value between the test image and the reference image is determined based on the initial color difference value and the first clustering result. This can quantify the color similarity between the test image and the reference image without relying on parameter settings or human experience or annotation.
[0131] In some embodiments of this application, the first determining unit 410 is specifically used for:
[0132] The test image is color space converted to obtain the first target image, and the reference image is color space converted to obtain the second target image;
[0133] Color clustering is performed on the first target image to obtain the first clustering result, and color clustering is performed on the second target image to obtain the second clustering result.
[0134] In some embodiments of this application, the second determining unit 420 is specifically used for:
[0135] Based on the first clustering result, determine the first target color channel parameter corresponding to each first clustering result in the first clustering result, and based on the second clustering result, determine the second target color channel parameter corresponding to each second clustering result in the second clustering result;
[0136] Based on the parameters of the first target color channel and the second target color channel, the initial color difference value between the test image and the reference image is determined.
[0137] In some embodiments of this application, the second determining unit 420 is further configured to:
[0138] Based on the color channel parameters of all pixels in each first cluster result in each color channel, calculate the average color channel parameters of each first cluster result in each color channel.
[0139] The average color channel parameters of each first cluster result in each color channel are determined as the first target color channel parameters corresponding to each first cluster result.
[0140] In some embodiments of this application, the second determining unit 420 is further configured to:
[0141] Based on the color channel parameters of all pixels in each second cluster result in each color channel, calculate the average color channel parameters of each second cluster result in each color channel.
[0142] The average color channel parameters of each second clustering result under each color channel are determined as the second target color channel parameters corresponding to each second clustering result.
[0143] In some embodiments of this application, the second determining unit 420 is further configured to:
[0144] Based on the first target color channel parameters and the second target color channel parameters, several color channel parameter groups are determined;
[0145] Based on several color channel parameter groups, the initial color difference value between the test image and the reference image is determined.
[0146] In some embodiments of this application, the second determining unit 420 is further configured to:
[0147] Based on the parameters of the first target color channel and the parameters of the second target color channel, several candidate color difference values are determined.
[0148] Based on several candidate color difference values, several color channel parameter groups are determined.
[0149] In some embodiments of this application, the image analysis unit 430 is specifically used for:
[0150] Based on the first clustering result, determine the color difference weight corresponding to each initial color difference value in the initial color difference values;
[0151] Based on the initial color difference value and color difference weight, the target color difference value between the test image and the reference image is determined.
[0152] In some embodiments of this application, the image analysis unit 430 is further configured to:
[0153] Based on the number of pixels contained in each first cluster result, determine the proportion of pixels contained in each first cluster result;
[0154] Based on the quantity ratio, determine the color difference weight corresponding to each initial color difference value in the initial color difference values.
[0155] In some embodiments of this application, the image analysis apparatus further includes:
[0156] The image quality evaluation unit is used to evaluate the image quality of the display device based on the target color difference value.
[0157] This application also provides a computer device that integrates any of the image analysis devices provided in this application. The computer device includes:
[0158] One or more processors;
[0159] Memory; and
[0160] One or more applications, wherein the applications are stored in memory and configured to be executed by a processor from the steps of the image analysis method in any of the above-described image analysis method embodiments.
[0161] This application also provides a computer device that integrates any of the image analysis devices provided in this application. For example... Figure 14 As shown, it illustrates a schematic diagram of the computer device involved in the embodiments of this application, specifically:
[0162] The computer device may include components such as a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a power supply 503, and an input unit 504. Those skilled in the art will understand that... Figure 14 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0163] The processor 501 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 502, and by calling data stored in the memory 502, it performs various functions of the computer device and processes data, thereby providing overall monitoring of the computer device. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 501.
[0164] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
[0165] The computer equipment also includes a power supply 503 that supplies power to the various components. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 503 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0166] The computer device may also include an input unit 504, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0167] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 501 in the computer device loads the executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 runs the application programs stored in the memory 502 to realize various functions, as follows:
[0168] The first clustering result is determined based on the test image, and the second clustering result is determined based on the reference image;
[0169] Based on the first and second clustering results, the initial color difference value between the test image and the reference image is determined;
[0170] Based on the initial color difference value and the first clustering result, the target color difference value between the test image and the reference image is determined.
[0171] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0172] Therefore, embodiments of this application provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc. A computer program is stored thereon, which is loaded by a processor to execute the steps in any of the image analysis methods provided in embodiments of this application. For example, the computer program, when loaded by a processor, can execute the following steps:
[0173] The first clustering result is determined based on the test image, and the second clustering result is determined based on the reference image;
[0174] Based on the first and second clustering results, the initial color difference value between the test image and the reference image is determined;
[0175] Based on the initial color difference value and the first clustering result, the target color difference value between the test image and the reference image is determined.
[0176] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0177] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0178] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0179] The foregoing has provided a detailed description of an image analysis method, apparatus, computer device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An image analysis method, characterized in that, include: The first clustering result is determined based on the test image, and the second clustering result is determined based on the reference image; Based on the first clustering result and the second clustering result, an initial color difference value between the test image and the reference image is determined; Based on the initial color difference value and the first clustering result, the target color difference value between the test image and the reference image is determined; The step of determining the initial color difference value between the test image and the reference image based on the first clustering result and the second clustering result includes: Based on the first clustering result, determine the first target color channel parameter corresponding to each first clustering result in the first clustering result, and based on the second clustering result, determine the second target color channel parameter corresponding to each second clustering result in the second clustering result; Based on the first target color channel parameters and the second target color channel parameters, several candidate color difference values are determined; Based on the aforementioned candidate color difference values, several color channel parameter groups are determined; Based on the aforementioned color channel parameter groups, the initial color difference value between the test image and the reference image is determined.
2. The method according to claim 1, characterized in that, The step of determining the first clustering result based on the test image and the second clustering result based on the reference image includes: The test image is converted to a color space to obtain the first target image, and the reference image is converted to a color space to obtain the second target image; Color clustering is performed on the first target image to obtain a first clustering result, and color clustering is performed on the second target image to obtain a second clustering result.
3. The method according to claim 1, characterized in that, The step of determining the first target color channel parameters corresponding to each first clustering result in the first clustering results includes: Based on the color channel parameters of all pixels in each first clustering result in each color channel, the average color channel parameters of each first clustering result in each color channel are calculated respectively. The average color channel parameter of each first clustering result in each color channel is determined as the first target color channel parameter corresponding to each first clustering result.
4. The method according to claim 1, characterized in that, The step of determining the second target color channel parameters corresponding to each second clustering result in the second clustering result includes: Based on the color channel parameters of all pixels in each second clustering result in each color channel, the average color channel parameters of each second clustering result in each color channel are calculated respectively. The average color channel parameters of each second clustering result in each color channel are determined as the second target color channel parameters corresponding to each second clustering result.
5. The method according to claim 1, characterized in that, Determining the target color difference value between the test image and the reference image based on the initial color difference value and the first clustering result includes: Based on the first clustering result, determine the color difference weight corresponding to each initial color difference value in the initial color difference values; Based on the initial color difference value and the color difference weight, the target color difference value between the test image and the reference image is determined.
6. The method according to claim 5, characterized in that, The step of determining the color difference weight corresponding to each initial color difference value in the initial color difference values based on the first clustering result includes: Based on the number of pixels contained in each first clustering result in the first clustering result, determine the proportion of the number of pixels contained in each first clustering result; Based on the stated quantity ratio, the color difference weight corresponding to each initial color difference value in the initial color difference values is determined.
7. The method according to claim 1, characterized in that, Also includes: The display device is evaluated for picture quality based on the target color difference value.
8. An image analysis device, characterized in that, include: The first determining unit is used to determine the first clustering result based on the test image and the second clustering result based on the reference image; The second determining unit is configured to determine an initial color difference value between the test image and the reference image based on the first clustering result and the second clustering result; An image analysis unit is configured to determine a target color difference value between the test image and the reference image based on the initial color difference value and the first clustering result; The second determining unit is specifically used for: Based on the first clustering result, determine the first target color channel parameter corresponding to each first clustering result in the first clustering result, and based on the second clustering result, determine the second target color channel parameter corresponding to each second clustering result in the second clustering result; Based on the first target color channel parameters and the second target color channel parameters, several candidate color difference values are determined; Based on the aforementioned candidate color difference values, several color channel parameter groups are determined; Based on the aforementioned color channel parameter groups, the initial color difference value between the test image and the reference image is determined.
9. A computer device, characterized in that, The computer device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the image analysis method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to perform the steps of the image analysis method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Face recognition method based on structuralized factor analysis
CN104239859A
Dynamic crosstalk test system and dynamic crosstalk test method
CN110708540A