Image processing method and device, electronic equipment, storage medium and program product

CN122802787APending Publication Date: 2026-09-22BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510330316.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2026-09-22

AI Technical Summary

Benefits of technology

[0029]在本公开实施例中,在获取到基于第一光源的第一光谱参数生成的初始图像的情况下,可以基于第一光源的偏振参数对第一光谱参数进行精准调整,以基于调整得到的第二光谱参数对初始图像的颜色进行精准校正,从而在对初始图像的颜色进行校正的过程中减少光源的偏振所产生的干扰。如此,能够提高对初始图像的颜色进行校正的精准性,提高校正得到的目标图像的颜色和拍摄对象在视觉上的真实颜色之间的一致性,从而提高目标图像的显示效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122802787A_ABST
    Figure CN122802787A_ABST
Patent Text Reader

Abstract

The present disclosure provides an image processing method, device, electronic equipment, storage medium and program product, the method comprising: acquiring an initial image; wherein the initial image is generated based on a first spectral parameter collected for a first light source; adjusting the first spectral parameter based on a polarization parameter of the first light source to obtain a second spectral parameter; correcting the color of the initial image based on the second spectral parameter to obtain a target image. In this way, the interference caused by the polarization of the first light source can be reduced during the correction of the color of the initial image, thereby improving the accuracy of the correction of the color of the initial image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing, and more particularly to an image processing method, apparatus, electronic device, storage medium, and program product. Background Technology

[0002] In related technologies, images of a subject can be acquired under illumination. Due to the influence of the illumination light source, there may be discrepancies between the colors of the acquired image and the visual colors of the subject in the actual scene. In such cases, the colors of the acquired image can be corrected based on an automatic white balance (AWB) algorithm.

[0003] However, the AWB algorithm in related technologies has limitations. It still cannot ensure the accuracy of color correction during the process of color correction of the image, which may result in the display effect of the acquired image not meeting the display requirements. Summary of the Invention

[0004] To overcome the problems in related technologies, this disclosure provides an image processing method, apparatus, electronic device, storage medium, and program product to improve the accuracy of color correction of an initial image.

[0005] According to a first aspect of the present disclosure, an image processing method is provided, the method comprising:

[0006] Acquire an initial image; wherein the initial image is generated based on the first spectral parameters acquired for the first light source;

[0007] Based on the polarization parameters of the first light source, the first spectral parameters are adjusted to obtain the second spectral parameters;

[0008] Based on the second spectral parameter, the color of the initial image is corrected to obtain the target image.

[0009] In one embodiment, the method further includes: determining a pixel to be adjusted from an initial image based on the polarization parameters of a first light source; wherein the pixel value of the pixel to be adjusted is determined based on a spectral sub-parameter corresponding to the pixel to be adjusted in a first spectral parameter; and adjusting the first spectral parameter based on the polarization parameters of the first light source to obtain a second spectral parameter, including: adjusting the spectral sub-parameter corresponding to the pixel to be adjusted in the first spectral parameter based on the polarization parameters of the first light source to obtain the second spectral parameter.

[0010] In one embodiment, the method further includes: acquiring a polarization image; wherein the polarization image is an image obtained by image acquisition targeting a second light source; the second light source is a light source formed after polarizing a first light source; determining the polarization parameters of a second pixel in an initial image that matches the position of the first pixel based on the pixel value of the first pixel in the polarization image; wherein the polarization parameters of the first light source include the polarization parameters of the second pixel in the initial image; determining the pixel to be adjusted from the initial image based on the polarization parameters of the first light source, including determining the pixel to be adjusted from the second pixel based on the polarization parameters of the second pixel and a preset parameter threshold.

[0011] In one embodiment, determining the pixel to be adjusted from the initial image based on the polarization parameter of the first light source includes: determining the focus area in the initial image as a first candidate area, and / or selecting a second candidate area from the initial image based on a touch operation on the initial image; and determining the pixel to be adjusted from the first candidate area and / or the second candidate area based on the polarization parameter of the first light source.

[0012] In one embodiment, determining a second candidate region from an initial image based on a touch operation on an initial image includes: determining the region where each target object is located in the initial image; and determining the region where the first target object is located as the second candidate region in response to detecting a touch operation on a first target object in the initial image.

[0013] In one embodiment, the number of target objects is at least two, and determining the region where the first target object is located as the second candidate region includes: determining the second target object from at least two target objects in the initial image based on the location of the first target object and / or the type of the first target object; and determining the region where the first target object is located and the region where the second target object is located as the second candidate region.

[0014] In one embodiment, the polarization parameters of the first light source include: polarization degree and polarization angle. Based on the polarization parameters of the first light source, the first spectral parameters are adjusted to obtain the second spectral parameters, including: determining the reflection parameters of the reflected light in the first light source based on the polarization angle; and adjusting the first spectral parameters based on the reflection parameters in response to the reflection parameters and polarization degree satisfying a preset mapping relationship to obtain the second spectral parameters.

[0015] According to a second aspect of the present disclosure, an image processing apparatus is provided, the apparatus comprising:

[0016] The acquisition module is configured to acquire an initial image; wherein the initial image is generated based on the first spectral parameters acquired for the first light source;

[0017] The adjustment module is configured to adjust the first spectral parameters based on the polarization parameters of the first light source to obtain the second spectral parameters;

[0018] The correction module is configured to correct the color of the initial image based on the second spectral parameter to obtain the target image.

[0019] In one embodiment, the image processing apparatus includes: a determining module configured to determine a pixel to be adjusted from an initial image based on the polarization parameters of a first light source; wherein the pixel value of the pixel to be adjusted is determined based on a spectral sub-parameter corresponding to the pixel in the first spectral parameters; and an adjusting module further configured to adjust the spectral sub-parameter corresponding to the pixel in the first spectral parameters based on the polarization parameters of the first light source to obtain a second spectral parameter.

[0020] In one embodiment, the acquisition module is further configured to acquire a polarization image; wherein the polarization image is an image obtained by image acquisition of a second light source; the second light source is a light source formed after polarizing the first light source; the determination module is further configured to: determine the polarization parameters of a second pixel in the initial image that matches the position of the first pixel based on the pixel value of the first pixel in the polarization image; wherein the polarization parameters of the first light source include: the polarization parameters of the second pixel in the initial image; and determine the pixel to be adjusted from the second pixel based on the polarization parameters of the second pixel and a preset parameter threshold.

[0021] In one embodiment, the determining module is further configured to: determine a focus area in the initial image as a first candidate area, and / or select a second candidate area from the initial image based on a touch operation on the initial image; and determine a pixel to be adjusted from the first candidate area and / or the second candidate area based on the polarization parameters of the first light source.

[0022] In one embodiment, the determining module is further configured to: determine the region where each target object is located in the initial image; and, in response to detecting a touch operation on a first target object in the initial image, determine the region where the first target object is located as a second candidate region.

[0023] In one embodiment, the number of target objects is at least two, and the determining module is further configured to: determine a second target object from at least two target objects in the initial image based on the location of the first target object and / or the type of the first target object; and determine the region where the first target object is located and the region where the second target object is located as a second candidate region.

[0024] In one embodiment, the polarization parameters of the first light source include: polarization degree and polarization angle; the adjustment module is further configured to: determine the reflection parameters of the reflected light in the first light source based on the polarization angle; and adjust the first spectral parameters based on the reflection parameters to obtain the second spectral parameters in response to the reflection parameters and polarization degree satisfying a preset mapping relationship.

[0025] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing computer programs or instructions; wherein the processor executes the computer programs or instructions to implement the steps of any of the image processing methods in the first aspect described above.

[0026] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, comprising: when a computer program or instructions in the storage medium are executed by a processor, implementing the steps of any of the image processing methods in the first aspect described above.

[0027] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implement the steps of any of the image processing methods in the first aspect described above.

[0028] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0029] In this embodiment, upon acquiring an initial image generated based on the first spectral parameters of a first light source, the first spectral parameters can be precisely adjusted based on the polarization parameters of the first light source. The color of the initial image can then be precisely corrected based on the adjusted second spectral parameters, thereby reducing interference caused by the polarization of the light source during the color correction process. This improves the accuracy of color correction for the initial image, enhances the consistency between the corrected target image color and the visually true color of the photographed object, and ultimately improves the display effect of the target image.

[0030] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0031] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0032] Figure 1 This is a flowchart illustrating an image processing method according to an exemplary embodiment.

[0033] Figure 2This is a structural block diagram of an image processing apparatus according to an exemplary embodiment.

[0034] Figure 3 This is a structural block diagram of an electronic device according to an exemplary embodiment.

[0035] Figure 4 This is a block diagram of an apparatus according to an exemplary embodiment. Detailed Implementation

[0036] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0037] The image processing method shown in this disclosure can be applied to electronic devices with image acquisition capabilities. Here, the electronic device can include a mobile electronic device or a fixed electronic device. The mobile electronic device can include devices such as mobile phones, tablets, laptops, and in-vehicle electronic devices. The fixed electronic device can include desktop computers, smart TVs, etc. In some embodiments, the operating system of the electronic device can include an Input Output System (IOS) operating system, an Android operating system, etc.

[0038] It should be noted that electronic devices may include, but are not limited to, mobile communication electronic devices, portable entertainment devices, wearable devices, home appliances, augmented reality devices, virtual reality devices, and special-purpose devices. Among these, mobile communication electronic devices may include, but are not limited to, mobile phones, tablets, and smartwatches; portable entertainment devices may include, but are not limited to, digital cameras; wearable devices may include, but are not limited to, smart bracelets and smart glasses; home appliances may include, but are not limited to, televisions and video recorders; augmented reality (AR) devices may include, but are not limited to, AR glasses; virtual reality (VR) devices may include, but are not limited to, VR glasses; and special-purpose devices may include, but are not limited to, professional cameras (such as SLR cameras and point-and-shoot cameras).

[0039] It should be noted that the execution entity of the embodiments disclosed herein may be a central processing unit (CPU) in an electronic device in terms of hardware, and may be a related background service or application in the electronic device in terms of software, without limitation.

[0040] To better understand the technical solutions in the embodiments of this disclosure, the following provides an exemplary description of focusing methods in related technologies:

[0041] In related technologies, image color correction can be performed based on the AWB algorithm. For example, based on the logic of the grayscale world, target pixels that need to be adjusted to white can be identified from the image. White balance adjustment parameters are then determined based on the pixel values ​​of the target pixels. The image color is then corrected based on these white balance adjustment parameters. These parameters are used to adjust the proportions of each color component of the target pixel's pixel value to the same ratio. Alternatively, image color correction can be performed based on artificial intelligence (AI) algorithms.

[0042] While AWB algorithms in related technologies can correct image colors, they only do so based on spectral parameters collected from ambient light sources. Because ambient light sources are complex—for example, they may contain a large amount of polarized light—the collected spectral parameters may contain interference. Therefore, the accuracy of color correction based on spectral parameters cannot be guaranteed, resulting in a corrected image that still does not meet display requirements.

[0043] Based on this Figure 1 This is a flowchart illustrating an image processing method according to an exemplary embodiment, such as... Figure 1 As shown, the method includes steps 101 to 103, wherein:

[0044] Step 101: Obtain an initial image; wherein the initial image is generated based on the first spectral parameters acquired for the first light source.

[0045] In one embodiment, the initial image can be an image generated by an image acquisition device based on first spectral parameters acquired from a first light source. Here, the image acquisition device may include a camera and a first image sensor. When the first light source is incident on the first image sensor via the camera, the first image sensor can acquire the first spectral parameters. The initial image can be generated based on the first spectral parameters acquired by the first image sensor. It should be noted that the camera and the first image sensor can be arranged adjacent to each other; that is, there may be no other components between the camera and the first image sensor, and the first light source can be directly incident on the first image sensor via the camera.

[0046] In one embodiment, the first spectral parameter includes a first light intensity parameter and / or a first wavelength parameter. The first light intensity parameter characterizes the light intensity of the first light source. The first wavelength parameter can be used to indicate the wavelength range of the first light source.

[0047] In one embodiment, the first spectral parameter may include a first number of spectral sub-parameters. The pixel values ​​of a first number of pixels in the initial image may be determined based on the first number of spectral sub-parameters in the first spectral parameter, and the pixel values ​​of different pixels may be determined based on different spectral sub-parameters.

[0048] Step 102: Based on the polarization parameters of the first light source, adjust the first spectral parameters to obtain the second spectral parameters.

[0049] In one embodiment, if the polarization parameter is greater than a preset parameter threshold, the first spectral parameter is adjusted to obtain the second spectral parameter; or, if the polarization parameter is less than or equal to the preset parameter threshold, the color of the initial image is corrected based on the first spectral parameter to obtain the target image. That is, if the polarization parameter is less than the preset parameter threshold, there is no need to adjust the first spectral parameter.

[0050] Here, when the polarization parameter is large—that is, when the interference from the polarization of the first light source is significant during the color correction of the initial image—the first spectral parameter can be adjusted to use the adjusted second spectral parameter for accurate color correction of the initial image. This improves the accuracy of color correction of the initial image. Conversely, when the polarization parameter is small—that is, when the interference from the polarization of the first light source is minimal during color correction of the initial image—the first spectral parameter does not need to be adjusted, and accurate color correction of the initial image can continue based on the first spectral parameter. This reduces the computational load caused by frequent adjustments to the first spectral parameter while maintaining relatively accurate color correction of the initial image.

[0051] In one embodiment, the polarization parameter may include: polarization degree and / or polarization angle. A polarization parameter greater than a preset threshold may include at least one of the following: the polarization degree is greater than a preset degree threshold, and the polarization angle is greater than a preset angle threshold. For example, the preset degree threshold may be 0.2.

[0052] For example, if the degree of polarization is greater than a preset threshold, the first spectral parameter can be adjusted to obtain the second spectral parameter. If the degree of polarization is less than the preset threshold, the color of the initial image is corrected based on the first spectral parameter to obtain the target image. That is, if the degree of polarization is less than the preset threshold, there is no need to adjust the first spectral parameter. For example, the preset threshold can be 0.2.

[0053] For example, if the polarization angle is greater than a preset angle threshold, the first spectral parameter can be adjusted to obtain the second spectral parameter. If the polarization angle is less than the preset angle threshold, the color of the initial image is corrected based on the first spectral parameter to obtain the target image. That is, if the polarization angle is less than the preset angle threshold, there is no need to adjust the first spectral parameter.

[0054] In one embodiment, the pixel to be adjusted can be determined from the initial image, and the second spectral parameter can be obtained by adjusting the spectral sub-parameters in the first spectral parameter that correspond to the pixel to be adjusted in the initial image based on the polarization parameter.

[0055] In one embodiment, the initial image may have a first number of pixels. All of these first number of pixels in the initial image can be determined as pixels to be adjusted. That is, all pixels in the initial image can be determined as pixels to be adjusted. Alternatively, a second number of pixels in the initial image can be determined as pixels to be adjusted. The second number can be less than the first number. That is, a subset of pixels in the initial image can be determined as pixels to be adjusted.

[0056] Step 103: Based on the second spectral parameters, correct the color of the initial image to obtain the target image.

[0057] It should be noted that the color correction of the initial image in this disclosure can be understood as performing white balance processing on the initial image so that the color of the processed target image when displayed is consistent with the color of the photographed object observed by the user's eyes, thereby improving the user experience.

[0058] In one embodiment, the color temperature parameter can be determined based on the second spectral parameter; the color of the initial image can be corrected based on the color temperature parameter to obtain the target image. For example, the white balance adjustment parameter can be determined based on the color temperature parameter; the color of the initial image can be corrected based on the white balance adjustment parameter to obtain the target image. The color temperature parameter can be used to indicate the ambient color temperature of the environment in which the image acquisition device is located. The white balance adjustment parameter can be used to adjust the proportion of each color component in the pixel value of the initial image.

[0059] In one embodiment, the second spectral parameters and the initial image can be input into a preset image processing model to obtain the target image. The image processing model is a pre-trained model that performs white balance processing on the input image based on the input spectral parameters. This improves the efficiency of color correction of the initial image based on the second spectral parameters.

[0060] In one embodiment, an initial image is acquired; wherein the initial image is generated based on first spectral parameters acquired for a first light source; the first spectral parameters are adjusted based on the polarization parameters of the first light source to obtain second spectral parameters; the pixel value of a second pixel in the initial image is adjusted based on the polarization parameters to obtain an adjusted initial image; and the color of the adjusted initial image is corrected based on the second spectral parameters to obtain a target image. Here, the pixel values ​​of pixels in the initial image can be adjusted based on the polarization parameters of the first light source to obtain an adjusted initial image, so as to accurately reflect the imaging result of the light source when no polarization is generated. Thus, when the color of the adjusted initial image is corrected based on the second spectral parameters, the consistency between the color of the corrected target image and the visual color of the real light source can be improved.

[0061] In one embodiment, the first spectral parameter can be adjusted based on the adjustment value corresponding to the polarization parameter of the first light source. The adjustment value can be positively correlated with the polarization parameter.

[0062] In this embodiment, upon acquiring an initial image generated based on the first spectral parameters of a first light source, the first spectral parameters can be precisely adjusted based on the polarization parameters of the first light source. The color of the initial image can then be precisely corrected based on the adjusted second spectral parameters, thereby reducing interference caused by the polarization of the light source during the color correction process. This improves the accuracy of color correction for the initial image, enhances the consistency between the corrected target image color and the visually true color of the photographed object, and ultimately improves the display effect of the target image.

[0063] In one embodiment, the method further includes:

[0064] Based on the polarization parameters of the first light source, the pixel to be adjusted is determined from the initial image; wherein, the pixel value of the pixel to be adjusted is determined based on the spectral sub-parameter corresponding to the pixel to be adjusted in the first spectral parameters;

[0065] Based on the polarization parameters of the first light source, the first spectral parameters are adjusted to obtain the second spectral parameters, including:

[0066] Based on the polarization parameters of the first light source, the spectral sub-parameters corresponding to the pixels to be adjusted in the first spectral parameters are adjusted to obtain the second spectral parameters.

[0067] In one embodiment, the first spectral parameter includes: a first spectral sub-parameter corresponding to the pixel to be adjusted, and a second spectral sub-parameter other than the first spectral sub-parameter. The second spectral parameter includes: a second spectral sub-parameter, and a third spectral sub-parameter obtained by adjusting the first spectral sub-parameter. For example, the second spectral parameter can be obtained by adjusting the first spectral sub-parameter based on the polarization parameter while keeping the second spectral sub-parameter unchanged.

[0068] In one embodiment, a second number of pixels to be adjusted can be determined from the initial image based on the polarization parameters of the first light source. The polarization parameters can be positively correlated with the second number. Thus, if the interference from the polarization of the first light source is significant during color correction of the initial image, the spectral sub-parameters of a larger number of pixels to be adjusted can be adjusted; that is, most of the spectral sub-parameters in the first spectral parameters can be adjusted to improve the reliability of the adjusted second spectral parameters during the color correction process.

[0069] In one embodiment, if the polarization parameter of the first light source is greater than a preset parameter threshold, all pixels in the initial image can be identified as pixels to be adjusted. Alternatively, if the polarization parameter of the first light source is less than or equal to the preset parameter threshold, a second number of pixels to be adjusted can be identified from the initial image.

[0070] In this embodiment of the disclosure, when different spectral sub-parameters in the first spectral parameters are used to determine the pixel values ​​of different pixels in the initial image—that is, when different spectral sub-parameters correspond to different pixels—the pixel to be adjusted can be accurately determined from the initial image based on the polarization parameter first, and then the spectral sub-parameters in the first spectral parameters corresponding to the pixel to be adjusted can be adjusted. In this case, it is unnecessary to adjust all spectral sub-parameters in the first spectral parameters, thereby reducing resource waste and increasing the speed of adjusting the first spectral parameters.

[0071] In one embodiment, the method further includes:

[0072] Acquire a polarization image; wherein the polarization image is an image obtained by image acquisition targeting a second light source; the second light source is a light source formed after polarizing the first light source;

[0073] Based on the pixel value of the first pixel in the polarization image, the polarization parameters of the second pixel in the initial image that matches the position of the first pixel are determined; wherein, the polarization parameters of the first light source include: the polarization parameters of the second pixel in the initial image;

[0074] Based on the polarization parameters of the first light source, the pixels to be adjusted are determined from the initial image, including:

[0075] Based on the polarization parameters of the second pixel and the preset parameter threshold, the pixel to be adjusted is determined from the second pixel.

[0076] In one embodiment, when the first light source is polarized in at least two light transmission directions to form at least two second light sources, polarization images can be acquired for each of the second light sources. In this case, the number of polarization images can be at least two. It should be noted that the polarization images can be images acquired by any image acquisition device of this disclosure for the second light source.

[0077] For example, the light transmission direction may include at least two of the following: a first direction with an angle of 0° to the horizontal direction; a second direction with an angle of 45° to the horizontal direction; a third direction with an angle of 90° to the horizontal direction; and a fourth direction with an angle of 135° to the horizontal direction.

[0078] At this point, polarization images can be generated for each of the second light sources formed in each light transmission direction. Here, the number of polarization images generated is the same as the number of light transmission directions. For example, a first polarization image can be generated for the second light source formed in the first direction; a second polarization image can be generated for the second light source formed in the second direction; a third polarization image can be generated for the second light source formed in the third direction; and a fourth polarization image can be generated for the second light source formed in the fourth direction.

[0079] In one embodiment, the image acquisition device may include a camera and a second image sensor. When a first light source is polarized to form a second light source, and the second light source is incident on the second image sensor, the second image sensor can acquire a third spectral parameter. The polarized image can be an image generated based on the third spectral parameter acquired by the second image sensor for the second light source.

[0080] It should be noted that the image acquisition device may also include a polarizing device for polarizing the first light source. For example, the polarizing device can be a polarizing filter. Here, the polarizing device can be positioned between the camera and the second image sensor. In this case, after the first light source enters the camera, it passes through the polarizing device to form a second light source, and the second light source can enter the second image sensor.

[0081] In one embodiment, when a second light source is formed by polarizing a first light source, and a second image sensor acquires a third spectral parameter of the second light source, the third spectral parameter acquired by the second image sensor can be understood as the first spectral parameter acquired for the first light source in this disclosure. The initial image generated based on the first spectral parameter can be understood as the image obtained by fusing the various polarization images generated based on the third spectral parameter.

[0082] In one embodiment, the polarization parameters of a second pixel in the initial image that matches the position of the first pixel are determined based on the pixel value of a first pixel with the same pixel coordinates in each polarization image.

[0083] For example, the formula for calculating the polarization parameter of the second pixel can be shown in formulas (1) to (5) below:

[0084] I = img1(x,y)(1);

[0085] In formula (1), img1 is the first polarization image generated for the second light source formed in the first direction, and img1(x,y) is the pixel value of the first pixel point with pixel coordinates (x,y) in the first polarization image.

[0086] Q = img3(x,y) - img1(x,y)(2);

[0087] In formula (2), img1 is the first polarization image generated for the second light source formed in the first direction, and img1(x,y) is the pixel value of the first pixel point with pixel coordinates (x,y) in the first polarization image. img3 is the third polarization image generated for the second light source formed in the third direction, and img3(x,y) is the pixel value of the first pixel point with pixel coordinates (x,y) in the third polarization image.

[0088] U = img2(x,y) - img4(x,y)(3);

[0089] In formula (2), img2 is the second polarization image generated for the second light source formed in the second direction, and img2(x,y) is the pixel value of the first pixel point with pixel coordinates (x,y) in the second polarization image. img4 is the fourth polarization image generated for the second light source formed in the fourth direction, and img4(x,y) is the pixel value of the first pixel point with pixel coordinates (x,y) in the fourth polarization image.

[0090] It should be noted that I, Q, and U in the above formulas can be understood as the Stokes parameters of the second pixel with pixel coordinates (x, y) in the initial image. The polarization parameters of the second pixel can be determined based on the Stokes parameters of the second pixel, combined with the following formulas (4) and (5).

[0091] DOP = np.sqrt(Q 2 +U 2 ) / (I+1e-8)(4);

[0092] In formula (4), DOP is the polarization degree of the second pixel with pixel coordinates (x,y), I is the pixel value of the first pixel with pixel coordinates (x,y) in the first polarized image, Q is the difference between the pixel values ​​of the first pixel with pixel coordinates (x,y) in the third polarized image and the first polarized image, and U is the difference between the pixel values ​​of the first pixel with pixel coordinates (x,y) in the second polarized image and the fourth polarized image.

[0093] AOP=0.5*np.arctan2(U,Q)(5);

[0094] In formula (5), AOP is the polarization angle of the second pixel with pixel coordinates (x,y), Q is the difference between the pixel values ​​of the first pixel with pixel coordinates (x,y) in the third polarization image and the first polarization image, and U is the difference between the pixel values ​​of the first pixel with pixel coordinates (x,y) in the second polarization image and the fourth polarization image.

[0095] In one embodiment, the image acquisition device includes a first image sensor and a second image sensor. In response to determining that the first image sensor has acquired a first spectral parameter and / or generated an initial image, a first position of the first image sensor and a second position of the second image sensor are determined. The first image sensor is controlled to move from the first position to a position different from the first position, and the second image sensor is controlled to move from the second position to the first position. At the second position, the second image sensor is controlled to acquire a third spectral parameter for a second light source, and a polarization image is generated based on the third spectral parameter. Here, by moving the positions of the first and second image sensors, the consistency of their positions during image acquisition can be maintained, thereby enabling faster finding of pixels whose positions match in the polarization image and the initial image.

[0096] It should be noted that the position-matched second and first pixels can be used to represent the same feature of the photographed object. Therefore, when the first and second image sensors are located at the same second position for image acquisition, the pixel coordinates of the same feature of the photographed object are the same in the second pixel of the initial image generated based on the first image sensor and in the polarized image generated based on the second image sensor. In this case, the position-matched second and first pixels can be understood as pixels with the same pixel coordinates in the polarized image and the initial image.

[0097] In another embodiment, the location where the first image sensor acquires the first spectral parameter may differ from the location where the second image sensor acquires the third spectral parameter. For example, the first and second image sensors may be arranged side-by-side. The first image sensor may be in the third position, and the second image sensor may be in the fourth position. The first spectral parameter can be acquired by the first image sensor at the third position, and the third spectral parameter can be acquired by the second image sensor at the fourth position. Here, there is no need to move the positions of the first and second image sensors, reducing the control costs required due to moving the image sensors.

[0098] It should be noted that when the first and second image sensors are located at different positions for image acquisition, the pixel coordinates of the same feature of the photographed object in the initial image generated by the first image sensor and the polarized image generated by the second image sensor are different in the two images. Here, the pixel points whose positions match in the polarized image and the initial image can be determined based on the relative positional relationship between the first and second image sensors.

[0099] In one embodiment, determining the pixel to be adjusted from the second pixel based on the polarization parameter of the second pixel and a preset parameter threshold includes: if the polarization parameter of the second pixel is greater than the preset parameter threshold, determining the second pixel as the pixel to be adjusted.

[0100] It should be noted that different second pixels correspond to different photosensitive units in the image sensor, and the polarization parameter of the second pixel can be understood as the polarization parameter of the light incident on the photosensitive unit from the first light source. When the light incident on the photosensitive unit is reflected light, the determined degree of polarization of the light incident on the photosensitive unit is relatively large. When the light incident on the photosensitive unit is scattered light, the determined degree of polarization of the light incident on the photosensitive unit is relatively small.

[0101] In other words, for the second pixel with a low degree of polarization in the initial image, it can be considered to have little correlation with the reflected light, and its pixel value is mainly determined based on the spectral sub-parameters of the scattered light from the first light source. Conversely, for the second pixel with a high degree of polarization in the initial image, it can be considered to have a greater correlation with the reflected light, and its pixel value is determined based on the spectral sub-parameters of the reflected light from the first light source. Therefore, the scattering and reflecting regions in the initial image can be segmented based on a preset polarization threshold, i.e., the scattered and reflected light from the first light source can be decoupled.

[0102] Furthermore, the second spectral sub-parameter corresponding to the second pixel in the scattering region can be considered as a spectral sub-parameter that does not require adjustment. The first spectral sub-parameter corresponding to the second pixel in the reflection region can be considered as a spectral sub-parameter that needs adjustment. The first spectral sub-parameter corresponding to the second pixel in the reflection region can be adjusted to obtain a third spectral sub-parameter. The adjusted third spectral sub-parameter can then be combined with the second spectral sub-parameter of the second pixel in the scattering region to form the second spectral parameter. It should be noted that the first spectral sub-parameter can be the intensity of the reflected light. The incident light intensity before reflection can be calculated using a reflection model (such as the Fresnel formula). The first spectral sub-parameter can then be adjusted based on this incident light intensity.

[0103] Here, the scattered and reflected light in the first light source can be decoupled based on polarized light, and the incident light of the reflected light can be traced, thereby directly obtaining accurate light source information and completely solving the problem of light source information decoupling. Thus, even in scenarios where solid-color objects, wood grain, or human faces are being photographed, the colors of the initial image can still be accurately corrected based on precise second spectral parameters, resulting in a target image with good display quality.

[0104] In this embodiment, the pixel to be adjusted can be determined from the second pixel based on polarization parameters and a preset parameter threshold. For example, a second pixel in the initial image whose polarization parameter is greater than the preset parameter threshold can be determined as the pixel to be adjusted. That is, if the probability that the incident light corresponding to the second pixel is reflected light is relatively high, the second pixel can be determined as the pixel to be adjusted, thereby improving the accuracy of determining the pixel to be adjusted. At this time, the spectral sub-parameters related to the pixel to be adjusted can be adjusted in the initial image where the reflectance of the subject and the light source information are coupled, so as to decouple the reflectance of the subject and the light source information, thereby improving the accuracy of color correction of the initial image based on the light source information.

[0105] In one embodiment, determining the pixel to be adjusted from the initial image based on the polarization parameters of the first light source includes:

[0106] The focus area in the initial image is identified as the first candidate region, and / or,

[0107] A second candidate region is selected from the initial image based on the touch operation on the initial image;

[0108] Based on the polarization parameters of the first light source, the pixel to be adjusted is determined from the first candidate region and / or the second candidate region.

[0109] It should be noted that the sharpness of the focused area in the initial image is higher than that of other areas in the initial image besides the focused area.

[0110] In one embodiment, the first spectral parameters can be acquired based on preset focus parameters for a first light source, and the initial image can be generated based on the acquired first spectral parameters. The focus area in the initial image can be determined based on the preset focus parameters. It should be noted that the preset focus parameters can be used to indicate the focus area in the image preview interface, and the size of the initial image can be the same as the size of the image preview interface. For example, the preview focus parameters can be used to indicate that the central area of ​​the image preview interface is the focus area. Based on the preview focus parameters, the central area of ​​the initial image can be determined as the focus area.

[0111] It should be noted that the first spectral parameter can be acquired by the image acquisition device based on preset focus parameters for the first light source. When the first spectral parameter is acquired by the image acquisition device, since there is a correspondence between the relative distance between the image sensor and the camera in the image acquisition device and the focus area in the generated image, the relative distance between the image sensor and the camera can be controlled by moving the image sensor to the target position corresponding to the preset focus parameters. This controls the position of the focus area in the generated initial image, ensuring that the position of the focus area in the initial image meets the requirements of the preset focus parameters. In other words, this ensures consistency between the position of the focus area in the initial image and the position of the focus area in the image preview interface.

[0112] In this disclosure, a focus area with higher clarity in the initial image can be identified as a first candidate region; that is, an area in the initial image that needs to be highlighted is identified as a first candidate region, and pixels to be adjusted are selected from the first candidate region. In this way, pixels to be adjusted can be selected from the first candidate region that needs to be highlighted, thereby improving the display effect of the first candidate region. Furthermore, pixels to be adjusted can be selected from a portion of the initial image, improving the efficiency of selecting pixels to be adjusted.

[0113] In one embodiment, selecting a second candidate region from the initial image based on a touch operation on the initial image includes: selecting a second candidate region from the initial image that includes the touch position and has a preset size parameter based on the touch position of the touch operation. For example, the second candidate region may be a region centered on the touch position and having a preset size parameter.

[0114] In this embodiment, a second candidate region can be flexibly selected from the initial image based on touch operation. That is, a second candidate region can be flexibly selected from the initial image according to the user's needs, and pixels to be adjusted can be selected from the second candidate region. This allows for the selection of pixels to be adjusted from the user-selected second candidate region, improving the display effect of the second candidate region and enhancing the user experience. Furthermore, pixels to be adjusted can be selected from a portion of the initial image, improving the efficiency of selecting pixels to be adjusted.

[0115] In one embodiment, determining a second candidate region from an initial image based on a touch operation on an initial image includes:

[0116] Determine the regions where each target object is located in the initial image;

[0117] In response to detecting a touch operation on a first target object in the initial image, the region where the first target object is located is determined as a second candidate region.

[0118] In one embodiment, semantic segmentation can be performed on the initial image to obtain individual target objects in the initial image. The regions where each target object is located in the initial image are determined. In response to detecting a touch operation targeting at least one first target in the initial image, the region where the first target is located is determined as a second candidate region.

[0119] In one embodiment, a third candidate region is selected from the initial image based on the type of each target object in the initial image; and pixels to be adjusted are selected from the third candidate region based on polarization parameters. For example, the region containing a target object of a preset type in the initial image can be determined as the third candidate region. For example, the target object of the preset type can be a face.

[0120] In this embodiment of the disclosure, the entire area where the first target object is located can be determined as the second candidate area based on the touch operation on the first target object. Here, in the process of adjusting the spectral sub-parameters related to the pixels to be adjusted from the second candidate area, and correcting the color of the initial image based on the adjusted second spectral parameters, the consistency of the adjustment of the entire display area where the first target object is located can be improved, and the situation where the display effect of different parts of the first target object is too different can be reduced.

[0121] In one embodiment, the number of target objects is at least two, and determining the area where the first target object is located as the second candidate area includes:

[0122] Based on the location of the first target object and / or the type of the first target object, a second target object is determined from at least two target objects in the initial image;

[0123] The area where the first target object is located and the area where the second target object is located are determined as the second candidate areas.

[0124] In one embodiment, a second target object located within a preset range of the first target object can be determined from at least two target objects in the initial image based on the location of the first target object.

[0125] In one embodiment, a preset range can be determined based on the performance parameters of the electronic device. The performance parameters and the preset range can be positively correlated. The performance parameters can be used to characterize the computing power margin of the electronic device and / or the processing speed of the processor. This allows the size of the determined second candidate region to be matched with the performance parameters of the electronic device, thereby improving the efficiency of determining the pixels to be adjusted from the second candidate region.

[0126] Here, not only can the area of ​​the first target object selected based on touch operation be determined as the second candidate area, but also the area of ​​the second target object located within a preset range of the first target object can be determined as the second candidate area. Thus, during the process of adjusting the spectral sub-parameters related to the pixels to be adjusted from the second candidate area, and correcting the color of the initial image based on the adjusted second spectral parameters, the range of the second candidate area can be appropriately increased to ensure a natural transition between the display effect of the area of ​​the first target object and the display effect of the area of ​​the second target object surrounding the first target object, thereby improving the overall display effect of the target image.

[0127] In one embodiment, there may be a correspondence between the types of the first target object and the types of the second target object. Based on the type of the first target object, a second target object corresponding to the first target object can be determined from at least two target objects in the initial image. For example, the type of the first target object may be a face, and the type of the second target object may be a human torso; there may be a correspondence between a face and a torso. In this case, the second target object can be determined based on the first target object, and if the first target object and the second target object are different parts of the same object, both the first target object and the second target object can be determined as second candidate regions.

[0128] In this embodiment of the disclosure, a second target object associated with the first target object can be quickly determined from at least two target objects in the initial image based on the location and / or type of the first target object, so that the regions where both the first and second target objects are located can be quickly determined as second candidate regions. This improves the speed of determining multiple second candidate regions from the initial image.

[0129] In one embodiment, the polarization parameters of the first light source include: polarization degree and polarization angle; based on the polarization parameters of the first light source, the first spectral parameters are adjusted to obtain the second spectral parameters, including:

[0130] Based on the polarization angle, the reflection parameters of the reflected light in the first light source are determined; in response to the reflection parameters and polarization degree satisfying a preset mapping relationship, the first spectral parameters are adjusted based on the reflection parameters to obtain the second spectral parameters.

[0131] In one embodiment, the reflection parameters include: a first reflectance of the object in a fifth direction and a second reflectance of the object in a sixth direction. The fifth direction can be a direction parallel to the incident surface of the object. The sixth direction can be a direction perpendicular to the incident surface of the object. The first and second reflectances can be determined based on the polarization angle. In response to the first reflectance, second reflectance, and polarization degree satisfying a preset mapping relationship, the first spectral parameters are adjusted based on the first and second reflectances to obtain the second spectral parameters.

[0132] For example, the expression for the first reflectivity, the second reflectivity, and the degree of polarization satisfying a preset mapping relationship is shown in the following formula (6):

[0133]

[0134] In formula (6), DOP represents the degree of polarization, and R... s R is the first reflectivity. p This is the second reflectivity.

[0135] For example, the calculation formula for adjusting the first spectral parameter is shown in the following formula (7):

[0136]

[0137] In formula (7), I reflected I is the first spectral parameter. incident R is the second spectral parameter. s R is the first reflectivity. p This is the second reflectivity.

[0138] Here, I reflectedThis can be understood as the first light intensity parameter related to the pixel to be adjusted in the first spectral parameters, I. incident This can be understood as the second light intensity parameter obtained by adjusting the light intensity parameters related to the pixel to be adjusted. The second light intensity parameter can be obtained by replacing the first light intensity parameter in the first spectral parameter.

[0139] In one embodiment, the incident angle of the first light source on the photographed object is determined based on the polarization angle. The refraction angle of the first light source on the photographed object is determined based on the incident angle and the first refraction parameter of the photographed object; the reflection parameter of the reflected light in the first light source is determined based on the incident angle and the refraction angle. Here, the polarization angle can be the same as the incident angle. Alternatively, a first correspondence can be pre-established between the polarization angle and the incident angle, and an incident angle with a first correspondence with the polarization angle can be determined based on the polarization angle. The difference between the polarization angle and the incident angle can be less than a preset difference threshold. The difference threshold can be determined based on historically acquired deviation values ​​between the polarization angle and the incident angle.

[0140] In one embodiment, the first refraction parameter of the photographed object can be determined based on an algorithmic model. For example, the algorithmic model can be a model trained on a combination of image samples taken of the photographed object and refraction parameter samples of the object. An initial image taken of the photographed object can be input into the algorithmic model to obtain the first refraction parameter of the object. Alternatively, the first refraction parameter of the photographed object can be determined based on the type of the photographed object. A pre-established second correspondence can exist between the type of the photographed object and its first refraction parameter. Here, a semantic analysis algorithm can be used to determine the type of the photographed object in the initial image, thereby determining the first refraction parameter of the photographed object based on the type of the photographed object.

[0141] In one embodiment, determining the refraction angle of the first light source on the object being photographed, based on the incident angle and a first refraction parameter of the object, includes: determining the refraction angle of the first light source on the object being photographed based on the incident angle, the first refraction parameter of the object being photographed, and a second refraction parameter of the propagation medium between the object being photographed and the image acquisition device. For example, the propagation medium between the object being photographed and the image acquisition device can be air. It should be noted that the first refraction parameter can be the refractive index of the object being photographed, and the second refraction parameter can be the refractive index of the propagation medium between the object being photographed and the image acquisition device. For example, the propagation medium between the object being photographed and the image acquisition device can be air, and the second refraction parameter can be 1.

[0142] For example, the formula for calculating the angle of refraction can be shown in the following formula (8):

[0143]

[0144] In formula (8), θ i Let θ be the incident angle. t Let n be the angle of refraction, n1 be the refractive index of the medium between the subject and the camera, and n2 be the refractive index of the subject. For example, the medium between the subject and the camera can be air, and n1 can be the refractive index of air. For example, n1 can be 1.

[0145] For example, the formula for calculating the first reflectivity can be shown in formula (9) below:

[0146]

[0147] In formula (9), n1 is the refractive index of the propagation medium between the object being photographed and the camera, and n2 is the refractive index of the object being photographed. θ i Let θ be the incident angle. t R is the angle of refraction. s This is the first reflectivity.

[0148] For example, the formula for calculating the second reflectivity can be shown in formula (10) below:

[0149]

[0150] In formula (10), n1 is the refractive index of the propagation medium between the object being photographed and the camera, and n2 is the refractive index of the object being photographed. θ i Let θ be the incident angle. t R is the angle of refraction. p This is the second reflectivity.

[0151] In this embodiment, the reflection parameters of the reflected light in the first light source can be determined based on the polarization angle, and the calculated reflection parameters can be verified based on the degree of polarization and a preset mapping relationship. When the degree of polarization and the reflection parameters satisfy the preset mapping relationship, that is, when the reflection parameters pass verification, the first spectral parameters can be adjusted based on reliable reflection parameters to obtain accurate second spectral parameters. This improves the reliability of adjusting the first spectral parameters.

[0152] In one embodiment, this disclosure provides an image processing method, the method comprising steps 21 to 26:

[0153] Step 21: The first light source is polarized according to the preset first direction, second direction, third direction and fourth direction respectively to form the second light source in each direction.

[0154] The first direction has an angle of 0° with the horizontal direction; the second direction has an angle of 45° with the horizontal direction; the third direction has an angle of 90° with the horizontal direction; and the fourth direction has an angle of 135° with the horizontal direction.

[0155] Step 22: Acquire an image of the second light source to obtain a polarization image corresponding to the second light source.

[0156] The polarization images include: a first polarization image, a second polarization image, a third polarization image, and a fourth polarization image;

[0157] The first polarization image is an image generated for a second light source formed in a first direction; the second polarization image is an image generated for a second light source formed in a second direction; the third polarization image is an image generated for a second light source formed in a third direction; and the fourth polarization image is an image generated for a second light source formed in a fourth direction.

[0158] Step 23: Based on each polarization image, calculate the Stokes parameters of each second pixel in the initial image.

[0159] Here, the stokens parameter of each second pixel in the initial image can be determined based on formulas (1) to (3) in this disclosure.

[0160] Step 24: Determine the polarization angle and polarization degree of each second pixel based on the stokens parameters of each second pixel.

[0161] Here, the polarization degree of each second pixel can be determined based on formula (4) of this disclosure. The polarization angle of each second pixel can be determined based on formula (5) of this disclosure.

[0162] Step 25: The second pixel with a polarization degree greater than the preset degree threshold is identified as the pixel to be adjusted.

[0163] Step 26: Adjust the spectral sub-parameters related to the pixel to be adjusted in the first spectral parameters to obtain the second spectral parameters.

[0164] Here, the spectral sub-parameters related to the pixel to be adjusted in the first spectral parameters can be adjusted based on formulas (7) to (10) in this disclosure.

[0165] Step 27: Based on the second spectral parameters, perform white balance processing on the initial image to obtain the target image.

[0166] In one embodiment, this disclosure provides a method for adjusting a first spectral parameter, the method comprising steps 31 to 38:

[0167] Step 31: Obtain at least one of the following data: sensing data collected by the polarization sensor, the first refractive index of the propagation medium between the object being photographed and the image acquisition device, and the second refractive index of the object being photographed;

[0168] It should be noted that the polarization sensor here can be any of the second image sensors disclosed herein, and the sensing data can include: image data of any of the first polarization image, image data of the second polarization image, image data of the third polarization image, and image data of the fourth polarization image disclosed herein.

[0169] It should be noted that the second refractive index of the photographed object can be determined based on the type of the photographed object. For example, if there is a correspondence between the second refractive index of the photographed object and the type of the photographed object, the second refractive index corresponding to the type of the photographed object can be determined based on the type of the photographed object.

[0170] Step 32: Based on the sensing data collected by the polarization sensor, determine the degree of polarization and the polarization angle of the first light source.

[0171] Step 33: The incident angle of the first light source on the subject can be determined based on the polarization angle.

[0172] Step 34: Determine the refraction angle of the first light source on the photographed object based on the incident angle, the first refractive index, and the second refractive index.

[0173] Here, the angle of refraction can be calculated according to Snell's law. For example, the angle of refraction can be calculated based on formula (8) of this disclosure.

[0174] Step 35: Based on the first refractive index, the second refractive index, the incident angle, and the refraction angle, calculate the first reflectivity of the photographed object in the fifth direction. The fifth direction can be a direction parallel to the incident surface of the photographed object.

[0175] Here, the first reflectivity can be calculated based on formula (9) of this disclosure.

[0176] Step 36: Based on the first refractive index, the second refractive index, the incident angle, and the refraction angle, calculate the second reflectivity of the photographed object in the sixth direction. The sixth direction can be a direction perpendicular to the incident surface of the photographed object.

[0177] Here, the second reflectivity can be calculated based on formula (10) of this disclosure.

[0178] Step 37: Determine whether the first reflectivity, the second reflectivity, and the degree of polarization satisfy a preset mapping relationship.

[0179] It should be noted that the preset mapping relationship can be as shown in formula (6) of this disclosure.

[0180] Step 38: In response to the preset mapping relationship between the first reflectivity, the second reflectivity and the degree of polarization, the first spectral parameter can be adjusted based on the first reflectivity and the second reflectivity to obtain the second spectral parameter.

[0181] Here, the first spectral parameter can be adjusted based on the formula (7) of this disclosure.

[0182] Figure 2 This is a structural block diagram of an image processing apparatus according to an exemplary embodiment, see below. Figure 2 The device includes:

[0183] According to a second aspect of the present disclosure, an image processing apparatus is provided, the apparatus comprising:

[0184] The acquisition module 201 is configured to acquire an initial image; wherein the initial image is generated based on the first spectral parameters acquired for the first light source;

[0185] The adjustment module 201 is configured to adjust the first spectral parameters based on the polarization parameters of the first light source to obtain the second spectral parameters;

[0186] The correction module 203 is configured to correct the color of the initial image based on the second spectral parameters to obtain the target image.

[0187] In one embodiment, the image processing apparatus includes: a determining module configured to determine a pixel to be adjusted from an initial image based on the polarization parameters of a first light source; wherein the pixel value of the pixel to be adjusted is determined based on a spectral sub-parameter corresponding to the pixel to be adjusted in a first spectral parameter; and an adjusting module 202 further configured to: adjust the spectral sub-parameter corresponding to the pixel to be adjusted in the first spectral parameter based on the polarization parameters of the first light source to obtain a second spectral parameter.

[0188] In one embodiment, the acquisition module 201 is further configured to acquire a polarization image; wherein the polarization image is an image obtained by image acquisition of a second light source; the second light source is a light source formed after polarizing the first light source; the determination module is further configured to: determine the polarization parameters of a second pixel in the initial image that matches the position of the first pixel based on the pixel value of the first pixel in the polarization image; wherein the polarization parameters of the first light source include: the polarization parameters of the second pixel in the initial image; and determine the pixel to be adjusted from the second pixel based on the polarization parameters of the second pixel and a preset parameter threshold.

[0189] In one embodiment, the determining module is further configured to: determine a focus area in the initial image as a first candidate area, and / or select a second candidate area from the initial image based on a touch operation on the initial image; and determine a pixel to be adjusted from the first candidate area and / or the second candidate area based on the polarization parameters of the first light source.

[0190] In one embodiment, the determining module is further configured to: determine the region where each target object is located in the initial image; and, in response to detecting a touch operation on a first target object in the initial image, determine the region where the first target object is located as a second candidate region.

[0191] In one embodiment, the number of target objects is at least two, and the determining module is further configured to: determine a second target object from at least two target objects in the initial image based on the location of the first target object and / or the type of the first target object; and determine the region where the first target object is located and the region where the second target object is located as a second candidate region.

[0192] In one embodiment, the polarization parameters of the first light source include: polarization degree and polarization angle; the adjustment module 202 is further configured to: determine the reflection parameters of the reflected light in the first light source based on the polarization angle; and adjust the first spectral parameters based on the reflection parameters to obtain the second spectral parameters in response to the reflection parameters and polarization degree satisfying a preset mapping relationship.

[0193] The image processing method shown in the embodiments of this disclosure can be applied to electronic devices. Figure 3 This is a structural block diagram illustrating an electronic device 300 according to an exemplary embodiment. For example, the electronic device 300 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0194] Reference Figure 3 The electronic device 300 may include one or more of the following components: processing component 302, memory 304, power supply component 306, multimedia component 308, audio component 310, input / output (I / O) interface 312, sensor component 314, and communication component 316.

[0195] Processing component 302 typically controls the overall operation of electronic device 300, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. Processing component 302 may include one or more processors 320 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 302 may include one or more modules to facilitate interaction between processing component 302 and other components. For example, processing component 302 may include a multimedia module to facilitate interaction between multimedia component 308 and processing component 302.

[0196] Memory 304 is configured to store various types of data to support the operation of electronic device 300. Examples of such data include at least one of the following: instructions for any application or method operating on electronic device 300, contact data, phonebook data, messages, pictures, and videos. Memory 304 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0197] Power supply component 306 provides power to various components of electronic device 300. Power supply component 306 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 300.

[0198] Multimedia component 308 includes a screen that provides an output interface between electronic device 300 and user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.

[0199] In some embodiments, the multimedia component 308 may include the image acquisition device shown in the embodiments of this disclosure. The image acquisition device may include a front-facing camera and / or a rear-facing camera. When the device 300 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0200] Audio component 310 is configured to output and / or input audio signals. For example, audio component 310 includes a microphone (MIC) configured to receive external audio signals when electronic device 300 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 304 or transmitted via communication component 316. In some embodiments, audio component 310 also includes a speaker for outputting audio signals.

[0201] I / O interface 312 provides an interface between processing component 302 and peripheral interface modules, such as keyboards, click wheels, and buttons. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0202] Sensor assembly 314 includes one or more sensors for providing state assessments of various aspects of electronic device 300. For example, sensor assembly 314 can detect the on / off state of electronic device 300, the relative positioning of components such as the display and keypad of electronic device 300, changes in position of electronic device 300 or one of its components, the presence or absence of user contact with electronic device 300, orientation or acceleration / deceleration of electronic device 300, and temperature changes of electronic device 300. Sensor assembly 314 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 314 may also include an optical sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications.

[0203] In some embodiments, the sensor assembly 314 may also include, but is not limited to, at least one of the following: an accelerometer, a gyroscope, a magnetic sensor, a pressure sensor, and a temperature sensor.

[0204] Communication component 316 is configured to facilitate wired or wireless communication between electronic device 300 and other devices. Electronic device 300 can access wireless networks based on communication standards, such as Wi-Fi, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 316 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 316 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.

[0205] In an exemplary embodiment, the electronic device 300 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.

[0206] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 304 including executable instructions or a computer program, which can be executed by a processor 320 of an electronic device 300 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.

[0207] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a mobile electronic device, enables the mobile electronic device to perform any of the image processing methods described above in the embodiments of this disclosure. For example, the image processing method includes:

[0208] Acquire an initial image; wherein the initial image is generated by the image acquisition device based on the first spectral parameters acquired for the first light source;

[0209] Based on the polarization parameters of the first light source, the first spectral parameters are adjusted to obtain the second spectral parameters;

[0210] Based on the second spectral parameter, the color of the initial image is corrected to obtain the target image.

[0211] This disclosure provides a computer program product comprising a computer program or executable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program or executable instructions from the computer-readable storage medium and executes the computer program or executable instructions, causing the computer device to perform any of the image processing methods described above in this disclosure.

[0212] Figure 4 This is a block diagram illustrating an apparatus 400 for performing the image processing method shown in embodiments of the present disclosure, according to an exemplary embodiment. For example, apparatus 400 may be provided as a server. (Refer to...) Figure 4 The apparatus 400 includes a processing component 422, which further includes one or more processors, and memory resources represented by memory 432 for storing instructions, such as application programs, that can be executed by the processing component 422. The application programs stored in memory 432 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 422 is configured to execute instructions to perform the image processing method described above.

[0213] Acquire an initial image; wherein the initial image is generated by the image acquisition device based on the first spectral parameters acquired for the first light source;

[0214] Based on the polarization parameters of the first light source, the first spectral parameters are adjusted to obtain the second spectral parameters;

[0215] Based on the second spectral parameter, the color of the initial image is corrected to obtain the target image.

[0216] It should be noted that the processing component 433 of the device 400 can be configured to execute instructions to acquire an initial image from the electronic device shown in the embodiments of this disclosure. The electronic device may be equipped with an image acquisition device shown in the embodiments of this disclosure, and the initial image may be an image generated by the image acquisition device in the electronic device based on the acquired first spectral parameters.

[0217] Device 400 may also include a power supply component 426 configured to perform power management of device 400, a wired or wireless network interface 450 configured to connect device 400 to a network, and an input / output (I / O) interface 458. Device 400 can operate an operating system stored in memory 432, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.

[0218] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the foregoing claims.

[0219] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. An image processing method, characterized in that, include: Acquire an initial image; wherein the initial image is generated based on a first spectral parameter acquired for a first light source; Based on the polarization parameters of the first light source, the first spectral parameters are adjusted to obtain the second spectral parameters; Based on the second spectral parameters, the color of the initial image is corrected to obtain the target image.

2. The image processing method according to claim 1, characterized in that, The method further includes: Based on the polarization parameters of the first light source, a pixel to be adjusted is determined from the initial image; wherein, the pixel value of the pixel to be adjusted is determined based on the spectral sub-parameter corresponding to the pixel to be adjusted in the first spectral parameters; The step of adjusting the first spectral parameters based on the polarization parameters of the first light source to obtain the second spectral parameters includes: Based on the polarization parameters of the first light source, the spectral sub-parameters corresponding to the pixel to be adjusted in the first spectral parameters are adjusted to obtain the second spectral parameters.

3. The image processing method according to claim 2, characterized in that, The method further includes: Acquire a polarization image; wherein the polarization image is an image obtained by image acquisition targeting a second light source; the second light source is a light source formed by polarizing the first light source; Based on the pixel value of the first pixel in the polarization image, the polarization parameters of the second pixel in the initial image that matches the position of the first pixel are determined; wherein, the polarization parameters of the first light source include: the polarization parameters of the second pixel in the initial image; The step of determining the pixel to be adjusted from the initial image based on the polarization parameters of the first light source includes: The pixel to be adjusted is determined from the second pixel based on the polarization parameters of the second pixel and a preset parameter threshold.

4. The image processing method according to claim 2, characterized in that, The step of determining the pixel to be adjusted from the initial image based on the polarization parameters of the first light source includes: The focus area in the initial image is determined as the first candidate region, and / or, Based on the touch operation on the initial image, a second candidate region is selected from the initial image; Based on the polarization parameters of the first light source, the pixel to be adjusted is determined from the first candidate region and / or the second candidate region.

5. The image processing method according to claim 4, characterized in that, The step of determining a second candidate region from the initial image based on a touch operation on the initial image includes: Determine the region where each target object is located in the initial image; In response to detecting a touch operation on a first target object in the initial image, the region where the first target object is located is determined as the second candidate region.

6. The image processing method according to claim 5, characterized in that, The number of target objects is at least two, and determining the area where the first target object is located as the second candidate area includes: Based on the location of the first target object and / or the type of the first target object, a second target object is determined from at least two target objects in the initial image; The region where the first target object is located and the region where the second target object is located are determined as the second candidate region.

7. The image processing method according to any one of claims 1 to 3, characterized in that, The polarization parameters of the first light source include: polarization degree and polarization angle. The adjustment of the first spectral parameters based on the polarization parameters of the first light source to obtain the second spectral parameters includes: Based on the polarization angle, the reflection parameters of the reflected light in the first light source are determined; In response to the reflection parameter and the polarization degree satisfying a preset mapping relationship, the first spectral parameter is adjusted based on the reflection parameter to obtain the second spectral parameter.

8. An image processing apparatus, characterized in that, The device includes: The acquisition module is configured to acquire an initial image; wherein the initial image is generated based on a first spectral parameter acquired for a first light source; The adjustment module is configured to adjust the first spectral parameters based on the polarization parameters of the first light source to obtain the second spectral parameters; The correction module is configured to correct the color of the initial image based on the second spectral parameters to obtain the target image.

9. An electronic device, characterized in that, include: processor; Memory used to store computer programs or instructions; The processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing a computer program or instructions, characterized in that, When the computer program or instructions in the storage medium are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.