A data processing method, device, apparatus, and storage medium
Patent Information
- Application Number
- CN202111342034.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-12
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2041-11-12
AI Technical Summary
但对于大面积纯色的场景,基于图像的方法计算出来的CCT值误差较大,导致后续进行颜色调整时效果很差
[0016]本申请实施例提供的数据处理方法、装置、设备和存储介质,获取环境光的光谱数据;基于所述光谱数据,识别目标颜色;所述目标颜色为所述光谱数据的采集场景的颜色;利用所述目标颜色对应的色温回归模型,基于所述光谱数据,确定目标色温,所述目标色温为所述环境光的色温;采用颜色分类模型和色温回归模型这种串联的结果来识别光谱数据所表征的环境光的色温,从而针对不同的颜色,使用对应的色温回归模型来预测出环境光的色温,即当前场景下光源的色温,提高色温的计算准确度,减小色温的计算误差。
Smart Images

Figure CN116124300B_ABST
Abstract
Description
Technical Field
[0001] This application relates to information processing technology, and more particularly to a data processing method, apparatus, device, and storage medium. Background Technology
[0002] Automatic White Balance (AWB) technology refers to the ability to reproduce white objects in an image as white under any lighting conditions in a shooting scene. Correlated color temperature (CCT) is a measure of the color of light emitted by a light source. When the color of the light emitted by a light source is the same as the color of light radiated by a black body at a certain temperature T, the color temperature of that light source is defined as T, measured in Kelvin (K). For example, if the color of light emitted by a 100-watt (W) light bulb is the same as the color of light emitted by a black body at 2527 degrees Celsius (°C), then the color temperature of the light emitted by this bulb is (2527 + 273) K = 2800 K. White objects appear differently under ambient light of different color temperatures. For example, at a color temperature < 3000 K, white objects appear reddish, while at a color temperature > 5000 K, white objects appear bluish. The most crucial aspect of the AWB algorithm is determining the color temperature value of the ambient light and then adjusting the image color based on that value.
[0003] In related technologies, image analysis is used to identify white points in an image and then estimate the CCT of the ambient light in the current scene. However, for scenes with large areas of solid color, the CCT value calculated by image-based methods has a large error, resulting in poor performance when performing subsequent color adjustments. Summary of the Invention
[0004] This application provides a data processing method, apparatus, device, and storage medium that can determine accurate color temperature and reduce color temperature calculation errors.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] In a first aspect, embodiments of this application provide a data processing method, including:
[0007] Acquire spectral data of ambient light;
[0008] Based on the spectral data, the target color is identified; the target color is the color of the scene where the spectral data was collected.
[0009] Using the color temperature regression model corresponding to the target color, the target color temperature is determined based on the spectral data. The target color temperature is the color temperature of the ambient light.
[0010] Secondly, embodiments of this application provide a data processing method, the apparatus comprising:
[0011] Acquisition unit, used to acquire spectral data of ambient light;
[0012] The first identification unit is used to identify the target color based on the spectral data; the target color is the color of the scene where the spectral data was collected.
[0013] The second identification unit is used to determine the target color temperature based on the spectral data using a color temperature regression model corresponding to the target color, wherein the target color temperature is the color temperature of the ambient light.
[0014] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the above-described data processing method.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium, i.e., a storage medium, on which a computer program is stored, which, when executed by a processor, implements the above-described data processing method.
[0016] The data processing method, apparatus, device, and storage medium provided in this application embodiment acquire spectral data of ambient light; identify a target color based on the spectral data; the target color is the color of the scene where the spectral data was acquired; determine the target color temperature based on the spectral data using a color temperature regression model corresponding to the target color, the target color temperature being the color temperature of the ambient light; and identify the color temperature of the ambient light represented by the spectral data by using the cascaded result of a color classification model and a color temperature regression model, thereby predicting the color temperature of the ambient light, i.e., the color temperature of the light source in the current scene, for different colors using the corresponding color temperature regression model, improving the accuracy of color temperature calculation and reducing color temperature calculation error. Attached Figure Description
[0017] Figure 1 This is an optional architecture diagram of the data processing system provided in an embodiment of this application;
[0018] Figure 2 This is an optional structural diagram of the data processing terminal provided in the embodiments of this application;
[0019] Figure 3 This is an optional architecture diagram of the data processing system provided in an embodiment of this application;
[0020] Figure 4 This is an optional flowchart illustrating the data processing method provided in an embodiment of this application;
[0021] Figure 5 This is an optional schematic diagram of multispectral data provided in an embodiment of this application;
[0022] Figure 6 This is an optional schematic diagram of the first spectral curve data provided in the embodiments of this application;
[0023] Figure 7 This is an optional schematic diagram of the second spectral curve data provided in the embodiments of this application;
[0024] Figure 8 This is an optional schematic diagram of multispectral data provided in an embodiment of this application;
[0025] Figure 9 This is an optional schematic diagram of the tristimulus values of CIE provided in an embodiment of this application;
[0026] Figure 10 This is a schematic diagram showing the relationship between the multispectral data received by the multispectral sensor provided in this application embodiment and the multispectral data of the light emitted by the light source;
[0027] Figure 11 This is an optional polygonal line diagram of the multispectral data provided in the embodiments of this application;
[0028] Figure 12 This is an optional columnar schematic diagram of the multispectral data provided in the embodiments of this application;
[0029] Figure 13A and 13B This is a comparative schematic diagram of the spectral curves of the same light source under different pure color scenes provided in the embodiments of this application;
[0030] Figure 14A and 14B This is a comparative schematic diagram of the spectral curves of different light sources in the same pure color scene provided in the embodiments of this application;
[0031] Figure 15 This is an optional flowchart illustrating the data processing method provided in an embodiment of this application;
[0032] Figure 16 This is an optional structural schematic diagram of the data processing apparatus provided in the embodiments of this application;
[0033] Figure 17 This is an optional structural schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0034] 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. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0035] The embodiments of this application can provide a data processing method, apparatus, device, and storage medium. In practical applications, the data processing method can be implemented by a data processing apparatus, and the functional entities in the data processing apparatus can be collaboratively implemented by the hardware resources of electronic devices (such as terminal devices), such as computing resources like processors and communication resources (such as those used to support various communication methods such as optical fiber and cellular).
[0036] Of course, the embodiments of this application are not limited to providing methods and hardware, and can also be implemented in various ways, such as providing a storage medium (stored with instructions for executing the data processing method provided in the embodiments of this application).
[0037] The data processing method provided in this application embodiment can be applied to... Figure 1 The data processing system shown, such as Figure 1 As shown, the data processing system includes a data processing terminal 10 and a data acquisition terminal 20. The data processing terminal 10 and the data acquisition terminal 20 can be integrated on the same physical device or implemented independently on different physical devices. When the data processing terminal and the data acquisition terminal are implemented on different physical devices, they can communicate via wired or wireless communication methods. These communication methods can include one of the following: wireless local area network (WLAN), Bluetooth, or data network. The WLAN technology used can be Wi-Fi.
[0038] In this embodiment, the device implemented at the data processing end can be a terminal device. A terminal device can refer to an access terminal, user equipment (UE), user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent, or user equipment. An access terminal can be a cellular phone, cordless phone, Session Initiation Protocol (SIP) phone, Wireless Local Loop (WLL) station, Personal Digital Assistant (PDA), digital camera, handheld device with wireless communication capabilities, computing device or other processing device connected to a wireless modem, in-vehicle device, wearable device, terminal device in a 5G network, or terminal device in a future Public Land Mobile Network (PLMN), etc.
[0039] The data acquisition end can be a multispectral sensor, spectrometer, or other device capable of acquiring spectral data of ambient light.
[0040] In the embodiments of this application, such as Figure 2 As shown, the data processing terminal 10 is equipped with a color classification model 101 and at least one color temperature regression model 102. The color classification model 101 is used to identify the color of the scene reflected by the input spectral data; the color temperature regression model is used to identify the color temperature of the ambient light reflected by the spectral data. In this embodiment of the application, when multiple color temperature regression models are set in the data processing terminal, different color temperature regression models correspond to different colors.
[0041] In this embodiment, the data acquisition terminal collects spectral data and sends it to the data processing terminal. The data processing terminal can acquire the spectral data of ambient light; based on the spectral data, identify the target color; the target color is the color of the scene where the spectral data was collected; using the color temperature regression model corresponding to the target color, determine the target color temperature based on the spectral data, the target color temperature being the color temperature of the ambient light.
[0042] based on Figure 1 The data processing system shown, such as Figure 3 As shown, the data processing system may also include a model training terminal 30, wherein the data processing terminal 10 and the model training terminal 30 may be integrated on the same physical device or implemented independently on different physical devices.
[0043] Here, the model training end trains the color classification model and the color temperature regression model using training data including sample data and labels, and stores the trained color classification model and color temperature regression model in the data processing end.
[0044] When the data processing end and the model training end are implemented on different physical devices, the model training end can send the trained color classification model and color temperature regression model to the data processing end, and the data processing end stores the received color classification model and color temperature regression model. Here, the data processing end and the data acquisition end can communicate via wired or wireless communication methods, including one of the following: wireless LAN, Bluetooth, or data network. The wireless LAN technology used can be Wi-Fi.
[0045] Below, in conjunction with Figure 1 or Figure 3 The schematic diagram of the data processing system shown illustrates various embodiments of the data processing method, apparatus, device, and storage medium provided in this application. The data processing method provided in this application can be applied to the data processing end of a data processing system, and the data processing end is implemented on an electronic device.
[0046] This application provides a data processing method. Figure 4 This is a schematic diagram illustrating the implementation flow of the data processing method according to an embodiment of this application, as shown below. Figure 4 As shown, the method may include the following steps:
[0047] S401. Electronic devices acquire spectral data of ambient light.
[0048] The spectral data acquired by the electronic device can be spectral data collected by the electronic device itself, or spectral data collected by a data acquisition device outside the electronic device.
[0049] When the data acquisition end and the data processing end are implemented on the same physical device, the spectral data is acquired by the electronic device itself. When the data acquisition end and the data processing end are implemented on different physical devices, the data acquisition device, which is implemented as the data acquisition end, acquires the spectral data and sends the spectral data to the data processing end, which receives the spectral data sent by the data acquisition device.
[0050] The spectral data acquired by the electronic device is the spectral data of ambient light in the physical environment where the data acquisition terminal is located. Here, the electronic device and the data acquisition terminal are located in the same physical environment, or they can be located in different physical environments.
[0051] In this embodiment, the spectral data acquired by the electronic device may include: multispectral data acquired by a multispectral sensor, second spectral curve data acquired by a spectrometer, etc. The multispectral sensor acquires the light response, i.e., energy intensity, within a set first wavelength range through multiple channels, wherein different channels are used to acquire the response of different bands within the set first wavelength range. The spectrometer is used to acquire the energy intensity of each wavelength within a set second wavelength range, wherein the first wavelength range and the second wavelength range may be the same or different.
[0052] S402. The electronic device identifies the target color based on the spectral data; the target color is the color of the scene where the spectral data was collected.
[0053] Electronic devices can directly identify colors based on the acquired spectral data, or process the spectral data before identifying colors. The identified color is the target color, which is the color of the scene where the spectral data was acquired.
[0054] In this embodiment of the application, the electronic device compares the acquired spectral data with the reference spectral data corresponding to each color, and takes the color corresponding to the reference spectral data with the highest matching degree as the target color.
[0055] In one example, the electronic device acquires multispectral data. The electronic device compares the acquired multispectral data with the reference multispectral data corresponding to each color, and selects the color corresponding to the reference multispectral data with the highest matching degree as the target color.
[0056] In one example, the electronic device acquires multispectral data, reconstructs the multispectral data to obtain first spectral curve data, compares the first spectral curve data with the reference spectral curve data corresponding to each color, and selects the color corresponding to the reference spectral curve data with the highest matching degree to the first spectral curve data as the target color.
[0057] In one example, the electronic device acquires the second spectral curve data collected by the spectrometer. The electronic device compares the acquired second spectral curve data with the reference spectral curve data corresponding to each color, and takes the color corresponding to the reference spectral curve data with the highest matching degree with the second spectral curve data as the target color.
[0058] In this embodiment of the application, the electronic device directly inputs the acquired spectral data into the color classification model, or processes the spectral data and then inputs it into the color classification model. In this case, the color classification model outputs the target color.
[0059] In one example, the electronic device acquires spectral data including multispectral data. The electronic device inputs the multispectral data into a first color classification model, at which point the first color classification model outputs the target color. The first color classification model is trained based on the multispectral data.
[0060] In one example, the spectral data acquired by the electronic device includes multispectral data. The electronic device reconstructs the multispectral data to obtain first spectral curve data and inputs the first spectral curve data into a second color classification model. At this time, the second color classification model outputs the target color.
[0061] In one example, the spectral data acquired by the electronic device includes second spectral curve data. The electronic device inputs the second spectral curve data into a second color classification model, at which point the second color classification model outputs the target color.
[0062] The second color classification model is trained based on either the first or second spectral curve data.
[0063] In this embodiment of the application, when the spectral data includes multispectral data, the target color can be determined based on the multispectral data and the first spectral curve data obtained after the multispectral data is reconstructed. At this time, the multispectral data and the first spectral curve data are input into the third color classification model, and the third color classification model outputs the target color.
[0064] When using a color classification model to identify target colors, the color classification model is a network model that can identify colors in the spectral data acquisition scene. It can be trained using deep learning or machine learning methods. This application embodiment does not impose any limitations on the model structure of the color classification model.
[0065] In this embodiment of the application, the spectral data acquired by the electronic device, i.e. the spectral data acquired by the data acquisition terminal, is the result of multiplying the ambient light emitted by the light source and the reflectivity of the acquisition scene. Here, the target color output by the color classification model is the color of the acquisition scene reflected by the spectral data.
[0066] S403. The electronic device uses the color temperature regression model corresponding to the target color to determine the target color temperature based on the spectral data, wherein the target color temperature is the color temperature of the ambient light.
[0067] After the color classification model outputs the target color, the electronic device inputs the spectral data into the color temperature regression model corresponding to the target color. The color temperature regression model outputs the predicted color temperature based on the input spectral data. Here, the color temperature predicted by the color temperature regression model is the color temperature of the environment in which the spectral data was collected.
[0068] In one example, if the target color is red, the electronic device will input the spectral data into the color temperature regression model corresponding to red, and the color temperature regression model corresponding to red will output the color temperature based on the input spectral data.
[0069] In one example, if the target color is yellow, the electronic device will input the spectral data into the color temperature regression model corresponding to yellow, and the color temperature regression model corresponding to yellow will output the color temperature based on the input spectral data.
[0070] The color temperature regression model is a network model that can identify the color temperature of ambient light in spectral data. It can be trained using deep learning or machine learning methods. This application does not impose any limitations on the model structure of the color temperature regression model.
[0071] In this embodiment of the application, when the types of spectral data acquired are different, the acquired spectral data is input into the color temperature regression model trained based on the corresponding type of spectral data.
[0072] In one example, when the acquired spectral data includes multispectral data, the electronic device inputs the multispectral data into a first color temperature regression model, which outputs the target color temperature. This first color temperature regression model is trained based on the multispectral data.
[0073] In one example, when the acquired spectral data includes multispectral data, the electronic device reconstructs the spectral data to obtain first spectral curve data, and inputs the first spectral curve data into a second color temperature regression model, which outputs the target color temperature.
[0074] In one example, when the acquired spectral data includes second spectral curve data, the electronic device inputs the second spectral curve data into a second color temperature regression model, which outputs the target color temperature. The second color temperature regression model is trained based on either the first or second spectral curve data.
[0075] In this embodiment, the electronic device acquires spectral data of ambient light; based on the spectral data, it identifies a target color; the target color is the color of the scene where the spectral data was acquired; using the color temperature regression model corresponding to the target color, based on the spectral data, it determines the target color temperature, which is the color temperature of the ambient light. Thus, for different colors, the corresponding color temperature regression model is used to predict the color temperature of the ambient light, i.e., the color temperature of the light source in the current scene, thereby improving the accuracy of color temperature calculation and reducing color temperature calculation error.
[0076] For solid-color scenes where the acquisition environment is a large area of pure color, the spectral data acquired by multi-channel sensors or spectrometers is severely distorted relative to the spectral data of the ambient light itself. The data processing method provided in this application can utilize color classification models and color temperature regression models obtained by machine learning or deep learning algorithms to perform color recognition of the acquisition scene and CCT value regression prediction on the acquired spectral data, and output a relatively accurate relative color temperature.
[0077] In some embodiments, the spectral data includes: multispectral data collected by a multispectral sensor; in this case, S402 identifies the target color based on the spectral data, which is implemented by: inputting the multispectral data into a color classification model to obtain the target color output by the color model; S403 uses the color temperature regression model corresponding to the target color to determine the target color temperature based on the spectral data, which is implemented by: inputting the multispectral data into the color temperature regression model corresponding to the target color to obtain the target color temperature.
[0078] Here, when the spectral data includes multispectral data collected by a multispectral sensor, the electronic device can directly input the multispectral data into the color classification model and the color temperature regression model corresponding to the target color.
[0079] Here, the electronic device inputs multispectral data into a color classification model to obtain the target color output by the color classification model. The electronic device then inputs the multispectral data into a color temperature regression model corresponding to the target color to obtain the target color temperature output by the color temperature regression model corresponding to the target color.
[0080] In this embodiment, the color classification model inputting multispectral data is referred to as the first color classification model, and the color temperature regression model inputting multispectral data is referred to as the first color temperature regression model. The first color classification model is trained using multispectral data and corresponding colors, and the first color temperature regression model is trained using multispectral data and corresponding color temperatures. Here, the multispectral data used to train the first color classification model is referred to as sample multispectral data. After receiving the multispectral data, the first color classification model extracts features from the multispectral data and determines the target color corresponding to the input multispectral data based on the extracted features. The extracted features may include parameters such as channel ratios based on the energy intensity of different channels. In this embodiment, no limitations are placed on the features extracted by the first color classification model.
[0081] In this embodiment, the multispectral data can be a 1*n matrix, where n represents the channel data of the multispectral sensor, and the elements in the matrix are the response values of each channel to incident light. Different channels generate responses to light in different bands within the first wavelength range.
[0082] In some embodiments, the spectral data includes: multispectral data collected by a multispectral sensor; after S401, the following steps are further implemented: reconstructing the multispectral data based on a set reconstruction matrix to obtain first spectral curve data corresponding to the multispectral data; correspondingly, S402 identifies the target color based on the spectral data, which can be implemented by: inputting the first spectral curve data into a color classification model to obtain the target color output by the color model; S403 determines the target color temperature based on the spectral data using a color temperature regression model corresponding to the target color, which can be implemented by: inputting the first spectral curve data into the color temperature regression model corresponding to the target color to obtain the target color temperature.
[0083] In this embodiment, the electronic device can reconstruct multispectral data based on a reconstruction matrix to obtain first spectral curve data. The multispectral data is a 1*n matrix C: [C1 C2 … C… n The reconstructed matrix is an n*m matrix M: Multiplying the multispectral data C and the reconstruction matrix M yields the first spectral curve data S:
[0084] In this embodiment, the first spectral curve data is close to the spectral data collected by the spectrometer. By reconstructing the multispectral data, first spectral curve data that is closer to the actual light source can be obtained.
[0085] In one example, n is 10, and the curve of the multispectral data is as follows: Figure 5 As shown in curve 501, after reconstructing the multispectral data shown in curve 501, the resulting first spectral curve data is as follows. Figure 6 As shown in curve 601, the curve of the second spectral curve data acquired by the spectrometer is as follows. Figure 7 As shown in curve 701, based on Figure 5 Curve 501 and Figure 6 Curve 601 in Figure 7 A comparison of curve 701 shows that the reconstructed first spectral curve data is closer to the shape of the original ambient light spectral curve and the second spectral curve data. Among these, Figure 5 and Figure 6 In the diagram, the vertical axis represents the energy intensity of light rays in one channel.
[0086] After obtaining the first spectral curve data, the electronic device inputs the first spectral curve data into the color classification model to obtain the target color output by the color classification model. The electronic device then inputs the first spectral curve data into the color temperature regression model corresponding to the target color to obtain the target color temperature output by the color temperature regression model corresponding to the target color.
[0087] In this embodiment, the first spectral curve data is spectral data. The color classification model inputting the first spectral curve data can be called the second color classification model, and the color temperature regression model inputting the first spectral curve data can be called the second color temperature regression model. The second color classification model is trained using spectral data and corresponding colors, and the second color temperature regression model is trained using spectral data and corresponding color temperatures. Here, the spectral data used to train the second color classification model is called sample spectral data. After receiving the first spectral curve data, the second color classification model extracts features from the first spectral curve data and determines the target color corresponding to the input first spectral curve data based on the extracted features. The extracted features may include parameters reflecting waveform characteristics, such as the number of peaks. In this embodiment, no limitations are placed on the features extracted by the second color classification model.
[0088] In practical applications, when the data input to the color classification model includes multispectral data and first spectral curve data, the multispectral data and first spectral curve data can be concatenated and input into a third color classification model. In this case, the multispectral data acquired by the multispectral sensor and the reconstructed first spectral curve data (or the second spectral curve data acquired by the spectrometer) are simultaneously used to train the third color classification model, enabling it to recognize colors based on either the multispectral data or the first spectral curve data. During color recognition, this color classification model can extract different features based on different input spectral data to perform color recognition based on these extracted features.
[0089] In some embodiments, the spectral data includes: second spectral curve data acquired by a spectrometer; S402 identifies a target color based on the spectral data, including: inputting the second spectral curve data into a color classification model to obtain the target color output by the color model; and determining a target color temperature based on the spectral data using a color temperature regression model corresponding to the target color, including: inputting the second spectral curve data into the color temperature regression model corresponding to the target color to obtain the target color temperature.
[0090] When the spectral data includes spectral data collected by a spectrometer, i.e., the second spectral curve data, the electronic device can directly input the second spectral curve data into the color classification model and the color temperature regression model corresponding to the target color.
[0091] Here, the electronic device receives the second spectral curve data and inputs it into the color classification model to obtain the target color output by the color classification model. The electronic device then inputs the second spectral curve data into the color temperature regression model corresponding to the target color to obtain the target color temperature output by the color temperature regression model corresponding to the target color.
[0092] In this embodiment of the application, the second spectral curve data belongs to spectral data. The second spectral curve data can be input into the second color classification model and the second color temperature regression model.
[0093] In some embodiments, S403 uses the color temperature regression model corresponding to the target color to determine the target color temperature based on the spectral data, wherein the target color temperature is the color temperature of the ambient light. This can be implemented as follows: determining the target color temperature regression model corresponding to the target color from at least two color temperature regression models, wherein different color temperature regression models correspond to different colors; and using the target color temperature regression model to determine the target color temperature based on the spectral data.
[0094] Here, different color temperature regression models can correspond to different colors. For the current multispectral data, the color temperature of the current multispectral data can be predicted by the color temperature regression model corresponding to the target color identified by the color classification model.
[0095] In one example, at least two color temperature regression models are included: color temperature regression model 1 corresponding to color 1, color temperature regression model 2 corresponding to color 2, color temperature regression model 3 corresponding to color 3, color temperature regression model 4 corresponding to color 4, and color temperature regression model 5 corresponding to color 5. When the color classification model predicts that the current multispectral data reflects color 1, the color temperature of the current multispectral data is predicted based on color temperature regression model 1. When the color classification model predicts that the current multispectral data reflects color 3, the color temperature of the current multispectral data is predicted based on color temperature regression model 3.
[0096] In some embodiments, the data processing method provided in this application further includes the following steps: determining a first label corresponding to each sample spectral data in at least two sample spectral data included in the sample data set, obtaining a first label set, wherein the first label represents the color corresponding to the sample spectral data; and training an initial color classification model using the sample data set and the first label set to obtain the color classification model.
[0097] Here, the untrained color classification model is called the initial color classification model. The electronic device inputs the sample spectral data into the initial color classification model and iterates the initial color classification model multiple times to obtain a converged initial color classification model, i.e., the color classification model.
[0098] In each iteration, the electronic device compares the color output by the initial color classification model with the color represented by the first label, updates the parameters of the initial color classification model based on the comparison result, and performs the next iteration based on the updated initial color classification model.
[0099] In this embodiment, when the sample spectral data is multispectral data, the trained color classification model is a first color classification model. In this case, when the electronic device identifies the color of the acquisition scene reflected by the multispectral data, it inputs the multispectral data into the first color classification model. When the sample spectral data is spectral curve data, the trained color classification model is a second color classification model. In this case, when the electronic device identifies the color of the acquisition scene reflected by the spectral data, it inputs the spectral curve data into the second color classification model. The spectral curve data input into the second color classification model includes one or more of the first and second spectral curve data. Correspondingly, the sample spectral curve data used for training the second color classification model includes: sample spectral curve data reconstructed based on the multispectral data and sample spectral curve data acquired by a spectrometer.
[0100] In some embodiments, the data processing method provided in this application further includes the following steps:
[0101] Based on the first label corresponding to each sample spectral data in at least two sample spectral data included in the sample data set, the sample data set is divided into at least two sample data subsets. The first label represents the color of the acquisition scene of the sample spectral data. The first label corresponding to the sample spectral data in different sample data subsets is different.
[0102] For each of the at least two subsets of sample data, perform the following processing:
[0103] Determine the second label corresponding to the spectral data of each sample in the sample data subset to obtain the second label set corresponding to the sample data subset, where the second label represents the color temperature corresponding to the sample spectral data;
[0104] The initial color temperature regression model is trained using the sample data subset and the second label set to obtain a first color temperature regression model, which corresponds to the color represented by the first label corresponding to the sample data subset.
[0105] The electronic device divides the sample spectral data in the sample data set into multiple sample data subsets according to the corresponding first label. Different sample data subsets correspond to different first labels, and the sample spectral data in the same sample data subset correspond to the same first label.
[0106] In one example, the sample spectral data of the sample dataset includes: data 1, data 2, data 3, data 4, data 5, and data 6. The first labels corresponding to each sample spectral data are: color 1, color 3, color 2, color 2, color 3, and color 2, respectively. Then, the sample data subsets of the sample dataset include: sample data subset 1 corresponding to color 1, sample data subset 2 corresponding to color 2, and sample data subset 3 corresponding to color 3. The sample spectral data of sample data subset 1 includes: data 1; the sample spectral data of sample data subset 2 includes: data 3, data 4, and data 6; and the sample spectral data of sample data subset 3 includes: data 2 and data 5.
[0107] For each subset of sample data, the electronic device trains the color temperature regression model corresponding to that subset of sample data based on the subset of sample data and the second label of the sample spectral data in that subset of sample data.
[0108] In one example, the sample dataset is divided into three subsets: subset 1 corresponding to color 1, subset 2 corresponding to color 2, and subset 3 corresponding to color 3. The electronic device trains a color temperature regression model 1 corresponding to color 1 based on subset 1, a color temperature regression model 2 corresponding to color 1 based on subset 2, and a color temperature regression model 3 corresponding to color 3 based on subset 3.
[0109] For a color temperature regression model, the electronic device inputs a subset of sample spectral data into the initial color temperature regression model, iterates the initial color temperature regression model multiple times, and obtains a converged initial color temperature regression model, i.e., the color temperature regression model.
[0110] In each iteration, the electronic device compares the color temperature output by the initial color temperature regression model with the color temperature represented by the second label, updates the parameters of the initial color temperature regression model based on the comparison results, and performs the next iteration based on the updated initial color temperature regression model.
[0111] In one example, during the training of the color temperature regression model corresponding to color 1, the initial color temperature regression model is iterated multiple times based on the sample data subset 1 corresponding to color 1 to obtain a converged color temperature regression model. In the first iteration, the electronic device inputs the sample data subset 1 corresponding to color 1 into the initial color temperature regression model. Based on the predicted color temperature corresponding to each sample data output by the initial color temperature regression model, the loss is determined based on the predicted color temperature and the color temperature in the corresponding second label set. Based on the determined loss, the parameters of the initial color temperature regression model are updated. If the color temperature regression model after the first parameter update does not converge, a second iteration is performed based on the color temperature regression model after the first parameter update. In the second iteration, the electronic device inputs the sample data subset 1 corresponding to color 1 into the color temperature regression model after the first parameter update. Based on the predicted color temperature of each sample data output by the initial color temperature regression model after the first parameter update, the loss is determined based on the predicted color temperature and the color temperature in the corresponding second label set. Based on the determined loss, the parameters of the initial color temperature regression model after the first parameter update are updated a second time. If the color temperature regression model after the second parameter update does not converge, a third iteration is performed based on the color temperature regression model after the second parameter update. This process is repeated until the initial color temperature regression model after the parameter update converges, and no further iteration is performed. At this point, the converged initial color temperature regression model is the color temperature regression model obtained through training.
[0112] In this embodiment of the application, the initial color temperature regression models for obtaining the color temperature regression models corresponding to each color may be the same or different. In this embodiment of the application, no limitation is made on the structure of the initial color temperature regression models corresponding to each color temperature regression model.
[0113] In this embodiment, when the sample spectral data is multispectral data, the trained color temperature regression model is a first color temperature regression model. In this case, when the electronic device identifies the color temperature of the ambient light reflected by the spectral data, it inputs the multispectral data into the first color temperature regression model. When the sample spectral data is sample spectral curve data, the trained color temperature regression model is a second color temperature regression model. In this case, when the electronic device identifies the color temperature of the ambient light reflected by the spectral data, it inputs the spectral curve data into the second color temperature regression model. The spectral curve data input into the second color temperature regression model includes one or more of the first and second spectral curve data. Correspondingly, the sample spectral curve data used for training the second color temperature regression model includes: sample spectral curve data reconstructed based on the multispectral data and sample spectral curve data acquired by a spectrometer.
[0114] In this embodiment of the application, the acquisition scenario for collecting sample spectral data may include a solid color scenario where a large area is a solid color.
[0115] In this embodiment of the application, after acquiring sample spectral data, the electronic device can receive a first label input by the user, so that the user can label the first label.
[0116] When an electronic device receives a second tag, the received information can be the second tag itself or the user-inputted light source type. Based on the received light source type, the device selects the corresponding second tag. Different light source types correspond to different color temperatures. In one example, the light source types include: light-emitting diode (LED) - yellow, LED - warm white, and LED - white, with corresponding color temperatures of 2700K, 4000K, and 6500K, respectively. The correspondence between light source type and color temperature can be set according to actual needs; this application does not impose any limitations on the correspondence between light source type and color temperature.
[0117] In some embodiments, the data processing method provided in this application may further implement the following steps:
[0118] Acquire an image under the ambient light; adjust the color of the image based on the target color temperature to obtain the target image.
[0119] Here, the acquired spectral data and the collected images are acquired under the same ambient light. The electronic device performs image processing on the acquired images based on a determined target color temperature, thereby restoring the colors of the content in the image as much as possible and achieving white balance.
[0120] The data processing method provided in this application embodiment can utilize the color classification model and color temperature regression model obtained by machine learning algorithm to perform color recognition of the acquisition scene and CCT value regression prediction on the acquired spectral data, and output a relatively accurate relative color temperature, thereby making the color adjustment effect in white balance more realistic.
[0121] The following describes the data processing method provided in the embodiments of this application, taking multispectral data as an example.
[0122] In related technologies, the methods for determining the CCT of ambient light include the following two:
[0123] Method 1: Based on image analysis, identify white points in the image and then estimate the CCT of the ambient light in the current scene.
[0124] Method 2: Determine the color temperature using the chromaticity coordinates of the light source, including:
[0125] The spectral curve P(λ) of ambient light is reconstructed using a multispectral sensor. Then, using formula (1), the tristimulus values X, Y, and Z of the light source are calculated based on the chromaticity functions x(λ), y(λ), and z(λ) of the International Commission on Illumination (CIE) and the spectral curve P(λ).
[0126] X=∫P(λ)*x(λ)dλ
[0127] Y=∫P(λ)*y(λ)dλ
[0128] Z=∫P(λ)*z(λ)dλ Formula (1);
[0129] The color coordinates (x, y, z) of the light source on the chromaticity diagram are shown in formula (2):
[0130] x = X / (X + Y + Z)
[0131] y = Y(XY + Z)
[0132] z = ZX + Y + Z Formula (2);
[0133] Using formula (3), the relative color temperature is calculated based on the color coordinates (x,y,z).
[0134] CCT=449n 3 +3525n 2 +6823.3n+5520.33 Formula (3);
[0135] Where, n = (x - 0.3320) / (0.1858 - y).
[0136] In one example, the spectral curve of ambient light is as follows: Figure 8 As shown in Figure 801, the standard CIE tristimulus curves x(λ), y(λ), and z(λ) are respectively as follows: Figure 9 As shown in 901, 902 and 903.
[0137] Determining color temperature using the chromaticity coordinates of a light source is only suitable for simple scenarios where there isn't a large area of pure color.
[0138] When the scene consists of a large area of solid color, the CCT value calculated using Method 1 has a large error, resulting in poor performance during subsequent color adjustments. In Method 2, for this type of scene, the spectral curve received by the multispectral sensor, such as... Figure 10As shown, this is the result of multiplying the ambient light spectrum curve of light source 1001 with the reflectance curve of object 1002 in the scene. Because the spectrum curve received by the multispectral sensor is severely distorted relative to the ambient light spectrum curve itself, the final calculated ambient light CCT value has a large error, resulting in poor performance during subsequent color adjustment in AWB. Therefore, the difficulty of AWB lies in large-area solid color scenes.
[0139] To address the issue of significant errors in directly calculating CCT values in large-area solid color scenes, this application utilizes machine learning algorithms to identify light sources and predict CCT values from the spectral curves acquired by multispectral sensors. This results in the output of more accurate light source types and relative color temperature values, leading to more realistic color adjustment effects in white balance.
[0140] The data processing method provided in this application includes:
[0141] 1. Collect training samples.
[0142] Under various common light sources, collect multispectral data of large areas of pure color scenes (such as but not limited to red, orange, yellow, green, blue, indigo, violet, gray, white, etc.), and label the corresponding light source type, scene color information, and scene color temperature value (CCT).
[0143] A single multispectral data point is an array of size 1*n, where n is the number of channels in the multispectral sensor. The value of n includes 5, 8, 10, etc. In one example, a single multispectral data point from an 8-channel multispectral sensor is: [244.586777000000 329.188446000000 395.074432000000 639.5548100000001900.22790500000 2364.01831100000 2541.02465800000 710.4664920000003959.91455100000 293.993652000000]. This multispectral data point can be represented as... Figure 11 The line graph shown or Figure 12 The bar chart shown.
[0144] 2. Model training.
[0145] Using machine learning / deep learning methods, a color classification model is first trained, and then a color temperature regression model is trained separately for each color. The trained color classification model and the color temperature regression model corresponding to each color are saved.
[0146] 3. For testing purposes.
[0147] While the camera is taking pictures, the multispectral sensor can collect multispectral data of the current scene, input the multispectral data into the color classification model, predict the color of the current scene through the color classification model, and then input the multispectral data into the color temperature regression model under the corresponding color, predict the color temperature value (CCT) of the current ambient light through the color temperature regression model.
[0148] In the data processing method provided in this application embodiment, the color temperature regression models are different for different colors. Here, the light source curves of different light sources in the same color scene are respectively as follows: Figure 13A and Figure 13B As shown, it exhibits clustering properties, where, Figure 13A Light source curves for different light sources in a red scene. Figure 13B The images show the spectral curves of different light sources in a green scene. It can be seen that the spectral curves of the same color from different light sources exhibit a clear gradual change with increasing color temperature. The spectral curves of different colors collected under the same light source are shown below. Figure 14A and Figure 14B As shown, the light source curve is chaotic and lacks a clear pattern. Figure 14A The spectral curves of a 4000K light source under different color scenes. Figure 14B The spectral curves of 6500K light sources are provided for different color scenarios. Therefore, directly classifying or matching light sources will result in a relatively large color temperature error.
[0149] Therefore, in this embodiment, different colors correspond to different color temperature regression models, which can accurately predict the color temperature of the light source in the current color scene, thus providing good support for subsequent AWB color adjustment.
[0150] The data processing method provided in the embodiments of this application is as follows: Figure 15 As shown, it includes:
[0151] S1501. Acquire multispectral data using a multispectral sensor;
[0152] S1502, Reconstructing multispectral curves from multispectral data;
[0153] Here, the reconstructed multispectral curve can be understood as the first multispectral curve data.
[0154] S1503. Input the multispectral curve into the color classification model to obtain the predicted color output by the color classification model;
[0155] S1504. Input the multispectral curve into the target color temperature regression model corresponding to the predicted color to obtain the predicted color temperature output by the target color temperature regression model.
[0156] S1505, AWB color adjustment based on predicted color temperature.
[0157] In S1502, the spectral curve of the light source is a curve with wavelengths from 350 to 1100 nm, which contains a lot of information. However, the multispectral data collected by the multispectral sensor only has data from 10 channels, which cannot express the shape of the original spectral curve and results in serious information loss. Therefore, the multispectral data needs to be reconstructed.
[0158] Here, matrix multiplication is used to reconstruct the multispectral data. The multispectral data is multiplied by a predefined reconstruction matrix, where the reconstruction matrix is an n*m matrix, and the size of m can be set according to actual needs.
[0159] In one example, the multispectral data is a 1*10 matrix C: [C1 C2 … C 10 ], where 10 is the number of channels in the multispectral sensor; the reconstruction matrix is set to be a 10*621 matrix M: At this point, the spectral curve is matrix S. Among them, the multispectral data collected by the multispectral sensor can be used as Figure 5 As shown, the spectral curve reconstructed based on the reconstruction matrix is as follows: Figure 6 As shown, Figure 7 This is a spectral curve of the light source acquired using a high-resolution spectrometer. Figure 5 , 6 As can be seen from the comparison with 7, the multispectral data collected by the multispectral sensor, after reconstruction, approximates the actual spectral curve.
[0160] To implement the above data processing method, this application provides a data processing device 1600, such as... Figure 16 As shown, the device 1600 includes:
[0161] Acquisition unit 1601 is used to acquire spectral data of ambient light;
[0162] The first identification unit 1602 is used to identify the target color based on the spectral data; the target color is the color of the scene where the spectral data was collected.
[0163] The second identification unit 1603 is used to determine the target color temperature based on the spectral data using the color temperature regression model corresponding to the target color, wherein the target color temperature is the color temperature of the ambient light.
[0164] In some embodiments, the first identification unit 1602 is further configured to input the multispectral data in the spectral data into the color classification model to obtain the target color output by the color model;
[0165] The second identification unit 1603 is also used to input the multispectral data into the color temperature regression model corresponding to the target color to obtain the target color temperature.
[0166] In some embodiments, the device 1600 further includes:
[0167] The reconstruction unit is used to reconstruct the multispectral data in the spectral data based on a set reconstruction matrix to obtain the first spectral curve data corresponding to the multispectral data.
[0168] The first identification unit 1602 is further configured to input the first spectral curve data into the color classification model to obtain the target color output by the color model;
[0169] The second identification unit 1603 is further configured to input the first spectral curve data into the color temperature regression model corresponding to the target color to obtain the target color temperature.
[0170] In some embodiments, the first identification unit 1602 is further configured to input the second spectral curve data collected by the spectrometer in the spectral data into the color classification model to obtain the target color output by the color model;
[0171] The second identification unit 1603 is further configured to input the second spectral curve data into the color temperature regression model corresponding to the target color to obtain the target color temperature.
[0172] In some embodiments, the second identification unit 1603 is further configured to: determine the target color temperature regression model corresponding to the target color from at least two color temperature regression models, wherein different color temperature regression models correspond to different colors; and determine the target color temperature based on the spectral data using the target color temperature regression model.
[0173] In some embodiments, the apparatus 1600 further includes: a first training unit, configured to:
[0174] Determine the first label corresponding to each sample spectral data in at least two sample spectral data included in the sample data set to obtain a first label set, wherein the first label represents the color of the acquisition scene of the sample spectral data;
[0175] The initial color classification model is trained using the sample data set and the first label set to obtain the color classification model.
[0176] In some embodiments, the apparatus 1600 further includes: a second training unit, configured to:
[0177] Based on the first label corresponding to each sample spectral data in at least two sample spectral data included in the sample data set, the sample data set is divided into at least two sample data subsets. The first label represents the color of the acquisition scene of the sample spectral data. The first label corresponding to the sample spectral data in different sample data subsets is different.
[0178] For each of the at least two subsets of sample data, perform the following processing:
[0179] Determine the second label corresponding to the spectral data of each sample in the sample data subset to obtain the second label set corresponding to the sample data subset, where the second label represents the color temperature corresponding to the sample spectral data;
[0180] The initial color temperature regression model is trained using the sample data subset and the second label set to obtain a first color temperature regression model, which corresponds to the color represented by the first label corresponding to the sample data subset.
[0181] In some embodiments, the device 1600 further includes: an adjustment unit, configured to:
[0182] Acquire the image captured under the ambient light;
[0183] The color of the image is adjusted based on the target color temperature to obtain the target image.
[0184] It should be noted that the logic units included in the data processing device provided in this application embodiment can be implemented by a processor in an electronic device; of course, they can also be implemented by specific logic circuits; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field-programmable gate array (FPGA), etc.
[0185] The description of the system embodiments above is similar to that of the method embodiments above, and has similar beneficial effects. For technical details not disclosed in the system embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0186] It should be noted that, in the embodiments of this application, if the above-described data processing method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0187] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the data processing method described above.
[0188] Correspondingly, embodiments of this application provide a storage medium, namely a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the data processing method provided in the above embodiments.
[0189] It should be noted that the descriptions of the storage medium embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0190] It should be noted that, Figure 17 This is a schematic diagram of a hardware entity of an electronic device according to an embodiment of this application, such as... Figure 17 As shown, the electronic device 1700 includes: a processor 1701, at least one communication bus 1702, at least one external communication interface 1704, and a memory 1705. The communication bus 1702 is configured to enable communication between these components. In one example, the electronic device 1700 further includes: a user interface 1703, which may include a display screen; and the external communication interface 1704 may include standard wired and wireless interfaces.
[0191] The memory 1705 is configured to store instructions and applications executable by the processor 1701, and can also cache data to be processed or already processed by the processor 1701 and various modules in the electronic device (e.g., image data, audio data, and communication data), which can be implemented by flash memory or random access memory (RAM).
[0192] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0193] It should be noted that, in this document, 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. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0194] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0195] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0196] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0197] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0198] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0199] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data processing method, characterized in that, The method includes: The data acquisition terminal collects spectral data of ambient light in the physical environment; the spectral data collected by the data acquisition terminal is the result of multiplying the ambient light emitted by the light source by the reflectivity of the scene being collected; the scene being collected is a solid color scene. Based on the spectral data, the target color is identified; the target color is the color of the scene where the spectral data was collected. Using the color temperature regression model corresponding to the target color, the target color temperature is determined based on the spectral data. The target color temperature is the color temperature of the ambient light, which is the color temperature of the light source. The spectral data is input into the color temperature regression model corresponding to the target color, and the color temperature regression model outputs the target color temperature based on the input spectral data. Color temperature regression models corresponding to different colors are used to predict the color temperature of the light source in different color acquisition scenarios.
2. The method according to claim 1, characterized in that, The spectral data includes: multispectral data acquired by a multispectral sensor; The step of identifying the target color based on the spectral data includes: inputting the multispectral data into a color classification model to obtain the target color output by the color classification model; The step of determining the target color temperature based on the spectral data using the color temperature regression model corresponding to the target color includes: inputting the multispectral data into the color temperature regression model corresponding to the target color to obtain the target color temperature.
3. The method according to claim 1, characterized in that, The spectral data includes: multispectral data acquired by a multispectral sensor; the method further includes: The multispectral data is reconstructed based on the set reconstruction matrix to obtain the first spectral curve data corresponding to the multispectral data; Correspondingly, identifying the target color based on the spectral data includes: inputting the first spectral curve data into a color classification model to obtain the target color output by the color classification model; The step of determining the target color temperature based on the spectral data using the color temperature regression model corresponding to the target color includes: inputting the first spectral curve data into the color temperature regression model corresponding to the target color to obtain the target color temperature.
4. The method according to claim 1, characterized in that, The spectral data includes: second spectral curve data acquired by the spectrometer; The step of identifying the target color based on the spectral data includes: inputting the second spectral curve data into a color classification model to obtain the target color output by the color classification model; The step of determining the target color temperature based on the spectral data using the color temperature regression model corresponding to the target color includes: inputting the second spectral curve data into the color temperature regression model corresponding to the target color to obtain the target color temperature.
5. The method according to claim 1, characterized in that, The step of using the color temperature regression model corresponding to the target color, based on the spectral data, to determine the target color temperature, wherein the target color temperature is the color temperature of the ambient light, includes: From at least two color temperature regression models, determine the target color temperature regression model corresponding to the target color, where different color temperature regression models correspond to different colors; The target color temperature is determined based on the spectral data using the target color temperature regression model.
6. The method according to claim 1, characterized in that, The method further includes: Determine the first label corresponding to each sample spectral data in at least two sample spectral data included in the sample data set to obtain a first label set, wherein the first label represents the color of the acquisition scene of the sample spectral data; The initial color classification model is trained using the sample data set and the first label set to obtain the color classification model.
7. The method according to claim 1, characterized in that, The method further includes: Based on the first label corresponding to each sample spectral data in at least two sample spectral data included in the sample data set, the sample data set is divided into at least two sample data subsets. The first label represents the color of the acquisition scene of the sample spectral data. The first label corresponding to the sample spectral data in different sample data subsets is different. For each of the at least two subsets of sample data, perform the following processing: Determine the second label corresponding to the spectral data of each sample in the sample data subset to obtain the second label set corresponding to the sample data subset, where the second label represents the color temperature corresponding to the sample spectral data; The initial color temperature regression model is trained using the sample data subset and the second label set to obtain a first color temperature regression model, which corresponds to the color represented by the first label corresponding to the sample data subset.
8. The method according to claim 1, characterized in that, The method further includes: Acquire the image captured under the ambient light; The color of the image is adjusted based on the target color temperature to obtain the target image.
9. A data processing apparatus, characterized in that, The device includes: The acquisition unit is used to acquire spectral data of ambient light in the physical environment collected by the data acquisition terminal; the spectral data is the result of multiplying the ambient light emitted by the light source and the reflectivity of the acquisition scene; the acquisition scene is a solid color scene. The first identification unit identifies the target color based on the spectral data; the target color is the color of the scene where the spectral data was collected. The second identification unit is used to determine the target color temperature based on the spectral data using the color temperature regression model corresponding to the target color, wherein the target color temperature is the color temperature of the ambient light; the color temperature of the ambient light is the color temperature of the light source; wherein the spectral data is input into the color temperature regression model corresponding to the target color, and the color temperature regression model corresponding to the target color outputs the target color temperature based on the input spectral data; Among them, the color temperature regression model corresponding to different colors is used to predict the color temperature of the light source in different color acquisition scenarios.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data processing method according to any one of claims 1 to 8.
11. A storage medium storing an executable program, characterized in that, When the executable program is executed by the processor, it implements the data processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Color recognition method and system
CN107462330A
Illuminance measuring device and illuminance measuring method
CN112484847A