Method for testing dazzle light degree of camera and electronic equipment

By adjusting the exposure parameters and gamma processing of the electronic device's camera, combined with histogram analysis, the problems of accuracy and efficiency in glare testing were solved, achieving rapid and accurate glare assessment.

CN121967902APending Publication Date: 2026-05-01HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-10-30
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Different electronic devices produce varying degrees of glare in backlit scenes, making it difficult to accurately test with current technology. Furthermore, the degree of glare is affected by exposure and white balance parameters, resulting in inaccurate and complex testing, and making it impossible to quickly test multiple devices.

Method used

By acquiring RAW images from electronic device cameras, adjusting exposure parameters to match those of standard equipment, and performing gamma processing, the degree of flare is analyzed using histograms to eliminate the influence of exposure and white balance, thus simplifying the calculation of the flare index.

Benefits of technology

It enables rapid and accurate glare testing, eliminates the influence of exposure and white balance parameters, and improves testing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967902A_ABST
    Figure CN121967902A_ABST
Patent Text Reader

Abstract

The invention provides a method for testing the dazzle light degree of a camera and electronic equipment, relates to the technical field of electronic equipment, and can accurately test the dazzle light degree of the camera of the electronic equipment. The method comprises the following steps: acquiring a first image shot by a camera of the electronic equipment under the condition that the brightness of a light source of a backlight scene is first brightness; aligning the brightness of the first image with the brightness of the second image, and determining a target exposure parameter corresponding to a camera of the electronic equipment; the second image is an image acquired by the camera of the standard electronic equipment under the condition that the brightness of the light source of the backlight scene is the first brightness; under the condition that the brightness of the light source of the backlight scene is the second brightness, acquiring a third image shot by the camera of the electronic equipment; respectively carrying out brightness adjustment on the third image and the fourth image according to a unified brightness adjustment parameter to obtain a fifth image and a sixth image; and determining the dazzle light degree of the camera of the electronic equipment according to the fifth image and the sixth image.
Need to check novelty before this filing date? Find Prior Art

Description

A method and electronic device for testing camera flare. Technical Field

[0001] This application relates to the field of electronic devices, and more particularly to a method and electronic device for testing camera flare levels. Background Technology

[0002] With the development of electronic device technology, more and more users will use the camera in electronic devices (such as mobile phones) to take pictures.

[0003] When a user takes photos in backlit scenes using an electronic device's camera, the strong light source in the backlit scene shines on the camera, causing glare in the captured image. Glare affects the contrast and saturation of the image, thus impacting the overall image quality.

[0004] However, the glare levels of cameras on different electronic devices vary, and the impact on the captured images differs. Therefore, there is an urgent need for a method that can accurately test the glare levels of cameras on electronic devices. Summary of the Invention

[0005] This application provides a method and electronic device for testing camera glare, which can accurately test the glare level of the camera in the electronic device.

[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0007] In a first aspect, embodiments of this application provide a method for testing camera glare, applied to an electronic device. This method may include: acquiring a first image captured by a camera of an electronic device when the brightness of the light source in a backlit scene is a first brightness; aligning the brightness of the first image with the brightness of a second image to determine the target exposure parameters corresponding to the camera of the electronic device; the second image being an image acquired by a standard electronic device's camera when the brightness of the light source in a backlit scene is the first brightness; acquiring a third image captured by the camera of the electronic device based on the target exposure parameters when the brightness of the light source in the backlit scene is a second brightness; the second brightness being greater than the first brightness; adjusting the brightness of the third and fourth images respectively according to a unified brightness adjustment parameter to obtain a fifth and a sixth image after brightness adjustment; the fourth image being an image acquired by a standard electronic device's camera when the brightness of the light source in a backlit scene is the second brightness; and determining the glare level of the camera of the electronic device based on the fifth and sixth images.

[0008] Based on the camera glare testing method described in the first aspect, by aligning the brightness of an image captured by the camera of an electronic device in a backlit scene with a light source brightness of a first brightness level with the brightness of an image captured by a standard electronic device's camera in a backlit scene with a light source brightness of the first brightness level, the exposure level of the electronic device's camera when capturing the image can be adjusted to be consistent with that of the standard electronic device's camera, thus obtaining the target exposure parameters corresponding to the camera of the electronic device under brightness alignment. Therefore, based on these target exposure parameters, an image captured by the camera of the electronic device in a backlit scene with a light source brightness of a second brightness level will have the same exposure level as an image captured by the standard electronic device's camera in a backlit scene with a light source brightness of the second brightness level. Thus, when determining the glare level of the electronic device's camera based on the image captured by the electronic device's camera in a backlit scene with a light source brightness of the second brightness level and the image captured by the standard electronic device's camera in a backlit scene with a light source brightness of the second brightness level, the influence of the electronic device's camera's exposure level on the glare level test can be eliminated. This improves the accuracy of the glare level test for the electronic device's camera.

[0009] Furthermore, the solution in this application involves uniformly adjusting the brightness of an image captured by the camera of an electronic device in a backlit scene with a second brightness level based on the target exposure parameters (i.e., the third image) and an image captured by the camera of a standard electronic device in a backlit scene with a second brightness level (i.e., the fourth image). The glare level of the electronic device's camera is then determined based on the brightness-adjusted image. Since the brightness adjustment performed on the third and fourth images is uniform and does not involve white balance processing, the influence of the electronic device's white balance (i.e., white balance parameters) on the glare level test of the camera under test can be eliminated when determining the glare level of the electronic device's camera based on the uniformly brightness-adjusted image. This further improves the accuracy of the glare level determination of the electronic device's camera.

[0010] In conjunction with the first aspect, in another possible implementation, aligning the brightness of the first image with the brightness of the second image to determine the target exposure parameters corresponding to the camera of the electronic device may include: determining the brightness value of the target region in the first image and the brightness value of the target region in the second image; the position and size of the target region in the first image are the same as the position and size of the target region in the second image; determining a first difference between the brightness value of the target region in the first image and the brightness value of the target region in the second image; and determining the current exposure parameters corresponding to the camera of the electronic device as the target exposure parameters if the first difference is less than or equal to a first preset difference threshold.

[0011] Based on this possible implementation, by using the brightness difference between the brightness value of the first target region in the first image and the brightness value of the second target region in the second image, the brightness of the first image and the brightness of the second image can be quickly and accurately aligned. This allows for the rapid and accurate adjustment of the exposure level of an image captured by a camera on an electronic device to be consistent with the exposure level of an image captured by a camera on a standard electronic device.

[0012] In conjunction with the first aspect, in another possible implementation, the above-mentioned camera glare testing method may further include: if the first difference is greater than a first preset difference threshold, adjusting the current exposure parameter corresponding to the camera of the electronic device to the first exposure parameter; if the brightness of the light source in the backlit scene is the first brightness, acquiring a seventh image captured by the camera of the electronic device based on the first exposure parameter; determining a second difference between the brightness value of the target area in the seventh image and the brightness value of the target area in the second image; the position and size of the target area in the seventh image are the same as the position and size of the target area in the second image; if the second difference is less than or equal to the first preset difference threshold, determining the first exposure parameter as the target exposure parameter.

[0013] Based on this possible implementation, when the brightness difference between the first target region in the first image and the second target region in the second image is large, the exposure parameters of the electronic device's camera can be adjusted. When the brightness difference between the target region in the image captured under the adjusted exposure parameters and the second target region in the second image is small, it can be determined that the brightness of the first image and the brightness of the second image are aligned. This allows for quick and accurate adjustment of the exposure level of the electronic device's camera to match that of a standard electronic device's camera.

[0014] In conjunction with the first aspect, in another possible implementation, aligning the brightness of the first image with the brightness of the second image to determine the target exposure parameters corresponding to the camera of the electronic device may include: determining the brightness value of the first channel of the target region in the first image and the brightness value of the first channel of the target region in the second image; the position and size of the target region in the first image are the same as the position and size of the target region in the second image; determining a third difference between the brightness value of the first channel of the target region in the first image and the brightness value of the first channel of the target region in the second image; and determining the current exposure parameters corresponding to the camera of the electronic device as the target exposure parameters when the third difference is less than or equal to a second preset difference threshold.

[0015] Based on this possible implementation, by using the difference between the brightness value of the first channel of the target area in the first image and the brightness value of the first channel of the target area in the second image, the brightness of the first image and the brightness of the second image can be quickly and accurately aligned. This allows for the rapid and accurate adjustment of the exposure level of an image captured by a camera on an electronic device to be consistent with the exposure level of an image captured by a camera on a standard electronic device.

[0016] In conjunction with the first aspect, in another possible implementation, the above-mentioned camera glare testing method may further include: adjusting the current exposure parameter of the camera of the electronic device to the second exposure parameter when the third difference is greater than the second preset difference threshold; acquiring an eighth image captured by the camera of the electronic device based on the second exposure parameter when the brightness of the light source in the backlit scene is the first brightness; determining a fourth difference between the brightness value of the first channel of the target area in the eighth image and the brightness value of the first channel of the target area in the second image; the position and size of the target area in the eighth image in the first image are the same as the position and size of the target area in the second image in the second image; and determining the second exposure parameter as the target exposure parameter when the fourth difference is less than or equal to the second preset difference threshold.

[0017] Based on this possible implementation, when the difference between the brightness value of the first channel of the first target region in the first image and the brightness value of the first channel of the second target region in the second image is large, the exposure parameters of the camera of the electronic device can be adjusted. When the difference between the brightness value of the first channel of the target region in the image captured under the adjusted exposure parameters and the brightness value of the first channel of the second target region in the second image is small, it can be determined that the brightness of the first image and the brightness of the second image are aligned. This allows for quick and accurate adjustment of the exposure level of the camera of the electronic device to match the exposure level of the camera of a standard electronic device.

[0018] In conjunction with the first aspect, in another possible implementation, the aforementioned first channel is a green channel.

[0019] Based on this possible implementation, by aligning the brightness value of the green channel of the first target region in the first image with the brightness value of the green channel of the second target region in the second image, the brightness of the first image can be quickly and accurately aligned with the brightness of the second image, thus determining the brightness adjustment value of the first image. This allows for the rapid and accurate adjustment of the exposure level of an image captured by a camera on an electronic device to be consistent with the exposure level of an image captured by a camera on a standard electronic device.

[0020] In conjunction with the first aspect, in another possible implementation, determining the glare level of the electronic device's camera based on the fifth and sixth images may include: determining the histogram corresponding to the fifth image and the histogram corresponding to the sixth image, respectively; and determining the glare level of the electronic device's camera based on the histogram corresponding to the fifth image and the histogram corresponding to the sixth image.

[0021] Based on this possible implementation, since the glare level of the camera on an electronic device is determined using the histograms corresponding to the fifth and sixth images after brightness adjustment, the complex image processing algorithms involved in extracting glare regions and calculating glare indices are not required. This allows for rapid testing of the glare level of cameras on different electronic devices, improving the efficiency of glare level testing for electronic devices.

[0022] In conjunction with the first aspect, in another possible implementation, the first brightness is 2% of the total brightness of the light source in the backlit scene, and the second brightness is 100% of the total brightness of the light source in the backlit scene.

[0023] Based on this possible implementation, when the brightness of the light source in a backlit scene is 2% of the total light source brightness, the images captured by both the camera of the electronic device and the camera of the standard electronic device will not be overexposed. Therefore, by ensuring that the brightness of the light source in a backlit scene is 2% of the total light source brightness, the exposure level of the images captured by both the camera of the electronic device and the camera of the standard electronic device can be accurately adjusted to match the exposure level of the images captured by the camera of the electronic device.

[0024] In conjunction with the first aspect, in another possible implementation, the brightness adjustment parameters mentioned above may include gamma parameters. Based on the unified brightness adjustment parameters, the brightness of the third image and the fourth image are adjusted respectively to obtain the brightness-adjusted fifth image and the sixth image. This may include: based on the unified gamma parameters, the third image and the fourth image are subjected to unified gamma processing to obtain the brightness-adjusted fifth image and the sixth image.

[0025] Based on this possible implementation, an image taken with the camera exposure of an electronic device adjusted to a second brightness level in a backlit scene (i.e., the third image) and an image taken with the camera of a standard electronic device in the same backlit scene (i.e., the fourth image) are subjected to uniform gamma processing. Since gamma processing adjusts the brightness and contrast of the image to better match the non-linear response characteristics of the human eye to light intensity, it does not involve white balance processing. Therefore, when determining the glare level of the electronic device's camera based on the uniformly brightness-adjusted image, the influence of the electronic device's camera's white balance (i.e., white balance parameters) on the glare level test can be eliminated. This further improves the accuracy of the glare level test for the electronic device's camera.

[0026] In conjunction with the first aspect, in another possible implementation, the first image is the original image, the second image is the original image, the third image is the original image, and the fourth image is the original image.

[0027] Based on this possible implementation, since both the first and second images are original images that have not undergone exposure processing, by aligning the brightness of the first and second images and adjusting the exposure level of the electronic device's camera to match that of a standard electronic device's camera, the influence of the electronic device's camera's exposure level on the glare test can be further eliminated. This improves the accuracy of the electronic device's camera's glare test.

[0028] Furthermore, since the third and fourth images are both original images, which have not undergone white balance processing, by uniformly adjusting the brightness of the third and fourth images and determining the glare level of the electronic device's camera based on the brightness-adjusted images, the influence of the electronic device's camera's white balance (i.e., white balance parameters) on the glare level test can be further eliminated. This improves the accuracy of the electronic device's camera glare level test.

[0029] Secondly, embodiments of this application provide a camera flare testing device. This device can be applied to electronic devices to implement the method described in the first aspect. The function of this camera flare testing device can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, such as an acquisition module, an alignment module, a determination module, and an adjustment module.

[0030] The acquisition module is used to acquire the first image captured by the camera of the electronic device when the brightness of the light source in the backlit scene is at a first brightness.

[0031] The alignment module is used to align the brightness of the first image with the brightness of the second image to determine the target exposure parameters corresponding to the camera of the electronic device; the second image is an image acquired by the camera of the standard electronic device in a backlit scene with the light source brightness being the first brightness.

[0032] The acquisition module is also used to acquire a third image captured by the camera of the electronic device based on the target exposure parameters when the brightness of the light source in the backlight scene is a second brightness; the second brightness is greater than the first brightness.

[0033] The adjustment module is used to adjust the brightness of the third and fourth images according to a unified brightness adjustment parameter, so as to obtain the fifth and sixth images after brightness adjustment; the fourth image is an image obtained by the camera of a standard electronic device in a backlit scene with the light source brightness at the second brightness.

[0034] The determination module is also used to determine the degree of glare of the camera of the electronic device based on the fifth and sixth images.

[0035] Thirdly, a camera flare testing device is provided, which has the function of implementing the method described in the first aspect. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described function.

[0036] Fourthly, a camera flare testing device is provided, comprising: a processor and a memory; the memory is used to store computer execution instructions, and when the camera flare testing device is running, the processor executes the computer execution instructions stored in the memory to cause the camera flare testing device to perform the camera flare testing method as described in any one of the first aspects above.

[0037] Fifthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions thereon. When the computer program instructions are executed by an electronic device, the electronic device causes the electronic device to implement a method for testing camera flare intensity as described in any one of the first aspects or possible implementations of the first aspect.

[0038] In a sixth aspect, embodiments of this application provide a computer program product including computer-readable code that, when executed in an electronic device, causes the electronic device to implement a method for testing camera flare intensity as described in any one of the first aspects or possible implementations of the first aspect.

[0039] In a seventh aspect, an apparatus (e.g., a system-on-a-chip) is provided, comprising a processor for supporting an electronic device in performing the functions described in the first aspect above. In one possible design, the apparatus further comprises a memory for storing program instructions and data necessary for the electronic device. When the apparatus is a system-on-a-chip, it may be composed of chips or may include chips and other discrete devices.

[0040] It should be understood that the beneficial effects of the second to seventh aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0041] Figure 1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0042] Figure 2 is a schematic diagram of the software structure of an electronic device provided in an embodiment of this application;

[0043] Figure 3 is a flowchart illustrating a method for testing camera glare according to an embodiment of this application.

[0044] Figure 4 is a schematic diagram of the central area of ​​the chart provided in the embodiment of this application;

[0045] Figure 5 is a schematic diagram showing the relationship between the green channel value of the pixels in the central region of a RAW image captured by the camera provided in this application embodiment and the brightness value of the light source in a backlit scene.

[0046] Figure 6 is a schematic diagram of a RAW image captured by the camera of the electronic device provided in the embodiment of this application and an image after brightness adjustment;

[0047] Figure 7 is a schematic diagram of the histogram corresponding to the RAW image captured by the camera of the electronic device provided in the embodiment of this application;

[0048] Figure 8 is a schematic diagram of glare in an image captured by the camera of an electronic device provided in the embodiments of this application and a schematic diagram of glare in an image captured by the camera of a standard electronic device;

[0049] Figure 9 is a schematic flowchart of a camera glare testing method provided in an embodiment of this application.

[0050] Figure 10 is a schematic diagram of a camera glare testing device provided in an embodiment of this application. Detailed Implementation

[0051] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that “ / ” means “or,” for example, A / B can mean A or B; “and / or” in the text is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can mean: A alone, A and B simultaneously, and B alone.

[0052] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.

[0053] The terms "first" and "second" in the following embodiments of this application are for descriptive purposes only and should not be construed as implying relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0054] With the development of electronic device technology, more and more users will use the cameras in electronic devices (such as mobile phones, tablets, etc.) to take pictures.

[0055] When a user takes a photo in a backlit scene using the camera of an electronic device, the strong light source in the backlit scene will shine onto the camera of the electronic device, which will cause glare in the image taken by the electronic device.

[0056] Glare occurs when strong light (i.e., a light source in a backlit scene) shines into the camera of an electronic device. Due to the scattering and reflection of the light from the strong light source within the camera, the image captured by the electronic device becomes blurry and distorted, resulting in light spots or halos in the captured image. These light spots or halos affect the contrast and saturation of the image captured by the electronic device's camera, thus impacting the image quality and reducing the user experience.

[0057] For example, when a user takes a picture using their phone's camera (such as the front-facing camera), if the front-facing camera is pointed towards the sun, the scene is considered a backlit scene. Because sunlight (i.e., a strong light source) is scattered and reflected inside the phone's camera (i.e., inside the camera lens), the image captured by the phone's camera will be blurry and distorted, and will show light spots or halos in the image.

[0058] When glare exists in images captured by a camera on an electronic device, it affects the contrast and saturation of the image, thus impacting the quality of the captured image. Furthermore, the degree of glare in the camera's image capture will result in varying degrees of impact on the image quality.

[0059] In other words, when the glare level of an electronic device's camera is high, the image captured by the camera will contain more or brighter glare. This more or brighter glare will significantly affect the contrast and saturation of the image captured by the electronic device's camera, and thus have a significant impact on the image quality.

[0060] When the glare level of an electronic device's camera is low, the images captured by the camera contain less or less glare. This less glare has a smaller impact on the contrast and saturation of the images, and consequently, a smaller impact on the overall image quality.

[0061] Therefore, it is necessary to detect the glare level of electronic device cameras in order to evaluate the camera's shooting quality and thus improve the user experience.

[0062] In order to detect the glare level of the camera of an electronic device, the glare evaluation method in the related technology is based on the final output image of the camera of the electronic device, that is, the joint photographic group (JPG) image of the final output image of the camera of the electronic device. By collecting a large amount of data from the final output JPG image of the camera of the electronic device, the glare index of the camera of the electronic device is obtained, that is, the glare level of the camera of the electronic device.

[0063] The related technology involves converting a large amount of data acquired from the camera of an electronic device to produce a JPG image. This process can include preprocessing the final output JPG image, such as removing noise and correcting white balance; extracting glare areas from the final output JPG image, such as using image processing techniques to extract glare areas; calculating the glare index of the final output JPG image, such as calculating the glare index by comparing the brightness of the extracted glare areas with the background brightness; and statistical analysis of the data from the final output JPG image, such as performing statistical analysis on the glare index of multiple test samples to obtain the average glare level and glare distribution pattern of the camera.

[0064] However, the degree of glare from an electronic device's camera is affected not only by the camera itself (i.e., the camera lens), but also by the exposure level when the camera captures the image and the white balance (i.e., white balance parameters) processing performed on the captured image. In other words, different electronic devices produce different degrees of glare.

[0065] Exposure level is determined by the exposure parameters set by the camera of an electronic device when shooting, such as shutter speed, aperture, ISO, and exposure amount. The exposure level, determined by these parameters, determines the brightness of the image captured by the camera. In other words, the degree of glare from an electronic device's camera is affected by the exposure level at which the image is captured.

[0066] Because the JPG image ultimately output by the camera of an electronic device has already undergone exposure processing and white balance processing, the final JPG image output by the camera of the electronic device is already affected by the exposure and white balance parameters of the camera.

[0067] Therefore, in this related technology, when the electronic device obtains the glare level of the camera based on the final output image of the camera, the obtained glare level is also affected by the camera's exposure parameters and white balance parameters. Therefore, the accuracy of the glare level obtained by the electronic device in this related technology is questionable.

[0068] Furthermore, since different electronic devices exhibit varying degrees of glare, the related technology's method of calculating camera glare levels by converting a large amount of data from the final JPG images output by the electronic device's camera relies on complex image processing algorithms, such as image segmentation and edge detection, which involve glare region extraction and glare index calculation. These algorithms have high computational complexity and require a long processing time. Therefore, this related technology cannot quickly test the glare levels of cameras from multiple electronic devices.

[0069] To address the aforementioned problems, this application provides a method for testing camera flare levels, applied to an electronic device including a camera, which in this application embodiment can also be referred to as the electronic device under test. The method for testing camera flare levels may include: acquiring the original image captured by the camera of the electronic device under test, i.e., the RAW image captured by the camera of the electronic device under test, and determining the G-value of the central region of the RAW image captured by the camera of the electronic device under test; then, aligning the G-value of the central region of the RAW image captured by the camera of the electronic device under test with the G-value of the central region of the corresponding RAW image of a standard camera (the camera of the standard electronic device), thereby adjusting the exposure level of the image captured by the camera of the electronic device under test to be consistent with the exposure level of the image captured by the standard camera; and then, capturing the image again using the camera of the electronic device under test with the adjusted exposure level. The system acquires the original image captured again by the camera of the electronic device under test (DUT). Then, it performs uniform gamma processing on both the RAW image captured by the DUT's camera and the corresponding RAW image from the standard camera. Next, it determines the histograms of the Gamma-processed JPG image captured by the DUT's camera and the corresponding JPG image from the standard camera. Finally, based on the histograms of the Gamma-processed JPG image captured by the DUT's camera and the corresponding JPG image from the standard camera, it determines the degree of glare from the DUT's camera.

[0070] The solution in this application aligns the G-values ​​of the central region of the RAW image captured by the camera of the electronic device under test (DUT) with those of the central region of the corresponding RAW image from a standard camera. This aligns the brightness of the central region of the RAW image with that of the standard camera, thus ensuring that the exposure level of the DUT's camera is consistent with that of the standard camera. Therefore, when determining the flare level of the DUT's camera using a re-captured RAW image from the DUT's camera and comparing it to the corresponding standard camera image, the influence of the DUT's camera's exposure level on the flare level test can be eliminated.

[0071] Furthermore, the proposed solution involves uniformly applying Gamma processing to both the RAW images captured by the camera of the electronic device under test (after alignment) and the corresponding RAW images from a standard camera. The degree of camera glare in the electronic device under test is then determined based on the histogram of the Gamma-processed JPG image. Since Gamma processing adjusts the brightness and contrast of the image to better match the non-linear response of the human eye to light intensity, it does not involve white balance processing of the image.

[0072] Therefore, the solution of this application can eliminate the influence of the white balance (i.e., white balance parameter) of the camera of the electronic device under test on the glare test when determining the glare level of the camera of the electronic device under test based on the histogram corresponding to the JPG image after Gamma processing.

[0073] Furthermore, the solution of this application determines the glare level of the camera of the electronic device under test based on the histogram corresponding to the JPG image after Gamma processing. It does not require the use of complex image processing algorithms involved in the extraction of glare areas and the calculation of glare index. Therefore, the solution of this application can quickly test the glare level of the camera of different electronic devices under test.

[0074] The method for testing camera glare provided in the embodiments of this application is described below.

[0075] The camera flare testing method provided in this application embodiment can be applied to the above-mentioned electronic device (i.e., the above-mentioned electronic device under test).

[0076] In some embodiments, the aforementioned electronic device may be a mobile phone, tablet computer, handheld computer, personal computer (PC), cellular phone, personal digital assistant (PDA), or other electronic device including a camera, i.e., an electronic device including a lens. This application does not limit the specific form of the electronic device.

[0077] For example, taking a mobile phone as an example, Figure 1 shows a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0078] As shown in Figure 1, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 430, a charging management module 440, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0079] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0080] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0081] A controller can be the nerve center and command center of an electronic device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.

[0082] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0083] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0084] The wireless communication function of electronic devices can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0085] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0086] The mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G in electronic devices. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0087] The wireless communication module 160 can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0088] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling the electronic device to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc.

[0089] Electronic devices implement display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0090] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N displays 394, where N is a positive integer greater than 1.

[0091] The electronic device can implement shooting functions through an ISP, camera 193, video codec, GPU, display 194, and application processor. In some embodiments, the electronic device may include one or N cameras 193, where N is a positive integer greater than 1.

[0092] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data generated during the use of the electronic device (such as audio data, phonebook, etc.). Furthermore, internal memory 121 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, universal flash storage (UFS), etc.

[0093] The 180E accelerometer can periodically collect acceleration data from electronic devices at a certain frequency. For example, it can collect the magnitude of acceleration of electronic devices in various directions (generally the XYZ axes).

[0094] Of course, it is understood that Figure 1 above is merely an exemplary illustration when the electronic device is in the form of a mobile phone. If the electronic device is in the form of a tablet computer, handheld computer, PC, PDA, wearable device (such as smartwatch, smart bracelet), or other device forms, the structure of the electronic device may include fewer or more structures than shown in Figure 1, and there is no limitation here.

[0095] Understandably, the implementation of electronic device functions generally requires not only hardware support but also software cooperation.

[0096] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application's embodiment uses a layered architecture. Taking the system as an example, the software structure of the electronic device is illustrated.

[0097] Figure 2 is a software structure block diagram of the electronic device provided in an embodiment of this application.

[0098] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, [the following is omitted as the text is incomplete and likely refers to a specific implementation or feature]. The system is divided into four layers, from top to bottom: the application layer, the application framework layer (also known as the system framework Java layer), and... runtime ( The runtime and system libraries (also known as the Native layer), as well as the kernel layer.

[0099] The application layer can include a series of application packages. As shown in Figure 2, the application layer package can include applications such as photography applications (e.g., camera), gallery, calendar, phone, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0100] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0101] As shown in Figure 2, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0102] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0103] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0104] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0105] A phone manager is used to provide communication functions for electronic devices. For example, it manages call status (including connection and disconnection).

[0106] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0107] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0108] runtime The runtime includes the core libraries and the virtual machine. runtime runt ime is responsible System scheduling and management.

[0109] The core library consists of two parts: one part contains the functionalities that the Java language needs to call, and the other part is... The core library.

[0110] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0111] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0112] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0113] The methods described in the following embodiments can all be implemented in electronic devices having the above-described hardware or software structures.

[0114] The method for testing camera glare provided in this application will be described in detail below with reference to Figure 3. This method for testing camera glare can be applied to electronic devices (such as mobile phones), that is, the electronic device needs to test the glare of the camera. In the following embodiments, the electronic device under test is used as an example to illustrate the electronic device that needs to test the glare of the camera.

[0115] As shown in Figure 3, the test method for the glare level of this camera may include the following S301-S308.

[0116] S301. Under the first shooting condition, acquire a first RAW image of the target object captured by the camera of a standard electronic device, and determine the value of the green channel of the pixels in the center region of the first RAW image.

[0117] The camera of a standard electronic device is the camera of the electronic device used as a standard for judging the glare level of the camera of the electronic device under test. In other words, the camera of a standard electronic device can be a camera with good glare level, a camera with low glare level, or any other possible camera. Furthermore, in this embodiment, the camera of the standard electronic device can be referred to as a standard camera.

[0118] The first shooting conditions may include the exposure of the camera of the standard electronic device when shooting the target object, the target object, the initial brightness of the light source corresponding to the target object, the environment of the standard electronic device when shooting, the posture and position of the standard electronic device when shooting, and the target object being located at the center of the shooting interface of the electronic device. It should be noted that the first shooting conditions may also include other conditions, such as the distance between the standard electronic device and the target object when shooting. The specific content of the first shooting conditions is not limited in the embodiments of this application.

[0119] The exposure of a camera on a standard electronic device when taking a picture of a target object; that is, the exposure parameters of a camera on a standard electronic device when taking a picture of a target object.

[0120] The target object can be a test chart used for shooting (also called a camera or webcam test chart), or it can be other types of objects to be photographed. This application embodiment does not limit the specific type of the target object. This application embodiment uses a test chart used for shooting as an example for illustration.

[0121] The light source corresponding to the target object is the light source that can illuminate the target object, so that the camera of a standard electronic device can shoot in a backlit scene.

[0122] The light source corresponding to the target object can be a surface light source, a point light source, or other types of light sources. In this embodiment, the specific type of light source corresponding to the target object is not limited.

[0123] It should be noted that, since the light source in a backlit scene is usually a surface light source when the camera of a user's electronic device is shooting, this embodiment of the application uses the light source corresponding to the target object as an example for illustration.

[0124] The first brightness of the light source corresponding to the target object can be either the brightness value of the light source corresponding to the target object or a percentage of the total brightness of the light source corresponding to the target object. This embodiment does not limit this. This embodiment uses the example of the first brightness of the light source corresponding to the target object being a percentage of the total brightness of the light source corresponding to the target object for illustrative purposes. For example, when the first brightness of the light source corresponding to the target object is 2%, that is, the brightness of the light source corresponding to the target object is 2% of the total brightness.

[0125] It should be noted that, in order to facilitate the alignment of the green channel values ​​of the pixels in the center region of the captured RAW image in subsequent steps, when acquiring the first RAW image of the target object captured by the camera of a standard electronic device (the first RAW image in this embodiment can also be referred to as the second image), it is necessary to adjust the brightness of the light source corresponding to the target object so that the center region of the first RAW image is not overexposed (i.e., the brightness in the captured image is too high, the image will be white, and it exceeds the brightness range that the captured image should have).

[0126] Typically, when the brightness of the light source corresponding to the target object is within 5%, the central area of ​​the first RAW image captured by the camera of a standard electronic device will not be overexposed. That is, the first brightness can be any value within 5%, and this embodiment does not limit it. This embodiment uses a first brightness of 2% as an example for illustration. That is, the first RAW image may include a single image.

[0127] In some examples, the first brightness may include a brightness level at which the central region of the first RAW image taken of the target object is not overexposed, or it may include multiple brightness levels at which the central region of the first RAW image taken of the target object is not overexposed. The specific number and value of the first brightness are not limited in the embodiments of this application. For example, when the first brightness includes multiple brightness levels, the first brightness may also be 1%, 2%, 3%, 4%, and 5%. That is, the first RAW image may also include multiple images. When the number of first RAW images includes multiple images, the value of the green channel of the pixels in the central region of each RAW image is determined separately.

[0128] Under the first shooting conditions, after acquiring the first RAW image of the target object captured by the camera of the standard electronic device, the green channel value of the pixels in the center region of the first RAW image can be determined. This allows the green channel value of the pixels in the center region of the RAW image captured by the camera of the electronic device under test to be aligned with the green channel value of the pixels in the center region of the first RAW image, so that the exposure level of the camera of the electronic device under test can be adjusted to match the exposure level of the camera of the standard electronic device.

[0129] The central region of the first RAW image, i.e., the middle region of the first RAW image. To facilitate the determination of the central region of the first RAW image, the central region of the target object can be marked. For example, the central region of the chart (i.e., the target object) can be marked to facilitate the determination of the green channel (i.e., G channel) value of the pixels in the central region of the first RAW image.

[0130] For example, referring to Figure 4, when the target object is a chart, the central area of ​​the chart can be marked, i.e., the measurement area in Figure 4. This allows the camera of the standard electronic device to easily place the central area of ​​the target object at the center of the camera's shooting interface when taking a picture of the target object. It should be noted that the strong light source is located behind the chart, and the camera of the standard electronic device can be positioned in front of the chart so that the strong light source enables the camera of the standard electronic device to shoot in backlit scenes.

[0131] Furthermore, since the central region (i.e., the measurement region) is marked on the chart, the central region can be easily measured when the camera of a standard electronic device acquires the captured first RAW image. This allows for easy determination of the green channel (i.e., G channel) value of the pixels that determine the central region of the first RAW image. (In this embodiment, the green channel can also be referred to as the first channel).

[0132] In some examples, the green channel value of the pixels in the center region of the first RAW image can be either the average of the green channel values ​​of each pixel in the center region of the first RAW image, or the green channel value of each pixel in the center region of the first RAW image.

[0133] It should be noted that, under the first shooting conditions, after acquiring the first RAW image of the target object captured by the camera of the standard electronic device, the values ​​of the red channel, blue channel, or brightness of the pixels in the center region of the first RAW image can also be determined. This allows for the alignment of the red channel and blue channel values ​​of the pixels in the center region of the RAW image captured by the camera of the electronic device under test with the values ​​of the red channel and blue channel, or brightness of the pixels in the center region of the first RAW image, so that the exposure level of the camera of the electronic device under test can be adjusted to match the exposure level of the camera of the standard electronic device.

[0134] In some examples, the brightness value of the central region of the first RAW image can be either the average brightness value of each pixel in the central region of the first RAW image or the brightness value of each pixel in the central region of the first RAW image.

[0135] It should be noted that since the green channel (i.e., G channel) values ​​of pixels in RAW images obtained by different electronic devices shooting the same target object under the same shooting conditions are the same, this embodiment of the application illustrates the following: after obtaining the first RAW image of the target object shot by the camera of the standard electronic device under the first shooting conditions, the green channel value of the pixels in the center region of the first RAW image can be determined, and the green channel value of the pixels in the center region of the RAW image shot by the camera of the electronic device under test can be aligned with the green channel value of the pixels in the center region of the first RAW image using the green channel value of the pixels in the center region of the first RAW image.

[0136] S302. Under the second shooting condition, acquire a second RAW image of the target object taken by a standard camera.

[0137] Under the first shooting condition, after acquiring a first RAW image of the target object captured by a camera of a standard electronic device and determining the green channel value of the pixels in the central region of the first RAW image, a second RAW image of the target object captured by a standard camera can be acquired under the second shooting condition, and the green channel value of the pixels in the central region of the second RAW image can be determined. In this embodiment, the second RAW image can also be referred to as the fourth image.

[0138] The second shooting conditions may include the exposure of the camera of the standard electronic device when shooting the target object, the target object, the second brightness of the light source corresponding to the target object, the environment during shooting by the standard electronic device, the posture and position of the standard electronic device during shooting, and the target object being located at the center of the shooting interface of the electronic device. It should be noted that the second shooting conditions may also include other conditions, such as the distance between the standard electronic device and the target object during shooting. The specific types of the second shooting conditions included in the embodiments of this application are not limited.

[0139] In this embodiment of the application, the first brightness of the light source corresponding to the target object in the second shooting condition is different from the second brightness of the light source corresponding to the target object in the first shooting condition, while other contents are the same as those in the first shooting condition.

[0140] The second brightness of the light source corresponding to the target object can be either the brightness value of the light source corresponding to the target object or a percentage of the total brightness of the light source corresponding to the target object. This embodiment does not limit this. This embodiment uses the example of the second brightness of the light source corresponding to the target object being a percentage of the total brightness of the light source corresponding to the target object for illustrative purposes. For example, when the second brightness of the light source corresponding to the target object is 100%, that is, when the brightness of the light source corresponding to the target object is 100% of the total brightness.

[0141] It should be noted that when the brightness of the light source corresponding to the target object is high, the glare in the camera-captured image is quite noticeable. Therefore, to facilitate the determination of the glare level of the camera on the electronic device under test in subsequent steps, the second brightness of the light source corresponding to the target object can be set to a relatively high brightness. For example, the second brightness of the light source corresponding to the target object can be set to 100%.

[0142] It should be noted that, typically, when the brightness of the light source corresponding to the target object is above 5%, the first RAW image captured by the camera of a standard electronic device will experience glare. That is, the second brightness can be any value above 5%, and this embodiment does not limit this. This embodiment uses a second brightness of 100% as an example for illustration. That is, the second RAW image may include a single image.

[0143] In some examples, the second brightness may include a brightness level at which glare would occur in the first RAW image when the target object is captured, or it may include multiple brightness levels at which glare would occur in the first RAW image when the target object is captured. The specific number and value of the second brightness are not limited in the embodiments of this application. For example, when the second brightness includes multiple brightness levels, the second brightness may also be 10%, 100%, etc. That is, the second RAW image may also include multiple images.

[0144] It should be noted that the execution order of S301 and S302 in this embodiment is not limited. That is, S301 can be executed first, followed by S302, or S302 can be executed first, followed by S301, or both S301 and S302 can be executed simultaneously. This embodiment illustrates the example of executing S301 first, followed by S302.

[0145] S303. Under the third shooting condition, acquire the third RAW image of the target object captured by the camera of the electronic device under test, and determine the value of the green channel of the pixels in the center region of the third RAW image.

[0146] The camera of the electronic device under test is the electronic device whose glare needs to be tested.

[0147] The third shooting conditions may include the exposure of the camera of the electronic device under test when shooting the target object, the target object, the first brightness of the light source corresponding to the target object, the environment when the standard electronic device shoots, the posture and position of the standard electronic device when shooting, and the target object being located at the center of the shooting interface of the electronic device. It should be noted that the third shooting conditions may also include other conditions, such as the distance between the electronic device under test and the target object when shooting. The specific content of the third shooting conditions is not limited in the embodiments of this application.

[0148] In this embodiment of the application, the exposure of the camera of the electronic device under test when shooting the target object in the third shooting condition may be different from the exposure of the camera of the standard electronic device when shooting the target object, while the other contents are the same as those in the first shooting condition.

[0149] In some examples, when the first brightness includes a brightness at which the central region of the first RAW image does not overexpose when the target object is captured, such as 2%, the camera of the electronic device under test can acquire a third RAW image of the target object when the light source brightness is 2%, and determine the value of the green channel of the pixels in the central region of the third RAW image. That is, the third RAW image includes one. In the embodiments of this application, the third RAW image can also be referred to as the first image.

[0150] In other examples, when the first brightness includes multiple brightness levels where the central region of the first RAW image does not overexpose when the target object is captured, such as 1%, 2%, 3%, 4%, and 5%, the camera of the electronic device under test can acquire third RAW images of the target object at brightness levels of 1%, 2%, 3%, 4%, and 5%, respectively, and determine the green channel value of the pixels in the central region of the third RAW image. That is, there are multiple third RAW images, and the number of third RAW images is the same as the number of first RAW images.

[0151] When the number of third RAW images includes multiple images, the value of the green channel of the pixels in the center region of each RAW image is determined separately.

[0152] Under the third shooting condition, after acquiring the third RAW image of the target object captured by the camera of the electronic device under test, the green channel value of the pixels in the center region of the third RAW image can be determined. This allows the green channel value of the pixels in the center region of the RAW image captured by the camera of the electronic device under test to be aligned with the green channel value of the pixels in the center region of the first RAW image, so that the exposure level of the camera of the electronic device under test can be adjusted to be consistent with the exposure level of the camera of the standard electronic device.

[0153] The central region of the third RAW image is the same region as the central region of the first RAW image.

[0154] In some examples, the green channel value of the pixels in the center region of the first RAW image can be the average of the green channel values ​​of each pixel in the center region of the third RAW image, or it can be the green channel value of each pixel in the center region of the first RAW image.

[0155] It should be noted that, under the first shooting condition, after acquiring the first RAW image of the target object taken by the camera of the standard electronic device, the value determined is either the red channel value, the blue channel value, or the brightness value of the central region of the first RAW image. Under the third shooting condition, after acquiring the third RAW image of the target object taken by the camera of the electronic device under test, the value determined can be either the red channel value, the blue channel value, or the brightness value of the central region of the third RAW image. In other words, after acquiring the third RAW image of the target object taken by the camera of the electronic device under test, determining which pixel channel value or the brightness value of the central region of the third RAW image is the same as determining which pixel channel value or the brightness value of the central region of the first RAW image.

[0156] S304. Align the green channel values ​​of the pixels in the center region of the third RAW image with the green channel values ​​of the pixels in the center region of the first RAW image to adjust the exposure of the camera of the electronic device under test.

[0157] After determining the green channel values ​​of the pixels in the center region of the third RAW image and the green channel values ​​of the pixels in the center region of the first RAW image, the green channel values ​​of the pixels in the center region of the third RAW image can be aligned with the green channel values ​​of the pixels in the center region of the first RAW image.

[0158] Since the green channel values ​​of the pixels in the center region of the third RAW image and the first RAW image respectively reflect the brightness of the third RAW image and the first RAW image, aligning these values ​​ensures that the brightness of the image captured by the camera of the electronic device under test is consistent with the brightness of the image captured by the camera of the standard electronic device. Furthermore, since the camera exposure level determines the brightness of the image captured by the camera of the electronic device, aligning these values ​​again ensures that the exposure level of the camera of the electronic device under test is consistent with the exposure level of the camera of the standard electronic device. This eliminates the adverse effects of different exposure levels on the glare test results when determining the glare level of the electronic device under test based on the images captured by the cameras of the two devices. In some examples, aligning the green channel values ​​of pixels in the center region of the third RAW image with the green channel values ​​of pixels in the center region of the first RAW image can include determining the difference between the green channel values ​​of pixels in the center region of the third RAW image and the green channel values ​​of pixels in the center region of the first RAW image. Based on this difference in green channel values ​​(which can also be referred to as the third difference in this embodiment), it can be determined whether the exposure level of the camera of the electronic device under test when shooting the target object is consistent with the exposure level of the camera of the standard electronic device when shooting the target object.

[0159] When the difference between the green channel value of the pixels in the center region of the third RAW image and the green channel value of the pixels in the center region of the first RAW image is less than or equal to a preset difference threshold, it can be determined that the exposure level of the camera of the electronic device under test when shooting the target object is consistent with the exposure level of the camera of the standard electronic device when shooting the target object. In the embodiments of this application, when the difference between the green channel value of the pixels in the center region of the third RAW image and the green channel value of the pixels in the center region of the first RAW image is less than or equal to a preset difference threshold, the exposure amount corresponding to the camera of the electronic device under test can also be referred to as the target exposure parameter.

[0160] Exposure refers to the total amount of light received by the photosensitive element (such as film or digital sensor) of the camera of the electronic device under test. Exposure is determined by the product of the shutter speed (exposure time) and aperture size (amount of light) of the camera, and is also affected by ISO sensitivity. Exposure directly affects the brightness of the image captured by the camera of the electronic device under test; excessive exposure results in an overexposed image, while insufficient exposure results in an underexposed image.

[0161] Therefore, when the difference between the green channel value of the pixel in the center region of the third RAW image and the green channel value of the pixel in the center region of the first RAW image is greater than a preset difference threshold, the exposure of the electronic device under test can be adjusted so that the brightness of the image captured by the camera of the electronic device under test is consistent with the brightness of the image captured by the camera of the standard electronic device, that is, the exposure level of the camera of the electronic device under test is consistent with the exposure level of the camera of the standard electronic device.

[0162] When the difference between the green channel value of a pixel in the center region of the third RAW image and the green channel value of a pixel in the center region of the first RAW image is greater than a preset difference threshold (which can also be referred to as the second preset difference threshold in this embodiment), it can be determined that the exposure level of the camera of the electronic device under test when shooting the target object is inconsistent with the exposure level of the camera of the standard electronic device when shooting the target object. The specific value of the preset difference threshold (i.e., the second preset difference threshold) can be determined according to the actual situation, and is not limited in this embodiment.

[0163] When the difference between the green channel value of the pixels in the center region of the third RAW image and the green channel value of the pixels in the center region of the first RAW image is greater than a preset difference threshold (i.e., the second preset difference threshold), that is, when the exposure level of the camera of the electronic device under test when shooting the target object is inconsistent with the exposure level of the camera of the standard electronic device when shooting the target object, the exposure of the camera of the electronic device under test when shooting the target object can be adjusted (i.e., the current exposure parameter corresponding to the camera of the electronic device under test is adjusted to the second exposure parameter), and then the camera of the electronic device under test shoots the target object again to obtain a new third RAW image. When the difference between the green channel value of the pixels in the center region of the new third RAW image and the green channel value of the pixels in the center region of the first RAW image (which can also be called the fourth difference in this embodiment) is less than or equal to the preset difference threshold (i.e., the second preset difference threshold), it can be determined that the exposure level of the camera of the electronic device under test when shooting the target object is consistent with the exposure level of the camera of the standard electronic device when shooting the target object. Of course, if the difference between the green channel value of the pixels in the center region of the new third RAW image and the green channel value of the pixels in the center region of the first RAW image is greater than a preset difference threshold, the above process can be repeated according to the above logic until the difference between the green channel value of the pixels in the center region of the latest third RAW image and the green channel value of the pixels in the center region of the first RAW image is less than or equal to the preset difference threshold.

[0164] It should be noted that when both the first RAW image and the third RAW image include multiple images, the green channel values ​​of the pixels in the center region of the multiple images in the third RAW image can be aligned with the green channel values ​​of the pixels in the center region of the multiple images in the first RAW image to achieve the purpose of adjusting the exposure of the camera of the electronic device under test.

[0165] For example, if the first RAW image includes multiple images corresponding to light source brightness of 1%, 2%, 3%, 4%, and 5%, then the third RAW image also includes multiple images corresponding to light source brightness of 1%, 2%, 3%, 4%, and 5%. The green channel values ​​of the pixels in the central region of the third RAW image corresponding to 1% light source brightness can be aligned with the green channel values ​​of the pixels in the central region of the first RAW image; the green channel values ​​of the pixels in the central region of the third RAW image corresponding to 1% light source brightness can be aligned with the green channel values ​​of the pixels in the central region of the first RAW image corresponding to 1% light source brightness; and the green channel values ​​of the pixels in the central region of the third RAW image corresponding to 2% light source brightness can be aligned with the green channel values ​​of the pixels in the central region of the first RAW image corresponding to 2% light source brightness. Align the green channel values ​​of the pixels in the central region of the first RAW image corresponding to a source brightness of 2%; align the green channel values ​​of the pixels in the central region of the third RAW image corresponding to a source brightness of 3% with the green channel values ​​of the pixels in the central region of the first RAW image corresponding to a source brightness of 3%; align the green channel values ​​of the pixels in the central region of the third RAW image corresponding to a source brightness of 4% with the green channel values ​​of the pixels in the central region of the first RAW image corresponding to a source brightness of 4%; align the green channel values ​​of the pixels in the central region of the third RAW image corresponding to a source brightness of 5% with the green channel values ​​of the pixels in the central region of the first RAW image corresponding to a source brightness of 5%.

[0166] It should be noted that when both the first RAW image and the third RAW image include multiple images, the green channel value of the pixels in the center region of a certain image in the third RAW image can be aligned with the green channel value of the pixels in the center region of the corresponding image in the first RAW image.

[0167] For example, if the first RAW image includes multiple images corresponding to light source brightness of 1%, 2%, 3%, 4%, and 5%, then the third RAW image also includes multiple images corresponding to light source brightness of 1%, 2%, 3%, 4%, and 5%. The green channel value of the pixels in the central region of the third RAW image corresponding to light source brightness of 2% can be aligned with the green channel value of the pixels in the central region of the first RAW image corresponding to light source brightness of 2%.

[0168] It should be noted that, due to the linear relationship between the green channel values ​​of pixels in the central region of RAW images captured by cameras of electronic devices in backlit scenes with varying light source brightness, and the green channel values ​​of pixels in the central region of RAW images captured by cameras of different electronic devices with varying light source brightness in backlit scenes are not significantly different.

[0169] For example, referring to Figure 5, the horizontal axis in Figure 5 represents different brightness levels of the lit surface in a backlit scene, and the vertical axis represents the green channel value of the pixels in the central region of the RAW image captured by the camera of the electronic device in a backlit scene. The two curves in Figure 5 represent the green channel values ​​of the pixels in the central region of the RAW image captured by the camera of the tested electronic device in a backlit scene with different light source brightness levels, and the green channel values ​​of the pixels in the central region of the RAW image captured by the camera of the standard electronic device in a backlit scene with different light source brightness levels. As can be seen from Figure 5, the green channel values ​​of the pixels in the central region of the RAW image captured by the camera of the tested electronic device and the camera of the standard electronic device in a backlit scene with different light source brightness levels are linearly related, and the green channel values ​​of the pixels in the central region of the RAW image captured by the camera of the tested electronic device and the camera of the standard electronic device in a backlit scene with different light source brightness levels are not significantly different.

[0170] Therefore, by aligning the green channel values ​​of the pixels in the center region of the third RAW image with the green channel values ​​of the pixels in the center region of the first RAW image using the above method, it can be considered that the exposure level of the camera of the electronic device under test when shooting the target object is adjusted to be the same as the exposure level of the camera of the standard electronic device.

[0171] S305. Under the fourth shooting condition, based on the adjusted exposure, acquire the fourth RAW image of the target object captured by the camera of the electronic device under test.

[0172] After adjusting the exposure of the electronic device under test (DUT), that is, adjusting the exposure level of the DUT's camera when shooting the target object to be consistent with the exposure level of the standard electronic device's camera, a fourth RAW image of the target object can be acquired under the fourth shooting condition. In this embodiment, the fourth RAW image can also be referred to as the third image. The adjusted exposure in this embodiment can also be referred to as the target exposure parameter.

[0173] The fourth shooting condition may include the exposure of the standard electronic device's camera when shooting the target object (i.e., the adjusted exposure of the electronic device under test), the target object, the second brightness of the light source corresponding to the target object, the environment during shooting by the standard electronic device, the posture and position of the standard electronic device during shooting, and the target object being located at the center of the shooting interface of the electronic device. It should be noted that the fourth shooting condition may also include other conditions, such as the distance between the electronic device under test and the target object during shooting. The specific content of the fourth shooting condition is not limited in the embodiments of this application.

[0174] In this embodiment, the fourth shooting condition is the same as the second shooting condition.

[0175] It should be noted that when the second brightness of the light source corresponding to the target object is a certain brightness, that is, a brightness at which glare will occur when shooting the target object (such as when the brightness of the light source is 100%), the fourth RAW image of the target object captured by the camera of the electronic device under test includes one image, that is, the RAW image of the target object captured by the camera of the electronic device under test when the brightness of the light source is 100%.

[0176] When the second brightness of the light source corresponding to the target object is multiple brightness levels, that is, when the target object is photographed at multiple brightness levels that will cause glare (such as the brightness of the light source being 10% or 100%), the fourth RAW image of the target object captured by the camera of the electronic device under test includes multiple images, such as the RAW image of the target object captured by the camera of the electronic device under test when the brightness of the light source is 10%, and the RAW image of the target object captured by the camera of the electronic device under test when the brightness of the light source is 100%.

[0177] S306. Perform uniform gamma processing on the second RAW image and the fourth RAW image to obtain the restored JPG image corresponding to the second RAW image and the JPG image corresponding to the fourth RAW image.

[0178] Since both the second and fourth RAW images are RAW images, which have lower brightness, their brightness can be uniformly adjusted to facilitate testing of the camera glare level of the electronic device under test. This uniform brightness adjustment will not affect the accuracy of the glare level test.

[0179] For example, as shown in Figure 6(a), the RAW image captured by the camera of the electronic device has low brightness and the glare is not obvious. To facilitate testing the glare level of the camera on the electronic device under test, the brightness of the RAW image captured by the camera of the electronic device is adjusted. As shown in Figure 6(b), the adjusted RAW image captured by the camera of the electronic device has higher brightness and the glare is obvious.

[0180] In some examples, uniform brightness adjustment of the second and fourth RAW images can be achieved by uniform gamma adjustment of both images. It should be noted that uniform brightness adjustment of the second and fourth RAW images can also be achieved through other methods, as long as it does not affect the white balance parameters of the camera on the tested electronic device or the camera on the standard electronic device, thus affecting the resulting JPG image. This application embodiment uses uniform gamma adjustment of the second and fourth RAW images as an example for illustration.

[0181] In some examples, the second and fourth RAW images are subjected to a uniform gamma adjustment, that is, the second and fourth RAW images are processed using a uniform gamma parameter, thereby uniformly adjusting the brightness of the second and fourth RAW images.

[0182] Gamma processing adjusts the brightness and contrast of an image to better match the non-linear response of the human eye to light intensity; it does not involve white balance processing. Therefore, applying uniform gamma processing to the second and fourth RAW images to obtain the restored JPG images corresponding to the second and fourth RAW images will not affect the white balance parameters of the camera of the tested electronic device or the camera of the standard electronic device.

[0183] S307. Determine the histograms corresponding to the JPG images of the second RAW image and the JPG images of the fourth RAW image.

[0184] After performing uniform gamma processing on the second and fourth RAW images to obtain the restored JPG images corresponding to the second and fourth RAW images, the histograms corresponding to the JPG images corresponding to the second and fourth RAW images can be determined.

[0185] A histogram corresponding to a JPG image is a graphical representation used to show the distribution of pixel values ​​in an image. The histogram of a JPG image can indicate information such as exposure, contrast, and tone. Therefore, by using the histograms of the JPG images corresponding to the second and fourth RAW images, the degree of glare from the camera of the electronic device under test can be determined.

[0186] It should be noted that the specific implementation of determining the histograms corresponding to the JPG images corresponding to the second RAW image and the fourth RAW image in this application embodiment is not limited, as long as the histograms corresponding to the JPG images corresponding to the second RAW image and the fourth RAW image can be determined.

[0187] In some examples, when the second RAW image comprises multiple images, such as RAW images of the target object taken by the camera of a standard electronic device when the light source brightness is 10%, and RAW images of the target object taken by the camera of the standard electronic device when the light source brightness is 100%, the fourth RAW image also comprises multiple images, namely, RAW images of the target object taken by the camera of the electronic device under test when the light source brightness is 10%, and RAW images of the target object taken by the camera of the electronic device under test when the light source brightness is 100%. By performing uniform gamma processing on the second and fourth RAW images, the restored JPG images corresponding to the second and fourth RAW images are obtained. Alternatively, uniform gamma processing can be performed on the RAW images of the target object taken by the camera of a standard electronic device with the same light source brightness and the RAW images of the target object taken by the camera of the electronic device under test, resulting in the restored JPG images corresponding to the second and fourth RAW images.

[0188] In this embodiment, the following example illustrates how, when the second RAW image includes multiple images and the fourth RAW image includes multiple images, a standard electronic device's camera captures a RAW image of the target object with a light source brightness of 100%, and the camera of the electronic device under test captures a RAW image of the target object, and a unified gamma processing is performed to obtain a JPG image corresponding to the restored second RAW image and a JPG image corresponding to the fourth RAW image.

[0189] S308. Determine the glare level of the camera of the electronic device under test based on the histograms corresponding to the JPG images corresponding to the second RAW image and the fourth RAW image.

[0190] After determining the histograms corresponding to the JPG images of the second RAW image and the fourth RAW image, the glare level of the camera of the electronic device under test can be determined based on the histograms corresponding to the JPG images of the second RAW image and the fourth RAW image.

[0191] In some examples, the glare level of the camera of the electronic device under test is determined based on the histograms corresponding to the JPG images corresponding to the second and fourth RAW images. This can be achieved by determining the glare area corresponding to the JPG image corresponding to the fourth RAW image, and then determining the glare level of the camera of the electronic device under test based on the number of pixels in the glare area.

[0192] When the number of pixels in the glare area exceeds a preset threshold, it can be determined that the glare level of the camera of the electronic device under test is higher than that of the camera of the standard electronic device. When the number of pixels in the glare area is less than or equal to the preset threshold, it can be determined that the glare level of the camera of the electronic device under test is equal to or less than that of the camera of the standard electronic device.

[0193] The specific value of the preset quantity threshold can be determined according to the actual situation, and this application embodiment does not limit it.

[0194] It should be noted that the glare area is the region with a lower brightness value in the JPG image corresponding to the second RAW image, but a higher brightness value in the JPG image corresponding to the fourth RAW image. Since the exposure of the camera of the electronic device under test is the same as that of the camera of the standard electronic device, the brightness values ​​of the JPG images corresponding to the second and fourth RAW images should be the same. If there is a region with a higher brightness value in the JPG image corresponding to the fourth RAW image, and the brightness value of this region is lower in the corresponding region of the JPG image corresponding to the second RAW image, then this region can be identified as the glare area in the JPG image corresponding to the fourth RAW image.

[0195] In some examples, the glare level of the camera of the electronic device under test is determined based on the histograms corresponding to the JPG images corresponding to the second RAW image and the fourth RAW image. This can be achieved by determining the glare level of the camera of the electronic device under test based on the average brightness of the JPG images corresponding to the second RAW image and the fourth RAW image.

[0196] When the average brightness of the JPG image corresponding to the fourth RAW image is greater than the average brightness of the JPG image corresponding to the second RAW image, it can be determined that the glare level of the camera of the electronic device under test is higher than that of the camera of the standard electronic device. When the average brightness of the JPG image corresponding to the fourth RAW image is less than or equal to the average brightness of the JPG image corresponding to the second RAW image, it can be determined that the glare level of the camera of the electronic device under test is equal to or less than that of the camera of the standard electronic device.

[0197] Since a histogram reflects the number of pixels corresponding to each brightness value, the glare level of the camera of the electronic device under test can be determined by identifying the number of pixels in the glare area. When the number of pixels in the glare area exceeds a preset pixel count threshold, the glare level of the camera of the electronic device under test is greater than that of the camera of a standard electronic device. When the number of pixels in the glare area is less than or equal to the preset pixel count threshold, the glare level of the camera of the electronic device under test is less than or equal to that of the camera of a standard electronic device.

[0198] For example, referring to Figure 7, the horizontal axis of Figure 7 represents the pixel brightness values ​​in the JPG images corresponding to the fourth RAW image and the second RAW image, while the vertical axis represents the number of pixels in the JPG images corresponding to the fourth and second RAW images at each brightness level. It can be seen that in areas without glare, the number of pixels in the JPG images corresponding to the fourth and second RAW images is the same at different brightness values. Areas with the same brightness values ​​but different pixel counts are glare areas, as shown in the shaded areas of Figure 7. Therefore, the degree of glare in the camera of the electronic device under test can be determined by determining the number of pixels in the glare areas.

[0199] It should be noted that after performing uniform gamma processing on the second and fourth RAW images to obtain the restored JPG images corresponding to the second and fourth RAW images, the flare level of the camera of the electronic device under test can also be determined based on the restored JPG images corresponding to the second and fourth RAW images.

[0200] For example, the JPG image corresponding to the second RAW image captured by the camera of the standard electronic device after restoration is shown in Figure 8(a). It can be seen that the overall brightness of the JPG image corresponding to the second RAW image is low, and the glare in the JPG image corresponding to the second RAW image is not obvious. The JPG image corresponding to the fourth RAW image captured by the camera of the electronic device under test after restoration is shown in Figure 8(b). It can be seen that the overall brightness of the JPG image corresponding to the fourth RAW image is high, and the glare in the JPG image corresponding to the fourth RAW image is obvious. Therefore, it can be determined that the glare level of the camera of the electronic device under test is higher than that of the camera of the standard electronic device.

[0201] Furthermore, by using the above technical solution to process different electronic devices under test, it is convenient and quick to obtain the relationship between the glare levels of cameras of various different electronic devices under test and standard electronic devices.

[0202] The solution in this application aligns the G-values ​​of the central region of the RAW image captured by the camera of the electronic device under test (DUT) with those of the central region of the corresponding RAW image from the standard camera. This aligns the brightness of the central region of the RAW image with that of the standard camera, thus ensuring that the exposure level of the DUT's camera is consistent with that of the standard camera. Furthermore, when determining the flare level of the DUT's camera using a re-captured RAW image from the camera of the DUT and the corresponding standard camera image, the influence of the DUT's camera's exposure level on the flare level test can be eliminated.

[0203] Furthermore, the proposed solution involves uniformly applying Gamma processing to both the RAW images captured by the camera of the electronic device under test (after alignment) and the corresponding RAW images from a standard camera. The degree of camera glare in the electronic device under test is then determined based on the histogram of the Gamma-processed JPG image. Since Gamma processing adjusts the brightness and contrast of the image to better match the non-linear response of the human eye to light intensity, it does not involve white balance processing of the image.

[0204] Therefore, the solution of this application can eliminate the influence of the white balance (i.e., white balance parameter) of the camera of the electronic device under test on the glare test when determining the glare level of the camera of the electronic device under test based on the histogram corresponding to the JPG image after Gamma processing.

[0205] Furthermore, the solution of this application determines the glare level of the camera of the electronic device under test based on the histogram corresponding to the JPG image after Gamma processing. It does not require the use of complex image processing algorithms involved in the extraction of glare areas and the calculation of glare index. Therefore, the solution of this application can quickly test the relationship between the glare levels of cameras of different electronic devices under test.

[0206] For ease of understanding, this application also provides a method for testing camera flare intensity. As shown in FIG9, the method for testing camera flare intensity may include the following steps S901-S905.

[0207] S901. In a backlit scene where the brightness of the light source is at the first brightness, acquire the first image captured by the camera of the electronic device.

[0208] A backlit scene is a light source that illuminates the target object, allowing the camera of an electronic device to capture the image in a backlit scene.

[0209] The first brightness can be defined as the brightness of the light source that prevents glare or overexposure when the camera of an electronic device is shooting under a backlit light source.

[0210] In some examples, the first brightness can be less than 5% of the total brightness of the light source in the backlit scene. For example, the first brightness is 2% of the total brightness of the light source in the backlit scene.

[0211] The first image can be the original image obtained by the camera of an electronic device capturing the target object under the condition that the brightness of the light source in the backlit scene is the first brightness.

[0212] In some examples, the first image can be an image captured of a target region within a target object; that is, the first image can include the target region corresponding to the target object. In other words, the target region in the first image can be an area with a high brightness value. For example, the target region in the first image can be the central region of the first image.

[0213] It should be noted that when acquiring the first image captured by the camera of the electronic device, the shooting conditions of the electronic device can be the aforementioned third shooting conditions. That is, the third shooting conditions may include the target object, the first brightness of the light source corresponding to the target object, the environment during shooting by the standard electronic device, the posture and position of the standard electronic device during shooting, and the target object being located at the center of the shooting interface of the electronic device. It should also be noted that the third shooting conditions may include other conditions, such as the distance between the electronic device and the target object during shooting. The specific content of the third shooting conditions is not limited in the embodiments of this application.

[0214] Specifically, in this application embodiment, when the brightness of the light source in the backlight scene is the first brightness, the specific implementation method for obtaining the first image captured by the camera of the electronic device can be referred to the specific implementation method in S303 above, and will not be repeated in this application embodiment.

[0215] It should be noted that, in a backlit scene where the light source brightness is at the first brightness level, before acquiring the first image captured by the camera of the electronic device, a second image captured by the camera of the standard electronic device can be acquired first, where the light source brightness in the backlit scene is at the first brightness level.

[0216] A standard camera is the camera of an electronic device that serves as a benchmark for judging the glare level of the camera on the electronic device under test. In other words, a standard camera can be a camera with good or low glare levels.

[0217] It should be noted that when acquiring the second image captured by the camera of the standard electronic device, the shooting conditions of the standard electronic device can be the first shooting conditions described above. That is, the first shooting conditions may include the exposure of the camera of the standard electronic device when shooting the target object, the target object, the first brightness of the light source corresponding to the target object, the environment of the standard electronic device during shooting, the posture and position of the standard electronic device during shooting, and the target object being located at the center of the shooting interface of the electronic device. It should also be noted that the first shooting conditions may include other conditions, such as the distance between the standard electronic device and the target object during shooting. The specific content of the third shooting conditions is not limited in the embodiments of this application.

[0218] In other words, the exposure of the camera of the electronic device under test when shooting the target object in the third shooting condition can be different from the exposure of the camera of the standard electronic device when shooting the target object in the first shooting condition, while all other shooting conditions are the same.

[0219] Specifically, in this application embodiment, when the brightness of the light source in the backlight scene is the first brightness, the specific implementation method for obtaining the second image captured by the camera of the standard electronic device can be referred to the specific implementation method in S301 above, and will not be repeated in this application embodiment.

[0220] S902, Align the brightness of the first image with the brightness of the second image to determine the target exposure parameters corresponding to the camera of the electronic device; the second image is an image acquired by the camera of the standard electronic device in a backlit scene with the brightness of the light source being the first brightness.

[0221] The second image can be the original image. The target exposure parameters corresponding to the camera of the electronic device are the same as the exposure parameters of the image acquired by the camera of the standard electronic device in a backlit scene when the brightness of the light source is the first brightness.

[0222] In some examples, aligning the brightness of the first image with the brightness of the second image to determine the target exposure parameters corresponding to the camera of the electronic device may include: determining the brightness value of the target region in the first image and the brightness value of the target region in the second image; the position and size of the target region in the first image are the same as the position and size of the target region in the second image; determining a first difference between the brightness value of the target region in the first image and the brightness value of the target region in the second image; and if the first difference is less than or equal to a first preset difference threshold, determining the current exposure parameters corresponding to the camera of the electronic device as the target exposure parameters.

[0223] If the first difference is greater than a first preset difference threshold, the current exposure parameters of the camera of the electronic device are adjusted to the first exposure parameters. In a backlit scene where the light source brightness is a first brightness, a seventh image captured by the camera of the electronic device is acquired based on the first exposure parameters; a second difference is determined between the brightness value of the target area in the seventh image and the brightness value of the target area in the second image; the position and size of the target area in the seventh image are the same as the position and size of the target area in the second image; if the second difference is less than or equal to the first preset difference threshold, the first exposure parameters are determined as the target exposure parameters.

[0224] It should be noted that if the second difference is greater than the first preset difference threshold, the above process can be repeated until the difference between the brightness value of the target area of ​​the newly captured image and the brightness value of the target area of ​​the second image is less than or equal to the first preset difference threshold.

[0225] The specific value of the first preset difference threshold can be determined according to the actual situation, and this application embodiment does not limit it.

[0226] In other examples, aligning the brightness of the first image with the brightness of the second image to determine the target exposure parameters corresponding to the camera of the electronic device may also include: determining the brightness value of the first channel of the target region in the first image and the brightness value of the first channel of the target region in the second image; the position and size of the target region in the first image are the same as the position and size of the target region in the second image; determining a third difference between the brightness value of the first channel of the target region in the first image and the brightness value of the first channel of the target region in the second image; and determining the current exposure parameters corresponding to the camera of the electronic device as the target exposure parameters if the third difference is less than or equal to a second preset difference threshold.

[0227] If the third difference is greater than the second preset difference threshold, the current exposure parameter corresponding to the camera of the electronic device is adjusted to the second exposure parameter; if the brightness of the light source in the backlight scene is the first brightness, the eighth image captured by the camera of the electronic device is obtained based on the second exposure parameter; the fourth difference between the brightness value of the first channel of the target area in the eighth image and the brightness value of the first channel of the target area in the second image is determined; the position and size of the target area in the eighth image in the first image are the same as the position and size of the target area in the second image in the second image; if the fourth difference is less than or equal to the second preset difference threshold, the second exposure parameter is determined as the target exposure parameter.

[0228] It should be noted that if the fourth difference is greater than the second preset difference threshold, the above process can be repeated until the difference between the brightness value of the target area of ​​the newly captured image and the brightness value of the target area of ​​the second image is less than or equal to the second preset difference threshold.

[0229] The specific value of the second preset difference threshold can be determined according to the actual situation, and this application embodiment does not limit it.

[0230] It should be noted that the first channel can be a green channel, or other channels, such as a red channel or a blue channel. This embodiment illustrates the use of a green channel as the first channel.

[0231] Specifically, in this embodiment of the application, the specific implementation method for aligning the brightness of the first image with the brightness of the second image to determine the target exposure parameters corresponding to the camera of the electronic device can be referred to the specific implementation method in S304 above, and will not be repeated in this embodiment of the application.

[0232] S903. When the brightness of the light source in a backlit scene is the second brightness, a third image captured by the camera of the electronic device is obtained based on the target exposure parameters; the second brightness is greater than the first brightness.

[0233] The third image can be the original image.

[0234] The second brightness can be the brightness of the light source that prevents glare when the camera of an electronic device is shooting under a light source in a backlit scene.

[0235] In some examples, the second brightness can be more than 5% of the total brightness of the light source in the backlit scene. For example, the second brightness can be 100% of the total brightness of the light source in the backlit scene.

[0236] The third image can be the original image of the target object captured by the camera of an electronic device in a backlit scene where the brightness of the light source is the second brightness.

[0237] In some examples, the third image can be an image captured of a target area within the target object; that is, the third image can include the target area corresponding to the target object. In other words, the target area in the third image can be an area with a high brightness value. For example, the target area in the third image can be the central area of ​​the third image.

[0238] It should be noted that when acquiring the third image captured by the camera of the electronic device, the shooting conditions of the electronic device can be the aforementioned fourth shooting conditions. The fourth shooting conditions may include the exposure of the electronic device's camera when shooting the target object (i.e., the adjusted exposure of the electronic device), the target object, the second brightness of the light source corresponding to the target object, the environment during standard electronic device shooting, the posture and position of the standard electronic device during shooting, and the target object being located at the center of the electronic device's shooting interface. It should also be noted that the fourth shooting conditions may include other conditions, such as the distance between the electronic device and the target object during shooting. The specific content of the fourth shooting conditions is not limited in the embodiments of this application.

[0239] Specifically, in this application embodiment, when the brightness of the light source in the backlit scene is the second brightness, the specific implementation method for obtaining the third image captured by the camera of the electronic device based on the exposure parameters can be referred to the specific implementation method in S305 above, and will not be repeated in this application embodiment.

[0240] It should be noted that, in a backlit scene where the light source brightness is the second brightness, before acquiring the third image taken by the camera of the electronic device based on the exposure parameters, a fourth image taken by the camera of the standard electronic device can be acquired first, where the light source brightness in the backlit scene is the second brightness.

[0241] The fourth image can be the original image.

[0242] It should be noted that when acquiring the fourth image captured by the camera of the standard electronic device, the shooting conditions of the standard electronic device can be the second shooting conditions described above. That is, the second shooting conditions may include the exposure of the camera of the standard electronic device when shooting the target object, the target object, the second brightness of the light source corresponding to the target object, the environment of the standard electronic device during shooting, the posture and position of the standard electronic device during shooting, and the target object being located at the center of the shooting interface of the electronic device. It should also be noted that the second shooting conditions may include other conditions, such as the distance between the standard electronic device and the target object during shooting. The specific types of the second shooting conditions included in this application embodiment are not limited.

[0243] In other words, the fourth shooting condition is the same as the second shooting condition.

[0244] Specifically, in this application embodiment, when the brightness of the light source in the backlight scene is the second brightness, the specific implementation method for obtaining the second image captured by the camera of the standard electronic device can be referred to the specific implementation method in S302 above, and will not be repeated in this application embodiment.

[0245] S904. Based on the unified brightness adjustment parameters, adjust the brightness of the third and fourth images respectively to obtain the fifth and sixth images after brightness adjustment; the fourth image is an image acquired by the camera of a standard electronic device in a backlit scene with the light source brightness at the second brightness.

[0246] The fifth image can be a JPG image, and the sixth image can be a JPG image.

[0247] In some examples, the brightness adjustment parameters may include gamma parameters. The above-mentioned brightness adjustment of the third and fourth images according to the uniform brightness adjustment parameters to obtain the brightness-adjusted fifth and sixth images may include: performing uniform gamma processing on the third and fourth images according to the uniform gamma parameters to obtain the brightness-adjusted fifth and sixth images.

[0248] Specifically, in this embodiment of the application, the brightness of the third image and the fourth image are adjusted according to a unified brightness adjustment parameter to obtain the fifth image and the sixth image after brightness adjustment. For the specific implementation method, please refer to the specific implementation method in S306 above. This will not be repeated in this embodiment of the application.

[0249] S905. Based on the fifth and sixth images, determine the degree of glare of the camera of the electronic device.

[0250] In some examples, determining the glare level of the camera of the electronic device based on the fifth and sixth images may include: determining the histogram corresponding to the fifth image and the histogram corresponding to the sixth image, respectively; and determining the glare level of the camera of the electronic device based on the histogram corresponding to the fifth image and the histogram corresponding to the sixth image.

[0251] Specifically, the specific implementation method for determining the glare level of the camera of the electronic device based on the fifth and sixth images in this application embodiment can be referred to the specific implementation methods in S307-S308 above, and will not be repeated in this application embodiment.

[0252] The solution in this application aligns the brightness of an image captured by the camera of an electronic device in a backlit scene with a light source brightness of a first brightness level, with the brightness of an image captured by a standard electronic device's camera in a backlit scene with a light source brightness of the first brightness level. This aligns the exposure level of the electronic device's camera with that of the standard electronic device's camera, resulting in target exposure parameters for the camera under brightness alignment. Consequently, when the glare level of the electronic device's camera is determined based on these target exposure parameters, an image captured by the camera in a backlit scene with a light source brightness of a second brightness level will have the same exposure level as an image captured by the standard electronic device's camera in a backlit scene with a light source brightness of the second brightness level. Therefore, when determining the glare level of the electronic device's camera based on the images captured by the electronic device's camera in a backlit scene with a light source brightness of the second brightness level and those captured by the standard electronic device's camera in a backlit scene with a light source brightness of the second brightness level, the influence of the electronic device's camera's exposure level on the glare level test can be eliminated. This improves the accuracy of the glare level measurement for the electronic device's camera.

[0253] Furthermore, the solution in this application involves uniformly adjusting the brightness of an image captured by the camera of an electronic device (based on target exposure parameters) in a backlit scene with a light source brightness of a second brightness (i.e., the third image) and an image captured by the camera of a standard electronic device in a backlit scene with a light source brightness of the second brightness (i.e., the fourth image). The glare level of the electronic device's camera is then determined based on the brightness-adjusted image. Since the brightness adjustment performed on the third and fourth images is uniform and does not involve white balance processing, the influence of the electronic device's white balance (i.e., white balance parameters) on the glare level test of the camera under test can be eliminated when determining the glare level of the electronic device's camera based on the uniformly brightness-adjusted image. This further improves the accuracy of the glare level determination of the electronic device's camera.

[0254] Corresponding to the methods in the foregoing embodiments, this application also provides a camera flare testing device. This camera flare testing device can be applied to electronic devices to implement the methods in the foregoing embodiments. The functions of this camera flare testing device can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0255] For example, Figure 10 shows a schematic diagram of a camera glare testing device 10. As shown in Figure 10, the camera glare testing device 10 may include: an acquisition module 1001, an alignment module 1002, an adjustment module 1003, and a determination module 1004, etc.

[0256] The acquisition module 1001 is used to acquire the first image captured by the camera of the electronic device when the brightness of the light source in the backlight scene is at a first brightness.

[0257] Alignment module 1002 is used to align the brightness of the first image with the brightness of the second image to determine the target exposure parameters corresponding to the camera of the electronic device; the second image is an image acquired by the camera of the standard electronic device in a backlit scene with the light source brightness being the first brightness.

[0258] The acquisition module 1001 is also used to acquire a third image captured by the camera of the electronic device based on the target exposure parameters when the brightness of the light source in the backlight scene is a second brightness; the second brightness is greater than the first brightness.

[0259] The adjustment module 1003 is used to adjust the brightness of the third image and the fourth image respectively according to the unified brightness adjustment parameters to obtain the fifth image and the sixth image after brightness adjustment; the fourth image is an image obtained by the camera of a standard electronic device in a backlit scene with the light source brightness at the second brightness.

[0260] The determining module 1004 is also used to determine the degree of glare of the camera of the electronic device based on the fifth and sixth images.

[0261] It should be understood that the division of units or modules (hereinafter referred to as units) in the above device is only a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, all units in the device can be implemented in software through processing element calls; all units can be implemented in hardware; or some units can be implemented in software through processing element calls, and some units can be implemented in hardware.

[0262] For example, each unit can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as a program in memory, invoked and executed by a processing element within the device. Furthermore, these units can be integrated in whole or in part, or implemented independently. The processing element described here can also be called a processor, which can be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each of the above units can be implemented through integrated logic circuits in the processor element or through software invoked by the processing element.

[0263] In one example, the unit in the above device may be one or more integrated circuits configured to implement the above methods, such as one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of at least two of these integrated circuit forms.

[0264] For example, when the units in the device can be implemented through a processing element scheduler, the processing element can be a general-purpose processor, such as a CPU or other processor capable of calling programs. Alternatively, these units can be integrated together to form a system-on-a-chip (SoC).

[0265] In one implementation, the units that implement the corresponding steps in the above methods can be implemented in the form of a processing element scheduler. For example, the device may include a processing element and a storage element, wherein the processing element calls a program stored in the storage element to execute the methods described in the above embodiments. The storage element may be a storage element located on the same chip as the processing element, i.e., an on-chip storage element.

[0266] In another implementation, the program for performing the above methods can be located on a storage element on a different chip than the processing element, i.e., an off-chip storage element. In this case, the processing element calls or displays the program from the off-chip storage element to the on-chip storage element to call and execute the methods described in the above method embodiments.

[0267] For example, embodiments of this application may also provide an apparatus, such as an electronic device, which may include a processor and a memory for storing processor-executable instructions. When the processor is configured to execute the aforementioned instructions, it causes the electronic device to implement the camera flare testing method described in the foregoing embodiments. The memory may be located within or outside the electronic device. Furthermore, the processor may include one or more processors.

[0268] In another implementation, the unit implementing each step of the above method can be configured as one or more processing elements, which can be disposed on the corresponding electronic device described above. These processing elements can be integrated circuits, such as one or more ASICs, one or more DSPs, one or more FPGAs, or combinations of these types of integrated circuits. These integrated circuits can be integrated together to form a chip.

[0269] For example, this application also provides a chip that can be applied to the aforementioned electronic device. The chip includes one or more interface circuits and one or more processors; the interface circuits and processors are interconnected via lines; the processor receives and executes computer instructions from the electronic device's memory through the interface circuits to implement the methods described in the above method embodiments.

[0270] This application also provides a computer program product, including computer instructions for operation of the electronic device described above.

[0271] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0272] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0273] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0274] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0275] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to related technologies, or all or part of the technical solutions, can be embodied in the form of a software product, such as a program. This software product is stored in a program product, such as a computer-readable storage medium, and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0276] For example, embodiments of this application may also provide a computer-readable storage medium storing computer program instructions thereon. When the computer program instructions are executed by an electronic device, the electronic device causes the electronic device to implement the camera flare testing method as described in the foregoing method embodiments.

[0277] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for testing camera flare intensity, characterized in that, The method, applied to an electronic device, includes: acquiring a first image captured by a camera of the electronic device when the brightness of the light source in a backlit scene is a first brightness; aligning the brightness of the first image with the brightness of a second image to determine the target exposure parameters corresponding to the camera of the electronic device; the second image is an image acquired by a camera of a standard electronic device when the brightness of the light source in the backlit scene is the first brightness; acquiring a third image captured by a camera of the electronic device based on the target exposure parameters when the brightness of the light source in the backlit scene is a second brightness; the second brightness is greater than the first brightness; adjusting the brightness of the third image and the fourth image respectively according to a unified brightness adjustment parameter to obtain a fifth image and a sixth image after brightness adjustment; the fourth image is an image acquired by a camera of the standard electronic device when the brightness of the light source in the backlit scene is the second brightness; and determining the glare level of the camera of the electronic device based on the fifth image and the sixth image.

2. The method according to claim 1, characterized in that, Aligning the brightness of the first image with the brightness of the second image to determine the target exposure parameters corresponding to the camera of the electronic device includes: determining the brightness value of the target area in the first image and the brightness value of the target area in the second image; the position and size of the target area in the first image are the same as the position and size of the target area in the second image; determining a first difference between the brightness value of the target area in the first image and the brightness value of the target area in the second image; and determining the current exposure parameters corresponding to the camera of the electronic device as the target exposure parameters when the first difference is less than or equal to a first preset difference threshold.

3. The method according to claim 2, characterized in that, The method further includes: when the first difference is greater than the first preset difference threshold, adjusting the current exposure parameter corresponding to the camera of the electronic device to the first exposure parameter; when the brightness of the light source in the backlight scene is the first brightness, acquiring a seventh image captured by the camera of the electronic device based on the first exposure parameter; determining a second difference between the brightness value of the target area in the seventh image and the brightness value of the target area in the second image; the position and size of the target area in the seventh image are the same as the position and size of the target area in the second image; when the second difference is less than or equal to the first preset difference threshold, determining the first exposure parameter as the target exposure parameter.

4. The method according to claim 1, characterized in that, Aligning the brightness of the first image with the brightness of the second image to determine the target exposure parameters corresponding to the camera of the electronic device includes: determining the brightness value of the first channel of the target area in the first image and the brightness value of the first channel of the target area in the second image; the position and size of the target area in the first image are the same as the position and size of the target area in the second image; determining a third difference between the brightness value of the first channel of the target area in the first image and the brightness value of the first channel of the target area in the second image; and determining the current exposure parameters corresponding to the camera of the electronic device as the target exposure parameters if the third difference is less than or equal to a second preset difference threshold.

5. The method according to claim 4, characterized in that, The method further includes: when the third difference is greater than the second preset difference threshold, adjusting the current exposure parameter corresponding to the camera of the electronic device to the second exposure parameter; when the brightness of the light source in the backlight scene is the first brightness, acquiring an eighth image captured by the camera of the electronic device based on the second exposure parameter; determining a fourth difference between the brightness value of the first channel of the target area in the eighth image and the brightness value of the first channel of the target area in the second image; the position and size of the target area in the eighth image in the first image are the same as the position and size of the target area in the second image in the second image; when the fourth difference is less than or equal to the second preset difference threshold, determining the second exposure parameter as the target exposure parameter.

6. The method according to claim 4 or 5, characterized in that, The first channel is the green channel.

7. The method according to any one of claims 1-5, characterized in that, Determining the glare level of the camera of the electronic device based on the fifth image and the sixth image includes: determining the histogram corresponding to the fifth image and the histogram corresponding to the sixth image, respectively; and determining the glare level of the camera of the electronic device based on the histogram corresponding to the fifth image and the histogram corresponding to the sixth image.

8. The method according to any one of claims 1-5, characterized in that, The first brightness is 2% of the total brightness of the light source in the backlit scene, and the second brightness is 100% of the total brightness of the light source in the backlit scene.

9. The method according to any one of claims 1-5, characterized in that, The brightness adjustment parameters include gamma parameters. The step of adjusting the brightness of the third image and the fourth image respectively according to the unified brightness adjustment parameters to obtain the brightness-adjusted fifth image and the sixth image includes: performing unified gamma processing on the third image and the fourth image according to the unified gamma parameters to obtain the brightness-adjusted fifth image and the sixth image.

10. The method according to any one of claims 1-5, characterized in that, The first image is the original image, the second image is the original image, the third image is the original image, and the fourth image is the original image.

11. An electronic device, characterized in that, The electronic device includes a processor and a memory for storing processor-executable instructions; the processor is configured to, when executing the instructions, cause the electronic device to perform the method as described in any one of claims 1 to 10.

12. A computer-readable storage medium having computer program instructions stored thereon; characterized in that, When the computer program instructions are executed by the electronic device, the electronic device performs the method as described in any one of claims 1 to 10.