Image processing method, device, apparatus, storage medium, chip system and program product
Patent Information
- Application Number
- CN202510571639.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]然而,在一些场景中,电子设备通过白平衡处理进行色彩校正时,色彩校正的准确性较差,使得电子设备拍摄得到的图像存在色彩偏差,影响用户的拍摄体验
[0096]应当理解的是,本申请的第二方面至第八方面与本申请的第一方面的技术方案相对应,各方面及对应的可行实施方式所取得的有益效果相似,不再赘述。
Smart Images

Figure CN123020995A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to image processing methods, devices, apparatuses, storage media, chip systems, and software products. Background Technology
[0002] Currently, electronic devices support increasingly powerful shooting capabilities. Furthermore, to capture color-accurate images, after the camera acquires the raw (RAW) image, the electronic device can first perform white balance processing on the RAW image. The purpose of white balance processing is to ensure that white objects in the scene appear correctly white, so that other objects in the scene also appear the correct colors. The image displayed by the electronic device is the white-balanced image.
[0003] However, in some scenarios, when electronic devices perform color correction through white balance processing, the accuracy of color correction is poor, resulting in color deviations in the images captured by the electronic devices, which affects the user's shooting experience. Summary of the Invention
[0004] This application provides an image processing method, device, apparatus, storage medium, chip system, and program product, applicable to the field of terminal technology. The electronic device can determine a more reasonable automatic white balance (AWB) white point, which accurately reflects the color of the light source. Based on this AWB white point, RAW images can be more accurately color-corrected, resulting in more realistic colors in the captured images and improving the user's shooting experience.
[0005] In a first aspect, embodiments of this application propose an image processing method. The method includes: applying the method to an electronic device, the electronic device including a first camera module, a second camera module, and a light source reflector; responding to a first operation, the first camera module acquires first image data, and the second camera module acquires second image data; the first image data includes data collected based on reflected light from the light source reflector; the second image data includes data collected based on reflected light from a photographed object; and based on the first image data, performing white balance processing on the second image data to obtain white balance-processed image data.
[0006] In this configuration, the first camera module and the second camera module can be the same camera module. If the first camera module and the second camera module are the same camera module, the first camera module (i.e., the second camera module) can be, for example, the target camera module described below. This camera module can be a front-facing camera module or a rear-facing camera module. If the first camera module and the second camera module are different camera modules, the first camera module can be the target camera module described below, and the second camera module can be the imaging camera module described below.
[0007] The data collected based on the reflected light from the light source reflector can also be understood as: image data or pixel data collected by the first camera module based on the reflected light from the light source reflector, which can be, for example, a RAW image. The data collected based on the reflected light from the subject can also be understood as: image data or pixel data collected by the second camera module based on the reflected light from the subject. The subject can also be understood as the object photographed by the electronic device. The subject can include, for example, people and / or objects.
[0008] White balance processing can also be called automatic white balance processing, or it can be understood as color correction based on the AWB algorithm. Furthermore, after obtaining the white-balanced image data, the electronic device can display that image data. For example, the electronic device can display a target image, which is derived from this image data. Alternatively, the electronic device may not display the image data; for example, it can store (e.g., in a gallery) the target image, which is determined based on this image data.
[0009] In the image processing method of this application, the light reflected by the light source reflector is light from the light source itself, and the reflectivity of the light source reflector is the same or similar for all wavelengths of the visible light spectrum, so that the reflected light from the light source reflector can accurately reflect the color of the light source. The purpose of white balance processing is to reduce the influence of the light source color on the color of the subject in the image. Therefore, by performing white balance processing on the second image data based on the image data corresponding to the light source light reflected by the light source reflector, the influence of the light source color on the color of the subject in the second image data can be reduced, helping to make the colors of the images displayed by electronic devices more realistic.
[0010] Furthermore, even if the subject does not contain gray, white, or off-white objects, meaning the light reflected from the subject cannot accurately reflect the color of the light source, the white balance processing of the image data can still be performed because the light reflected by the light source reflector can accurately reflect the color of the light source. This helps to make the colors of the images displayed by electronic devices more realistic.
[0011] In one possible implementation, white balance processing of the second image data is performed based on the first image data, including: determining a target point in a first color coordinate system based on the first image data, wherein the target point represents the point where the white object is located in the first color coordinate system, and the first color coordinate system represents the relationship between different color channels; and performing color correction on the second image data based on the target point to obtain the white balance processed image data.
[0012] The first color coordinate system can be the two-dimensional plane of R / G and B / G as described below. The target point can be the AWB white point as described below.
[0013] In this way, since the target point is determined based on the first image data, the first image data can accurately reflect the color of the light source, and the target point is used to represent the position of the white object in the two-dimensional plane of R / G and B / G, the difference between the target point and (1,1) can represent the degree of influence of the light source color on the object color in the image data. Therefore, the second image data can be color corrected based on the target point, and image data that is closer to the true color of the object can be obtained.
[0014] In one possible implementation, determining the target point in the first color coordinate system based on the first image data includes: determining the target point in the first color coordinate system based on the first image data and the second image data.
[0015] Similar to the second possible implementation described below, the electronic device can determine the target point using image data acquired based on the reflected light from the light source reflector and image data acquired based on the reflected light from the subject.
[0016] In this way, not only can the reflected light from the light source accurately reflect the color of the light source, but the reflected light from the subject may also contain reflected light that accurately reflects the color of the light source, and even more accurately, reflected light from the subject, such as a grayish-white object located close to the light source. Therefore, determining the target point based on the first and second image data, combined with the reflected light from different objects, can more accurately determine the target point, thereby helping to improve the white balance processing effect.
[0017] In one possible implementation, the first camera module and the second camera module are the same camera module; determining the target point in the first color coordinate system includes: determining multiple first coordinate points in the first color coordinate system based on the first image data; determining multiple second coordinate points in the first color coordinate system based on the second image data; and calculating the weighted average of the coordinates of the multiple first coordinate points and the multiple second coordinate points to obtain the target point.
[0018] Among them, the multiple first coordinate points are, for example, multiple ambient light statistical points in the first case below, such as some or all of the t ambient light statistical points below. The multiple second coordinate points are, for example, multiple imaging statistical points in the first case below, such as some or all of the s imaging statistical points.
[0019] In this way, for multiple first coordinate points corresponding to the first image data and multiple second coordinate points corresponding to the second image data, each point can reflect the color of the light source with different degrees of accuracy, and thus different weights can be assigned to each point to more accurately determine the target point.
[0020] In one possible implementation, the weight of a first coordinate point among a plurality of first coordinate points is determined based on one or more of the following: the brightness corresponding to the first coordinate point, the aggregation degree of the plurality of first coordinate points, or whether the first coordinate point is located in the gray area of the first color coordinate system; and / or, the weight of a second coordinate point among a plurality of second coordinate points is determined based on one or more of the following: the brightness corresponding to the second coordinate point, the distance between the second coordinate point and the average coordinate point, or whether the second coordinate point is located in the gray area of the first color coordinate system, wherein the average coordinate point is the average of the coordinates of the plurality of first coordinate points.
[0021] Here, the first coordinate point can be any one of multiple first coordinate points. The brightness corresponding to the first coordinate point can also be understood as the brightness of the image data corresponding to the first coordinate point. The image data corresponding to the first coordinate point is also the image data that determines the first coordinate point, such as the image data of a region in the segmented RAW image. The greater the brightness, the closer the corresponding position of the point may be to the light source, thus accurately reflecting the color of the light source, and therefore it can be assigned a greater weight; conversely, it can be assigned a smaller weight.
[0022] The greater the aggregation degree of the first coordinate point, the more uniform the color of the light source around the camera module and the simpler the light source in the shooting scene. Therefore, multiple first coordinate points can accurately reflect the color of the light source, and the weight of multiple first coordinate points can be increased.
[0023] Points located in the gray area can more accurately reflect the color of the light source, so the first coordinate point located in the gray area can be given greater weight, while the first coordinate point not located in the gray area can be given less weight.
[0024] The second coordinate point can be any of the multiple second coordinate points. The average coordinate point is determined based on multiple first coordinate points. Since these first coordinate points accurately reflect the color of the light source, the average coordinate point can be a coordinate point that is close to the accurate AWB white point. Therefore, among the multiple second coordinate points, the closer the second coordinate point is to the average coordinate point, the greater its weight can be assigned; conversely, the further away it is, the smaller its weight can be assigned. The influence of brightness and gray area on the weight of the second coordinate point can be found in the description at the first coordinate point.
[0025] In this way, we can consider various dimensions, assigning greater weight to coordinate points that accurately reflect the color of the light source and less weight to coordinate points that do not accurately reflect the color of the light source, thereby helping to determine more accurate target points.
[0026] In one possible implementation, the aggregation degree of multiple first coordinate points is the average distance between the multiple first coordinate points and the average coordinate point.
[0027] The method for determining the average distance is described below.
[0028] Thus, the smaller the average distance, the more compactly the multiple first coordinate points are distributed in the first color coordinate system, and the greater the aggregation of the first coordinate points; the larger the average distance, the more dispersed the multiple first coordinate points are distributed in the first color coordinate system, and the smaller the aggregation of the first coordinate points.
[0029] In one possible implementation, the first camera module and the second camera module are different camera modules; the first image data includes a first part of data and a second part of data, the first part of data including data collected based on reflected light from a light source reflector; the second part of data including data collected based on reflected light from the subject; determining the target point in the first color coordinate system includes: obtaining multiple third coordinate points in the second color coordinate system based on the first part of data, and obtaining multiple fourth coordinate points in the second color coordinate system based on the second part of data; obtaining multiple second coordinate points in the first color coordinate system based on the second image data; mapping the multiple third coordinate points in the first color coordinate system to obtain multiple fifth coordinate points in the first color coordinate system; and mapping the multiple fourth coordinate points in the first color coordinate system to obtain multiple sixth coordinate points in the first color coordinate system; calculating the weighted average of the coordinates of the multiple fifth coordinate points, the multiple sixth coordinate points, and the multiple second coordinate points to obtain the target point.
[0030] Among them, multiple third coordinate points in the second color coordinate system are, for example, Figure 17 In (a), there are g ambient light statistical points on a two-dimensional plane of R / G and B / G; multiple fourth coordinate points can be... Figure 17 In (a), there are h central statistical points on a two-dimensional plane of R / G and B / G. Multiple second coordinate points can be... Figure 17 In (a), there are k imaging statistics points on another two-dimensional plane of R / G and B / G.
[0031] Multiple fifth coordinate points can be g statistical points obtained by mapping g ambient light statistical points onto another two-dimensional plane of R / G and B / G; multiple sixth coordinate points can be h statistical points obtained by mapping h center statistical points onto another two-dimensional plane of R / G and B / G.
[0032] In this way, not only can the reflected light from the light source accurately reflect the color of the light source, but the reflected light from the subject may also contain reflected light that accurately reflects the color of the light source, and even more accurately, reflected light from the subject, such as a grayish-white object located close to the light source. By acquiring image data from different camera modules based on the reflected light from different objects, the target point can be determined more accurately, thus helping to improve the white balance processing effect.
[0033] In one possible implementation, the weight of a fifth coordinate point among multiple fifth coordinate points is determined based on one or more of the following: the brightness corresponding to the fifth coordinate point, the aggregation degree of multiple fifth coordinate points, or whether the fifth coordinate point is located in the gray area of the first color coordinate system; and / or, the weight of any coordinate point among multiple sixth coordinate points and multiple second coordinate points is determined based on one or more of the following: the brightness corresponding to any coordinate point, the distance between any coordinate point and the average coordinate point, or whether any coordinate point is located in the gray area of the first color coordinate system, wherein the average coordinate point is the average of the coordinates of multiple fifth coordinate points.
[0034] The fifth coordinate point can be any one of multiple fifth coordinate points. The method for determining the weights of multiple fifth coordinate points can refer to the method for determining the weights of multiple first coordinate points described above, or the method for determining the weights of ambient light statistical points described below. The method for determining the weights of multiple sixth coordinate points and multiple second coordinate points can refer to the method for determining the weights of multiple second coordinate points described above, or the method for determining the weights of other statistical points described below.
[0035] In this way, more weight can be assigned to coordinate points that can accurately reflect the color of the light source, and less weight can be assigned to coordinate points that cannot accurately reflect the color of the light source, making the determined target points more accurate.
[0036] In one possible implementation, the aggregation degree of multiple fifth coordinate points is the average distance between the multiple fifth coordinate points and the average coordinate point.
[0037] The method for determining the average distance is described below.
[0038] Thus, the smaller the average distance, the more compactly the distribution of multiple fifth coordinate points in the first color coordinate system, and the greater the aggregation degree of multiple fifth coordinate points; the larger the average distance, the more dispersed the distribution of multiple fifth coordinate points in the first color coordinate system, and the smaller the aggregation degree of multiple fifth coordinate points.
[0039] In one possible implementation, the electronic device is pre-configured with multiple first calibration points in a second color coordinate system corresponding to the first camera module, and multiple second calibration points in the first color coordinate system corresponding to the second camera module. The multiple first calibration points are determined by image data captured by the first camera module under multiple standard light sources, and the multiple second calibration points are determined by image data captured by the second camera module under multiple standard light sources. Multiple third coordinate points are mapped into the first color coordinate system to obtain multiple fifth coordinate points in the first color coordinate system; and multiple fourth coordinate points are mapped into the first color coordinate system to obtain multiple sixth coordinate points in the first color coordinate system, including: in multiple Among the first calibration points, the two first calibration points closest to the target coordinate point are determined. The target coordinate point is any one of multiple third coordinate points or multiple fourth coordinate points. The two first calibration points are calibration points determined under the first standard light source and the second standard light source. Among the multiple second calibration points, the two second calibration points corresponding to the two first calibration points are determined. The two second calibration points are calibration points determined under the first standard light source and the second standard light source. Based on the two second calibration points, the mapped target coordinate point after the target coordinate point is mapped to the first color coordinate system is determined. The first triangle formed by the target coordinate point and the two first calibration points and the second triangle formed by the mapped target coordinate point and the two second calibration points are similar triangles.
[0040] The multiple standard light sources include, for example, one or more of the following: D75 light source, D65 light source, D50 light source, TL84 light source, A light source, or H light source. The multiple first calibration points include, for example, one or more of the following: D75 calibration point, D65 calibration point, D50 calibration point, TL84 calibration point, A calibration point, or H calibration point. The multiple second calibration points include, for example, one or more of the following: D75' calibration point, D65' calibration point, D50' calibration point, TL84' calibration point, A' calibration point, or H' calibration point.
[0041] The target coordinate point is, for example, statistical point 1 as described below. The first and second standard light sources are, for example, the D65 light source and the D50 light source. The two first calibration points are, for example, the D65 calibration point and the D50 calibration point as described below. The two second calibration points are, for example, the D65' calibration point and the D50' calibration point as described below. The mapped target coordinate point is, for example, mapped statistical point 1' as described below.
[0042] The first triangle is, for example, the original triangle described below; the second triangle is, for example, the triangle formed by the D65' calibration point, the D50' calibration point, and the mapping statistics point 1' described below.
[0043] In this way, based on the differences between the calibration points in the two coordinate systems, the original color characteristics can be preserved while accurately mapping coordinate points in one coordinate system to the other. This helps to more accurately determine the target point based on multiple coordinate points in one coordinate system.
[0044] In one possible implementation, the field of view of the first camera module is greater than that of the second camera module.
[0045] For example, the first camera module is the camera module of an ultra-wide-angle camera, and the second camera module is the camera module of a main camera, etc.
[0046] In this way, even if the image data acquired by the first camera module based on the reflected light from the subject is the data used for imaging—that is, the first camera module is both an imaging camera module and a target camera module—the resulting image data after cropping can still meet the size required for imaging. This allows the electronic device to display images of a normal size.
[0047] In one possible implementation, the reflected light from the light source reflector includes: light rays from the light source reflected by the light source reflector; and / or, the reflected light from the subject includes: light rays from the light source reflected by the subject.
[0048] In one possible implementation, before the electronic device receives the first operation, the method further includes: launching a first application for capturing an image; and after obtaining the white-balanced image data, the method further includes: displaying the target image within a first interface of the first application based on the white-balanced image data.
[0049] The first application is an application capable of capturing images, such as a camera app or other shooting applications. The first interface is, for example, a preview interface of the first application. The target image is an image obtained based on image data after white balance processing. For example, after the electronic device obtains the image data after white balance processing, it can perform a series of post-processing steps on the white balance processed image data to obtain and display the target image.
[0050] Secondly, this application provides an electronic device, including: a first surface, a first camera module, and a light source reflector; wherein the light source reflector is located between the first surface and the first camera module; or, the light source reflector is disposed on the first surface; the light source reflector is a continuous ring or a discontinuous ring; the light source reflector is used to reflect light from a light source so that the reflected light from the light source enters the first camera module.
[0051] The first surface can be any surface of the first device, and can be the surface facing the lens assembly of the first camera module. The first camera module can be the target camera module described below, such as camera module 204. The light source reflector can be ring-shaped to reflect light from various angles. The light source reflector can also be a discontinuous ring, or can be understood as being spaced out, etc.
[0052] In this way, the light source reflector is located between the first surface and the first camera module, so that the user can use the electronic device without touching the light source reflector. On the one hand, this does not affect the user's experience, and on the other hand, it helps to perform white balance processing more accurately, which helps the electronic device display more realistic images and improves the user's shooting and visual experience.
[0053] When the light source reflector is placed on the first surface, it can reflect more reflected light, which helps to increase the effective signal acquired by the camera module and improve the signal-to-noise ratio.
[0054] In one possible implementation, the first surface is a back panel or a screen.
[0055] The first surface can be understood as the back panel, which is the surface of the back panel away from the screen. The first camera module can be a rear camera module. The screen is, for example, a display screen 210, and the first surface can be the screen surface, such as the screen surface touched by the user when using the device. The first camera module can be a front camera module.
[0056] In one possible implementation, the backplate includes a protective plate and a rear shell, with the first surface being the plane where the protective plate is located.
[0057] The protective plate can be a lens cover 203; the rear cover can be a rear cover 202.
[0058] In this way, the light reflected by the light source reflector can enter the first camera module to a greater extent.
[0059] In one possible implementation, the light source reflector is a discontinuous ring shape, comprising: the light source reflector includes multiple spaced reflective strips, the multiple reflective strips are arranged around the central axis of the lens assembly of the first camera module, and no reflective strip is provided at the corresponding position of any reflective strip among the multiple reflective strips, the corresponding position being a position symmetrical about the central axis to any reflective strip.
[0060] This ensures that the corresponding positions of the reflective strips do not block the light rays that the reflective strips can reflect, allowing each reflective strip to function as intended. Figure 12 A similar method of reflecting light from the light source allows electronic devices to capture a wider range of light reflected by the light source reflector, facilitating the acquisition of more pixel data corresponding to the light source and thus determining a more reasonable AWB white point.
[0061] In one possible implementation, the light source reflector is a discontinuous ring shape, comprising: a reflective strip arranged around the central axis of the lens assembly of the first camera module, the reflective strip being part of a continuous ring-shaped object, and the two ends of the reflective strip not being connected together.
[0062] The concept of a continuous ring-shaped object is introduced to more clearly illustrate the shape of the light source reflector; however, this object may not be present in the actual device. When the light source reflector includes a reflective strip, for example, with... Figure 11 Similar to reflective strip 1 in the image.
[0063] In this case, electronic devices are combined Figure 15 In (a) the ambient light region 1502 may not be a shape that surrounds the imaging region 1501, but only a portion of it, such as only the area directly below the woman. This is because when the light source reflector includes a reflective strip, the reflective strip may not be able to reflect the area of the light source light around the first camera module, so that the ambient light region 1502 does not surround the imaging region 1501.
[0064] In one possible implementation, the light source reflector includes a second surface for reflecting light from the light source and allowing the reflected light to enter the first camera module; a first axis passes through the plane containing the second surface and is perpendicular to the lens assembly of the first camera module.
[0065] The second surface can be, for example, the inner surface of the ring or the outer surface of the ring. The first axis is any axis perpendicular to the lens assembly of the first camera module.
[0066] This helps the second surface reflect light from the light source into the lens assembly of the first camera module.
[0067] In one possible implementation, the second surface faces the lens assembly of the first camera module.
[0068] Similar to the first type of light source reflector described below, the second surface (inner ring) faces the lens assembly. Alternatively, similar to the third type of light source reflector, the second surface (outer ring) faces the lens assembly.
[0069] This helps the second surface reflect light from the light source into the lens assembly of the first camera module.
[0070] In one possible implementation, the reflector of the light source has a consistent reflectivity across all bands of the visible light spectrum.
[0071] Consistency can be understood as being the same or close (e.g., the difference is less than a certain threshold).
[0072] This allows the light reflected by the light source reflector to accurately reflect the color of the light source, which helps to improve the effect of white balance processing.
[0073] In one possible implementation, the light source reflector satisfies one or more of the following: the light source reflector is a white or gray reflector; the light source reflector is a mirrored object; or, part or all of the light source reflector is made of a frosted semi-transparent material.
[0074] Among them, the frosted semi-transparent part can be, for example, frosted glass or other glass that is not completely transparent, or other white, gray or grayish-white semi-transparent objects, so that it can reflect light to a greater extent.
[0075] In this way, the reflectivity of the light source reflector is consistent across all wavelengths of the visible light spectrum, thus enabling the reflected light to accurately reflect the color of the light source.
[0076] In one possible implementation, the electronic device further includes at least one second camera module, the lens assembly of which is oriented in the same or opposite direction to the lens assembly of the first camera module.
[0077] For example, both the first and second camera modules can be either rear-facing or front-facing. Alternatively, the first camera module can be a front-facing camera module, and the second camera module can be a rear-facing camera module. Or, the first camera module can be a rear-facing camera module, and the second camera module can be a front-facing camera module, etc.
[0078] Thirdly, a camera device is provided, comprising: a first camera module and a light source reflector, the light source reflector being disposed on one side of the light-receiving surface of the first camera module; the light source reflector including a second surface, the second surface being a surface for reflecting light from a light source and allowing the reflected light from the light source to enter the first camera module; a first axis passing through the plane containing the second surface, the first axis being perpendicular to the lens assembly of the first camera module; the light source reflector being used to reflect light from a light source so that the reflected light from the light source enters the first camera module.
[0079] The camera device can be understood as any device with camera function, or as an application to a device with camera function.
[0080] In one possible implementation, the second surface faces the lens assembly of the first camera module.
[0081] In one possible implementation, the light source reflector is either a continuous ring or a discontinuous ring.
[0082] In one possible implementation, the light source reflector is a discontinuous ring shape, comprising: the light source reflector includes multiple spaced reflective strips, the multiple reflective strips are arranged around the central axis of the lens assembly of the first camera module, and no reflective strip is provided at the corresponding position of any reflective strip among the multiple reflective strips, the corresponding position being a position symmetrical about the central axis to any reflective strip.
[0083] In one possible implementation, the light source reflector is a discontinuous ring shape, comprising: a reflective strip arranged around the central axis of the lens assembly of the first camera module, the reflective strip being part of a continuous ring-shaped object, and the two ends of the reflective strip not being connected together.
[0084] In one possible implementation, the reflector of the light source has a consistent reflectivity across all bands of the visible light spectrum.
[0085] In one possible implementation, the light source reflector satisfies one or more of the following: the light source reflector is a white or gray reflector; the light source reflector is a mirrored object; or, part or all of the light source reflector is made of a frosted semi-transparent material.
[0086] In one possible implementation, the camera device further includes at least one second camera module, the lens assembly of which is oriented in the same or opposite direction to the lens assembly of the first camera module.
[0087] Fourthly, embodiments of this application provide an image processing apparatus, which may be an electronic device or a chip or chip system within an electronic device. The image processing apparatus may include a first camera module, a second camera module, a light source reflector, and a processing unit. When the image processing apparatus is an electronic device, the processing unit may be a processor. The image processing apparatus may further include a storage unit, which may be a memory. The storage unit stores instructions, and the processing unit executes the instructions stored in the storage unit to cause the electronic device to implement an image processing method described in the first aspect or any possible implementation of the first aspect. When the image processing apparatus is a chip or chip system within an electronic device, the processing unit may be a processor and may process image data acquired by the first and second camera modules (such as white balance processing mentioned above). The processing unit executes the instructions stored in the storage unit to cause the electronic device to implement an image processing method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (e.g., a register, cache, etc.) or a storage unit located outside the chip within the electronic device (e.g., a read-only memory, random access memory, etc.).
[0088] For example, the processing unit is used to perform white balance processing on the second image data based on the first image data to obtain white balance processed image data.
[0089] Fifthly, embodiments of this application provide an electronic device including a processor and a memory, the memory for storing code instructions, and the processor for executing the code instructions to perform the methods described in the first aspect or any possible implementation of the first aspect.
[0090] In addition, the electronic device may also include a first camera module, a second camera module, and a light source reflector;
[0091] The light source reflector is used to reflect light from the light source; the first camera module is used to acquire first image data, which includes data collected based on the reflected light from the light source reflector; the second camera module is used to acquire second image data, which includes data collected based on the reflected light from the light source reflector; the first camera module and the second camera module are the same camera module, or the first camera module and the second camera module are different camera modules.
[0092] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0093] In a seventh aspect, embodiments of this application provide a computer program product including a computer program, which, when run on a computer, causes the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0094] Eighthly, this application provides a chip or chip system including at least one processor and a communication interface, the communication interface and the at least one processor being interconnected via a circuit, the at least one processor being used to run computer programs or instructions to perform the methods described in the first aspect or any possible implementation thereof. The communication interface in the chip may be an input / output interface, pins, or circuits, etc.
[0095] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).
[0096] It should be understood that the second to eighth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0097] Figure 1 A schematic diagram illustrating the process of previewing and capturing images using an electronic device;
[0098] Figure 2 This is a schematic diagram of the structure of an electronic device;
[0099] Figure 3 This is a partial breakdown diagram of an electronic device;
[0100] Figure 4 This is a schematic diagram of the lens cap plate.
[0101] Figure 5 This is a schematic diagram of a color correction process based on the AWB algorithm.
[0102] Figure 6 This is a schematic diagram illustrating the contrast of colors in an image.
[0103] Figure 7 A schematic diagram illustrating the location of the light source reflector provided in an embodiment of this application;
[0104] Figure 8 A schematic diagram of a light source reflector of a first shape provided in an embodiment of this application;
[0105] Figure 9 A cross-sectional view of a light source reflector of a first shape provided in an embodiment of this application;
[0106] Figure 10 A schematic diagram of the light source for the lens assembly provided in an embodiment of this application;
[0107] Figure 11 A schematic diagram of a light source reflector of a second shape provided in an embodiment of this application;
[0108] Figure 12 A side view of a light source reflector of a second shape provided in an embodiment of this application reflecting light from a light source;
[0109] Figure 13 A schematic diagram of a third shape of light source reflector provided in an embodiment of this application;
[0110] Figure 14 A cross-sectional view of a light source reflector of a third shape provided in an embodiment of this application;
[0111] Figure 15A schematic diagram provided in this application embodiment for comparing the RAW image obtained by the target camera module with the target image to be displayed;
[0112] Figure 16 A schematic diagram illustrating the process of determining AWB white points when the target camera module is an imaging camera module, as provided in this embodiment of the application;
[0113] Figure 17 A schematic diagram illustrating the process of determining AWB white points when the target camera module is not an imaging camera module, as provided in this embodiment of the application;
[0114] Figure 18 A schematic diagram illustrating a statistical point mapping process provided in an embodiment of this application;
[0115] Figure 19 A schematic diagram provided for illustrating the trend of statistical point weight changes in an embodiment of this application;
[0116] Figure 20 A flowchart illustrating a method for determining the weights corresponding to statistical points, provided in an embodiment of this application;
[0117] Figure 21 A schematic diagram of the function curve showing the functional relationship between the initial weight 1 and the average distance provided in the embodiments of this application;
[0118] Figure 22 A flowchart illustrating another method for determining the weights corresponding to statistical points, provided in an embodiment of this application;
[0119] Figure 23 A schematic diagram illustrating the interaction between the software and hardware of an electronic device provided in an embodiment of this application;
[0120] Figure 24 A schematic block diagram of the hardware architecture of the electronic device provided in the embodiments of this application;
[0121] Figure 25 This is a schematic block diagram of an image processing apparatus provided in an embodiment of this application. Detailed Implementation
[0122] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:
[0123] 1. White balance
[0124] White balance is a technique used in photography and videography to correct the colors in images. Its purpose is to make white appear neutral under different light sources, thus ensuring that other colors in the image are accurately represented.
[0125] It's understandable that different light sources (such as sunlight, high color temperature fluorescent lamps, and incandescent lamps) have different colors, resulting in different hues in an image. For example, incandescent light might make an image appear yellowish, while high color temperature fluorescent light might make it appear bluish. White balance corrects color by adjusting the proportions of red, green, and blue in an image.
[0126] 2. Field of view (FOV)
[0127] The angle between the two edges of the lens assembly, which is the maximum range through which the image of the subject can pass through the lens assembly, is called the field of view.
[0128] 3. 7500 Kelvin (K) Daylight (D75)
[0129] Standard daylight with a color temperature of 7500K.
[0130] 4. 6500K daylight (daylight 6500K, D65)
[0131] Standard daylight with a color temperature of 6500K.
[0132] 5. 5000K daylight (daylight 5000K, D50)
[0133] Standard daylight with a color temperature of 5000K.
[0134] 6. Triphosphor lamp 84 (TL84)
[0135] A common fluorescent light source, widely used in commercial lighting environments, with a color temperature typically around 4000K.
[0136] 7. Type A incandescent lamp (A)
[0137] A standard incandescent light source with a color temperature of 2856K is typically used to simulate home lighting conditions.
[0138] 8. Horizon light (H)
[0139] Represents the light conditions at sunrise or sunset; the color temperature is usually low, around 2300K.
[0140] 9. Two-dimensional planes of R / G and B / G
[0141] The R / G and B / G two-dimensional plane is a tool for analyzing and processing color information. This plane represents the relationship between different color channels in an image. In this two-dimensional plane, the horizontal axis is usually represented by R / G, and the vertical axis is usually represented by B / G.
[0142] R / G can be understood as the ratio of the intensity of the red channel to the intensity of the green channel. It is used to measure the intensity of red relative to green in an image. B / G can be understood as the ratio of the intensity of the blue channel to the intensity of the green channel. It is used to measure the intensity of blue relative to green in an image.
[0143] 10. Gray area on the two-dimensional plane of R / G and B / G
[0144] Also known simply as the gray area, it typically refers to a near-neutral gray region on the two-dimensional plane of R / G and B / G. In the gray area, the intensities of the red, green, and blue channels are relatively similar, forming a state of equilibrium.
[0145] For example, the center of the gray area can be located at (1, 1), or, due to the different characteristics of various image sensors (e.g., different spectral response curves, leading to different sensitivities in different color channels, which may cause the R / G and B / G ratios to deviate from 1), the center of the gray area may not be located at (1, 1). In practical applications, due to the influence of noise, lighting variations, and other factors, neutral gray pixels in a real image may not fall precisely at the center position. Therefore, the gray area is usually defined as a tolerance range around the center position. For example, to better reflect deviations under natural lighting conditions, an ellipse can be used to define the gray area, the lengths of which can be determined based on empirical data or standard deviation. This elliptical region can be understood as the gray area.
[0146] It should be understood that in practical applications, the gray area can also be determined in other ways, and the gray area can also be a region of other shapes. This application does not specifically limit this.
[0147] 11. Other terms
[0148] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order of execution. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.
[0149] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0150] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.
[0151] 12. Electronic equipment
[0152] The electronic devices in this application embodiment may include handheld devices with image processing functions, vehicle-mounted devices, etc. For example, some electronic devices include: mobile phones, tablets, PDAs, laptops, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving vehicles, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to a wireless modem, in-vehicle devices, wearable devices, terminal devices in 5G networks, or future evolution of public land mobile communication networks. Terminal devices in a network (PLMN), etc., are not limited to this in the embodiments of this application.
[0153] By way of example and not limitation, in this embodiment, the electronic device can also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for devices that utilize wearable technology to intelligently design and develop everyday wearables, such as glasses, gloves, watches, clothing, and shoes. Wearable devices are portable devices that are worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not merely hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are feature-rich, large in size, and can achieve complete or partial functions without relying on a smartphone, such as smartwatches or smart glasses, as well as those that focus on a specific type of application function and require the use of other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0154] Furthermore, in this embodiment of the application, the electronic device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-to-object interconnection.
[0155] The electronic devices in the embodiments of this application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent, or user device, etc.
[0156] In this embodiment, the electronic device or various network devices include a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux, Unix, Android, iOS, or Windows. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0157] With the development of terminal technology, the shooting functions of electronic devices are becoming increasingly powerful. Electronic devices support capturing images in multiple shooting modes.
[0158] For example, Figure 1 This is a schematic diagram illustrating the process of previewing and capturing images using an electronic device.
[0159] like Figure 1 As shown in (a), this interface can be understood as a desktop. The desktop contains multiple icons, such as icon 101 for the camera application. This is how it appears on electronic devices. Figure 1 When the interface shown in (a) is displayed, the user input operation (such as a click operation) on icon 101 is received.
[0160] In response to the user's input on icon 101, the electronic device can launch the camera application and display... Figure 1The interface shown in (b) is a preview interface in portrait shooting mode. This interface can be understood as a preview window 102, a shooting control 103, and a thumbnail control 104. The preview window 102 displays a real-time preview image captured by the electronic device through the camera.
[0161] When electronic devices display Figure 1 When the interface shown in (b) is accessed, the electronic device receives an input operation (such as a click) from the user on the shooting control 103. In response to this input operation, the electronic device can capture a target image and display it. Figure 1 The interface shown in (c) is as follows. This interface includes: a preview window 102, a shooting control 103, and a thumbnail control 104.
[0162] It should be understood that Figure 1 (c) and Figure 1 The interface shown in (b) is similar. The difference is that... Figure 1 In (c), the icon of the thumbnail control 104 is a thumbnail of the target image captured above.
[0163] On electronic device display Figure 1 When the interface shown in (c) is accessed, and the user input operation on the thumbnail control 104 is received, such as a click operation, the electronic device displays... Figure 1 The interface (d) in the image is the one that displays the captured target image, which is image 105.
[0164] It should be understood that Figure 1 This is merely an example. In actual application scenarios, the shooting mode selected by the electronic device may be other, and the camera application may be launched in other ways. This application does not impose any specific limitations on this.
[0165] It is understandable that electronic devices can be equipped with one or more cameras (i.e., two or more). For example, to enhance shooting performance, electronic devices typically have multiple cameras, such as a main camera, an ultra-wide-angle camera, and a telephoto camera. Furthermore, electronic devices can use different cameras to capture images in different shooting modes.
[0166] In addition, multiple cameras in electronic devices may include a front camera and a rear camera to meet users' shooting needs in different scenarios such as selfies and photos taken by others.
[0167] The following section uses a mobile phone as an example, with multiple cameras, to illustrate the structure of an electronic device.
[0168] Figure 2This is a structural schematic diagram of a device 200. (Example) Figure 2 As shown, the device 200 includes a housing 20. The housing 20 includes a middle frame 201 and a rear cover 202. The middle frame 201 and the rear cover 202 are connected and form the structural frame of the device 200.
[0169] A lens cover 203 can be fixedly or detachably connected to the rear cover 202. The lens cover 203 can be used to protect the lens assembly of the camera module. Light can also reach the lens through the lens cover 203.
[0170] For example, refer to Figure 3 , Figure 3 This is a partial exploded view of device 200. Device 200 includes a mid-frame 201, a back cover 202, and a display screen 210.
[0171] The rear cover 202 is installed on one side of the middle frame 201, and the display screen 210 is installed on the middle frame 201 on the side away from (or relative to) the rear cover 202. The display screen 210, the middle frame 21, and the rear cover 22 together form the receiving space of the device 200 (not shown in the figure).
[0172] The containment space houses multiple camera modules and a support member 209. The support member 209 can be used to fix and support the multiple camera modules.
[0173] It should be understood that Figure 2 The shapes of the components shown are for illustrative purposes only. In actual applications, these components may have other shapes. For example, the support 209 only needs to be able to fix and support multiple camera modules without blocking light from entering the lens assembly. Figure 2 This does not constitute a limitation on the embodiments of this application.
[0174] The camera module can be understood as the core component of a camera, used for capturing and initially processing image data. A camera module may include an image sensor, lens assembly, image signal processor (ISP), and filters. Detailed structures of camera modules can be found in relevant field materials and will not be elaborated upon here.
[0175] The multiple camera modules include, for example, camera module 204, camera module 205, camera module 206, camera module 207, and camera module 208. These multiple camera modules may include a front-facing camera module and a rear-facing camera module. The front-facing camera module is typically positioned on the side facing the electronic device's display screen; while the rear-facing camera module is typically positioned on the side facing the back panel of the electronic device.
[0176] It is understood that each of the multiple camera modules includes a lens assembly and an image sensor. The lens assembly may consist of one or more stacked lenses (such as lenses).
[0177] To allow light to pass sequentially through the lens cover 203 and the support member 209 to reach the lens assembly and image sensor of each camera module, the lens cover 203 and the support member 209 may include the same number of through holes as the camera modules. Furthermore, a transparent cover may be provided at each through hole of the lens cover 203.
[0178] Still combined Figure 3 In some possible implementations, decorative rings (or decorative elements) are also provided at multiple through-holes of the lens cover 203. The decorative rings can also be simply referred to as deco. The deco may be made of materials such as metal and typically has no actual optical function, serving only a decorative purpose. The deco can be a ring-shaped object and can be detachably or fixedly connected to the lens cover 203; alternatively, the deco can also be a ring-shaped coating.
[0179] It should be understood that the decorative rings and camera modules can be matched one-to-one. For example... Figure 4 As shown, the multiple through holes in the lens cover 203 correspond one-to-one with multiple camera modules, allowing light to reach each camera module through the through holes. Each of the multiple through holes may also be provided with a decorative ring. For example, decorative rings 301, 302, 303, 304, and 305.
[0180] Alternatively, the decorative rings may not correspond one-to-one with the camera modules. For example, multiple cameras can share a single decorative ring. Alternatively, a decorative ring can be placed around the lens cover 203.
[0181] The electronic device can capture images (including preview images) using a camera module. For example, the lens assembly in the camera module can focus light onto an image sensor; the image sensor can convert the acquired light signal into an electrical signal; the image ISP can be used to process the raw image data output by the image sensor, such as a RAW image, for example, performing noise reduction, white balance processing, etc. Subsequently, the electronic device can further process the image output by the ISP to obtain the target image (e.g.,...). Figure 1 (Preview image or image 105 in the image).
[0182] White balance processing is used to correct the colors of an image. Currently, most electronic devices support AWB functionality.
[0183] It's understandable that the color temperature of a light source affects the tone of a captured image. For example, incandescent light sources might make an image appear yellowish, while fluorescent light might make it appear bluish. The ISP in the camera module can analyze the color information in the RAW image using the AWB algorithm to determine the lighting conditions (such as the color of the light source) in the shooting scene. Based on the analysis results, the gain of the red, green, and blue (RGB) channels can then be adjusted to correct the image's color.
[0184] For example, Figure 5 This is a schematic diagram of a color correction process based on the AWB algorithm.
[0185] like Figure 5 As shown in (a), the electronic device acquires a RAW image and can divide the RAW image into multiple regions, such as into multiple rectangular regions of equal area.
[0186] Assume there are n×m regions after segmentation. Each of the n×m rectangular regions contains multiple pixels, and each pixel contains a color channel value: red (R), green (G), or blue (B).
[0187] like Figure 5 As shown in (b), taking any region (such as region 1) out of an n×m rectangular region as an example, region 1 includes multiple pixels. Each pixel may include one R, G, or B. The electronic device calculates the RGB average values corresponding to region 1 based on the R, G, or B of each pixel in region 1: R', B', and G'. Wherein, R' is the average of all R values in region 1; B' is the average of all B values in region 1; and G' is the average of all G values in region 1.
[0188] For example, suppose region 1 contains a values of R: R1, R2, ..., R a Then R' = R sum / a;R sum Let R1, R2, ..., R a The sum of , where a is a positive integer.
[0189] Assume region 1 contains c values of G: G1, G2, ..., G c Then G' = G sum / c;G sum Let G1, G2, ..., G c The sum of these, where c is a positive integer.
[0190] Assume region 1 contains d values of B: B1, B2, ..., B d Then B' = B sum / d;B sum Let B1, B2, ..., B d The sum of d, where d is a positive integer.
[0191] Based on the average RGB values corresponding to region 1, the coordinates (R' / G', B' / G') of region 1 on the two-dimensional plane of R / G and B / G can be determined. Here, R' / G' is the ratio of R' to G'; B' / G' is the ratio of B' to G'.
[0192] like Figure 5 As shown in (c), by traversing each region in the n×m rectangular regions in the above manner, the RGB average value corresponding to each region in the n×m rectangular regions can be obtained. Then, the coordinates of each region on the two-dimensional plane of R / G and B / G can be determined, resulting in a total of n×m coordinates. Mapping these n×m coordinates onto the two-dimensional plane of R / G and B / G yields n×m points, which are called n×m statistical points.
[0193] Electronic devices can determine an AWB white point based on n×m statistical points. The coordinates of the AWB white point are the weighted sum of the coordinates of the n×m statistical points. The AWB white point is used for color correction of RAW images.
[0194] It's understandable, combined Figure 5 In (c), the two-dimensional plane of R / G and B / G includes a gray area. Among the n×m statistical points, some may fall into the gray area, and some may not. The electronic device can assign a weight to each of the n×m statistical points. The statistical points falling into the gray area have relatively larger weights, while the statistical points not falling into the gray area have relatively smaller weights.
[0195] A gray area can be understood as a region that is close to neutral gray. Neutral gray can also be understood as having no color (gray, white, or off-white, etc.). Therefore, in the n×m regions of a RAW image, the regions corresponding to the statistical points that fall into the gray area are likely close to neutral gray. That is, the objects shown in these regions are likely to be objects that are close to neutral gray.
[0196] Since neutral gray objects (i.e., colorless objects) can reflect the color of the light source, statistical points falling into the gray area may better reflect the color of the light source. Therefore, statistical points falling into the gray area can be given greater weight.
[0197] Electronic devices can perform color correction on RAW images based on AWB white points.
[0198] For example, suppose the coordinates of the AWB white point are (e, f), where e represents R / G and f represents B / G. Since the AWB white point should correspond to a white object, the electronic device can adjust both e and f to 1. That is, e × 1 / e and f × 1 / f to correct the AWB white point to neutral white.
[0199] Here, 1 / e and 1 / f are the adjustment factors. The electronic device can correct the color of each pixel in the RAW image based on 1 / e and 1 / f. That is, the electronic device can adjust all R values in the RAW image by 1 / e and all B values by 1 / f, resulting in the corrected RAW image. For example, assuming e is 0.5 and f is 1.2, the electronic device can adjust all R values in the RAW image by 1 / 0.5 and all B values by 1 / 1.2.
[0200] Since e and f can represent the deviation of the light source color from the image color, color correction based on 1 / e and 1 / f can reduce the color deviation of the image, so that the target image captured by the electronic device can present more realistic colors.
[0201] Combination Figure 5 As can be seen from the color correction process shown, the selection of the AWB white point is crucial to the color correction effect.
[0202] Typically, the AWB white point needs to accurately reflect the color of the light source in the shooting scene (or environment). The higher the accuracy of the AWB white point in reflecting the color of the light source, the higher the accuracy of color correction based on the AWB white point.
[0203] Since only colorless objects in the shooting scene can accurately reflect the color of the light source, the color of the light source must be extracted from the colorless objects in the shooting scene. That is, when there are colorless objects in the shooting scene, the electronic device can determine a more reasonable AWB white point based on the image data corresponding to the colorless objects. A more reasonable AWB white point can more accurately reflect the color of the light source.
[0204] However, due to the limited field of view (FOV) of the lens assembly in electronic devices, the area captured by the camera module may not contain colorless objects. This may cause the electronic device to determine an unreasonable white point (AWB), which may not accurately reflect the color of the light source, resulting in a large deviation in the color correction of the image by the electronic device.
[0205] For example, combining Figure 5 When there are no colorless objects in a RAW image, the n×m statistical points may not accurately reflect the color of the light source, and the AWB white points determined based on the n×m statistical points may also fail to accurately reflect the color of the light source. Therefore, the error in color correction of RAW images based on AWB white points is relatively large.
[0206] Therefore, when the area captured by the camera module does not contain colorless objects, the color correction error may be large, resulting in a significant color deviation in the captured target image. For example, combining... Figure 6The two images were taken under the same conditions. The difference is that image (b) does not include gray objects (colorless objects). This results in a larger color deviation in image (b) compared to image (a).
[0207] In view of this, embodiments of this application provide an image processing method in which a target lens assembly in an electronic device may be correspondingly provided with a colorless light source reflector (including a mirror-like or white translucent material). The light source reflector may, for example, be located at the deco position, so that it can reflect light from the shooting scene into the target lens assembly. The electronic device can determine the AWB white point based on the pixel data corresponding to the light source.
[0208] Because the light source reflector is a colorless object, it has the same reflectivity for all wavelengths of visible light. This ensures that the light reflected from the light source into the target lens assembly accurately reflects the color of the light source. Therefore, the AWB white point determined based on the pixel data corresponding to this light source can accurately reflect the color of the light source, thereby improving the color correction effect.
[0209] It is understood that, in the embodiments of this application, a colorless light source reflector is an object with the same reflectivity across all wavelengths of the visible light spectrum. This sameness can be completely identical or the difference can be less than a certain threshold. Furthermore, a colorless light source reflector can be, but is not limited to: an opaque object that is gray, white, or off-white; a mirrored object; or a white translucent object (or a translucent object made of frosted material, such as frosted glass). This application does not limit the material or specific color of the light source reflector.
[0210] To facilitate understanding of the embodiments of this application, the light source reflector will be described in detail below.
[0211] In one possible implementation, the light source reflector may be disposed on the lens cover plate 203.
[0212] For example, first refer to Figure 3 Taking the target lens assembly as the lens assembly in the camera module 204 as an example, and then combining it with Figure 4 The light source reflector can be positioned at the decorative ring 301. For example, the light source reflector can be connected to the decorative ring 301. Alternatively, it can still be combined with... Figure 4 If the lens cover 203 does not have a decorative ring 301, then the light source reflector can be located at the through hole where the decorative ring 301 is located. Furthermore, the light source reflector can be fixedly connected to the lens cover 203 or detachably connected.
[0213] For example, such as Figure 7 As shown in (a) above, compared to Figure 4 , Figure 7In (a), a light source reflector 701 is also provided on the lens cover 203 (or decorative ring 301). The light source reflector 701 is annular, and when the decorative ring 301 is provided on the lens cover 203, the light source reflector 701, the decorative ring 301, and the lens assembly in the camera module 204 are coaxial.
[0214] Furthermore, when a decorative ring 301 is provided on the lens cover plate 203, one end of the light source reflector 701 can be fixedly or detachably connected to the decorative ring 301. Alternatively, when no decorative ring 301 is provided on the lens cover plate 203, the light source reflector 701 can also be directly fixedly or detachably connected to the lens cover plate 203.
[0215] In this way, the light source reflector 701 can reflect the light source in the shooting scene, and the light source reflected by the light source reflector 701 can reach the lens assembly in the camera module 204, so that the image sensor in the camera module 204 can obtain the corresponding pixel data based on the light source, and then determine the AWB white point based on the pixel data.
[0216] It is understood that when the light source reflector 701 is disposed on the lens cover plate 203, the light source reflector 701 can be disposed on the side (or one side) of the lens cover plate 203 away from the support member 209, in combination with Figure 2 When the user uses device 200, they can touch the light source reflector 701. Alternatively, the light source reflector 701 can also be located on one side (or one side) of the lens cover 203 near the support 209, that is, the light source reflector 701 is located between the lens cover 203 and the support 209, and is fixedly or detachably connected to the lens cover 203. Figure 2 When using device 200, the user may not be able to touch the light source reflector 701.
[0217] In another possible implementation, the light source reflector 701 may also be disposed on other components, such as on the support member 209.
[0218] For example, such as Figure 7 As shown in (b), the light source reflector 701 can be disposed in the support member 209 at the through hole corresponding to the camera module 204, so that the light source reflected by the light source reflector 701 can enter the camera module 204 through the through hole.
[0219] Furthermore, the light source reflector 701 can be disposed on the side (or side) of the support member 209 near the lens cover plate 203, that is, the light source reflector 701 can be located between the lens cover plate 203 and the support member 209; or, the light source reflector 701 can be disposed on the side (or side) of the support member 209 away from the lens cover plate 203, that is, the light source reflector 701 can be located between the camera module 204 and the support member 209.
[0220] It is understandable that in practical applications, depending on the device form, the light source reflector can be placed in other locations, such as on the lens assembly of the camera module, and located on the side where light enters the lens assembly of the camera module. This application does not specifically limit this.
[0221] Furthermore, the shape of the light source reflector 701 can be, for example, one of the following.
[0222] First shape: Refer to the first one. Figure 8 , Figure 8 This is a schematic diagram of a light source reflector of a first shape provided in an embodiment of this application. (See attached diagram.) Figure 8 As shown, the light source reflector 701 can be a continuous ring. Light can be reflected by the inner surface of the light source reflector 701 and enter the lens assembly in the camera module 204. Part of the light propagation path is as follows: Figure 7 As shown by the dashed line in the image.
[0223] Alternatively, the inner surface of the light source reflector 701 may be inclined outward from bottom to top. For example, refer to... Figure 9 Taking the light source reflector 701 disposed on the lens cover plate 203 as an example, Figure 9 This is a cross-sectional view of a light source reflector of a first shape provided in an embodiment of this application. The diameter of the end of the light source reflector 701 near the lens cover plate 203 is larger than the diameter of the end away from the lens cover plate 203.
[0224] When the light source reflector 701 is disposed on the side of the lens cover 203 away from the support 209, such as Figure 9 As shown in (a), the light reflected from the inner surface of the light source reflector 701 enters the lens assembly through the lens cover plate 203; when the light source reflector 701 is disposed on the side of the lens cover plate 203 near the support member 209, as... Figure 9 As shown in (b), the light reflected from the inner surface of the light source reflector 701 enters the lens assembly.
[0225] This allows light to be reflected by the inner surface of the light source reflector 701 and then enter the lens assembly in the camera module 204. For example, the reflected light can enter the lens assembly in a direction perpendicular to the lens assembly, and part of the light propagation path is as follows: Figure 9 As shown by the dashed line in the image.
[0226] Understandable. Figure 8 and Figure 9 For illustrative purposes only, the outer ring of the light source reflector 701 can be of any shape. For example, the outer ring diameter can be the same from bottom to top (i.e., from the end closer to the lens cover 203 to the end farther from the lens cover 203), or the diameter can gradually change from bottom to top. This application does not specifically limit this aspect.
[0227] By providing the light source reflector 701, light from a region outside the field of view (FOV) of the target lens assembly can be reflected into the lens assembly. For example, as shown... Figure 10 As shown, the field of view (FOV) of the lens assembly in the camera module 204 is α. Without the light source reflector 701, the light captured by the lens assembly in the camera module 204 comes from within the FOV(α). When the light source reflector 701 is provided, it can reflect a portion of the light source light outside the FOV(α). Therefore, the lens assembly in the camera module 204 can capture light source light within area 1001. This light source light is the light source light of the shooting scene reflected by the light source reflector 701, accurately reflecting the color of the light source.
[0228] By incorporating a light source reflector, the target lens assembly can capture light over a wider range. Even if there are no colorless objects within the FOV of the target lens assembly, it can still capture the light reflected by the light source reflector, allowing the electronic device to determine a reasonable AWB white point based on the pixel data corresponding to that light source.
[0229] Second shape: Reference Figure 11 , Figure 11 This is a schematic diagram of a second-shaped light source reflector provided in an embodiment of this application. (See attached diagram.) Figure 11 As shown in (a), the second shape is similar to Figure 8 The difference between the first shape shown and the second shape is that the second shape is a discontinuous ring. That is, the light source reflector 701 is a segmented ring. In this way, the light source reflector 701 can reflect light from a wider range.
[0230] For example, combining Figure 11 In (a), since the light source reflector 701 is a segmented ring-shaped object, when there is no obstruction on the opposite side, the light source reflector 701 can reflect light up to the path shown in (b). However, if there is an obstruction on the opposite side (e.g., if the light source reflector 701 is ring-shaped, then the opposite side is also part of the light source reflector 701), the light source reflector 701 can reflect light up to the path shown in (a). Combined with... Figure 12 , Figure 12 This is a side view of a light source reflector of a second shape provided in an embodiment of this application, reflecting light from a light source. When there are no obstructions on the opposite side, the path of the light reflected by the light source reflector 701 is as follows... Figure 12 The dashed line in the diagram represents the angle range (90°) of the light source reflector 701 reflecting the light from the light source. Figure 10 (Similar to the angle α in the text) it can reach 180°.
[0231] Therefore, when the light source reflector 701 is a segmented ring-shaped object, it can reflect light from a wider range. This allows the electronic device to acquire light from a wider range reflected by the light source reflector 701, facilitating the acquisition of more pixel data corresponding to the light source light, and thus determining a more reasonable AWB white point.
[0232] Alternatively, when the light source reflector 701 is a discontinuous ring, the light source reflector 701 includes multiple spaced reflective strips, which surround the central axis of the lens assembly of the camera module 204; no reflective strip is provided at the corresponding position of any reflective strip among the multiple reflective strips, and the corresponding position is symmetrical about the central axis with respect to any reflective strip.
[0233] For example, such as Figure 11 As shown in (b) in the figure, Figure 11 Figure (b) shows a top view of the light source reflector 701. The light source reflector 701 includes multiple spaced-apart reflective strips, as indicated by the gray-filled boxes in the figure. No reflective strip is provided at the corresponding position of each reflective strip.
[0234] Taking reflector strip 1 as an example, point O is the point through which the central axis of the lens assembly of camera module 204 passes. The corresponding position of reflector strip 1 can be understood as the position circled by the dashed ellipse 1101. The corresponding position of reflector strip 1 and the location of reflector strip 1 are symmetrical about the central axis of the lens assembly of camera module 204. No reflector strip is provided at the corresponding position of reflector strip 1. This ensures that the corresponding position of reflector strip 1 does not block the light source light that can be reflected by reflector strip 1, so that each reflector strip can be positioned according to... Figure 12 A similar method of reflecting light from the light source allows the electronic device to acquire a wider range of light reflected by the light source reflector 701, facilitating the acquisition of more pixel data corresponding to the light source and thus determining a more reasonable AWB white point.
[0235] The third shape: such as Figure 13 As shown, Figure 13 This is a schematic diagram of a third shape of light source reflector provided in an embodiment of this application. Figure 13 As shown, the third shape and Figure 8 The difference between the first shape shown and the third shape is that, in the third shape, the light source reflector 701 reflects light from the outside of the ring, and the diameter of the outer end of the ring near the lens cover 203 is smaller than the diameter of the outer end away from the lens cover 203. This allows light from the light source in the shooting scene to enter the target lens assembly after being reflected by the outer end of the light source reflector 701. For example, the path of the reflected light from the light source reflector 701 can be as follows: Figure 13 As shown by the dashed line in the image.
[0236] Similar to the second-shaped light source reflector 701, the third-shaped light source reflector 701 is not obstructed by the opposite object when reflecting light, thus increasing the angular range of light reflected by the third-shaped light source reflector 701 (compared to...). Figure 10 The angle α (similar to that in the text) can also reach 180°, which can reflect light from a wider range of sources.
[0237] Furthermore, by reflecting light from the outside of the ring, the amount of reflected light can be increased, thereby improving the effective signal acquired by the image sensor. This is especially beneficial in low-light scenarios, as it helps to improve the signal-to-noise ratio (SNR) and image quality.
[0238] It is understandable that, since the third-shaped light source reflector 701 reflects light from the outside of the ring, a transparent cover plate 1301 needs to be provided at the end of the light source reflector 701 near the lens cover plate 203 in order to allow the light source to reach the lens assembly in the camera module 204. The transparent cover plate 1301 can be a transparent annular cover plate. The outer ring diameter of the transparent cover plate 1301 is greater than or equal to the diameter of the end of the light source reflector 701 furthest from the lens cover plate 203. This ensures that all light reflected by the light source reflector 701 can pass through the transparent cover plate 1301 and reach the lens assembly in the camera module 204.
[0239] For example, such as Figure 14 As shown, Figure 14 This is a cross-sectional view of a third-shaped light source reflector provided in an embodiment of this application. One end of the light source reflector 701 can be fixedly or detachably connected to the transparent cover plate 1301. The transparent cover plate 1301 can be nested within the through hole of the lens cover plate 203. The transparent cover plate 1301 can be fixedly or detachably connected to the lens cover plate 203.
[0240] It should be understood that Figure 14 For illustrative purposes only, in actual applications, the diameter of the inner ring surface of the light source reflector 701 can be the same or different from top to bottom. For example, the diameter can increase from the end closer to the lens cover 203 to the end farther away from the lens cover 203, thus avoiding blocking the light. This application does not impose specific limitations in this regard.
[0241] It should be noted that the above combination Figures 7 to 14 The light source reflector shown is merely an example. In practical applications, the light source reflector can also be any shape other than a circular ring, such as an elliptical ring or a square ring. This application does not impose any specific limitations on this.
[0242] In addition, the third type of light source reflector can also be a non-continuous ring, similar to the second type. For the sake of simplicity, it will not be described in detail here.
[0243] It should also be noted that the above description uses the example of the light source reflector being disposed on the lens cover 203. In actual applications, the lens cover 203 can also be disposed in other locations, such as at the end of the target lens assembly near the lens cover 203, or on the side of the support 209 near the lens cover 203. This application embodiment does not specifically limit the position of the light source reflector.
[0244] It is understood that the above description uses the lens assembly in camera module 204 as an example, with the target lens assembly (corresponding to the lens assembly with the light source reflector) as the example. In actual application scenarios, the target lens assembly can be the lens assembly in one or more camera modules in an electronic device. Specifically, it may be any of the following situations.
[0245] Scenario 1: The electronic device includes a camera module. The target lens assembly is the lens assembly of the camera module, that is, the lens assembly of the camera module is provided with a light source reflector.
[0246] For example, an electronic device includes a camera module 204, and a light source reflector is disposed on a lens cover 203, the light source reflector being coaxial with the lens assembly of the camera module 204. The light reflected by the light source reflector can enter the lens assembly of the camera module 204.
[0247] Scenario 2: The electronic device includes multiple camera modules. The target lens assembly is the lens assembly of some of these camera modules (such as one, or possibly multiple).
[0248] For example, refer to Figure 3 The electronic device includes camera modules 204 to 208, wherein the lens assembly of camera module 204 is correspondingly provided with a light source reflector, and the light source reflector is coaxial with the lens assembly of camera module 204; or, wherein the lens assemblies of camera module 204 and camera module 208 are respectively provided with light source reflectors, then the lens assembly of camera module 204 is coaxial with one light source reflector so that the light source reflected by the light source reflector can enter the lens assembly of camera module 204, and the lens assembly of camera module 208 is coaxial with another light source reflector so that the light source reflected by the light source reflector can enter the lens assembly of camera module 208.
[0249] Scenario 3: The electronic device includes multiple camera modules. The target lens assembly is the lens assembly of these multiple camera modules. That is, each lens assembly of the multiple camera modules is respectively equipped with a light source reflector.
[0250] For example, refer to Figure 3 The electronic device includes camera modules 204 to 208, and the lens assemblies of camera modules 204 to 208 are respectively provided with light source reflectors.
[0251] Scenario 4: The electronic device includes one or more camera modules used for capturing images. Other camera modules may also be included in the electronic device, with the target lens assembly being the lens assembly of these other camera modules. That is, the lens assemblies of these other camera modules are equipped with corresponding light source reflectors. These other camera modules can be understood as those used for color correction. Specifically, these other camera modules can acquire the light reflected from the light source reflectors and then determine the AWB white point based on the pixel data corresponding to the light source light. These other camera modules are not used for imaging (i.e., the captured images are not displayed).
[0252] For example, combining Figure 3 The device 200 can also add a new camera module (i.e., the other camera modules mentioned above) on the basis of the existing camera modules 204, 205, 206, 207 and 208. The lens assembly of the camera module is equipped with a light source reflector.
[0253] It is understandable that, regardless of which camera module the target lens assembly is in the electronic device, the corresponding light source reflectors of these lens assemblies can be referred to in the description above. For the sake of brevity, they will not be described in detail here.
[0254] Different shooting modes allow electronic devices to use different cameras to capture images. For example, in portrait mode, the electronic device can use both the main camera and the ultra-wide-angle camera to capture a portrait with a blurred background and a sharp subject; in still mode, the electronic device can use only the main camera to capture an image.
[0255] Therefore, under different circumstances, the camera module used by the electronic device to capture images may be the same camera module as the target lens assembly, or it may not be the same camera module as the target lens assembly. For example, when the target lens assembly is a lens assembly in an ultra-wide-angle camera, then in portrait mode, the camera module used by the electronic device to capture images includes the camera module to which the target lens assembly belongs (i.e., the ultra-wide-angle camera); in photo mode, the camera module used by the electronic device to capture images does not include the camera module to which the target lens assembly belongs.
[0256] For the sake of brevity, the camera module used for the final imaging of electronic devices will be referred to as the imaging camera module, and the camera module to which the target lens assembly belongs will be referred to as the target camera module.
[0257] When the camera module in the electronic device is either case 1 or case 3 as described above, the target camera module is an imaging camera module.
[0258] When the camera module in the electronic device is Case 2 as described above, depending on the camera used to capture the image, in some cases the target camera module is an imaging camera module; in other cases, the target camera module is not an imaging camera module.
[0259] When the camera module in the electronic device is in situation 4 above, the target camera module is not an imaging camera module.
[0260] The process of determining the AWB white point by the electronic device will be explained in detail below for the cases where the target camera module is an imaging camera module (first case) and the cases where the target camera module is not an imaging camera module (second case).
[0261] The first scenario: The target camera module is an imaging camera module.
[0262] Understandably, taking camera module 204 as the target camera module as an example, combined with... Figure 10 The target lens assembly can capture light within the FOV(α) range, as well as light reflected by the light source reflector 701 over a wider range (such as region 1001). Therefore, compared to not having the light source reflector 701, the RAW image obtained by the camera module 204 includes not only the imaging area but also the ambient light area surrounding the imaging area. The imaging area is the area corresponding to the subject, and the ambient light area is the area corresponding to the light reflected by the light source reflector 701.
[0263] It is understandable that ambient light areas can appear grayish-white in bright light scenes and dark grayish-black in dark light scenes. That is, the brighter the ambient light source, the closer the ambient light area is to white; the lower the brightness of the ambient light source, the closer the ambient light area is to black.
[0264] The ambient light area can be understood as the region that represents the color of the light source around the camera module 204. This "around" does not include the area directly in front of the camera module 204, and the light source information directly in front of the camera module 204 can be represented by the imaging area. Here, "directly in front" and "around" are relative terms. "Around" is equivalent to a ring of areas surrounding "directly in front." The size of the "directly in front" area is related to the FOV of the camera module 204 and is not limited to only the area extending outward along the optical axis from the front surface of the lens assembly.
[0265] Since the ambient light area does not display the subject (such as people, landscapes, or streets), the target image actually sent and displayed by the electronic device does not include the ambient light area. In other words, after determining the AWB white point based on the ambient light area, the electronic device can crop the ambient light area and send the image to be displayed.
[0266] For example, such as Figure 15As shown, the RAW image obtained by the camera module 204 can be represented as shown in image (a). This image includes an imaging region 1501 and an ambient light region 1502. The ambient light region consists of pixel data formed based on light rays reflected from the light source reflector 701. The imaging region 1501 consists of pixel data formed based on light rays within the field of view (FOV).
[0267] Furthermore, because the target lens assembly can capture both the light reflected from the light source reflector 701 and the light reflected from the subject at the edge of the FOV range, a region (i.e., region 1503) exists at the boundary between the imaging region 1501 and the ambient light region 1502. Although region 1503 can display part of the subject, the content of region 1503 cannot be clearly displayed and appears dull due to the superimposed ambient light image (grayish-white image) formed by the light source. Therefore, as... Figure 15 As shown in (b), the target image actually displayed by the electronic device is the image obtained after cropping out region 1503 and ambient light region 1502.
[0268] Based on the RAW image obtained by camera module 204, the electronic device can... Figure 16 The process shown determines the AWB white spot.
[0269] like Figure 16 As shown in (a), the electronic device can divide the imaging region 1501 and the ambient light region 1502 into multiple regions. For example, the imaging region 1501 is divided into s regions; the ambient light region 1502 is divided into t regions, where s and t are positive integers.
[0270] like Figure 16 As shown in (b) above, according to Figure 5 The electronic device can determine the statistical points corresponding to region 1 in the following way: s statistical points corresponding to s regions and t statistical points corresponding to t regions.
[0271] For ease of distinction, the s statistical points corresponding to the s regions in imaging region 1501 are called imaging statistical points, and the t statistical points corresponding to the t regions in ambient light region 1502 are called ambient light statistical points.
[0272] The electronic device can determine the AWB white point based on t ambient light statistical points, or based on t ambient light statistical points and s imaging statistical points. The specific determination method is described below and will not be detailed here.
[0273] In conjunction with the above, since the image displayed by the electronic device in this case is a cropped image, the target camera module can optionally be an ultra-light camera. This ensures that when the imaging camera module includes an ultra-light camera, the FOV corresponding to the RAW image captured by the ultra-light camera is larger, thus allowing the ambient light area (such as...) in the RAW image to be... Figure 16 After cropping regions 1502 and 1503, the size of the resulting imaging region meets the size requirements of the target image. That is, the size of the imaging region will not be too small, allowing the electronic device to display the target image at a normal size.
[0274] The second scenario: The target camera module is not an imaging camera module.
[0275] In this case, the RAW image captured by the target camera module and Figure 15 The image shown in (a) is similar. That is, the RAW image obtained by the target camera module includes the ambient light region (equivalent to the pixel data corresponding to the ambient light region 1502) and the central image region (equivalent to the pixel data corresponding to the imaging region 1502).
[0276] The RAW images captured by the imaging camera module used by electronic devices are... Figure 5 The image shown in (a) is similar, excluding the ambient light area.
[0277] Based on the RAW image obtained by the target camera module and the RAW image captured by the imaging camera module, the electronic device can determine the AWB white point through the following process.
[0278] Figure 17 This is a schematic diagram illustrating another process for determining AWB white spots provided in an embodiment of this application.
[0279] like Figure 17 As shown in (a), the electronic device can obtain g statistical points corresponding to the ambient light region and h statistical points corresponding to the central image region on a two-dimensional plane of R / G and B / G based on the RAW image captured by the target camera module, where g and h are positive integers.
[0280] For ease of distinction, the g statistical points corresponding to the ambient light region are called g ambient light statistical points, and the h statistical points corresponding to the central image region are called h central statistical points.
[0281] In addition, based on the RAW image captured by the imaging camera module, the electronic device can obtain k statistical points on another two-dimensional plane of R / G and B / G, where k is a positive integer.
[0282] For ease of distinction, the k statistical points corresponding to the RAW image captured by the imaging camera module are called the k imaging statistical points.
[0283] It is understandable that the electronic device determines the g ambient light statistical points and h center statistical points based on the RAW image captured by the target camera module in a way that is similar to... Figure 16 The process shown is similar; the method of determining k imaging statistical points based on the RAW image captured by the imaging camera module is the same as... Figure 5 The process shown is similar and can be referred to the description above, so it will not be repeated here.
[0284] It is understandable that, since the target camera module and the imaging camera module are different types of cameras, there are differences between the lens components of the target camera module and the lens components of the imaging camera module. Furthermore, there are also differences between the image sensors of the target camera module and the imaging camera module, resulting in different color characteristics between the RAW images captured by the target camera module and the RAW images captured by the imaging camera module.
[0285] Therefore, the electronic device obtains g ambient light statistical points and h center statistical points on a two-dimensional plane of R / G and B / G based on the RAW image captured by the target camera module, and k imaging statistical points on another two-dimensional plane of R / G and B / G based on the RAW image captured by the imaging camera module. These two R / G and B / G two-dimensional planes may be different planes. In order to determine a suitable AWB white point based on the g ambient light statistical points, h center statistical points, and k imaging statistical points, as follows... Figure 17 As shown in (b), the electronic device can map g ambient light statistical points, h center statistical points, and k imaging statistical points onto the same two-dimensional R / G and B / G plane. Then, based on the g ambient light statistical points, h center statistical points, and k imaging statistical points on a single two-dimensional R / G and B / G plane, the electronic device can determine a suitable AWB white point.
[0286] The following example illustrates how an electronic device maps g ambient light statistical points, h center statistical points, and k imaging statistical points onto the same two-dimensional R / G and B / G plane, using the mapping of g ambient light statistical points and h center statistical points onto the k imaging statistical points.
[0287] Figure 18 This is a schematic diagram of a statistical point mapping process provided in an embodiment of this application.
[0288] like Figure 18As shown in (a), the electronic device may have a pre-set R / G and B / G plane corresponding to the target camera module, and the plane includes AWB white points corresponding to multiple light sources, such as the AWB white points corresponding to each of the D75, D65, D50, TL84, A and H light sources, which are respectively called D75 calibration point, D65 calibration point, D50 calibration point, TL84 calibration point, A calibration point and H calibration point.
[0289] For example, the D75, D65, D50, TL84, A, and H calibration points can be determined in the following way. Taking the D75 calibration point as an example, the tester can use the target camera module to photograph the gray card when the light source of the standard lightbox is D75, obtaining the RAW image corresponding to D75; and based on this RAW image, multiple D75 statistical points in the R / G and B / G planes can be determined. This process is similar to... Figure 5 The process of determining n×m statistical points is similar and can be referred to the description above; the electronic device takes the average of multiple D75 statistical points to determine the AWB white point (i.e., the D75 calibration point) corresponding to D75. The horizontal coordinate of the D75 calibration point can be the average of the horizontal coordinates of multiple D75 statistical points, and the vertical coordinate of the D75 calibration point can be the average of the vertical coordinates of multiple D75 statistical points.
[0290] In this way, by using the target camera module, images are captured under standard light boxes with D75, D65, D50, TL84, A, and H light sources, respectively, and then the D75 calibration point, D65 calibration point, D50 calibration point, TL84 calibration point, A calibration point, and H calibration point can be obtained in the above manner.
[0291] Furthermore, the electronic device may also have a pre-set R / G and B / G plane corresponding to the imaging camera module, and this plane includes multiple calibration points (AWB white points) corresponding to multiple light sources, such as the AWB white points (i.e. calibration points) corresponding to each of the D75, D65, D50, TL84, A and H light sources, which are respectively called D75' calibration point, D65' calibration point, D50' calibration point, TL84' calibration point, A' calibration point and H' calibration point.
[0292] It should be understood that the determination methods for calibration points D75', D65', D50', TL84', A', and H' are similar to those for determining calibration point D75, and can be referred to the description above, which will not be repeated here.
[0293] like Figure 18 As shown in (b), the electronic device can select any statistical point from g ambient light statistical points and h centers. For example, statistical point 1 can be projected onto the R / G and B / G planes corresponding to the target camera module.
[0294] Furthermore, the electronic equipment can determine the two calibration points closest to statistical point 1 among calibration points D75, D65, D50, TL84, A, and H, such as calibration point D65 and calibration point D50. Calibration points D65, D50, and calibration point 1 can form a triangle, which is called the original triangle.
[0295] like Figure 18 As shown in (c), in the R / G and B / G planes corresponding to the imaging camera module, among the D75', D65', D50', TL84', A', and H' calibration points, two calibration points with the same light source as the D65 and D50 calibration points are determined, namely the D65' and D50' calibration points.
[0296] The electronic device constructs a similar triangle to the original triangle based on the calibration points D65' and D50', which is called a corresponding triangle. The three angles of the corresponding triangle correspond to the calibration points D65', D50', and the mapping statistical point 1' of statistical point 1, respectively.
[0297] Following the above method, by traversing all statistical points among the g ambient light statistical points and h center statistical points, the g ambient light statistical points and h center statistical points can be mapped onto the R / G and B / G planes corresponding to the imaging camera module. In this way, the electronic device can acquire the ambient light statistical points, center statistical points, and imaging statistical points (such as...) in an R / G and B / G plane. Figure 17 (as shown in (b)).
[0298] Subsequently, the electronic device can combine ambient light statistics points, center statistics points, and imaging statistics points in an R / G and B / G plane to determine the AWB white point.
[0299] Based on the above embodiments, regardless of whether the target camera module is an imaging camera module (first case) or not (second case), the electronic device can obtain ambient light statistical points (statistical points determined based on pixel data corresponding to light rays reflected by the light source reflector).
[0300] In one possible implementation, the electronic device can determine the AWB white point based on ambient light statistics.
[0301] In another possible implementation, the electronic device may determine the AWB white point based on ambient light statistics points and imaging statistics points (first case), or based on ambient light statistics points, center statistics points, and imaging statistics points (second case).
[0302] The two methods will be explained in detail below.
[0303] The first possible implementation method: Determine the AWB white point based on ambient light statistical points.
[0304] As an optional embodiment, the abscissa of the AWB white point in the R / G and B / G plane is the average of the abscissas of multiple ambient light statistical points, and the ordinate of the AWB white point in the R / G and B / G plane is the average of the ordinates of multiple ambient light statistical points.
[0305] The multiple ambient light statistical points can be some or all of the ambient light statistical points obtained by the electronic device. For example, in the first case, refer to... Figure 16 In (b), the electronic device obtains t ambient light statistical points, and the electronic device can determine the AWB white point based on some or all of the statistical points in the t ambient light statistical points.
[0306] Alternatively, in the second case, you can refer to Figure 17 In (b), the electronic device obtains g ambient light statistical points. The electronic device can determine the AWB white point based on some or all of the g ambient light statistical points.
[0307] For example, in some scenarios, there may be statistical points located outside the gray area among the ambient light statistical points. In this case, the multiple ambient light statistical points can be the statistical points located in the gray area among all the ambient light statistical points.
[0308] This simplifies the calculation method and reduces the number of statistical points used, thus minimizing the computational burden on electronic devices to determine the AWB white point. Furthermore, since ambient light statistical points more accurately reflect the color of the light source, the AWB white point obtained based on these points can accurately reflect the color of the light source.
[0309] As another optional embodiment, the abscissa of the AWB white point in the R / G and B / G plane is the weighted average of the abscissas of multiple ambient light statistical points, and the ordinate of the AWB white point in the R / G and B / G plane is the weighted average of the ordinates of multiple ambient light statistical points. The weights corresponding to some or all of the multiple ambient light statistical points may differ.
[0310] For example, the weight of each statistical point among multiple ambient light statistical points is related to the position of the region corresponding to each statistical point in the RAW image. The region corresponding to each statistical point is the segmented region of the RAW image.
[0311] like Figure 19As shown, among the multiple regions divided into ambient light region 1502, the region located below imaging region 1501, such as the region circled by ellipse 1901 (i.e., region 1901), can reflect the light source information from above (the side furthest from the ground) in the actual shooting scene. Therefore, among the multiple regions divided into ambient light region 1502, the closer to the bottom, the greater the weight of the corresponding ambient light statistical point can be. For example... Figure 19 In the middle, the weight can be gradually increased according to the direction pointed by the dashed arrow.
[0312] In this way, since the area near the bottom can reflect the light source information above (the side away from the ground) in the actual shooting scene, and the probability that the ambient light source is located above (the side away from the ground) in the actual shooting scene is relatively high, the AWB white dot obtained in this way can more accurately reflect the color of the light source.
[0313] Optionally, the electronic device can determine the weights corresponding to multiple ambient light statistical points in the following manner. (Still combined with...) Figure 19 For the multiple regions divided within the ambient light region 1502, the initial weight of the ambient light statistical points corresponding to the topmost row (the end furthest from region 1901) is the initial value, such as u0; for other regions (such as the i-th row region), the initial weight of the ambient light statistical points is u0 + step size × i, where i is an integer greater than 1. The step size and u0 can be preset positive numbers.
[0314] In this way, the electronic device can determine the initial weight corresponding to each ambient light statistical point among multiple ambient light statistical points.
[0315] The electronic device can then normalize the initial weights corresponding to multiple ambient light statistical points, thereby determining the weight of each ambient light statistical point among the multiple ambient light statistical points.
[0316] The second possible implementation: Determine the AWB white point based on ambient light statistical points and imaging statistical points (first case), or based on ambient light statistical points, center statistical points, and imaging statistical points (second case).
[0317] When the target camera module is an imaging camera module (first case), the x-coordinate of the AWB white point in the R / G and B / G plane is the weighted average of the x-coordinates of multiple ambient light statistical points and multiple imaging statistical points, and the y-coordinate of the AWB white point in the R / G and B / G plane is the weighted average of the y-coordinates of multiple ambient light statistical points and multiple imaging statistical points. The weights corresponding to some or all of the statistical points among the multiple ambient light statistical points and multiple imaging statistical points are different.
[0318] Among them, multiple ambient light statistical points can be some or all of the statistical points among all ambient light statistical points, and multiple imaging statistical points can be some or all of the statistical points among all imaging statistical points.
[0319] For example, in the first case, reference can be made to Figure 16 In (b), the electronic device obtains t ambient light statistical points, and multiple ambient light statistical points are some or all of the t ambient light statistical points. The electronic device obtains s imaging statistical points, and multiple imaging statistical points are some or all of the s imaging statistical points.
[0320] When the target camera module is not an imaging camera module (the second case), the x-coordinate of the AWB white point in the R / G and B / G plane is the weighted average of the x-coordinates of multiple ambient light statistical points, multiple center statistical points, and multiple imaging statistical points. The y-coordinate of the AWB white point in the R / G and B / G plane is the weighted average of the y-coordinates of multiple ambient light statistical points, multiple center statistical points, and multiple imaging statistical points. The weights of some or all of the multiple ambient light statistical points, multiple center statistical points, and multiple imaging statistical points may differ.
[0321] Among them, multiple ambient light statistical points can be some or all of the statistical points among all ambient light statistical points, multiple central statistical points can be some or all of the statistical points among all central statistical points, and multiple imaging statistical points can be some or all of the statistical points among all imaging statistical points.
[0322] For example, in the second case, reference can be made to Figure 17 In (b), the electronic device obtains g ambient light statistical points, h center statistical points, and k imaging statistical points on a two-dimensional plane of R / G and B / G. The multiple ambient light statistical points are some or all of the g ambient light statistical points, the multiple center statistical points are some or all of the h center statistical points, and the multiple imaging statistical points are some or all of the k imaging statistical points.
[0323] For the sake of brevity, the imaging statistical points in the first case, and the center statistical point and imaging statistical point in the second case, will be referred to as "other statistical points" in the following text, meaning statistical points other than the ambient light statistical point. The weights of each statistical point among the ambient light statistical point and other statistical points may be affected by one or more factors.
[0324] Optionally, multiple ambient light statistics points satisfy one or more of the following conditions:
[0325] Item 1: Among multiple ambient light statistical points, the greater the brightness of the corresponding region (the segmented region of the RAW image) of each statistical point, the greater its weight; conversely, the smaller the brightness of the corresponding region, the smaller its weight. For example, for statistical point 2 among the multiple ambient light statistical points (statistic point 2 can be any of the multiple ambient light statistical points), the greater the brightness of the region corresponding to statistical point 2, the greater its weight. That is, the smaller the brightness of the region corresponding to statistical point 2, the smaller its weight.
[0326] Item 2: The greater the aggregation degree of multiple ambient light statistical points, the greater the weight of the multiple ambient light statistical points. That is, the smaller the aggregation degree of multiple ambient light statistical points, the smaller the weight of the multiple ambient light statistical points.
[0327] Item 3: For any statistical point among multiple ambient light statistical points, if the statistical point does not fall into the gray area, the weight corresponding to the statistical point is reduced. For example, for statistical point 3 among multiple ambient light statistical points, statistical point 3 can be any of the multiple ambient light statistical points. The weight corresponding to statistical point 3 when it is in the gray area is greater than the weight corresponding to statistical point 3 when it is not in the gray area.
[0328] For the first item, the brighter the ambient light statistics point in the corresponding area, the closer the area may be to the light source position in the shooting environment. In this case, the ambient light statistics point can reflect the light source information that is closer to the ambient light source position, so the ambient light statistics point can more accurately reflect the color of the light source, and the corresponding weight can be greater.
[0329] Regarding the second point, multiple ambient light statistical points can represent the color of the light source around the camera module. The greater the aggregation degree of multiple ambient light statistical points, the more uniform the color of the light source around the camera module and the simpler the light source in the shooting scene. Therefore, multiple ambient light statistical points can accurately reflect the color of the light source, and the weight of multiple ambient light statistical points can be increased.
[0330] For item 3, since the gray area typically represents a region close to the color of the light source, if some statistical points among multiple ambient light statistical points do not fall into the gray area, the weight of those statistical points is reduced.
[0331] For example, Figure 20 This is a flowchart illustrating the method 2000 for determining the weights corresponding to statistical points, as provided in an embodiment of this application.
[0332] like Figure 20 As shown, method 2000 includes the following steps:
[0333] S2001. The electronic device determines multiple ambient light statistical points and multiple other statistical points in an R / G and B / G plane.
[0334] That is, in the first case, the electronic device can determine multiple ambient light statistical points and multiple imaging statistical points (and) in an R / G and B / G plane. Figure 16 (similar to (b)).
[0335] In the second scenario, the electronic device can determine multiple ambient light statistical points, multiple center statistical points, and multiple imaging statistical points (and) in an R / G and B / G plane. Figure 17 (Similar to (b) in the text).
[0336] S2002. The electronic device determines an average statistical point based on multiple ambient light statistical points. The abscissa of the average statistical point is the average of the abscissas of the multiple ambient light statistical points, and the ordinate of the average statistical point is the average of the ordinates of the multiple ambient light statistical points.
[0337] The average statistical point can reflect the average position of multiple ambient light statistical points. Because the ambient light statistical points best represent the color of the ambient light source, the average statistical point is likely the statistical point closest to the AWB white point.
[0338] S2003. Calculate the distance between each ambient light statistical point and the average statistical point among multiple ambient light statistical points to obtain multiple distances; and calculate the average of the multiple distances to obtain the average distance.
[0339] Here, distance can also be understood as the distance between the ambient light statistical point and the average statistical point in the R / G and B / G planes. For example, assuming the coordinates of an ambient light statistical point in the R / G and B / G planes are (x1, y1), and the coordinates of the average statistical point in the R / G and B / G planes are (x2, y2), then the distance d1 between the ambient light statistical point and the average statistical point satisfies the following formula:
[0340]
[0341] The average distance reflects the degree of aggregation of multiple ambient light statistical points. The smaller the average distance, the greater the degree of aggregation of multiple ambient light statistical points, and the greater the weight corresponding to multiple ambient light statistical points can be; the larger the average distance, the smaller the degree of aggregation of multiple ambient light statistical points, and the greater the weight corresponding to multiple ambient light statistical points can be.
[0342] S2004. Based on the average distance, obtain the initial weight 1 corresponding to multiple ambient light statistical points. The initial weight 1 can be understood as the initial value of the initial weights corresponding to multiple ambient light statistical points. Subsequently, the initial weights corresponding to multiple ambient light statistical points can be adjusted based on the initial weight 1.
[0343] For example, an electronic device may have a preset function 1, which represents the transformation relationship between the average distance and the initial weights 1 corresponding to multiple ambient light statistical points. The preset function 1 may be a linear function or a nonlinear function, and it may be a continuous function or a discontinuous function. Furthermore, the preset function 1 may be expressed in the form of a formula or in the form of a curve.
[0344] For example, the curve corresponding to preset function 1 can be as follows: Figure 21 As shown, curve 2001 may include three straight lines: a line corresponding to an average distance of 0.5 to 1.2, which represents the linear relationship between the average distance and the initial weight 1 when the average distance is 0.5 to 1.2; a line corresponding to an average distance of 1.2 to 1.7, which also represents the linear relationship between the average distance and the initial weight 1 when the average distance is 1.2 to 1.7; and a line corresponding to an average distance of 1.7 to 2.5, which also represents the linear relationship between the average distance and the initial weight 1 when the average distance is 1.7 to 2.5. For example, assuming an average distance of 1.2, the initial weight 1 is 1.7; assuming an average distance of 2.1, the initial weight 1 is 0.3.
[0345] Furthermore, combined Figure 21 As can be seen, the maximum value of the initial weight 1 can be 2, and the minimum value can be 0.2. That is, when the average distance is greater than or equal to 2.5, the initial weight 1 is 0.2; when the average distance is less than or equal to 0.5, the initial weight 1 is 2.0.
[0346] It should be understood that Figure 21 This is just an example; in real-world applications, the preset function 1 can be any other function, or... Figure 21 The values of the average distance and initial weight 1 shown can also be replaced with other values, and this application does not specifically limit them.
[0347] S2005. Based on the initial weight 1, adjust the initial weight corresponding to each ambient light statistical point according to the distance between each ambient light statistical point and the average statistical point among the multiple ambient light statistical points to obtain multiple initial weights 2 corresponding to the multiple ambient light statistical points. The multiple initial weights 2 include the initial weights 2 corresponding to each ambient light statistical point among the multiple ambient light statistical points.
[0348] In other words, there is a one-to-one correspondence between multiple ambient light statistical points and multiple initial weights 2. The smaller the distance between an ambient light statistical point and the average statistical point, the larger the initial weight 2 corresponding to that ambient light statistical point, meaning a greater increase from the initial weight 1. Conversely, the larger the distance between an ambient light statistical point and the average statistical point, the smaller the initial weight 2 corresponding to that ambient light statistical point, meaning a greater decrease from the initial weight 1.
[0349] It can be understood that initial weight 1 can be interpreted as the initial value of the initial weight corresponding to each ambient light statistical point among multiple ambient light statistical points. The electronic device can adjust the initial weights corresponding to each ambient light statistical point based on one or more influencing factors, building upon initial weight 1. Multiple initial weights 2 can be understood as the initial weights adjusted based on the distance between each ambient light statistical point and the average statistical point.
[0350] For example, taking any statistical point among multiple ambient light statistical points, such as statistical point 4, and assuming the distance between statistical point 4 and the average statistical point is D4, the electronic device can have a preset function 2. Preset function 2 can be used to describe the conversion relationship between the increase and D4, where the initial weight 2 corresponding to statistical point 4 = initial weight 1 + increase. Furthermore, preset function 2 satisfies the condition that the smaller D4 is, the larger the increase. Alternatively, the increase can be replaced with a decrease. And preset function 2 is used to describe the conversion relationship between the decrease and D4, where initial weight 2 = initial weight 1 - decrease.
[0351] Alternatively, the electronic device can have a pre-set mapping table, which can include mapping relationships between multiple distance ranges and multiple increments (or decrements). The electronic device can then determine the distance range to which D4 belongs, and further determine the increment (or decrement) mapped to that distance range based on the mapping table.
[0352] For example, as shown in Table 1, when the distance range of D4 is 0-1, the initial weight 2 corresponding to the statistical point 4 is equal to the initial weight 1 + 0.8; when the distance range of D4 is 1-2, the initial weight 2 corresponding to the statistical point 4 is equal to the initial weight 1 + 0.4.
[0353] Table 1
[0354] Distance range Increase 0-1 0.8 1-2 0.4
[0355] S2006. When some ambient light statistical points are located outside the gray area among multiple ambient light statistical points, the initial weight 2 corresponding to each of these ambient light statistical points is reduced by a threshold 1. In this way, the electronic device can obtain multiple initial weights 3 corresponding to multiple ambient light statistical points, with each ambient light statistical point corresponding to one initial weight 3. Furthermore, the initial weight 2 corresponding to the ambient light statistical points located in the gray area is the same as the initial weight 3; that is, the initial weight 2 corresponding to the ambient light statistical points located in the gray area is not reduced by the threshold 1; the initial weight 3 corresponding to the ambient light statistical points not located in the gray area is equal to the difference between the initial weight 2 and the threshold 1.
[0356] For multiple statistical points other than the multiple ambient light statistical points, the following conditions must be met: among the multiple other statistical points, the statistical point closer to the average statistical point has a larger corresponding weight; and / or, among the multiple other statistical points, the statistical points not located in the gray area have their corresponding weight reduced.
[0357] For example, the electronic device may determine the initial weight corresponding to each statistical point among a plurality of other statistical points through S2007-S2008.
[0358] S2007. Based on the initial weight 4, and considering the distance between each of the other statistical points and the average statistical point, adjust the initial weight corresponding to each of the other statistical points to obtain multiple initial weights 5 corresponding to the other statistical points. Each initial weight 5 includes the initial weight corresponding to each of the other statistical points. Each initial weight 5 corresponds one-to-one with each of the other statistical points.
[0359] Here, initial weight 4 can be understood as the initial value of the initial weights corresponding to multiple other statistical points. Initial weight 4 can be a preset value, or it can be determined based on initial weight 1. For example, initial weight 4 and initial weight 1 can be negatively correlated. The initial weights corresponding to multiple other statistical points can be adjusted based on initial weight 4. Multiple initial weights 5 can be understood as initial weights adjusted based on the distance between other statistical points and the average statistical point.
[0360] It should be understood that the implementation of S2007 is similar to that of S2005, and can be referred to the description above, so it will not be repeated here.
[0361] S2008. Subtract the threshold 2 from the initial weight 5 of each statistical point in one or more statistical points located outside the gray area to obtain multiple initial weights 6.
[0362] Multiple other statistical points correspond one-to-one with multiple initial weights 6. Furthermore, the initial weight 6 corresponding to other statistical points located in the gray area is the same as the initial weight 5, that is, the initial weight corresponding to other statistical points located in the gray area is not reduced by the threshold 2; the initial weight 6 corresponding to other statistical points not located in the gray area is equal to the difference between the initial weight 5 and the threshold 2.
[0363] S2009. The electronic device normalizes the multiple initial weights 3 corresponding to multiple ambient light statistical points and the multiple initial weights 6 corresponding to multiple other statistical points to obtain the weights corresponding to each statistical point among the multiple ambient light statistical points and multiple other statistical points.
[0364] For example, suppose there are multiple ambient light statistical points including: ambient light statistical point 1, ambient light statistical point 2, ..., ambient light statistical point o1; and multiple other statistical points including: other statistical point 1, other statistical point 2, ..., other statistical point o2; o1 and o2 are positive integers.
[0365] Then the weight corresponding to the ambient light statistical point i is equal to the total initial weight corresponding to the ambient light statistical point i / SUM; the weight corresponding to other statistical points j is equal to the total initial weight corresponding to other statistical points j / SUM1.
[0366] Where i is an integer greater than or equal to 1 and less than or equal to o1; j is an integer greater than or equal to 1 and less than or equal to o2. SUM1 is the sum of multiple initial weights 3 corresponding to multiple ambient light statistical points and multiple initial weights 6 corresponding to multiple other statistical points.
[0367] In this way, the electronic device can combine the weights of each statistical point among multiple ambient light statistical points and multiple other statistical points, and perform weighted summation on the horizontal and vertical coordinates of the multiple ambient light statistical points and multiple other statistical points to determine the AWB white point.
[0368] Alternatively, electronic devices can determine the AWB white point based on multiple initial weights 3 corresponding to multiple ambient light statistical points and multiple initial weights 6 corresponding to multiple other statistical points.
[0369] For example, the x-coordinate of the AWB white point = (x-coordinate of ambient light statistical point 1 × initial weight 3 corresponding to ambient light statistical point 1 + x-coordinate of ambient light statistical point 2 × initial weight 3 corresponding to ambient light statistical point 2 + ... + x-coordinate of ambient light statistical point o1 × initial weight 3 corresponding to ambient light statistical point o1 + x-coordinate of other statistical point 1 × initial weight 6 corresponding to other statistical point 1 + x-coordinate of other statistical point 2 × initial weight 6 corresponding to other statistical point 2 + ... + x-coordinate of other statistical point o2 × initial weight 6 corresponding to other statistical point o2) / SUM1;
[0370] AWB white point ordinate = (Ambient light statistical point 1 ordinate × initial weight 3 corresponding to ambient light statistical point 1 + ambient light statistical point 2 ordinate × initial weight 3 corresponding to ambient light statistical point 2 + ... + ambient light statistical point o1 ordinate × initial weight 3 corresponding to ambient light statistical point o1 + other statistical point 1 ordinate × initial weight 6 corresponding to other statistical point 1 + other statistical point 2 ordinate × initial weight 6 corresponding to other statistical point 2 + ... + other statistical point o2 ordinate × initial weight 6 corresponding to other statistical point o2) / SUM1.
[0371] Through method 2000, the electronic device can assign relatively high weights to statistical points that can more accurately reflect the color of the light source, thereby determining a more reasonable AWB white point. This AWB white point can more accurately reflect the color of the light source, and thus, based on this AWB white point, color correction can be performed more accurately. This results in the electronic device displaying realistic colors in the captured target image, providing a better shooting experience for the user.
[0372] In addition to Method 2000, electronic devices can also determine the weights corresponding to each statistical point in the following manner, and determine the AWB white points based on the weights corresponding to each statistical point.
[0373] For example, Figure 22 A flowchart illustrating the method 2200 for determining the weights corresponding to statistical points provided in this application embodiment.
[0374] like Figure 22 As shown, method 2200 includes the following steps:
[0375] S2201. The electronic device determines the initial weight 'a' corresponding to multiple ambient light statistical points based on the average distance. The initial weight 'a' is similar to the initial weight 1, and can be referred to the implementation methods in S2001 to S2004, which will not be repeated here.
[0376] S2202. The electronic device determines the initial weight b corresponding to each ambient light statistical point based on the distance between each ambient light statistical point and the average statistical point among multiple ambient light statistical points.
[0377] It should be understood that the method for determining the average statistical point is similar to that in Method 2000, which can be referred to in the above description and will not be repeated here.
[0378] The initial weight 'b' for each ambient light statistical point reflects the distance between that point and the average statistical point. The smaller the distance between the ambient light statistical point and the average statistical point, the larger the initial weight 'b' for that point.
[0379] For example, similar to the implementation in S2005, the electronic device may have a preset function b. This preset function b describes the conversion relationship between the distance between the ambient light statistical point and the average statistical point, and the initial weight b corresponding to the ambient light statistical point. The electronic device can then determine the initial weight b corresponding to each ambient light statistical point based on the distance between each ambient light statistical point and the average statistical point, and the preset function b. Furthermore, the preset function b satisfies the condition that the distance between the ambient light statistical point and the average statistical point is negatively correlated with the initial weight b corresponding to the ambient light statistical point.
[0380] S2203. The electronic device determines the initial weight c corresponding to each ambient light statistical point based on the brightness of the region corresponding to each ambient light statistical point (the region where the RAW image is segmented) among multiple ambient light statistical points.
[0381] The initial weight 'c' for each ambient light statistical point reflects the brightness of the area corresponding to that point. Furthermore, the greater the brightness of the area corresponding to a particular ambient light statistical point, the greater the initial weight 'c'.
[0382] For example, similar to the implementation in S2201, the electronic device may have a preset function c. This preset function c describes the conversion relationship between the brightness of the region corresponding to each ambient light statistical point and the initial weight c corresponding to that ambient light statistical point. The electronic device can then determine the initial weight c corresponding to each ambient light statistical point based on the brightness of the region corresponding to each of the multiple ambient light statistical points and the preset function c. Furthermore, the preset function c satisfies the condition that the brightness of the region corresponding to the ambient light statistical point is positively correlated with the initial weight c corresponding to that ambient light statistical point.
[0383] S2204. The electronic device determines the initial weight d for each ambient light statistical point based on whether each ambient light statistical point is located in the gray area among multiple ambient light statistical points. The initial weight d for an ambient light statistical point located in the gray area is greater than the initial weight d for an ambient light statistical point not located in the gray area.
[0384] For example, if the initial weight d corresponding to the ambient light statistics point located in the gray area is 1, and the initial weight d corresponding to the ambient light statistics point not located in the gray area is 2, then the value 1 is greater than the value 2. The values 1 and 2 can be preset values.
[0385] Thus, for each of the multiple ambient light statistical points, there can be an initial weight a, an initial weight b, an initial weight c, and an initial weight d.
[0386] Similarly, the electronic device can also determine multiple initial weights corresponding to each other statistical point in accordance with S2202 to S2204.
[0387] S2205. The electronic device determines the initial weight e corresponding to each other statistical point based on the distance between each other statistical point and the average statistical point among multiple other statistical points.
[0388] S2206. The electronic device determines the initial weight f corresponding to each of the other statistical points based on the brightness of the region corresponding to each of the other statistical points (the region where the RAW image is segmented).
[0389] S2207. The electronic device determines the initial weight g corresponding to each of the multiple other statistical points based on whether each other statistical point is located in the gray area. The initial weight g corresponding to the other statistical point located in the gray area is greater than the initial weight g corresponding to the other statistical point not located in the gray area.
[0390] For example, if the initial weight g corresponding to other statistical points located in the gray area is 3, and the initial weight g corresponding to other statistical points not located in the gray area is 4, then the value 3 is greater than the value 4, and the values 3 and 4 can be preset values.
[0391] Thus, for each of the other statistical points, there can be an initial weight e, an initial weight f, and an initial weight g.
[0392] It should be understood that the implementation of S2205 to S2207 is similar to the implementation of S2202 to S2204. The difference is that the preset function used to determine the initial weights corresponding to other statistical points is different from the preset function used to determine the initial weights corresponding to ambient light statistical points. Please refer to the description above, which will not be repeated here.
[0393] It should also be understood that in the embodiments of this application, each preset function can be a linear function or a nonlinear function, a continuous function or a discontinuous function. Furthermore, each preset function can be expressed in the form of a formula or a curve, etc. The embodiments of this application do not impose specific limitations in this regard.
[0394] S2208. The electronic device determines the total initial weight corresponding to each ambient light statistical point among multiple ambient light statistical points. The total initial weight is equal to the product (or sum) of the initial weights a, b, c, and d corresponding to each ambient light statistical point. The electronic device determines the total initial weight corresponding to each other statistical point among multiple other statistical points. The total initial weight is equal to the product (or sum) of the initial weights e, f, and g corresponding to each other statistical point.
[0395] Thus, for each statistical point, the smaller the distance from the average statistical point, the greater the corresponding total initial weight; the greater the brightness of the corresponding area, the greater the corresponding total initial weight; and the total initial weight when located in the gray area is greater than the total initial weight when not located in the gray area. This makes the accuracy of each statistical point in reflecting the color of the light source higher, and the corresponding total initial weight higher, thus making the determined AWB white point more reasonable and able to more accurately reflect the color of the light source.
[0396] S2209. The electronic device determines the AWB white point based on the total initial weight corresponding to each ambient light statistical point among multiple ambient light statistical points, and the total initial weight corresponding to each other statistical point among multiple other statistical points.
[0397] For example, the electronic device can first normalize the total initial weight corresponding to each ambient light statistical point among multiple ambient light statistical points, and the total initial weight corresponding to each of the other statistical points among multiple other statistical points, to obtain the weight corresponding to each of the multiple ambient light statistical points and the multiple other statistical points. Furthermore, the electronic device can determine the AWB white point based on the weight corresponding to each of the multiple ambient light statistical points and the multiple other statistical points; the specific determination method can be found in the description above.
[0398] For example, suppose there are multiple ambient light statistical points including: ambient light statistical point 1, ambient light statistical point 2, ..., ambient light statistical point o1; and multiple other statistical points including: other statistical point 1, other statistical point 2, ..., other statistical point o2; o1 and o2 are positive integers.
[0399] Then the weight corresponding to ambient light statistical point i is equal to the total initial weight corresponding to ambient light statistical point i / SUM; the weight corresponding to other statistical points j is equal to the total initial weight corresponding to other statistical points j / SUM2.
[0400] Where i is an integer greater than or equal to 1 and less than or equal to o1; j is an integer greater than or equal to 1 and less than or equal to o2. SUM2 is the sum of the total initial weights corresponding to multiple ambient light statistical points and multiple other statistical points.
[0401] Alternatively, the x-coordinate of the AWB white point = (x-coordinate of ambient light statistical point 1 × total initial weight corresponding to ambient light statistical point 1 + x-coordinate of ambient light statistical point 2 × total initial weight corresponding to ambient light statistical point 2 + ... + x-coordinate of ambient light statistical point o1 × total initial weight corresponding to ambient light statistical point o1 + x-coordinate of other statistical point 1 × total initial weight corresponding to other statistical point 1 + x-coordinate of other statistical point 2 × total initial weight corresponding to other statistical point 2 + ... + x-coordinate of other statistical point o2 × total initial weight corresponding to other statistical point o2) / SUM2;
[0402] AWB white point ordinate = (Ambient light statistical point 1 ordinate × total initial weight corresponding to ambient light statistical point 1 + Ambient light statistical point 2 ordinate × total initial weight corresponding to ambient light statistical point 2 + ... + Ambient light statistical point o1 ordinate × total initial weight corresponding to ambient light statistical point o1 + Other statistical point 1 ordinate × total initial weight corresponding to other statistical point 1 + Other statistical point 2 ordinate × total initial weight corresponding to other statistical point 2 + ... + Other statistical point o2 ordinate × total initial weight corresponding to other statistical point o2) / SUM2.
[0403] Through method 2200, the electronic device can assign relatively high weights to statistical points that can more accurately reflect the color of the light source, thereby determining a more reasonable AWB white point. This AWB white point can more accurately reflect the color of the light source, and thus color correction can be performed more accurately based on this AWB white point. This results in more realistic colors in the captured target image displayed by the electronic device, providing a better shooting experience for the user.
[0404] Furthermore, by combining ambient light statistical points with other statistical points to determine the AWB white point, the following advantages are achieved: Firstly, ambient light statistical points are determined based on the light reflected from the light source's reflectors, accurately reflecting the light source's color. Secondly, some of the other statistical points may correspond to colorless objects, and these points can also accurately reflect the light source's color. By combining ambient light statistical points with other statistical points to determine the AWB white point, the accuracy of the AWB white point is significantly improved, allowing for a more precise reflection of the light source's color.
[0405] It should be understood that methods 2000 and 2200 are described using the distance between statistical points and the average statistical point, the degree of aggregation, brightness, and whether they are located in the gray area as examples to illustrate the impact of these factors on the weights. In practical applications, the weights corresponding to each statistical point can be determined by combining the influence of more or fewer factors on the weights. For example, when the influence of brightness on the weights is not considered, methods 2200 may not include S2203 and S2206, and in S2208, when calculating the total initial weights of each statistical point, the total initial weights corresponding to the ambient light statistical points are not calculated based on the initial weight c, and the total initial weights corresponding to other statistical points are not calculated based on the initial weight f. The specific implementation methods are similar to those of method 2200, and for the sake of simplicity, they will not be shown one by one here.
[0406] Afterwards, electronic devices can perform color correction on the RAW image based on the AWB white point. The color correction method can be found in [reference needed]. Figure 5 The description of that location will not be repeated here.
[0407] It should be understood that the sequence numbers in the above embodiments do not imply the order of execution. The execution order of each process should be determined by its function and internal logic.
[0408] The image processing method of the embodiments of this application has been described above. The apparatus for executing the above method provided in the embodiments of this application is described below. The prompting apparatus includes modules or units for executing each part of the above embodiments. The modules or units may be software or hardware, or hardware, or a combination of software and hardware. The following is only a brief illustrative example of the prompting method; for details of the implementation, please refer to the description of the foregoing method embodiments, which will not be repeated below.
[0409] The following is combined with Figure 23The software structure of the electronic device according to the embodiments of this application will be described in detail.
[0410] Figure 23 This is a schematic diagram of the architecture (including software system and some hardware) used in the embodiments of this application. Figure 23 As shown, the application architecture is divided into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the application architecture can be divided into five layers, from top to bottom: the application layer, the application framework (FWK) layer, the hardware abstraction layer (HAL), the kernel layer, and the hardware layer.
[0411] like Figure 23 As shown, the application layer can include applications such as camera, gallery, and system UI. The system UI is used to display the interface of the electronic device, such as displaying images captured by the electronic device.
[0412] like Figure 23 As shown, the application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions.
[0413] The application framework layer may include a camera access interface. This interface can handle requests from applications (such as camera apps) and forward them to the camera HAL. It can also be used to manage the camera's lifecycle and resource allocation. Furthermore, the camera access interface can be used to set parameters related to image capture, such as resolution, frame rate, focus mode, exposure compensation and ISO value, white balance, and flash mode; these parameters may be specified by the application.
[0414] The HAL layer is a wrapper around Linux kernel drivers, providing interfaces to the upper layers and shielding them from the implementation details of the underlying hardware. The HAL layer includes a camera hardware abstraction module (such as the camera HAL) and a camera algorithm library.
[0415] The camera HAL (Host Allocation Array) can be used to translate commands or requests from the camera access interface into commands that the hardware (such as the camera) can understand. It can be used to interact with hardware (such as the camera). For example, the camera HAL can be used to set certain camera parameters, such as sensor initialization (e.g., camera operating mode), image processing parameters (e.g., noise reduction, sharpening, color correction), buffer management (e.g., setting buffer size and format), and camera frame synchronization.
[0416] The camera hardware abstraction module can include multiple camera devices, such as camera device 1, camera device 2, etc.
[0417] The camera algorithm library includes a post-processing algorithm module and a decision module.
[0418] The post-processing algorithm module can be used to perform various image processing operations, including image depth calculation, blurring, and HDR processing. These different processing methods can effectively improve image quality.
[0419] The decision module can then pass the pre-set parameters to the camera hardware abstraction module based on different shooting modes. Furthermore, this decision module can also send the sensor's imaging method to the main camera, ultra-wide-angle camera, and telephoto camera, and transmit the parameter configurations of each ISP to the ISP.
[0420] The kernel layer is the layer between hardware and software. For example, the kernel layer can be used to drive hardware resources. The kernel layer can include multiple driver modules. Figure 23 As shown, the kernel layer includes camera device drivers, digital signal processor (DSP) drivers, and graphics processing unit (GPU) drivers, etc.
[0421] The hardware layer includes an image sensor, an ISP, a digital signal processor, and a graphics processor. The ISP is used to perform white balance processing on the RAW images acquired by the image sensor. The white balance processing process can be referenced in the section above on determining the AWB white point in electronic devices and performing color correction based on the AWB white point.
[0422] For example, after an electronic device launches a camera application, based on the user's input operation to trigger the image capture, the camera application can obtain the photo capture command, and the photo capture command can be sent to the hardware abstraction layer through the camera access interface.
[0423] The decision module in the camera algorithm library can determine the output parameters based on parameters such as ambient light. These output parameters may include information such as the camera information to be used by the electronic device to capture the image, exposure level, and exposure time. These output parameters are then transmitted to the camera hardware abstraction module.
[0424] The camera hardware abstraction module sends the output parameters configured by the decision module to the camera device driver. The camera device driver then sends these output parameters to the hardware layer; for example, it sends the image sensor's output method to the image sensor and transmits the ISP's parameter configuration to the ISP. The image sensor outputs images based on the output method, such as specifying which image sensor in the camera module needs to be used. The ISP performs corresponding preprocessing based on its parameter configuration, including white balance processing, the process of which is described above.
[0425] Additionally, the image output by the ISP can be sent to the camera device driver. The camera device driver can then transmit the image output by the ISP to the camera hardware abstraction module. The camera hardware abstraction module can then send this image to the post-processing algorithm module for further processing, and can also transmit the image output by the post-processing algorithm module to the camera application through the camera access interface. The image obtained by the camera application can be understood as the target image mentioned above. The camera application can then display this target image.
[0426] Understandable. Figure 23 The illustration shows an example of software modules included in an electronic device. Each layer of the electronic device's software architecture may also include more or fewer software modules. For example, the application layer of the electronic device may also include other applications, such as messaging, alarm clock, weather, stopwatch, compass, timer, flashlight, calendar, Alipay, etc. This application does not specifically limit the scope of the application.
[0427] Figure 24 This is a schematic diagram of the structure of the electronic device 2400 provided in an embodiment of this application. Figure 24 As shown, the electronic device 2400 may include a processor 2410, an external memory interface 2420, an internal memory 2421, a universal serial bus (USB) interface 2430, a charging management module 2440, a power management module 2441, a battery 2442, an antenna 1, an antenna 2, a mobile communication module 2450, a wireless communication module 2460, an audio module 2470, a sensor module 2480, a button 2490, a motor 2491, an indicator 2492, a camera 2493, a display screen 2494, and a subscriber identification module (SIM) card interface 2495, etc.
[0428] The audio module 2470 may include a speaker, receiver, microphone, and headphone jack. The sensor module 2480 may include a pressure sensor, gyroscope sensor, barometric pressure sensor, magnetic sensor, accelerometer, distance sensor, proximity sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor, bone conduction sensor, etc.
[0429] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 2400. In other embodiments of this application, the electronic device 2400 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.
[0430] Processor 2410 may include one or more processing units, such as application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0431] In some examples, the electronic device 2400 may include one or more cameras 2493 (represented by 1 to N in the figure, where N is a positive integer). The camera 2493 may be used, for example, to implement the steps and / or processes executed by the camera module described above. For instance, it may be used to acquire image data (such as RAW images); and the processor 2410 (such as an ISP) may acquire this image data from the camera 2493 and perform white balance processing according to the method described above to obtain white balance-processed image data.
[0432] It is understood that the processor 2410 can further process the image data after white balance processing, and the processed image data can be displayed on the display screen 2494; or, the processor 2410 may not display the processed image data on the display screen 2494.
[0433] In some examples, processor 2410 may be a system-on-chip (SOC) of electronic device 2400. In one possible implementation, processor 2410 may perform white balance processing on RAW images captured by camera 193; and may also perform some other processing on the white balance processed image to obtain a target image; and may display the target image on display screen 2494.
[0434] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0435] The processor 2410 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 2410 is a cache memory. This memory can store instructions or data that the processor 2410 has just used or is recurring. If the processor 2410 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 2410, and thus improves the efficiency of the system.
[0436] In some embodiments, processor 2410 may include one or more interfaces.
[0437] Electronic device 2400 implements display functions through a GPU, a display screen 2494, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 2494 and the application processor. The GPU performs mathematical and geometric calculations for graphics rendering. Processor 2410 may include one or more GPUs, which execute program instructions to generate or modify display information. For example, processor 110 may invoke the GPU to perform front-end and back-end processing on image data 1.
[0438] Display screen 2494 is used to display images, videos, etc. Display screen 2494 includes a DDIC and a display panel. In some embodiments, electronic device 2400 may include one or N displays screens 2494, where N is a positive integer greater than 1.
[0439] Internal memory 2421 can be used to store computer executable program code, which includes instructions. Internal memory 2421 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 created during the use of electronic device 2400 (such as audio data, phonebook, etc.). Furthermore, internal memory 2421 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. Processor 2410 executes various functional applications and data processing of electronic device 2400 by running instructions stored in internal memory 2421 and / or instructions stored in memory located in the processor.
[0440] It should be understood that Figure 24 The connection relationships between the modules shown are merely illustrative and do not constitute a limitation on the connection relationships between the modules of the electronic device 2400. Optionally, the modules of the electronic device 2400 may also adopt a combination of various connection methods described in the above embodiments.
[0441] Figure 25 This is a schematic block diagram of an image processing apparatus 2500 provided in an embodiment of this application. The apparatus 2500 includes a processor 2501, a communication interface 2502, and a memory 2503. The processor 2501, communication interface 2502, and memory 2503 communicate with each other via internal connection paths. The memory 2503 stores instructions, and the processor 2501 executes the instructions stored in the memory 2503. The communication interface 2502 can be used to send signals to other devices (e.g., the processor 2501 or the display screen of an electronic device) and to receive signals from other devices (e.g., the memory 2503). Exemplarily, the communication interface 2502 reads instructions stored in the memory 2503 and sends the instructions to the processor 2501.
[0442] It should be understood that the device 2500 may specifically be an electronic device as described in the above embodiments, and may be used to perform the various steps and / or processes corresponding to the electronic device in the above method embodiments. Optionally, the memory 2503 may include read-only memory and random access memory, and provide instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information. The processor 2501 may be used to execute instructions stored in the memory, and when the processor 2501 executes instructions stored in the memory, the processor 2501 is used to perform the various steps and / or processes of the above method embodiments.
[0443] It should be understood that in the embodiments of this application, the processor can be a CPU, or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0444] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or as a combination of hardware and software modules within the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor executes the instructions in the memory, combining them with its hardware to complete the steps of the above method. To avoid repetition, detailed descriptions are omitted here.
[0445] The image processing method provided in this application embodiment can be applied to electronic devices. The specific device form of the electronic device can be referred to the above-mentioned relevant description, and will not be repeated here.
[0446] This application provides an electronic device, which includes a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the electronic device to perform the above-described method.
[0447] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.
[0448] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0449] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage or other magnetic storage devices, or any other medium targeted to carry or to store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, Digital Versatile Discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0450] This application provides a computer program product, which includes a computer program that, when run, causes a computer to perform the above-described method.
[0451] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0452] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. An image processing method, characterized in that, Applied to electronic devices, the electronic devices include a first camera module, a second camera module, and a light source reflector; In response to the first operation, the first camera module acquires first image data, and the second camera module acquires second image data; the first image data includes data collected based on reflected light from the light source reflector; the second image data includes data collected based on reflected light from the subject. Based on the first image data, white balance processing is performed on the second image data to obtain white balance processed image data.
2. The method according to claim 1, characterized in that, The step of performing white balance processing on the second image data based on the first image data includes: Based on the first image data, a target point is determined in a first color coordinate system. The target point is used to represent the point where the white object is located in the first color coordinate system, which is used to represent the relationship between different color channels. Based on the target point, color correction is performed on the second image data to obtain the image data after white balance processing.
3. The method according to claim 2, characterized in that, The step of determining the target point in the first color coordinate system based on the first image data includes: The target point is determined in the first color coordinate system based on the first image data and the second image data.
4. The method according to claim 3, characterized in that, The first camera module and the second camera module are the same camera module; Determining the target point in the first color coordinate system includes: Based on the first image data, a plurality of first coordinate points are determined in the first color coordinate system; Based on the second image data, a plurality of second coordinate points are determined in the first color coordinate system; The target point is obtained by calculating the weighted average of the coordinates of the plurality of first coordinate points and the plurality of second coordinate points.
5. The method according to claim 4, characterized in that, The weight of the first coordinate point among the plurality of first coordinate points is determined based on one or more of the following: the brightness corresponding to the first coordinate point, the aggregation degree of the plurality of first coordinate points, or whether the first coordinate point is located in the gray area of the first color coordinate system; And / or, The weight of the second coordinate point among the plurality of second coordinate points is determined based on one or more of the following: the brightness corresponding to the second coordinate point, the distance between the second coordinate point and the average coordinate point, or whether the second coordinate point is located in the gray area of the first color coordinate system, wherein the average coordinate point is the average value of the coordinates of the plurality of first coordinate points.
6. The method according to claim 5, characterized in that, The aggregation degree of the plurality of first coordinate points is the average distance between the plurality of first coordinate points and the average coordinate point.
7. The method according to claim 3, characterized in that, The first camera module and the second camera module are different camera modules; the first image data includes a first part of data and a second part of data, wherein the first part of data includes data collected based on the reflected light from the light source reflector; The second part of the data includes data collected based on the reflected light from the subject; Determining the target point in the first color coordinate system includes: Based on the first part of the data, multiple third coordinate points are obtained in the second color coordinate system, and based on the second part of the data, multiple fourth coordinate points are obtained in the second color coordinate system. Based on the second image data, the plurality of second coordinate points in the first color coordinate system are obtained; The plurality of third coordinate points are mapped onto the first color coordinate system to obtain a plurality of fifth coordinate points in the first color coordinate system; and the plurality of fourth coordinate points are mapped onto the first color coordinate system to obtain a plurality of sixth coordinate points in the first color coordinate system. The target point is obtained by calculating the weighted average of the coordinates of the plurality of fifth coordinate points, the plurality of sixth coordinate points, and the plurality of second coordinate points.
8. The method according to claim 7, characterized in that, The weight of the fifth coordinate point among the plurality of fifth coordinate points is determined based on one or more of the following: the brightness corresponding to the fifth coordinate point, the aggregation degree of the plurality of fifth coordinate points, or whether the fifth coordinate point is located in the gray area of the first color coordinate system; and / or, The weights of the plurality of sixth coordinate points and any one of the plurality of second coordinate points are determined based on one or more of the following: the brightness corresponding to any one coordinate point, the distance between any one coordinate point and the average coordinate point, or whether any one coordinate point is located in the gray area of the first color coordinate system, wherein the average coordinate point is the average value of the coordinates of the plurality of fifth coordinate points.
9. The method according to claim 8, characterized in that, The aggregation degree of the plurality of fifth coordinate points is the average distance between the plurality of fifth coordinate points and the average coordinate point.
10. The method according to any one of claims 7 to 9, characterized in that, The electronic device is pre-set with a plurality of first calibration points in the second color coordinate system corresponding to the first camera module, and a plurality of second calibration points in the first color coordinate system corresponding to the second camera module. The plurality of first calibration points are determined by image data captured by the first camera module under a plurality of standard light sources, and the plurality of second calibration points are determined by image data captured by the second camera module under a plurality of standard light sources. The plurality of third coordinate points are mapped onto the first color coordinate system to obtain a plurality of fifth coordinate points in the first color coordinate system; Furthermore, the plurality of fourth coordinate points are mapped onto the first color coordinate system to obtain a plurality of sixth coordinate points in the first color coordinate system, including: Among the plurality of first calibration points, the two first calibration points that are closest to the target coordinate point are determined. The target coordinate point is any one of the plurality of third coordinate points or the plurality of fourth coordinate points. The two first calibration points are calibration points determined under the first standard light source and the second standard light source. Among the plurality of second calibration points, two second calibration points corresponding to the two first calibration points are determined, and the two second calibration points are calibration points determined under the first standard light source and the second standard light source; Based on the two second calibration points, the mapped target coordinate point after the target coordinate point is mapped to the first color coordinate system is determined. The first triangle formed by the target coordinate point and the two first calibration points and the second triangle formed by the mapped target coordinate point and the two second calibration points are similar triangles.
11. The method according to any one of claims 7 to 10, characterized in that, The field of view of the first camera module is greater than that of the second camera module.
12. The method according to any one of claims 1 to 11, characterized in that, The reflected light from the light source reflector includes: light from the light source reflected by the light source reflector; and / or, the reflected light from the subject includes: light from the light source reflected by the subject.
13. The method according to any one of claims 1 to 12, characterized in that, Before the electronic device receives the first operation, the method further includes: Launch the first application, which is used to capture images; After obtaining the white balance-processed image data, the method further includes: Based on the image data after white balance processing, the target image is displayed in the first interface of the first application.
14. An electronic device, characterized in that, include: First surface, first camera module, and light source reflector; The light source reflector is located between the first surface and the first camera module; Alternatively, the light source reflector may be disposed on the first surface; the light source reflector may be a continuous ring or a discontinuous ring. The light source reflector is used to reflect the light from the light source so that the reflected light from the light source enters the first camera module.
15. The device according to claim 14, characterized in that, The first surface is a back panel or a screen.
16. The device according to claim 15, characterized in that, The back panel includes a protective plate and a rear shell, and the first surface is the plane where the protective plate is located.
17. The device according to any one of claims 14 to 16, characterized in that, The light source reflector is a discontinuous ring shape, comprising: The light source reflector includes multiple spaced reflective strips arranged around the central axis of the lens assembly of the first camera module. No reflective strip is provided at the corresponding position of any reflective strip among the multiple reflective strips, and the corresponding position is a position symmetrical to any reflective strip about the central axis.
18. The device according to any one of claims 14 to 16, characterized in that, The light source reflector is a discontinuous ring shape, comprising: The light source reflector includes a reflective strip, which is arranged around the central axis of the lens assembly of the first camera module. The reflective strip is part of a continuous ring-shaped object, and the two ends of the reflective strip are not connected together.
19. The device according to any one of claims 14 to 18, characterized in that, The light source reflector includes a second surface for reflecting light from the light source and allowing the reflected light to enter the first camera module; a first axis passes through the plane containing the second surface and is perpendicular to the lens assembly of the first camera module.
20. The device according to claim 19, characterized in that, The second surface faces the lens assembly of the first camera module.
21. The device according to any one of claims 14 to 20, characterized in that, The reflector of the light source has a consistent reflectivity across all bands of the visible light spectrum.
22. The device according to any one of claims 14 to 21, characterized in that, The light source reflector satisfies one or more of the following: The light source reflector is a white or gray reflector; The light source reflector is a mirrored object; or, The light source reflector is partially or entirely made of frosted semi-transparent material.
23. The device according to any one of claims 14 to 22, characterized in that, The electronic device further includes at least one second camera module, wherein the lens assembly of the second camera module is oriented in the same or opposite direction to the lens assembly of the first camera module.
24. A camera device, characterized in that, include: A first camera module and a light source reflector, wherein the light source reflector is disposed on one side of the light-inlet surface of the first camera module; the light source reflector includes a second surface, the second surface being a surface for reflecting light from a light source and allowing the reflected light from the light source to enter the first camera module; a first axis passes through the plane containing the second surface, and the first axis is perpendicular to the lens assembly of the first camera module; The light source reflector is used to reflect the light from the light source so that the reflected light from the light source enters the first camera module.
25. The apparatus according to claim 24, characterized in that, The second surface faces the lens assembly of the first camera module.
26. The apparatus according to claim 24 or 25, characterized in that, The light source reflector can be a continuous ring or a discontinuous ring.
27. The apparatus according to claim 26, characterized in that, The light source reflector is a discontinuous ring shape, comprising: The light source reflector includes multiple spaced reflective strips arranged around the central axis of the lens assembly of the first camera module. No reflective strip is provided at the corresponding position of any reflective strip among the multiple reflective strips, and the corresponding position is a position symmetrical to any reflective strip about the central axis.
28. The apparatus according to claim 26, characterized in that, The light source reflector is a discontinuous ring shape, comprising: The light source reflector includes a reflective strip, which is arranged around the central axis of the lens assembly of the first camera module. The reflective strip is part of a continuous ring-shaped object, and the two ends of the reflective strip are not connected together.
29. The apparatus according to any one of claims 24 to 28, characterized in that, The reflector of the light source has a consistent reflectivity across all bands of the visible light spectrum.
30. The apparatus according to any one of claims 24 to 29, characterized in that, The light source reflector satisfies one or more of the following: The light source reflector is a white or gray reflector; The light source reflector is a mirrored object; or, The light source reflector is partially or entirely made of frosted semi-transparent material.
31. The apparatus according to any one of claims 24 to 30, characterized in that, The camera device further includes at least one second camera module, wherein the lens assembly of the second camera module is oriented in the same or opposite direction to the lens assembly of the first camera module.
32. An electronic device, characterized in that, include: First camera module, second camera module, light source reflector, processor, and memory; The light source reflector is used to reflect light from the light source; The first camera module is used to acquire first image data, which includes data collected based on the reflected light from the light source reflector. The second camera module is used to acquire second image data. The first image data includes data collected based on the reflected light from the light source reflector. The first camera module and the second camera module are the same camera module, or the first camera module and the second camera module are different camera modules. The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in any one of claims 1-13.
33. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-13.
34. A chip system, characterized in that, It includes at least one processor and a communication interface, the communication interface and the at least one processor being interconnected via a line, the at least one processor being configured to run a computer program or instructions to perform the method as described in any one of claims 1-13.
35. A computer program product, characterized in that, Includes a computer program that, when run, causes a computer to perform the method as described in any one of claims 1-13.
