Color temperature detection method, device, apparatus and storage medium
By storing the correspondence between ambient illuminance range and exposure time, the color temperature sensor is controlled to collect electrical signals at different exposure times, solving the problem of color temperature detection in electronic devices over a wide illuminance range and achieving accurate color temperature value calculation.
Patent Information
- Application Number
- CN202510092866.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-01-20
AI Technical Summary
Electronic devices cannot achieve accurate color temperature detection over a wide range of ambient light levels because the electrical signal of the color temperature sensor is too small to be recognized under low light conditions, while the electrical signal is too large under high light conditions, exceeding the acquisition range.
The correspondence between ambient illuminance range and exposure time is pre-stored. The color temperature sensor is controlled to expose and collect electrical signal parameters in sequence. Target electrical signal parameters within the signal processing range are selected, and the color temperature value is calculated based on this.
Even when the ambient illuminance varies over a wide range, accurate color temperature detection can be achieved, preventing the electrical signal from exceeding the acquisition range and ensuring detection accuracy.
Smart Images

Figure CN119666163B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display technology, and in particular to a color temperature detection method, apparatus, device, and storage medium. Background Technology
[0002] Currently, smartphones, tablets, and other electronic devices are typically equipped with color temperature sensors. These sensors adjust the brightness and color temperature of the device based on ambient light and color temperature when the device is in different environments or when it enters shooting mode, thereby enhancing the user's viewing and shooting experience.
[0003] In different usage environments, the ambient light level can vary considerably. For example, a user may use electronic devices in darkness or in direct sunlight. Therefore, electronic devices need to be able to detect color temperature over a wide range of ambient light levels.
[0004] However, when electronic devices perform color temperature detection under low ambient light conditions, a sudden increase in ambient light causes the electrical signal generated by the color temperature sensor based on the strong light signal to become too large, exceeding the voltage acquisition range of the downstream device, thus preventing color temperature detection. Conversely, when electronic devices perform color temperature detection under high ambient light conditions, a decrease in ambient light causes the electrical signal generated by the color temperature sensor based on the weak light signal to become too small, falling below the acquisition range of the downstream device, making it impossible for the downstream device to recognize the electrical signal. In other words, electronic devices cannot achieve color temperature detection over a wide range of ambient light conditions. Summary of the Invention
[0005] This application provides a color temperature detection method, apparatus, device, and storage medium, which can improve the technical problem in related technologies that it is impossible to achieve color temperature detection under a wide range of ambient illuminance.
[0006] In a first aspect, embodiments of this application provide a color temperature detection method, applied to an electronic device including a color temperature sensor; the method includes:
[0007] Multiple ambient illuminance ranges and their corresponding exposure times are obtained from the first correspondence relationship; wherein, the first correspondence relationship is the correspondence between ambient illuminance ranges and exposure times;
[0008] Collect electrical signal parameters generated by the color temperature sensor at each exposure time;
[0009] Determine the target electrical signal parameter that matches the preset signal processing range from multiple electrical signal parameters;
[0010] The corresponding color temperature value is determined based on the target electrical signal parameters.
[0011] Secondly, embodiments of this application provide a color temperature detection device, the device comprising:
[0012] The acquisition module is used to acquire multiple ambient illuminance ranges and their corresponding multiple exposure times from a first correspondence relationship; wherein, the first correspondence relationship is the correspondence between ambient illuminance ranges and exposure times;
[0013] The acquisition module is used to acquire the electrical signal parameters generated by the color temperature sensor at each exposure time;
[0014] The matching module is used to determine the target electrical signal parameter that matches the preset signal processing range from multiple electrical signal parameters;
[0015] The determination module is used to determine the corresponding color temperature value based on the target electrical signal parameters.
[0016] Thirdly, embodiments of this application provide an electronic device, which includes: a processor and a memory storing computer program instructions;
[0017] The processor implements the color temperature detection method of the first aspect when executing computer program instructions.
[0018] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the color temperature detection method of the first aspect.
[0019] Compared with existing technologies, the color temperature detection method, apparatus, device, and storage medium provided in this application embodiment have a first correspondence pre-stored in the electronic device. This first correspondence is the correspondence between ambient illuminance ranges and exposure times. After determining the exposure time corresponding to each ambient illuminance range from the first correspondence, the color temperature sensor can be controlled to sequentially expose according to each exposure time, and the electrical signal parameters generated at each exposure time can be collected. Among multiple electrical signal parameters, a target electrical signal parameter that matches a preset signal processing range can be determined. Since the target electrical signal parameter is within the signal processing range and will not exceed the voltage acquisition range of the backend, the backend can obtain accurate target electrical signal parameters and calculate the current corresponding color temperature value based on the target electrical signal parameters using relevant color temperature detection algorithms. In the above embodiment, by sequentially performing multiple exposures at different times, target electrical signal parameters within the acquisition range of the backend can be filtered out, and the corresponding color temperature value can be determined based on the target electrical signal parameters. Even when the range of ambient illuminance variation is wide, the color temperature detection function can still be achieved. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic flowchart of a color temperature detection method provided in an embodiment of this application;
[0022] Figure 2 This is a partial flowchart of a color temperature detection method provided in another embodiment of this application;
[0023] Figure 3 This is a partial flowchart of a color temperature detection method provided in another embodiment of this application;
[0024] Figure 4 This is one of the flowcharts of a color temperature detection method provided in another embodiment of this application;
[0025] Figure 5 This is a second schematic flowchart of a color temperature detection method provided in another embodiment of this application;
[0026] Figure 6 This is the third schematic flowchart of a color temperature detection method provided in another embodiment of this application;
[0027] Figure 7 This is the fourth schematic flowchart of a color temperature detection method provided in another embodiment of this application;
[0028] Figure 8 This is the fifth flowchart of a color temperature detection method provided in another embodiment of this application;
[0029] Figure 9 This is the fifth flowchart of a color temperature detection method provided in another embodiment of this application;
[0030] Figure 10 This is a schematic diagram of the structure of a color temperature sensor provided in an embodiment of this application;
[0031] Figure 11 This is a schematic diagram of the structure of a color temperature detection device provided in an embodiment of this application;
[0032] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0033] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples of this application.
[0034] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0035] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The embodiments will now be described in detail with reference to the accompanying drawings.
[0036] Currently, smartphones, tablets, and other electronic devices are typically equipped with color temperature sensors. These sensors adjust the brightness and color temperature of the device based on ambient light and color temperature when the device is in different environments or when it enters shooting mode, thereby enhancing the user's viewing and shooting experience.
[0037] In different usage environments, the ambient illuminance can vary considerably. For example, a user may use an electronic device in darkness or in direct sunlight. Therefore, electronic devices need to be able to detect color temperature over a wide range of ambient illuminance levels, and then adjust brightness and color temperature accordingly based on the detected color temperature value.
[0038] However, when electronic devices perform color temperature detection under low ambient light conditions, if the ambient light level increases dramatically, the electrical signal generated by the color temperature sensor based on the strong light signal becomes too large, exceeding the voltage acquisition range of the backend, thus preventing color temperature detection. Conversely, when electronic devices perform color temperature detection under high ambient light conditions, if the ambient light level decreases, the electrical signal generated by the color temperature sensor based on the weak light signal becomes too small, below the acquisition range of the backend, making it impossible for the backend to recognize the electrical signal.
[0039] As an example, with an ambient illuminance of 100,000 lux, the number of channels for each color in the color temperature sensor is set to 1, and the exposure time is 1.41 ms. At this time, the voltage signal generated by the red channel is 0.6V, and the voltage signals generated by the green, blue and white channels are 1.12V, 0.83V and 4.50V, respectively.
[0040] In another example, keeping the exposure time constant and setting the ambient illuminance to 30 lux, the voltage signals generated by the red, green, blue, and white channels are 0.00018V, 0.000336V, 0.000249V, and 0.00135V, respectively. It is understandable that at the same exposure time, with an ambient illuminance of 100,000 lux, the detected voltage signal can reach 4.5V, while with an ambient illuminance of 30 lux, the detected voltage signal is only 0.00018V, far below the sampling lower limit of the electronic device's voltage sampling port, thus failing to achieve signal acquisition and color temperature detection. In other words, existing electronic devices cannot achieve color temperature detection over a wide range of ambient illuminance.
[0041] To address at least one of the aforementioned technical problems, embodiments of this application provide a color temperature detection method, apparatus, device, and storage medium. The color temperature detection method provided in this application embodiment will be described first below.
[0042] Figure 1 A schematic flowchart of a color temperature detection method according to an embodiment of this application is shown. The color temperature detection method is applied to an electronic device including a color temperature sensor, and the method may include the following steps:
[0043] S110, obtain multiple ambient illuminance ranges and their corresponding multiple exposure times from the first correspondence relationship; wherein, the first correspondence relationship is the correspondence between ambient illuminance ranges and exposure times;
[0044] S120 collects electrical signal parameters generated by the color temperature sensor at each exposure time;
[0045] S130, determine the target electrical signal parameter that matches the preset signal processing range from multiple electrical signal parameters;
[0046] S140 determines the corresponding color temperature value based on the target electrical signal parameters.
[0047] In this embodiment, the electronic device pre-stores a first correspondence, which is a correspondence between ambient illuminance ranges and exposure times. After determining the exposure time corresponding to each ambient illuminance range from the first correspondence, the color temperature sensor can be controlled to sequentially expose according to each exposure time and collect the electrical signal parameters generated at each exposure time. Among the multiple electrical signal parameters, a target electrical signal parameter that matches the preset signal processing range can be determined. Since the target electrical signal parameter is within the signal processing range and will not exceed the voltage acquisition range of the backend, the backend can obtain accurate target electrical signal parameters and calculate the current corresponding color temperature value based on the target electrical signal parameters using relevant color temperature detection algorithms. In the above embodiment, by sequentially performing exposures for multiple different exposure times, target electrical signal parameters within the acquisition range of the backend can be filtered out, and then the corresponding color temperature value can be determined based on the target electrical signal parameters. Even when the range of ambient illuminance variation is wide, the color temperature detection function can still be achieved.
[0048] The specific implementation methods for each of the above steps are described below.
[0049] In S110, the electronic device can perform color temperature detection under different ambient illuminance levels using a color temperature sensor. When performing color temperature detection, the electronic device can obtain a pre-generated first correspondence, which includes the correspondence between multiple ambient illuminance ranges and exposure times.
[0050] The electronic device can obtain multiple ambient illuminance ranges and their corresponding exposure times from the first correspondence, that is, the exposure time corresponding to each ambient illuminance range.
[0051] The multiple ambient illuminance intervals in the first correspondence should at least cover the ambient illuminance range in which the electronic device can maintain normal operation. For example, if the ambient illuminance range in which the electronic device can normally perform color temperature detection is 30 lux-100,000 lux, then the set of multiple ambient illuminance intervals should include the range of 30 lux-100,000 lux. In one example, the multiple ambient illuminance intervals could be 30 lux-140 lux, 140 lux-500 lux, 500 lux-2000 lux, 2000 lux-7000 lux, 7000 lux-30000 lux, and 30000 lux-100000 lux.
[0052] It should be noted that the number of ambient illuminance intervals and the range of each interval mentioned above are just examples. The specific ambient illuminance intervals and ranges need to be set according to the actual hardware parameters of the color temperature sensor, and no specific limitations are made here.
[0053] Please refer to Figure 2 In some embodiments, the color temperature sensor includes channels for at least two colors; prior to S110 above, the following may be included:
[0054] S210, obtain the upper and lower limits of ambient illuminance detection;
[0055] S220, with the initial ambient illuminance at the detection upper limit, acquires the electrical signal parameters generated by the color temperature sensor for each color channel at different exposure times;
[0056] S230, based on the electrical signal parameters at each exposure time, determines the exposure time interval that meets the signal range condition; wherein, the signal range condition is that the electrical signal parameters generated by each color channel are all within the preset signal processing range;
[0057] S240, within the exposure time interval, determine the target exposure time, and determine the exposure time as the minimum ambient illuminance that satisfies the signal range condition under the target exposure time;
[0058] S250 generates a target ambient illuminance range based on the initial ambient illuminance and the minimum ambient illuminance;
[0059] S260, using the lower limit of the current target ambient illuminance range as the new initial ambient illuminance, return to S220 to obtain the next target ambient illuminance range and its corresponding target exposure time, until the lowest ambient illuminance is less than or equal to the detection lower limit.
[0060] S270 generates a first correspondence based on multiple target ambient illuminance ranges and their corresponding target exposure times.
[0061] Before obtaining the first correspondence, the first correspondence can be generated in advance using the following implementation method.
[0062] In this embodiment, the electronic device can acquire a pre-set upper and lower limit value for ambient illuminance detection. The upper limit value is used as the initial ambient illuminance for the first target ambient illuminance interval. By continuously adjusting the exposure time and detecting the electrical signal parameters of each color channel at each exposure time, the exposure time interval can be obtained. Under the initial ambient illuminance, within the exposure time interval, the electrical signal parameters of any color channel can satisfy the signal range condition. After selecting a target exposure time from the exposure time interval, the ambient illuminance can be continuously adjusted at the target exposure time to determine the lowest ambient illuminance at which the electrical signal parameters of any color channel can satisfy the signal range condition. The first target ambient illuminance interval can be constructed based on the initial and lowest ambient illuminance. After determining a target ambient illuminance interval, the lowest ambient illuminance of the previous target ambient illuminance interval can be used as the initial ambient illuminance of the next target ambient illuminance interval, and the above operation is repeated to obtain multiple target ambient illuminance intervals until the lowest ambient illuminance of the obtained target ambient illuminance interval reaches the lower limit value. Based on the obtained multiple target ambient illuminance ranges and the target exposure time corresponding to each target ambient illuminance range, a first correspondence can be generated.
[0063] In S210, based on the ambient illuminance range in which the electronic device can maintain normal operation, the upper limit and lower limit of ambient illuminance detection can be determined.
[0064] As an example, the upper limit for detecting ambient illuminance can be 100,000 lux, and the lower limit can be 30 lux.
[0065] In S220, the ambient illuminance can be adjusted by changing the external light source. Based on the detection upper limit of the ambient illuminance, the initial ambient illuminance can be set as the detection upper limit.
[0066] Under initial ambient light conditions, electronic devices can acquire the electrical signal parameters generated by the color temperature sensor for each color channel at different exposure times.
[0067] It is understandable that for each color channel in a color temperature sensor, the generated electrical signal parameter can be a photocurrent signal or a voltage signal converted from the photocurrent signal. For example, the back-end sampling port connected to the color temperature sensor can directly read the photocurrent signal as the electrical signal parameter, or it can convert the photocurrent signal into a voltage signal and then read the corresponding voltage signal. In the following embodiment, the voltage signal obtained by converting the photocurrent is used as the electrical signal parameter. The magnitude of this voltage signal is positively correlated with the exposure time of the color temperature sensor. That is, under constant ambient illuminance, the longer the exposure time, the larger the voltage signal generated by each color channel.
[0068] In S230, after determining the electrical signal parameters generated by each color channel at each exposure time, the exposure time interval that satisfies the signal range condition can be determined accordingly. This signal range condition requires that the electrical signal parameters generated by each color channel are within a preset signal processing range.
[0069] As an alternative example, the electronic device includes multiple sampling ports connected to the channels of a color temperature sensor for each of the various colors. Each sampling port can receive electrical signal parameters generated by the same color channel. Taking voltage signals as an example, the voltage signal processing range that the sampling port can normally acquire is 0.5V-4.5V. Voltage signals outside the signal processing range may result in low sampling accuracy or overvoltage damage to the device.
[0070] At each exposure time, the electrical signal parameters generated by each color channel can be determined. If, at a certain exposure time, the electrical signal parameters generated by all color channels are within the preset signal processing range, then that exposure time satisfies the signal range condition.
[0071] As an optional implementation, the emitted light color of the electronic device can include red, green, blue, and white. Taking red, green, blue, and white as single-channel examples, with an initial ambient illuminance of 100,000 lux and an exposure time of 1.41 ms, the voltage signal generated by the red single channel is 0.60V, while the voltage signals generated by the green, blue, and white single channels are 1.12V, 0.83V, and 4.50V, respectively. When the signal processing range is 0.5V-4.5V, the electrical signal parameters generated by the four colors are all within the preset signal processing range, thus the exposure time of 1.41 ms meets the signal range requirements.
[0072] Similarly, under multiple different exposure times, one or more exposure times that satisfy the signal range condition can be determined. If multiple exposure times satisfy the signal range condition, the exposure time interval that satisfies the signal range condition can be determined based on the minimum and maximum times among the multiple exposure times.
[0073] It should be noted that, among multiple exposure times, at the minimum and maximum times that satisfy the signal range condition, the electrical signal parameters generated by all color channels in the color temperature sensor are within the preset signal processing range. Since the electrical signal parameters generated by a channel are positively correlated with the exposure time, for each color channel, the electrical signal parameters generated at any exposure time between the minimum and maximum times will also necessarily be within the preset signal processing range. Therefore, based on the minimum and maximum times that satisfy the signal range condition, the exposure time interval can be determined.
[0074] In S240, after determining the exposure time interval that satisfies the signal range conditions, the target exposure time can be determined within the exposure time interval, and the minimum ambient illuminance that satisfies the signal range conditions under the target exposure time can be determined.
[0075] Understandably, an exposure time range can only be determined when at least two exposure times satisfy the signal range condition, and then the target exposure time can be further determined from this range. If only one exposure time satisfies the signal range condition, then that exposure time can be directly determined as the target exposure time.
[0076] In some embodiments, the target exposure time is the maximum value within the exposure time interval.
[0077] Since any exposure time within the exposure time range can meet the requirements, and the longer the exposure time, the larger the voltage signal generated by the channel. Therefore, when the maximum value within the exposure time range is selected as the target exposure time, the voltage signal generated by each channel can approach the upper limit of the signal processing range. This avoids the voltage signal generated by each channel being too low at the target exposure time, making full use of the signal processing range and improving the accuracy of signal acquisition.
[0078] At the target exposure time and with the ambient illuminance at the initial ambient illuminance, the electrical signal parameters generated by each color channel are within a preset signal processing range. For example, when the initial ambient illuminance is 100,000 lux and the target exposure time is 0.94 ms, the voltage signals generated by each color channel are between 0.5V and 4.5V.
[0079] After determining the target exposure time, the ambient illuminance can be adjusted by gradually decreasing it. If, under the reduced illuminance, the voltage signal generated by each color channel at the target exposure time remains between 0.5V and 4.5V, then the reduced illuminance also meets the signal range condition. The ambient illuminance can then be further decreased until, at a certain illuminance, at least one color channel generates a voltage signal below 0.5V. At this point, it can be determined that the ambient illuminance does not meet the signal range condition, and the previous ambient illuminance that meets the signal range condition is determined as the minimum ambient illuminance. For example, if, at a target exposure time of 0.94ms, the ambient illuminance is reduced to 30000 lux, and the voltage signal generated by each color channel remains between 0.5V and 4.5V, but after further reducing the ambient illuminance, at least one color channel generates a voltage signal below 0.5V, then 30000 lux can be determined as the minimum ambient illuminance that meets the signal range condition.
[0080] Please refer to Figure 3 In some embodiments, the above-described S240 may include:
[0081] S310, with the exposure time being the target exposure time, acquires the electrical signal parameters generated by the color temperature sensor for each color channel under different ambient illuminance.
[0082] S320 filters out multiple ambient illuminances that meet the signal range conditions based on the electrical signal parameters under each ambient illuminance.
[0083] S330, determine the minimum ambient illuminance as the minimum value among multiple ambient illuminances that satisfy the signal range condition.
[0084] In this embodiment, after determining the target exposure time, the exposure time can be set as the target exposure time, and the electrical signal parameters generated by the channels of each color in the color temperature sensor are acquired under different ambient illuminance conditions. Based on the electrical signal parameters under each ambient illuminance condition, a subset of electrical signal parameters that meet the signal range condition can be selected. The ambient illuminance corresponding to this subset of electrical signal parameters constitutes the multiple ambient illuminance conditions that meet the signal range condition. After obtaining the multiple ambient illuminance conditions that meet the signal range condition, the minimum ambient illuminance can be selected as the lowest ambient illuminance within the target ambient illuminance range.
[0085] In S310, after determining the target exposure time, the exposure time can be set as the target exposure time, and the ambient illuminance can be adjusted. Under different ambient illuminance levels, the electrical signal parameters generated by each color channel of the color temperature sensor can be acquired. For example, after determining the target exposure time to be 0.94ms and the initial ambient illuminance to be 100,000 lux, the signal magnitude of the voltage signal generated by each color channel of the color temperature sensor can be acquired under different ambient illuminance levels such as 90,000 lux, 60,000 lux, and 30,000 lux.
[0086] In S320, after matching the signal range conditions for the electrical signal parameters under each ambient illuminance, multiple ambient illuminances that satisfy the signal range conditions can be selected. For example, at 90,000 lux, the signal magnitudes of the voltage signals generated by each color channel are all within the range of 0.5V-4.5V, so 90,000 lux is an ambient illuminance that satisfies the signal range conditions. Similarly, using the above method, 60,000 lux and 30,000 lux can also be determined as ambient illuminances that satisfy the signal range conditions. When the ambient illuminance is below 30,000 lux, the signal magnitude of the voltage signal generated by at least one color channel is below 0.5V. Finally, 90,000 lux, 60,000 lux, and 30,000 lux can be determined as multiple ambient illuminances that satisfy the signal range conditions.
[0087] It should be noted that the ambient illuminance values of 90,000 lux, 60,000 lux, and 30,000 lux mentioned above are just examples. The specific ambient illuminance can be set according to actual needs, and no specific limit is made here.
[0088] In step S330, after determining multiple ambient illuminance values that satisfy the signal range condition, the minimum value of the multiple ambient illuminance values can be determined as the lowest ambient illuminance value that satisfies the signal range condition. For example, in the embodiment described above, the lowest ambient illuminance value can be determined to be 30,000 lux.
[0089] In S250, after determining the minimum ambient illuminance, a target ambient illuminance range can be generated based on the initial ambient illuminance and the minimum ambient illuminance.
[0090] Taking the above implementation as an example, when the initial ambient illuminance is 100,000 lux and the minimum ambient illuminance is 30,000 lux, the target ambient illuminance range is 100,000 lux-30,000 lux.
[0091] In some embodiments, after S250 above, the following may also be included:
[0092] Based on the target exposure time and the electrical signal parameters corresponding to the color temperature sensor under different ambient illuminance, a second correspondence is generated within the target ambient illuminance range; wherein, the second correspondence is the correspondence between the electrical signal parameters and the ambient illuminance.
[0093] In this embodiment, after determining the target ambient illuminance range, the electrical signal parameters of the color temperature sensor at the target exposure time can be obtained under different ambient illuminances within the target ambient illuminance range. Based on the electrical signal parameters under each ambient illuminance, a second correspondence within the target ambient illuminance range can be fitted and generated.
[0094] Taking the red channel in a color temperature sensor as an example, after determining the target ambient illuminance range as 100,000 lux-30,000 lux, the voltage signals generated by the red channel at ambient illuminances of 90,000 lux, 60,000 lux, and 30,000 lux can be obtained at a target exposure time of 0.94 ms. Since the generated voltage signals are positively correlated with the ambient illuminance when the exposure time remains constant, the correspondence between the generated electrical signal parameters and the ambient illuminance can be fitted based on multiple ambient illuminances and their corresponding voltage signals. The fitting method described above can be linear fitting or nonlinear fitting.
[0095] The above implementation method can obtain the second correspondence of the red channel within the target ambient illuminance range. Using the same implementation method, the second correspondence of other color channels in the color temperature sensor can also be obtained.
[0096] It is understandable that after obtaining the second correspondence between each color channel in the color temperature sensor, the ambient illuminance can be determined based on the actual electrical signal parameters obtained during the operation of the electronic device, according to the second correspondence.
[0097] When determining the minimum ambient illuminance, partial ambient illuminance levels within the target ambient illuminance range have already been tested. When fitting and generating the second correspondence, the previous test data can be directly obtained. For example, when the minimum ambient illuminance is determined to be 30,000 lux, the voltage signals generated by each color channel at 90,000 lux, 60,000 lux, and 30,000 lux have already been tested. At this point, the second correspondence for each color can be directly fitted based on this test data.
[0098] It should be noted that if more data under ambient illuminance is needed when fitting the second correspondence, such as the voltage signals generated by each color channel at 40,000 lux and 70,000 lux, the ambient illuminance can be adjusted to 40,000 lux and 70,000 lux, and the electrical signal parameters generated by each color channel can be obtained.
[0099] In S260, after determining the target ambient illuminance range, the lower limit of the current target ambient illuminance range can be used as the new initial ambient illuminance, and the above S220-S250 can be executed again to obtain the next target ambient illuminance range and its corresponding exposure time, until the lowest ambient illuminance of the obtained target ambient illuminance range is less than or equal to the detection lower limit.
[0100] As an example, after determining the first target ambient illuminance range of 100,000 lux to 30,000 lux based on the detection upper limit, 30,000 lux can be used as the new initial ambient illuminance. The exposure time range that satisfies the signal range condition under this new ambient illuminance can then be determined. Within this exposure time range, a target exposure time of 3.51 ms can be selected. Based on the target exposure time of 3.51 ms, the ambient illuminance can be gradually reduced, and it can be determined whether the voltage signals generated by each color channel under each ambient illuminance are within the signal processing range. The minimum ambient illuminance under the target exposure time of 3.51 ms is then determined to be 7,000 lux. At this point, the second target ambient illuminance range can be determined to be 30,000 lux to 7,000 lux, and the target exposure time corresponding to this range is 3.51 ms.
[0101] Since the lowest ambient illuminance of 7000 lux in the second target ambient illuminance range is still greater than the detection limit of 30 lux, 7000 lux can be used as the initial ambient illuminance of the signal for the third target ambient illuminance range. The above steps are then performed to obtain the third target ambient illuminance range as 7000 lux-2000 lux, with a corresponding target exposure time of 13.1 ms.
[0102] By repeatedly executing the above steps, several target ambient illuminance ranges can be obtained, namely 2000 lux-500 lux, 500 lux-140 lux, and 140 lux-30 lux, corresponding to target exposure times of 49.2 ms, 184 ms, and 689 ms, respectively. At this point, since the lowest ambient illuminance in the target ambient illuminance range of 140 lux-30 lux matches the detection lower limit, the loop stops.
[0103] In S270, after determining multiple target ambient illuminance ranges and their corresponding target exposure times, a first correspondence can be generated.
[0104] In S120, based on the multiple exposure times in the first correspondence, the color temperature sensor is controlled to expose according to the duration of each exposure time, and the electrical signal parameters generated by the color temperature sensor at each exposure time are collected.
[0105] Please refer to Figure 4 In some embodiments, the color temperature sensor includes a first sensing subunit and a second sensing subunit, the first sensing subunit and the second sensing subunit including channels for at least two colors; the above S120 may include:
[0106] S410 divides multiple ambient illuminance ranges into a first group and a second group according to their corresponding exposure times;
[0107] S420, control the first sensing subunit to expose according to the exposure time corresponding to the ambient illuminance range of the first group, and control the second sensing subunit to expose according to the exposure time corresponding to the ambient illuminance range of the second group;
[0108] S430 collects the electrical signal parameters generated by the first sensing subunit at each exposure time and the electrical signal parameters generated by the second sensing subunit at each exposure time.
[0109] In this embodiment, the color temperature sensor includes two sensing subunits. After dividing multiple ambient illuminance ranges into two groups according to their exposure times, the first sensing subunit can be controlled to expose according to the exposure times of each group in the first group, and the second sensing subunit can be controlled to expose according to the exposure times of each group in the second group. Since the first and second sensing subunits can expose simultaneously, the total exposure time is the larger of the sum of the exposure times of the first group and the sum of the exposure times of the second group. Compared to an implementation using a single sensing subunit, this effectively reduces the exposure time and improves color temperature detection efficiency.
[0110] In S410, the color temperature sensor may include two types of sensing subunits, namely a first sensing subunit and a second sensing subunit. Both the first sensing subunit and the second sensing subunit include channels for at least two colors.
[0111] After determining multiple ambient illuminance ranges and multiple exposure times based on the first correspondence, the multiple ambient illuminance ranges can be divided into a first group and a second group according to their corresponding exposure times.
[0112] Please refer to Figure 5 In some embodiments, the above-described S410 may include:
[0113] S411, obtain the exposure time corresponding to multiple ambient illuminance ranges;
[0114] S412, divides multiple ambient illuminance intervals into a first group and a second group, so as to minimize the difference between the total exposure time of the first group and the total exposure time of the second group; wherein, the total exposure time is the sum of multiple exposure times.
[0115] In this embodiment, after obtaining the exposure times corresponding to multiple ambient illuminance intervals, the exposure times of each ambient illuminance interval can be grouped so that the difference between the total exposure times of the two groups is minimized after being divided into a first group and a second group. That is, the total exposure time of the first group and the total exposure time of the second group are made as close as possible through grouping.
[0116] In S411, when grouping multiple ambient illuminance intervals, the exposure time corresponding to each ambient illuminance interval can be obtained first.
[0117] In S412, after determining the exposure time corresponding to each ambient illuminance interval, multiple ambient illuminance intervals can be divided into a first group and a second group to minimize the difference between the total exposure time of the first group and the total exposure time of the second group. The total exposure time is the sum of the multiple exposure times.
[0118] As an optional implementation, the multiple ambient illuminance ranges in the first correspondence may include 30 lux-140 lux, 140 lux-500 lux, 500 lux-2000 lux, 2000 lux-7000 lux, 7000 lux-30000 lux, and 30000 lux-100000 lux, with corresponding exposure times of 689 ms, 184 ms, 49.2 ms, 13.1 ms, 3.51 ms, and 0.94 ms, respectively.
[0119] Since the exposure time of 689ms for the ambient illuminance range of 30 lux-140 lux is already greater than the sum of the exposure times for other ambient illuminance ranges, in order to minimize the difference between the total exposure time of the first group and the total exposure time of the second group, the ambient illuminance range of 30 lux-140 lux can be divided into the first group, and the remaining ambient illuminance range can be divided into the second group.
[0120] In some embodiments, the number of channels of the same color is the same in both the first sensing subunit and the second sensing subunit.
[0121] In this embodiment, both the first and second sensing subunits contain channels of multiple colors, and the number of channels for each color is the same. For example, if the first sensing subunit contains 8 red channels, then the second sensing subunit also contains 8 red channels. Since the number of red channels is the same, the voltage signals generated by the red channels of the two sensing subunits are also consistent under the same exposure time. That is, the second correspondence between the red channels of the two sensing subunits is also consistent.
[0122] In S420, after dividing multiple ambient illuminance ranges into a first group and a second group, the first sensing subunit can be controlled to expose according to the exposure time corresponding to the ambient illuminance range of the first group, and the second sensing subunit can be controlled to expose according to the exposure time corresponding to the ambient illuminance range of the second group.
[0123] Since the first and second sensing subunits can be exposed simultaneously, compared to using a single sensing subunit to expose sequentially according to the exposure time corresponding to each ambient illuminance range, the total exposure time can be saved and the color temperature detection efficiency can be improved.
[0124] It is understandable that, taking the above implementation as an example, if only a single sensing subunit is set, the total exposure time for sequentially performing exposures according to the exposure times corresponding to each ambient illuminance range is:
[0125] 689+184+49.2+13.1+3.51+0.94=939.75ms;
[0126] Using two sensing sub-units and a grouped exposure method, the first group has an ambient illuminance range of 30 lux-140 lux, and the second group has an ambient illuminance range of the remaining ambient illuminance. Therefore, the total exposure time for the first sensing sub-unit is 689 ms, and the total exposure time for the second sensing sub-unit is:
[0127] 184+49.2+13.1+3.51+0.94=250.75ms;
[0128] Since the first and second sensing subunits can operate independently, the total exposure time after grouping is the larger of the two total exposure times, which is 689ms. Compared to the total exposure time of 939.75ms when using a single sensing subunit, this significantly reduces the exposure time and improves color temperature detection efficiency.
[0129] In S430, electrical signal parameters generated by the first sensing subunit can be collected at each exposure time corresponding to the first group; electrical signal parameters generated by the second sensing subunit can be collected at each exposure time corresponding to the second group.
[0130] It should be noted that the color temperature sensor may also include three or more sensing sub-units. Depending on the number of sensing sub-units, multiple ambient illuminance ranges can be divided into multiple groups. Each sensing sub-unit can operate independently and expose the ambient illuminance ranges contained in different groups for the corresponding exposure time, thereby reducing the total exposure time.
[0131] Please refer to Figure 6 In some embodiments, the color temperature sensor includes a third sensing subunit and a fourth sensing subunit, the third sensing subunit and the fourth sensing subunit including channels for at least two colors; the above S120 may include:
[0132] S510 divides multiple ambient illuminance ranges into third and fourth groups according to their corresponding exposure times;
[0133] S520 controls the third sensing subunit to perform exposure according to the exposure time corresponding to the ambient illuminance range of the third group;
[0134] S530, control the third and fourth sensing subunits to perform exposure according to the updated exposure time; wherein, the updated exposure time corresponding to each ambient illuminance interval in the fourth group is lower than the exposure time corresponding to each ambient illuminance interval.
[0135] In this embodiment, the color temperature sensor includes two sensing subunits. After dividing multiple ambient illumination ranges into two groups based on exposure time, the third sensing subunit can be controlled to expose according to the exposure time duration of each group. For ambient illumination ranges with longer exposure times, they can be assigned to a fourth group, and the third and fourth sensing subunits can be controlled to expose simultaneously. The electrical signal parameters acquired by the electronic device are the sum of the electrical signal parameters of the third and fourth sensing subunits. To avoid the acquired voltage signal exceeding the signal processing range, the exposure time can be reduced to obtain an updated exposure time. With the updated exposure time, since the third and fourth sensing subunits generate electrical signal parameters simultaneously, the same signal quantity can be acquired with less exposure time. For ambient illumination ranges with longer exposure times, reducing the exposure time effectively saves the total exposure time and improves color temperature detection efficiency.
[0136] In the S510, the color temperature sensor may include two types of sensing subunits: a third sensing subunit and a fourth sensing subunit. Both the third and fourth sensing subunits may include channels for at least two colors.
[0137] After determining multiple ambient illuminance ranges and multiple exposure times based on the first correspondence, the multiple ambient illuminance ranges can be divided into a third group and a fourth group according to their corresponding exposure times.
[0138] Please refer to Figure 7 In some embodiments, the above-described S510 may include:
[0139] S511, obtain the exposure time corresponding to multiple ambient illuminance ranges;
[0140] S512, the ambient light range with an exposure time less than the duration threshold is divided into the third group, and the ambient light range with an exposure time greater than or equal to the duration threshold is divided into the fourth group.
[0141] In this embodiment, after obtaining the exposure times corresponding to multiple ambient illuminance intervals, the intervals can be grouped according to their exposure times, such that the intervals with shorter exposure times are assigned to the third group, and the intervals with longer exposure times are assigned to the fourth group.
[0142] In S511, when grouping multiple ambient illuminance ranges, the exposure time corresponding to each ambient illuminance range can be obtained first.
[0143] In S512, after determining the exposure time corresponding to each ambient illuminance interval, the ambient illuminance intervals with exposure times less than the duration threshold can be divided into the third group, and the ambient illuminance intervals with exposure times greater than or equal to the duration threshold can be divided into the fourth group.
[0144] As an optional implementation, the multiple ambient illuminance ranges in the first correspondence may include 30 lux-140 lux, 140 lux-500 lux, 500 lux-2000 lux, 2000 lux-7000 lux, 7000 lux-30000 lux, and 30000 lux-100000 lux, with corresponding exposure times of 689 ms, 184 ms, 49.2 ms, 13.1 ms, 3.51 ms, and 0.94 ms, respectively.
[0145] The preset duration threshold can be 200ms. Then, multiple ambient light ranges with exposure times less than the duration threshold are divided into the third group, while the ambient light range of 30 lux-140 lux with exposure times greater than the duration threshold is divided into the fourth group.
[0146] In S520, after dividing multiple ambient illuminance ranges into a third group and a fourth group, the third sensing subunit can be controlled to perform exposure according to the exposure time corresponding to the ambient illuminance range of the third group.
[0147] Taking the above implementation as an example, the exposure times corresponding to each ambient illuminance range in the third group are 184ms, 49.2ms, 13.1ms, 3.51ms, and 0.94ms, respectively. Therefore, the total exposure time for the third sensing subunit to complete the third group is:
[0148] 184+49.2+13.1+3.51+0.94=250.75ms;
[0149] In S530, after the third sensing subunit completes the exposure for each ambient illuminance interval in the third group, the third and fourth sensing subunits can be controlled to jointly perform exposure according to the updated exposure time corresponding to each ambient illuminance interval in the fourth group. This updated exposure time can be set to be lower than the exposure time corresponding to the ambient illuminance intervals in the fourth group.
[0150] Taking the above implementation as an example, the exposure time corresponding to the ambient illuminance range of 30 lux-140 lux in the fourth group is 689 ms. This exposure time is set based on the fact that the electrical signal parameters generated when a single third sensing subunit or a single fourth sensing subunit is exposed meet the signal processing range.
[0151] In the above embodiment, since the third and fourth sensing subunits are exposed together, under the same exposure time and ambient light, the final generated voltage signal will be greater than the voltage signal generated by a single sensing subunit, potentially causing the generated voltage signal to exceed the signal processing range. Therefore, to avoid generating an excessively large voltage signal, a shorter exposure time, i.e., a newer exposure time, is required when the third and fourth sensing subunits are exposed together.
[0152] In some embodiments, the number of channels of the same color is the same in the third and fourth sensing subunits, and the updated exposure time is half of the exposure time corresponding to the ambient illuminance range of the fourth group.
[0153] In this embodiment, the number of channels of the same color is the same in the third and fourth sensing subunits. That is, the voltage signals generated by the third and fourth sensing subunits will be consistent under the same exposure time and the same ambient illuminance.
[0154] Therefore, in order to generate the same voltage signal when the third and fourth sensing subunits are exposed together as when a single sensing subunit is operating, the updated exposure time can be set to half of the exposure time corresponding to the ambient illuminance range of the fourth group. For example, if the exposure time corresponding to the ambient illuminance range of 30 lux-140 lux for the fourth group is 689 ms under a single sensing subunit, then the updated exposure time is 345 ms.
[0155] Taking the above implementation method as an example, the total exposure time is the sum of the exposure times of the third group and the exposure times of the fourth group, that is:
[0156] 250.75 + 345 = 595.75 ms;
[0157] Comparing this exposure time with the total exposure time of 939.75ms for a single sensing subunit to sequentially expose to each ambient illuminance range, it can be seen that the above implementation method can also reduce the total exposure time in a single color temperature detection process and improve the color temperature detection efficiency.
[0158] In some embodiments, the number of channels of the same color is different in the third sensing subunit and the fourth sensing subunit.
[0159] In this embodiment, when the number of channels of the same color in the two sensing subunits is inconsistent, it is necessary to calculate the conversion coefficient between the original exposure time and the updated exposure time based on the number of channels of each color in the third sensing subunit and the number of channels of each color in the fourth sensing subunit, and calculate the updated exposure time corresponding to each exposure time in the fourth group based on the conversion coefficient.
[0160] In S130, after acquiring the electrical signal parameters generated by the color temperature sensor at the exposure time corresponding to each ambient illuminance range, the target electrical signal parameter that matches the preset signal processing range can be determined from multiple electrical signal parameters.
[0161] At each exposure time, each color channel of the color temperature sensor generates a corresponding voltage signal. Taking a color temperature sensor with red, green, blue, and white channels as an example, at each exposure time, the red, green, blue, and white channels can generate four voltage signals respectively. After matching the four voltage signals with a preset signal processing range, it can be determined whether at least one of the four voltage signals exceeds the signal processing range.
[0162] If at least one voltage signal is outside the signal processing range, then the current ambient illuminance does not belong to the ambient illuminance range corresponding to the exposure time.
[0163] After determining that the current ambient illuminance does not fall within the ambient illuminance range corresponding to a certain exposure time, the four voltage signals at the next exposure time can be matched with the preset signal processing range. This process continues until all four voltage signals at a certain exposure time are within the signal processing range, at which point these four voltage signals can be identified as the target electrical signal parameters.
[0164] If all four voltage signals at a certain exposure time are within the signal processing range, it indicates that the current ambient illuminance belongs to the ambient illuminance range corresponding to that exposure time.
[0165] Please refer to Figure 8 In some embodiments, the electrical signal parameters include signal voltages corresponding to at least two color channels; the above-mentioned S130 may include:
[0166] S610 matches the signal voltage corresponding to the channel of different colors in each electrical signal parameter with the preset signal processing range;
[0167] S620, if at least one signal voltage is outside the preset signal processing range, determine that the corresponding electrical signal parameter does not match the preset signal processing range;
[0168] S630 determines that the corresponding electrical signal parameters match the preset signal processing range when all signal voltages are within the preset signal processing range.
[0169] In this embodiment, after obtaining the electrical signal parameters for each exposure time, the signal voltages corresponding to the different color channels in each electrical signal parameter can be matched with a preset signal processing range. If at least one signal voltage among multiple signal voltages is outside the preset signal processing range, then the electrical signal parameter does not match the preset signal processing range. At this time, the signal voltages in the electrical signal parameters for the next exposure time can be matched until all signal voltages in a certain electrical signal parameter are within the preset signal processing range. This electrical signal parameter can then be determined as the target electrical signal parameter.
[0170] In S610, the electrical signal parameters include signal voltages corresponding to at least two color channels. These signal voltages can be obtained by converting the photocurrent signals generated by the photosensors in each color channel.
[0171] Based on the photocurrent signal generated by the optical sensor, the back-end sampling port connected to the channel can directly read the photocurrent signal as an electrical signal parameter, or it can convert the photocurrent signal into a voltage signal for reading. The following embodiments use a voltage signal as the electrical signal parameter for explanation.
[0172] Based on the electrical signal parameters corresponding to each exposure time, the signal voltages corresponding to different color channels in the electrical signal parameters can be matched with the preset signal processing range.
[0173] In S620, taking the electrical signal parameters under a single exposure time as an example, after matching the signal voltages corresponding to the channels of multiple colors with preset signal processing ranges, the matching result of each signal voltage can be determined. If at least one of the multiple signal voltages is outside the preset signal processing range, it indicates that the signal voltage does not match the preset signal processing range. For example, when the signal processing range is 0.5V-4.5V, if the signal voltage is greater than 4.5V or less than 0.5V, it indicates that the signal voltage does not match the preset signal processing range.
[0174] When at least one signal voltage does not match the preset signal processing range, it can be determined that the electrical signal parameters at that exposure time do not match the preset signal processing range.
[0175] In S630, taking the electrical signal parameters under a single exposure time as an example, if all signal voltages in the electrical signal parameters are within the preset signal processing range, it can be determined that the electrical signal parameters under that exposure time match the preset signal processing range. The matched electrical signal parameters are the target electrical signal parameters.
[0176] As an optional implementation, after acquiring the corresponding electrical signal parameters at each exposure time, the electrical signal parameters can be directly matched with the preset signal processing range. If all voltage signals in the electrical signal parameters are within the signal processing range, the electrical signal parameters can be directly determined as the target electrical signal parameters.
[0177] When performing exposures at various times, if the electrical signal parameter corresponding to a certain exposure time is identified as the target electrical signal parameter, the current exposure operation can be terminated early, without needing to continue exposures for subsequent times. For example, if multiple ambient illuminance ranges correspond to exposure times of 0.94ms, 3.51ms, 13.1ms, 49.2ms, 184ms, and 689ms respectively, and the color temperature sensor has already completed exposures at times of 0.94ms, 3.51ms, 13.1ms, and 49.2ms, and the electrical signal parameter generated at the 49.2ms exposure time is within the signal processing range, then this electrical signal parameter can be directly identified as the target electrical signal parameter. After determining the target electrical signal parameter, the exposure operation can be stopped, eliminating the need for subsequent exposures at 184ms and 689ms, thereby reducing exposure time, improving color temperature detection efficiency, and extending the sensor's lifespan.
[0178] Please refer to Figure 9 In some embodiments, after S130 above, the following may also be included:
[0179] S710, based on the target electrical signal parameters, determines the corresponding first ambient illuminance range;
[0180] S720, determine the target correspondence corresponding to the first ambient illuminance range from multiple second correspondences;
[0181] S730 determines the current ambient illuminance based on the target correspondence and target electrical signal parameters.
[0182] In this embodiment, after determining the target electrical signal parameters, the exposure time corresponding to those parameters can be determined. Based on this exposure time, a first ambient illuminance interval corresponding to the exposure time can be determined from a first correspondence. According to the first ambient illuminance interval, a target correspondence corresponding to the first ambient illuminance interval can be determined from multiple second correspondences. Based on this target correspondence and the target electrical signal parameters, the current ambient illuminance can be obtained.
[0183] In S710, after determining the target electrical signal parameter from multiple electrical signal parameters, the ambient illuminance range corresponding to the exposure time can be determined based on the first correspondence relationship, i.e., the first ambient illuminance range corresponding to the target electrical signal parameter can be determined. For example, if the exposure time corresponding to the target electrical signal parameter is 3.51ms, then based on the first correspondence relationship, the first ambient illuminance range corresponding to the target electrical signal parameter can be determined to be 30000 lux-7000 lux.
[0184] In S720, before color temperature detection, a second correspondence relationship for each ambient illuminance range has been pre-generated. After obtaining multiple second correspondence relationships, the target correspondence relationship for the first ambient illuminance range can be determined from them.
[0185] In S730, the second correspondence is the correspondence between the voltage signal magnitude in the electrical signal parameters and the ambient illuminance. After determining the target correspondence from multiple second correspondences, the ambient illuminance corresponding to the target electrical signal parameters can be obtained based on the target correspondence, and used as the current ambient illuminance.
[0186] In S140, after determining the target electrical signal parameters, the corresponding color temperature value can be determined based on the target electrical signal parameters.
[0187] Understandably, when the target electrical signal parameters match the signal processing range and the corresponding ambient illuminance range can be determined, electronic devices can detect color temperature values based on the signal quantity of the acquired target electrical signal parameters. For example, a color temperature sensor may include channels for multiple colors, and the electrical signal parameters include the voltage signals generated by each color channel. Based on the voltage signals corresponding to each color, the light intensity of different emitted colors can be determined, thereby determining the color temperature value of the displayed image.
[0188] In some embodiments, the color temperature sensor includes at least one red channel, at least one green channel, at least one blue channel, and at least one white channel.
[0189] In this embodiment, the color temperature sensor may include multiple color channels, such as at least one red channel, at least one green channel, at least one blue channel, and at least one white channel. Each color channel can be used to measure the light intensity of the corresponding emitted color. For example, a display module of an electronic device may include multiple light-emitting pixels, such as red pixels, green pixels, and blue pixels. The red channel of the color temperature sensor can detect the light intensity of the red pixels, the green and blue channels can detect the light intensity of the green and blue pixels respectively, and the white channel can detect the intensity of the white light formed by the red, green, and blue pixels.
[0190] As an alternative implementation, the color temperature sensor may include a red channel, a green channel, a blue channel, and a white channel.
[0191] With an initial ambient illuminance of 100,000 lux and a target exposure time of 1.41 ms, the voltage signal generated by the white channel is 4.5V. At this time, the voltage signals generated by the red, green, and blue channels are 0.6V, 1.12V, and 0.83V, respectively, all within the sampling voltage range of 0.5V-4.5V.
[0192] Starting from an initial ambient illuminance of 100,000 lux, as the ambient illuminance is gradually decreased, the voltage signals generated by each color channel also gradually decrease. When the ambient illuminance decreases to 78,400 lux, the voltage signal generated by the red channel decreases from 0.6V to 0.5V. If the ambient illuminance is further decreased at this point, the voltage signal generated by the red channel will fall below the sampling voltage range, resulting in abnormal sampling data. Therefore, when the initial ambient illuminance is 100,000 lux, the first target ambient illuminance range can be 100,000 lux - 78,400 lux.
[0193] Understandably, for the green channel, the generated voltage signal decreases to 0.5V when the ambient illuminance drops to 41900 lux. For the blue and white channels, the generated voltage signals decrease to 0.5V when the ambient illuminance drops to 56800 lux and 10500 lux, respectively. Since the voltage signals generated by all four color channels need to be within the sampling voltage range, the target ambient illuminance range needs to be based on the ambient illuminance at which the red channel generates a 0.5V signal, which serves as the minimum ambient illuminance.
[0194] After determining the first target ambient illuminance range, the initial ambient illuminance of the second target ambient illuminance range can be set at 78400 lux. At this point, by adjusting the exposure time, it can be determined that when the exposure time is 1.8 ms, the voltage signal generated by the white channel is 4.5V. The above steps can then be repeated to gradually reduce the ambient illuminance until the ambient illuminance is determined, at which point the voltage signal generated by the red channel is 0.5V. This ambient illuminance is then used as the minimum ambient illuminance for the second target ambient illuminance range.
[0195] It should be noted that when each color has only one channel, the voltage signals generated by each channel differ significantly. To ensure that the voltage signals generated by each channel fall within the processing range of the back-end signal, the resulting target ambient illuminance intervals are relatively small, and the intervals decrease further as the color progresses. This leads to an excessive number of target ambient illuminance intervals, significantly increasing the total exposure time. Therefore, when the voltage signal generated by a certain color channel is low, multiple channels can be connected in parallel to increase the number of channels for that color. This reduces the difference in voltage signals generated by the channels of different colors, allowing each individual target ambient illuminance interval to have a larger range.
[0196] As an example, with an ambient illuminance of 100,000 lux, the number of channels for each color in the color temperature sensor is set to 1, and the exposure time is 1.41 ms. At this time, the voltage signal generated by the red channel is 0.6V, and the voltage signals generated by the green, blue and white channels are 1.12V, 0.83V and 4.50V, respectively.
[0197] In another example, keeping the exposure time constant and setting the ambient illuminance to 30 lux, the voltage signals generated by the red, green, blue, and white channels are 0.00018V, 0.000336V, 0.000249V, and 0.00135V, respectively. It is understandable that at the same exposure time, with an ambient illuminance of 100,000 lux, the detected voltage signal can reach 4.5V, while with an ambient illuminance of 30 lux, the detected voltage signal is only 0.00018V, far below the sampling lower limit of the electronic device's sampling port, thus failing to achieve signal acquisition and color temperature detection. In other words, the existing implementation cannot achieve color temperature detection over a wide range of ambient illuminance.
[0198] In some embodiments, the color temperature sensor includes a red channel, b green channel, c blue channel, and d white channel; wherein,
[0199] a>b, a>c, a>d, b>d, c>d.
[0200] In this embodiment, the number of channels for each color in the color temperature sensor may not be exactly the same. When the number of red channels is 'a', the number of green channels is 'b', the number of blue channels is 'c', and the number of white channels is 'd', the relationship between the number of channels of different colors can be determined based on the magnitude of the signal generated by each color channel under the same ambient illumination and exposure time.
[0201] As an optional implementation, taking an ambient illuminance of 100,000 lux as an example, the number of channels for each color in the color temperature sensor is set to 1, and the exposure time is 1.41 ms. At this time, the voltage signal generated by the red channel is 0.6V, and the voltage signals generated by the green, blue and white channels are 1.12V, 0.83V and 4.50V, respectively.
[0202] Based on the magnitude of the voltage signal generated by each color's single channel, it can be seen that the signal generated by a single white channel is greater than that generated by the other monochrome channels, while the signal generated by a single red channel is less than that generated by the other monochrome channels. Therefore, to reduce the difference in signal magnitude between the channels, multiple channels can be connected in parallel for colors with lower signal magnitudes.
[0203] As an alternative example, the number of channels for each of the above colors can satisfy the following relationship:
[0204] a>b, a>c, a>d, b>d, c>d;
[0205] In this embodiment, since it can be determined from the above implementation that, under the same exposure time and ambient illumination, the signal quantity generated by a single white channel is the largest, and the signal quantity generated by a single red channel is the smallest, in order to make the signal quantities generated by channels of different colors more similar, the number of red channels can be set to be the largest and the number of white channels to be the smallest.
[0206] In some embodiments, b <c。
[0207] As can be seen from the above implementation method, under the same exposure time and ambient illuminance, the voltage signal generated by a single blue channel (0.83V) is less than the voltage signal generated by a single green channel (1.12V). Therefore, in order to make the signal quantities generated by the blue and green channels more similar, the number of green channels (b) can be set to be less than the number of blue channels (c).
[0208] In some embodiments, under the same ambient illuminance and the same exposure time, the amount of electrical signal generated by a red channels is less than the amount of electrical signal generated by d white channels.
[0209] In this embodiment, since the electrical signal generated by a single white channel is greater than that generated by other monochrome channels, the exposure time within each ambient illuminance range can be determined based on the electrical signal generated by the white channel. That is, at the exposure time corresponding to the ambient illuminance range, the electrical signal generated by the white channel is a voltage signal, which is lower than the preset signal processing range, i.e., lower than the upper sampling limit of 4.5V at the sampling port.
[0210] After determining the exposure time based on the electrical signal quantities generated by d white channels, if the electrical signal quantities generated by a red channels are greater than those generated by d white channels, the voltage signals generated by the a red channels may exceed the signal processing range, thus preventing the acquisition of the red channel voltage signals. To avoid this situation, when setting the number of red channels 'a' and the number of white channels 'd', the electrical signal quantities generated by each red channel and each white channel should be considered, ensuring that under the same exposure time and ambient illumination, the electrical signal quantities generated by the parallel 'a' red channels are less than those generated by the d white channels.
[0211] Similarly, under the same ambient illuminance and the same exposure time, when determining the number of green channels b and the number of blue channels c, it should be ensured that the electrical signal generated by b green channels is less than the electrical signal generated by d white channels, and the electrical signal generated by c blue channels is less than the electrical signal generated by d white channels.
[0212] In some embodiments, the color temperature sensor may include a 16-channel sensor, comprising 8 red channels, 2 green channels, 5 blue channels, and 1 white channel. Please refer to... Figure 10 , Figure 10 A schematic diagram of the structure of the light-sensing components corresponding to each color channel is shown in a portion of the display area of an electronic device.
[0213] like Figure 10 As shown, the R channel is connected to a light sensor that can recognize red light, and there are a total of 8 R channels; the G channel is connected to a light sensor that can recognize green light, the blue channel is connected to a light sensor that can recognize red light, and the C channel is connected to a light sensor that can recognize white light. The number of G channels, B channels and C channels are 2, 5 and 1 respectively.
[0214] In this embodiment, the color temperature sensor can be a 16-channel color temperature sensor, with each channel connected to a corresponding light sensor. The 16 channels can include 8 red channels, 2 green channels, 5 blue channels, and 1 white channel, that is, the color temperature sensor includes 8 red sensors, 2 green sensors, 5 blue sensors, and 1 white sensor.
[0215] It should be noted that the above-mentioned placement of each light sensor and each color channel is just an example. The actual placement of each light sensor and each color channel can be adjusted according to actual needs. For example, 16 light sensors can be placed in the same row, the same column, or arranged in an array. No specific limitation is made here.
[0216] As an optional implementation, when the color temperature sensor includes a 16-channel sensor, according to the above implementation, multiple ambient illuminance ranges can be determined as 30 lux-140 lux, 140 lux-500 lux, 500 lux-2000 lux, 2000 lux-7000 lux, 7000 lux-30000 lux, and 30000 lux-100000 lux, with corresponding exposure times of 689 ms, 184 ms, 49.2 ms, 13.1 ms, 3.51 ms, and 0.94 ms, respectively.
[0217] When using the aforementioned 16-channel sensor to expose the data sequentially according to each exposure time, the total exposure time is at least the sum of the individual exposure times, i.e., 940ms.
[0218] As an optional implementation, to reduce the total exposure time during a single color temperature detection process, the color temperature sensor can be configured to include two 16-channel sensors. Each of the two 16-channel sensors can include eight red channels, two green channels, five blue channels, and one white channel.
[0219] In ambient light ranges with short exposure times, color temperature sensors can be exposed using only a single 16-channel sensor. For example, in the range of 30,000 lux to 100,000 lux, the exposure time using a single 16-channel sensor is 0.94 ms.
[0220] In ambient light ranges with longer exposure times, the color temperature sensor can simultaneously operate two 16-channel sensors, effectively doubling the number of channels for each color. With the number of channels for each color doubled, to prevent the electrical signal generated by each channel from exceeding the signal processing range, the exposure time can be halved. For example, in the 30-140 lux range, using two 16-channel sensors reduces the exposure time from 689 ms to 345 ms, thus reducing the total exposure time by 344 ms. In other words, for lower ambient light ranges, multiple 16-channel sensors can be used simultaneously to reduce the exposure time in these ranges, thereby reducing the total exposure time in a single color temperature detection process and improving color temperature detection efficiency.
[0221] Based on the same inventive concept, this application also provides a color temperature detection device. Specifically, in conjunction with... Figure 11 Please provide a detailed explanation.
[0222] Figure 11 This is a schematic diagram of the structure of a color temperature detection device 1100 provided in an embodiment of this application.
[0223] like Figure 11 As shown, the color temperature detection device 1100 may include:
[0224] The acquisition module 1101 is used to acquire multiple ambient illuminance ranges and their corresponding multiple exposure times from a first correspondence relationship; wherein, the first correspondence relationship is the correspondence between ambient illuminance ranges and exposure times;
[0225] Acquisition module 1102 is used to acquire electrical signal parameters generated by the color temperature sensor at each exposure time;
[0226] Matching module 1103 is used to determine the target electrical signal parameter that matches the preset signal processing range from multiple electrical signal parameters;
[0227] The determination module 1104 is used to determine the corresponding color temperature value based on the target electrical signal parameters.
[0228] Figure 12 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application is shown. The electronic device can be at least one of a computer, a server, and a dedicated document generation device. The electronic device includes a processor 1201 and a memory 1202 storing computer program instructions.
[0229] Specifically, the processor 1201 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0230] Memory 1202 may include mass storage for data or instructions. For example, and not limitingly, memory 1202 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 1202 may include removable or non-removable (or fixed) media. Where appropriate, memory 1202 may be internal or external to an electronic device. In a particular embodiment, memory 1202 is a non-volatile solid-state memory.
[0231] Memory 1202 may include read-only memory (ROM), flash memory device, random access memory (RAM), disk storage medium device, optical storage medium device, electrical, optical, or other physical / tangible memory storage device. Therefore, typically, memory 1202 includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory device) of software that may be encoded with computer-executable instructions and, when executed (e.g., by one or more processors), is operable to perform the operations described with reference to the methods described above according to the foregoing aspects of this disclosure.
[0232] The processor 1201 implements any of the color temperature detection methods in the above embodiments by reading and executing computer program instructions stored in the memory 1202.
[0233] In one example, the electronic device may also include a communication interface 1203 and a bus 1210. For example, Figure 12 As shown, the processor 1201, memory 1202, and communication interface 1203 are connected through bus 1210 and complete communication with each other.
[0234] The communication interface 1203 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0235] Bus 1210 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 1210 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0236] This electronic device can achieve a combination based on color temperature detection methods. Figures 1 to 11 The described color temperature detection method and apparatus.
[0237] Furthermore, in conjunction with the color temperature detection methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the color temperature detection methods in the above embodiments.
[0238] In addition, this application also provides a computer program product, including a computer program, which, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0239] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0240] It should be understood that in the embodiments of this application, "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.
[0241] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A color temperature detection method, characterized in that, Applied to electronic devices containing color temperature sensors; the method includes: Multiple ambient illuminance ranges and their corresponding exposure times are obtained from the first correspondence relationship; wherein, the first correspondence relationship is the correspondence between ambient illuminance ranges and exposure times; Collect the electrical signal parameters generated by the color temperature sensor at each exposure time; From the plurality of electrical signal parameters, determine the target electrical signal parameter that matches the preset signal processing range; The corresponding color temperature value is determined based on the target electrical signal parameters.
2. The color temperature detection method according to claim 1, characterized in that, The color temperature sensor includes channels for at least two colors; before obtaining the multiple ambient illuminance ranges and their corresponding exposure times from the first correspondence, the method further includes: Obtain the upper and lower limits of ambient illuminance for detection; With the initial ambient illuminance at the detection upper limit, the electrical signal parameters generated by the color temperature sensor for each color channel at different exposure times are obtained. Based on the electrical signal parameters at each exposure time, an exposure time interval that meets the signal range condition is determined; wherein, the signal range condition is that the electrical signal parameters generated by each color channel are all within a preset signal processing range; Within the exposure time interval, a target exposure time is determined, and the exposure time is determined to be the minimum ambient illuminance that satisfies the signal range condition under the target exposure time. Based on the initial ambient illuminance and the minimum ambient illuminance, a target ambient illuminance range is generated; Using the lower limit of the current target ambient illuminance range as the new initial ambient illuminance, return to the following steps: obtain the electrical signal parameters generated by the color temperature sensor for each color channel at different exposure times, obtain the next target ambient illuminance range and its corresponding target exposure time, until the lowest ambient illuminance is less than or equal to the detection lower limit. The first correspondence is generated based on multiple target ambient illuminance ranges and their corresponding target exposure times.
3. The color temperature detection method according to claim 2, characterized in that, The determination of the exposure time as the minimum ambient illuminance that satisfies the signal range condition under the target exposure time includes: With the exposure time set to the target exposure time, the electrical signal parameters generated by the color temperature sensor for each color channel under different ambient illuminance are obtained. Based on the electrical signal parameters under each ambient illuminance, multiple ambient illuminances that meet the signal range conditions are selected; The minimum ambient illuminance is determined to be the minimum value among multiple ambient illuminance values that satisfy the signal range condition.
4. The color temperature detection method according to claim 3, characterized in that, After generating the target ambient illuminance range based on the initial ambient illuminance and the minimum ambient illuminance, the method further includes: Based on the target exposure time and the electrical signal parameters corresponding to the color temperature sensor under different ambient illuminance, a second correspondence is generated within the target ambient illuminance range; wherein, the second correspondence is the correspondence between electrical signal parameters and ambient illuminance.
5. The color temperature detection method according to claim 4, characterized in that, After determining the target electrical signal parameter that matches the preset signal processing range from the plurality of electrical signal parameters, the method further includes: Based on the target electrical signal parameters, the corresponding first ambient illuminance range is determined; From multiple second correspondences, determine the target correspondence corresponding to the first ambient illuminance range; Based on the target correspondence and the target electrical signal parameters, the current ambient illuminance is determined.
6. The color temperature detection method according to claim 2, characterized in that, The target exposure time is the maximum value within the exposure time interval.
7. The color temperature detection method according to claim 2, characterized in that, The electrical signal parameters include signal voltages corresponding to at least two color channels; determining the target electrical signal parameters that match the preset signal processing range from the plurality of electrical signal parameters includes: Match the signal voltage corresponding to the channel of different colors in each electrical signal parameter with the preset signal processing range; If at least one signal voltage is outside the preset signal processing range, it is determined that the corresponding electrical signal parameter does not match the preset signal processing range. When all signal voltages are within the preset signal processing range, determine that the corresponding electrical signal parameters match the preset signal processing range.
8. The color temperature detection method according to claim 1, characterized in that, The color temperature sensor includes a first sensing subunit and a second sensing subunit, and the first sensing subunit and the second sensing subunit include channels for at least two colors. The acquisition of electrical signal parameters generated by the color temperature sensor at each exposure time includes: Multiple ambient illuminance ranges were divided into a first group and a second group according to their corresponding exposure times; The first sensing subunit is controlled to expose according to the exposure time corresponding to the ambient illuminance range of the first group, and the second sensing subunit is controlled to expose according to the exposure time corresponding to the ambient illuminance range of the second group; The electrical signal parameters generated by the first sensing subunit at each exposure time and the electrical signal parameters generated by the second sensing subunit at each exposure time are collected.
9. The color temperature detection method according to claim 8, characterized in that, The process of dividing multiple ambient illuminance ranges into a first group and a second group according to their corresponding exposure times includes: Obtain the exposure time corresponding to multiple ambient illuminance ranges; Multiple ambient illuminance ranges are divided into a first group and a second group to minimize the difference between the total exposure time of the first group and the total exposure time of the second group; wherein the total exposure time is the sum of multiple exposure times.
10. The color temperature detection method according to claim 9, characterized in that, The number of channels of the same color is the same in the first sensing subunit and the second sensing subunit.
11. The color temperature detection method according to claim 1, characterized in that, The color temperature sensor includes a third sensing subunit and a fourth sensing subunit, and the third sensing subunit and the fourth sensing subunit include channels for at least two colors. The acquisition of electrical signal parameters generated by the color temperature sensor at each exposure time includes: Multiple ambient illuminance ranges were divided into a third group and a fourth group according to their corresponding exposure times; The third sensing subunit is controlled to perform exposure according to the exposure time corresponding to the ambient illuminance range of the third group; The third and fourth sensing subunits are controlled to expose according to the updated exposure time; wherein the updated exposure time corresponding to each ambient illuminance interval in the fourth group is lower than the exposure time corresponding to each ambient illuminance interval.
12. The color temperature detection method according to claim 11, characterized in that, The third and fourth sensing subunits have the same number of channels of the same color, and the updated exposure time is half of the exposure time corresponding to the ambient illuminance range of the fourth group.
13. The color temperature detection method according to claim 11, characterized in that, The division of multiple ambient illuminance ranges into a third group and a fourth group according to their corresponding exposure times includes: Obtain the exposure time corresponding to multiple ambient illuminance ranges; The ambient light range with an exposure time less than the duration threshold is divided into the third group, and the ambient light range with an exposure time greater than or equal to the duration threshold is divided into the fourth group.
14. The color temperature detection method according to claim 13, characterized in that, The number of channels of the same color is different in the third sensing subunit and the fourth sensing subunit.
15. The color temperature detection method according to claim 1, characterized in that, The color temperature sensor includes at least one red channel, at least one green channel, at least one blue channel, and at least one white channel.
16. The color temperature detection method according to claim 1, characterized in that, The color temperature sensor includes a red channel, b green channel, c blue channel, and d white channel; wherein, a>b, a>c, a>d, b>d, c>d.
17. The color temperature detection method according to claim 16, characterized in that, b <c。 18. The color temperature detection method according to claim 16, characterized in that, Under the same ambient illuminance and the same exposure time, the electrical signal generated by a red channels is less than the electrical signal generated by d white channels.
19. The color temperature detection method according to claim 16, characterized in that, The color temperature sensor is a 16-channel sensor, which includes 8 red channels, 2 green channels, 5 blue channels and 1 white channel.
20. A color temperature detection device, characterized in that, The device includes: The acquisition module is used to acquire multiple ambient illuminance ranges and their corresponding multiple exposure times from a first correspondence relationship; wherein, the first correspondence relationship is the correspondence between ambient illuminance ranges and exposure times; The acquisition module is used to acquire the electrical signal parameters generated by the color temperature sensor at each exposure time; The matching module is used to determine, from a plurality of electrical signal parameters, a target electrical signal parameter that matches a preset signal processing range; The determination module is used to determine the corresponding color temperature value based on the target electrical signal parameters.
21. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the color temperature detection method as described in any one of claims 1-19.
22. A computer storage medium, characterized in that, The computer storage medium stores computer program instructions, which, when executed by a processor, implement the color temperature detection method as described in any one of claims 1-19.
Citation Information
Patent Citations
Automatic exposure method, electronic equipment and storage medium
CN115589538A
Image processing method and device, electronic equipment and storage medium
CN116634279A