Image processing method, apparatus, device, medium, and program product

CN122120625APending Publication Date: 2026-05-29BEIJING XIAOMI MOBILE SOFTWARE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING XIAOMI MOBILE SOFTWARE CO LTD
Filing Date
2024-11-27
Publication Date
2026-05-29

Smart Images

  • Figure CN122120625A_ABST
    Figure CN122120625A_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image processing method, device, equipment, medium and program product. The image processing method comprises: in a shooting preview mode, in response to a preset correction condition being met, obtaining initial correction values of each preset region of a preview image; determining target correction values corresponding to the initial correction values based on the initial correction values; and performing lens shadow correction processing on the corresponding preset region based on the target correction values to obtain a corrected image for displaying a preview picture. The target correction values negatively correlated with the initial correction values are used as the basis for the lens shadow correction processing, which changes the relative size relationship of the correction intensities when the lens shadow correction processing is performed on each preset region, effectively suppresses the brightness improvement degree of the preset region located at the edge of the preview image, improves the purple edge problem of the preview picture while ensuring the overall brightness of the image, provides an accurate reference for the user to take a picture, and improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In recent years, with the rapid development of image processing technology and the continuous iteration of shooting equipment, shooting devices with rich shooting functions have been widely used in people's daily lives. By processing the light-sensitive images acquired by their image sensors, shooting devices can display preview images with good image quality to provide users with reference for taking photos.

[0003] However, when using related technologies for image processing, the preview images after processing in certain scenarios may have problems such as purple edges, making it difficult to provide accurate references for users to take photos and resulting in a poor user experience. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides an image processing method, apparatus, device, medium, and program product.

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

[0006] In shooting preview mode, in response to meeting the preset correction conditions, the initial correction values ​​of each preset area of ​​the preview image are obtained, and the initial correction values ​​are used for lens shadow correction processing;

[0007] Based on each of the initial correction values, a target correction value corresponding to each of the initial correction values ​​is determined, wherein the target correction value is negatively correlated with the corresponding initial correction value;

[0008] Based on the target correction values, lens shadow correction processing is performed on the corresponding preset areas to obtain a corrected image for displaying a preview screen.

[0009] In some embodiments of this disclosure, determining the target correction value corresponding to each of the initial correction values ​​based on each of the initial correction values ​​includes:

[0010] The following process is performed on each of the initial correction values:

[0011] Based on the reciprocal of the initial correction value and the preset correction value, the reciprocal correction value is determined;

[0012] The reciprocal correction value is used as the target correction value corresponding to the initial correction value, such that the target correction value is inversely proportional to the initial correction value; or,

[0013] Based on the reciprocal of the initial correction value and the preset correction value, the reciprocal correction value is determined;

[0014] Based on a preset scaling factor, the reciprocal correction value is scaled to obtain the target correction value corresponding to the initial correction value.

[0015] In some embodiments of this disclosure, the preset correction value is configured as follows:

[0016] The maximum value within the preset range of the initial correction value; or...

[0017] The product of each initial correction value and the reciprocal of each initial correction value is within the preset range of the initial correction value.

[0018] In some embodiments of this disclosure, the preset correction conditions include:

[0019] The current illuminance value is greater than or equal to the preset illuminance value and the current exposure time is less than the preset exposure time. The current illuminance value is negatively correlated with the amount of light entering the body.

[0020] In some embodiments of this disclosure, the image processing method further includes:

[0021] In response to the detection of a moving object, the motion capture function is activated to adjust the current exposure time to be less than the preset exposure time;

[0022] The preset correction conditions include: the current illuminance value is greater than or equal to the preset illuminance value and the motion capture function is enabled, and the current illuminance value is negatively correlated with the amount of light entering the camera.

[0023] In some embodiments of this disclosure, the image processing method further includes:

[0024] In response to enabling the motion capture function, a function activation prompt is displayed on the display interface to indicate that the motion capture function is enabled.

[0025] In some embodiments of this disclosure, the step of performing lens shadow correction processing on the corresponding preset area based on each of the target correction values ​​includes:

[0026] The following processing procedure is performed on each of the preset regions:

[0027] Based on the target correction value corresponding to the preset region and the initial pixel value of each pixel in the preset region, the target pixel value of each pixel is determined;

[0028] The initial pixel values ​​of each pixel within the preset area are converted into the corresponding target pixel values.

[0029] In some embodiments of this disclosure, each of the target correction values ​​is greater than or equal to 1.

[0030] In some embodiments of this disclosure, before performing the lens shading correction process, the image processing method further includes:

[0031] Acquire the initial photosensitive image;

[0032] The initial photosensitive image is subjected to black level correction processing to obtain the preview image.

[0033] In some embodiments of this disclosure, after obtaining the corrected image, the image processing method further includes:

[0034] The corrected image is subjected to tone mapping processing to obtain a tone-mapped image;

[0035] The tone-mapped image is subjected to white balance processing to obtain a white balance image;

[0036] The white balance image is displayed in the display interface.

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

[0038] The acquisition module is used to acquire the initial correction values ​​of each preset area of ​​the preview image in the shooting preview mode in response to the satisfaction of preset correction conditions. The initial correction values ​​are used for lens shadow correction processing.

[0039] The determining module is configured to determine a target correction value corresponding to each of the initial correction values ​​based on each of the initial correction values, wherein the target correction value is negatively correlated with the corresponding initial correction value;

[0040] The correction module is used to perform lens shadow correction processing on the corresponding preset area based on each of the target correction values ​​to obtain a corrected image for displaying a preview screen.

[0041] According to a third aspect of the present disclosure, an electronic device is provided, the electronic device comprising:

[0042] processor;

[0043] Memory used to store processor-executable instructions;

[0044] The processor is configured to perform the image processing method as described in the first aspect.

[0045] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image processing method as described in the first aspect.

[0046] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the image processing method as described in the first aspect.

[0047] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects: using the target correction value that is negatively correlated with the initial correction value as the basis for lens shadow correction processing, changing the relative magnitude relationship of correction intensity when lens shadow correction processing is performed between each preset area, effectively suppressing the brightness increase of the preset area located at the edge of the preview image, improving the problem of purple edges of the preview image while ensuring the overall brightness of the image, providing accurate reference for users to take pictures, and improving the user experience.

[0048] 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

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

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

[0051] Figure 2 This is a schematic diagram illustrating the initial correction value according to an exemplary embodiment.

[0052] Figure 3 This is a schematic diagram illustrating the target correction value according to an exemplary embodiment.

[0053] Figure 4 This is a flowchart illustrating the process of processing each initial correction value when determining the target correction value corresponding to each initial correction value based on each initial correction value, according to an exemplary embodiment.

[0054] Figure 5 This is a flowchart illustrating the process of processing each initial correction value when determining the target correction value corresponding to each initial correction value based on each initial correction value, according to another exemplary embodiment.

[0055] Figure 6 This is a flowchart illustrating the processing of each preset region when performing lens shadow correction processing on corresponding preset regions based on each target correction value, according to an exemplary embodiment.

[0056] Figure 7 This is a flowchart illustrating an image processing method according to another exemplary embodiment.

[0057] Figure 8 This is a flowchart illustrating an image processing method according to another exemplary embodiment.

[0058] Figure 9 This is a flowchart illustrating an image processing method according to another exemplary embodiment.

[0059] Figure 10 This is a block diagram of an image processing apparatus according to an exemplary embodiment.

[0060] Figure 11 This is a block diagram of an electronic device according to an exemplary embodiment.

[0061] In the picture:

[0062] 10-Acquisition module; 20-Determination module; 30-Correction module; 101-Processing component; 102-Memory; 103-Power component; 104-Multimedia component; 105-Audio component; 106-Input / output interface; 107-Sensor component; 108-Communication component; 109-Processor. Detailed Implementation

[0063] 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 the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0064] In recent years, with the rapid development of image processing technology and the continuous iteration of shooting equipment, shooting devices with multiple shooting functions, such as mobile phones and cameras, have gradually become an indispensable part of people's daily lives. Shooting devices acquire light-sensitive images through image sensors and display the processed preview on their display interface, thus providing users with references for the time, target, or angle when taking pictures.

[0065] In related technologies, the shooting device performs a series of processing steps on the photosensitive image, including Optical BlackCorrect (OBC), Lens Shading Correction (LSC), Tone Mapping, and White Balance, to ensure the image quality of the preview image.

[0066] However, in specific scenarios such as capturing moving targets in dark environments, in order to improve the frame rate and avoid motion blur, the shooting device has a shorter exposure time and a higher ISO sensitivity. In this case, the image processing methods using related technologies will result in more noise residue after black level correction. After conventional lens shadow correction, tone mapping, and white balance processing, this will lead to problems such as purple edges and overall darkness in the preview image, making it difficult to provide users with accurate references and resulting in a poor user experience.

[0067] Based on this, an exemplary embodiment of this disclosure provides an image processing method. When preset correction conditions are met, by obtaining initial correction values ​​for each preset region of the preview image and determining corresponding target correction values ​​based on each initial correction value, lens shadow correction processing can be performed on the corresponding preset regions according to each target correction value to obtain a corrected image, thereby adjusting the visual effect of the preview image. By using the target correction values, which are negatively correlated with the initial correction values, as the basis for lens shadow correction processing, the relative magnitude of the correction intensity during lens shadow correction processing among the preset regions is changed. This effectively suppresses the brightness increase of preset regions located at the edges of the preview image, improving the problem of purple edges in the preview image while ensuring the overall brightness of the image. This provides users with accurate references for taking photos and enhances the user experience.

[0068] In one exemplary embodiment, an image processing method is provided, applied to a shooting device, which may include, for example, a mobile phone, camera, tablet computer, or other device with a camera function. (Reference) Figure 1 As shown, the image processing methods include:

[0069] S100 In shooting preview mode, in response to meeting the preset correction conditions, the initial correction values ​​of each preset area of ​​the preview image are obtained. The initial correction values ​​are used for lens shadow correction processing.

[0070] In step S100, the shooting device has a shooting preview mode. In shooting preview mode, the shooting device can acquire light-sensitive images in real time and display the preview image on its display interface to provide a reference for the user's photography. Preset correction conditions are used to determine whether the current scene will cause a risk of purple edges (i.e., purplish discoloration) in the preview image. When the preset correction conditions are met, it means that the preview image may have a purple edge problem. At this time, the initial correction values ​​for each preset area of ​​the preview image are obtained. For example, the preset correction conditions may include the shooting device being in a dark shooting environment with a short exposure time. It should be noted that the exposure time and ISO sensitivity of the shooting device are mutually restrictive; a shorter exposure time usually corresponds to a higher ISO sensitivity.

[0071] The preview image can be, for example, an image obtained after certain preprocessing of the initial photosensitive image. The preview image can be divided into multiple preset areas, and each preset area can have the same shape and size. For example, the preset image is divided into 221 preset areas of the same size and in the shape of rectangles, each measuring 13×17.

[0072] Each preset area can obtain a corresponding initial correction value. The initial correction value for each preset area can be obtained through algorithm calibration on the shooting device's own platform or system, or it can be determined based on the location of the preset area, current shooting parameters, and preset configuration information. The preset configuration information characterizes the correspondence between the location of the preset area, current shooting parameters, and the initial correction value. The initial correction value is used for conventional lens shading correction processing, i.e., LCS processing. The initial correction value represents the correction intensity of the lens shading correction processing and can characterize the degree of brightness improvement after lens shading correction processing. Conventional lens shading correction processing is used to improve the problem of more light entering the image sensor from the lens in the center and less at the edges, reducing the brightness difference between the center and edges of the image. Therefore, as... Figure 2 As shown, the initial correction value is configured such that the initial correction value of the preset region near the geometric center of the preview image is less than or equal to the initial correction value of the preset region far from the geometric center of the preview image, so as to ensure that the correction intensity, i.e. the brightness enhancement, at the edge position of the preview image is greater than the brightness enhancement at the center position.

[0073] S200. Based on each initial correction value, determine the target correction value corresponding to each initial correction value. The target correction value is negatively correlated with the corresponding initial correction value.

[0074] In step S200, for each preset region, a target correction value is determined based on the acquired initial correction value. The target correction value and the initial correction value have a negative correlation; that is, the larger the initial correction value, the smaller the corresponding target correction value, and vice versa. For any two preset regions, the preset region with the larger initial correction value has a smaller target correction value, thus altering the relative magnitude of the correction values, i.e., the correction intensity, between the preset regions.

[0075] like Figure 3 As shown, the target correction value determined based on the initial correction value is negatively correlated with the initial correction value, so that the target correction value of the preset area close to the geometric center of the preview image is greater than or equal to the initial correction value of the preset area far from the geometric center of the preview image. This ensures that the brightness increase at the edge of the preview image is less than the brightness increase at the center, thereby ensuring that the center of the preview image has a high brightness effect while avoiding the purple color problem caused by excessive brightness increase at the edge.

[0076] S300: Based on each target correction value, lens shadow correction processing is performed on the corresponding preset area to obtain a corrected image for displaying a preview screen.

[0077] In step S300, for each preset area, lens shadow correction processing is performed according to the determined target correction value to achieve lens shadow correction for each preset area and obtain a corrected image, so as to display the subsequent preview screen based on the corrected image.

[0078] Understandably, the target correction value is negatively correlated with the initial correction value, altering the relative magnitude of the correction values ​​(i.e., correction intensities) among the presets, thus changing the relative magnitude of the brightness improvement after lens shading correction. Since the initial correction values ​​for each preset area are designed to improve the issue of more light entering the image sensor from the lens in the center and less at the edges—meaning the brightness improvement in the preset area at the center is less than that at the edges under the initial correction value—then under the target correction value, the brightness improvement in the preset area at the edges is less than that in the preset area at the center. This effectively suppresses the brightness improvement in the preset areas located at the edges of the preview image, preventing the corrected image from exhibiting a purple tinge at the edges.

[0079] In this embodiment, when preset correction conditions are met, initial correction values ​​for each preset region of the preview image are obtained, and corresponding target correction values ​​are determined based on these initial correction values. Lens shadow correction processing is then performed on the corresponding preset regions according to these target correction values ​​to obtain a corrected image, thus adjusting the visual effect of the preview image. Using the target correction values, which are negatively correlated with the initial correction values, as the basis for lens shadow correction processing changes the relative magnitude of the correction intensity among the preset regions. This effectively suppresses the brightness increase in preset regions located at the edges of the preview image, improving the purple tinge at the edges of the preview image while maintaining overall image brightness. This provides users with accurate references for taking photos and enhances the user experience.

[0080] In some embodiments, determining a target correction value corresponding to each initial correction value based on each initial correction value includes: performing the following operations on each initial correction value: Figure 4 The processing procedure shown is as follows:

[0081] S210. Determine the reciprocal correction value based on the reciprocal of the initial correction value and the preset correction value.

[0082] In step S210, for each preset region's initial correction value, a reciprocal correction value is determined based on the initial correction value and the preset correction value. The preset correction value can be, for example, the maximum value within the preset range of the initial correction value for the corresponding platform or system. The reciprocal correction value can be calculated based on the reciprocal of the initial correction value and the preset correction value. For example, the preset range of the initial correction value can be [1, 16], and the preset correction value can be, for example, 16. The reciprocal correction value LCS3 can be determined based on the initial correction value LCS1 and the preset correction value LCS2 using the formula (1) shown below:

[0083] LCS3=(1 / LCS1)* LCS2 (1)

[0084] S220. Use the reciprocal correction value as the target correction value corresponding to the initial correction value, so that the target correction value is inversely proportional to the initial correction value.

[0085] In step S220, the reciprocal correction value calculated in the above manner is inversely proportional to the initial correction value, and the range of the calculated reciprocal correction value is the same as the preset range of the initial correction value. The determined reciprocal correction value is directly used as the target correction value corresponding to the initial correction value, so that the target correction value is inversely proportional to the initial correction value, thereby making the target correction value and the initial correction value have a negative correlation.

[0086] In this embodiment, for each preset area, an initial correction value is determined based on the reciprocal of the initial correction value and the preset correction value. The reciprocal correction value is then used as the target correction value corresponding to the initial correction value. This ensures that the target correction value is inversely proportional to the initial correction value, achieving a negative correlation between the target correction value and the initial correction value. This improves the problem of purple edges on the preview screen while maintaining the overall brightness of the image, providing users with an accurate reference for taking photos and enhancing the user experience.

[0087] In other embodiments, determining a target correction value corresponding to each initial correction value based on each initial correction value includes: performing the following operations on each initial correction value: Figure 5 The processing procedure shown is as follows:

[0088] S230. Determine the reciprocal correction value based on the reciprocal of the initial correction value and the preset correction value.

[0089] In step S230, for the initial correction value of each preset region, a reciprocal correction value is determined based on the initial correction value and the preset correction value. The process of determining the reciprocal correction value is the same as in step S210, and will not be repeated here.

[0090] S240. Based on a preset scaling factor, scale the reciprocal correction value to obtain the target correction value corresponding to the initial correction value.

[0091] In step S240, the reciprocal correction value calculated in the above manner is inversely proportional to the initial correction value, and the range of the calculated reciprocal correction value is the same as the preset range of the initial correction value. A uniform preset scaling factor can be set for each reciprocal correction value, and the determined reciprocal correction value is scaled according to the preset scaling factor, and the scaled reciprocal correction value is used as the target correction value corresponding to the initial correction value.

[0092] For example, after determining the reciprocal correction value LCS3 using formula (1), the reciprocal correction value LCS3 can be scaled according to a preset scaling factor α using formula (2) as shown below to obtain the corresponding target correction value LCS4:

[0093] LCS4=(LCS3-1)*α+1 (2)

[0094] The target correction value calculated using the above method is negatively correlated with the initial correction value, and the range of the target correction value is smaller than the preset range of the initial correction value.

[0095] In this embodiment, for each preset region's initial correction value, a reciprocal correction value is determined based on the reciprocal of the initial correction value and the preset correction value. Then, the reciprocal correction value is scaled according to a preset scaling factor to obtain the target correction value corresponding to the initial correction value. This achieves a negative correlation between the target correction value and the initial correction value and reduces the range of the target correction value. On the one hand, it improves the problem of purple edges on the preview screen while ensuring the overall brightness of the image. On the other hand, it can reduce the brightness difference between different preset regions and further improve the overall visual effect of the preview screen.

[0096] In some embodiments, the preset correction value is configured as: the maximum value in the preset range of the initial correction value, or the product of the initial correction value and the reciprocal of each initial correction value is within the preset range of the initial correction value.

[0097] The maximum value in the preset range of the initial correction value can be used as the preset correction value for determining the reciprocal correction value, so that the range of the determined reciprocal correction value is the same as the preset range of the initial correction value, thereby ensuring that the target correction value of each preset region is within the preset range of the initial correction value. For example, the preset range of the initial correction value can be [1, 16], the preset correction value is 16, and the range of the target correction value determined according to formula (1) is also [1, 16].

[0098] Alternatively, a suitable constant can be set as a preset correction value for determining the reciprocal correction value, ensuring that the product of this preset correction value and the reciprocal of each initial correction value is within the preset range of the initial correction value. Both of these preset correction value configuration methods ensure that the target correction value for each preset region is within the preset range of the initial correction value, thereby preventing the target correction value from exceeding the preset range of the initial correction value—that is, the range supported by the platform or system for lens shading correction processing—and guaranteeing the normal implementation of lens shading correction processing.

[0099] In this embodiment, the preset correction value is configured as the maximum value in the preset range of the initial correction value, or the product of the preset correction value and the reciprocal of each initial correction value is within the preset range of the initial correction value. This ensures that the target correction value of each preset area is within the preset range of the initial correction value, thereby preventing the target correction value from exceeding the preset range of the initial correction value, i.e., the range of values ​​supported by the platform or system for lens shadow correction processing. This ensures the normal implementation of lens shadow correction processing and provides a basis for effectively suppressing the brightness increase of the preset area located at the edge of the preview image.

[0100] In some embodiments, the preset correction conditions include: the current illuminance value is greater than or equal to the preset illuminance value and the current exposure time is less than the preset exposure time, and the current illuminance value is negatively correlated with the amount of light received.

[0101] The current illuminance value is negatively correlated with the amount of light entering the camera. If the current illuminance value is greater than the preset illuminance value, it means that the amount of light entering the camera in the current scene is relatively low, and the shooting device is in a dark shooting environment. If the current illuminance value is greater than or equal to the preset illuminance value and the current exposure time is less than the preset exposure time, it means that the shooting device is in a dark environment with a short exposure time. In this scenario, noise residue will increase, and the preview image is prone to purple edges.

[0102] As mentioned earlier, the preset correction condition is used to determine whether the current scene will cause the preview image to have a risk of purple edges. Since the preview image is prone to purple edges when the current illuminance value is greater than or equal to the preset illuminance value and the current exposure time is less than the preset exposure time, the current illuminance value being greater than or equal to the preset illuminance value and the current exposure time being less than the preset exposure time can be used as the preset correction condition. When the preset condition is met, the subsequent target correction value is determined and lens shadow correction processing is performed based on the target correction value, so as to improve the problem in the scenario where the preview image has a purple edge problem.

[0103] In this embodiment, the current illuminance value being greater than or equal to the preset illuminance value and the current exposure time being less than the preset exposure time are used as preset correction conditions. This provides a basis for determining whether to perform subsequent processing, and can accurately identify scenarios where there is a risk of purple edges in the preview image. Thus, when the preset correction conditions are met, the relative magnitude of the correction intensity during lens shadow correction processing between each preset area can be changed to improve the problem of purple edges in the preview image, thereby improving the accuracy and pertinence of lens shadow correction processing and realizing adaptive adjustment of the preview image.

[0104] In some embodiments, the image processing method further includes: in response to detecting a moving object, activating a motion capture function to adjust the current exposure duration to be less than a preset exposure duration.

[0105] Shooting devices can detect whether the target is a moving object by means of inter-frame difference. When the shooting device detects that the target is a moving object, it will activate the motion capture function to adjust the current exposure time to be less than the preset exposure time, thereby avoiding motion blur by using a shorter exposure time.

[0106] The preset correction conditions include: the current illuminance value is greater than or equal to the preset illuminance value and the motion capture function is enabled; the current illuminance value is negatively correlated with the amount of light entering the camera.

[0107] As mentioned earlier, when the shooting device activates the motion capture function, it automatically adjusts the current exposure time to be shorter than the preset exposure time. Therefore, if the current illuminance value is greater than or equal to the preset illuminance value and the motion capture function is enabled, it means that the shooting device is in a dark environment with a short exposure time. The preview image is prone to purple edges. The current illuminance value being greater than or equal to the preset illuminance value and the motion capture function being enabled can be used as the preset correction condition. When the preset condition is met, the subsequent target correction value is determined and lens shadow correction processing is performed based on the target correction value to improve the problem in scenarios where the preview image has purple edges.

[0108] In this embodiment, when a moving object is detected, the motion capture function is activated to adjust the current exposure time to be shorter than the preset exposure time. This shorter exposure time avoids motion blur and ensures the imaging effect of the actual captured image. Using a current illuminance value greater than or equal to a preset illuminance value and the activation of the motion capture function as a preset correction condition accurately identifies scenes where there is a risk of purple edges in the preview image. Therefore, when the preset correction condition is met, the relative magnitude of the correction intensity during lens shadow correction processing in each preset area is changed to improve the purple edge problem in the preview image, enhancing the accuracy and specificity of lens shadow correction processing and achieving adaptive adjustment of the preview image.

[0109] It is understandable that the motion capture function can also be activated when the user's function activation operation is detected, so as to enable the user to have autonomous control over the motion capture function. For example, the function activation operation may include the user's click operation on the function activation control in the display interface.

[0110] In some embodiments, the image processing method further includes: in response to enabling the motion capture function, displaying a function enable prompt in the display interface, the function enable prompt indicating that the motion capture function is enabled.

[0111] When the motion capture function is detected as being enabled, the shooting device displays a function activation prompt on its display interface to inform the user that the motion capture function is now active. For example, the function activation prompt may be a special icon on the display interface, displayed through flashing, color changing, or other means.

[0112] In this embodiment, when the motion capture function is enabled, a prompt indicating that the function is enabled is displayed on the screen. This allows the user to intuitively observe the on / off status of the motion capture function through the prompt. If the user determines that the motion capture function is enabled and the shooting device has a short exposure time, the user can confirm that the shooting device has performed lens shadow correction processing based on the target correction value. The colors in the preview image are relatively accurate, and the preview image can be used as a reference and basis for taking pictures, thus improving the user experience.

[0113] In some embodiments, lens shading correction processing is performed on corresponding preset areas based on each target correction value, including: performing the following on each preset area as follows: Figure 6 The processing procedure shown is as follows:

[0114] S310. Based on the target correction value corresponding to the preset area and the initial pixel value of each pixel in the preset area, determine the target pixel value of each pixel.

[0115] In step S310, for each preset region, the target pixel value of each pixel is determined based on the target correction value corresponding to the preset region and the initial pixel value of each pixel within the preset region. For example, the initial pixel value of each pixel can be multiplied by the target correction value, and the resulting product can be used as the target pixel value of each pixel.

[0116] S320: Convert the initial pixel values ​​of each pixel in the preset area into the corresponding target pixel values.

[0117] In step S320, the initial pixel values ​​of each pixel within the preset area are converted into corresponding target pixel values ​​to adjust the pixel values ​​of each pixel within the preset area, thus completing the lens shadow correction process for the preset area. It can be understood that because the target pixel value at the center of the preview image is greater than the target pixel value at the edge, the adjustment degree of pixel values ​​at the center of the preview image is greater than that at the edge, thereby effectively suppressing the brightness increase of the preset area located at the edge of the preview image.

[0118] In this embodiment, for each preset area, the target pixel value of each pixel is determined based on the target correction value corresponding to the preset area and the initial pixel value of each pixel within the preset area. The initial pixel values ​​of each pixel within the preset area are then converted into corresponding target pixel values. Lens shadow correction processing for the preset area is achieved by adjusting the pixel values ​​of each pixel within the preset area. Furthermore, the pixel value adjustment degree of each pixel located at the center of the preview image is greater than that at the edges, thereby effectively suppressing the brightness increase of the preset area located at the edges of the preview image. This improves the problem of purple edges in the preview image while maintaining the overall brightness of the image.

[0119] In some embodiments, each target correction value is greater than or equal to 1.

[0120] For example, by limiting the preset correction value and preset scaling factor, it can be ensured that the target correction value determined based on the initial correction value is greater than or equal to 1. When the target correction value is greater than 1, the target pixel value determined based on the target correction value and the initial pixel value is greater than the corresponding initial pixel value. After lens shadow correction processing is performed on each preset area, the pixel value of each pixel is improved.

[0121] In this embodiment, each target correction value is greater than or equal to 1, which ensures that the target pixel value determined based on the target correction value and the initial pixel value is greater than or equal to the corresponding initial pixel value. This guarantees that after lens shadow correction processing is performed on each preset area, the brightness of each preset area can be maintained or improved, thereby ensuring the overall brightness effect of the preview image.

[0122] In some embodiments, reference Figure 7 As shown, before performing lens shading correction, the image processing method also includes:

[0123] S410, Acquire the initial photosensitive image.

[0124] In step S410, the imaging device acquires an initial photosensitive image corresponding to the current moment through the image sensor. The initial photosensitive image is the unprocessed raw image output by the image sensor.

[0125] S420: Perform black level correction on the initial photosensitive image to obtain a preview image.

[0126] In step S420, because the initial photosensitive image is limited by the accuracy of the converter during the conversion from light signal to digital signal, it cannot convert a portion of the signal with extremely small voltage values, resulting in loss of dark details in the initial photosensitive image. Therefore, a fixed offset needs to be set for the output signal. In addition, the image sensor will have dark current during operation, causing the pixels to generate output voltage even in the absence of any light. To ensure the accuracy of the image data, the signal level value corresponding to the dark current needs to be subtracted from the original data. This fixed offset and level value are the black level.

[0127] Black level correction (OBC) adjusts the lowest level value of completely black data (i.e., the black level) to obtain a realistic image and improve overall image quality. For example, it can be achieved by acquiring the level value of the completely opaque (optically black) portion of the image sensor and subtracting the OB level value from the raw data. Therefore, to ensure the accuracy of subsequent processing, the imaging device performs OBC on the initial photosensitive image before lens shading correction to obtain an accurate and realistic preview image.

[0128] In this embodiment, before performing lens shadow correction processing, an initial photosensitive image is acquired and black level correction processing is performed on the initial photosensitive image to obtain a preview image, providing a basis for subsequent processing. Black level correction processing can eliminate dark current noise and color deviation caused by image sensor non-uniformity in the initial photosensitive image, thereby restoring the true image data, improving the overall quality of the preview image, and ensuring the accuracy of subsequent processing.

[0129] In some embodiments, the corrected image after lens shading correction can be directly displayed on the display interface, so that the corrected image is displayed as the image corresponding to the preview screen, realizing real-time display of the preview screen of the shooting device. In other embodiments, refer to Figure 8 As shown, after obtaining the corrected image, the image processing method further includes:

[0130] S510. Perform tone mapping processing on the corrected image to obtain a tone-mapped image.

[0131] In step S510, after completing the lens shading correction process and obtaining the corrected image, tone mapping processing is performed on the corrected image. Tone mapping adjusts the image's color and brightness to enable the high dynamic range image, which was originally beyond the device's display capabilities, to be displayed on the device, ensuring that the image's color and brightness adapt to human visual perception. For example, when performing tone mapping on the corrected image, the average brightness of the current scene can be calculated, and a suitable brightness range can be selected based on the average. The entire corrected image is then mapped to this brightness range to achieve tone mapping processing and obtain a tone-mapped image.

[0132] S520. Perform white balance processing on the tone mapping image to obtain a white balance image.

[0133] In step S520, after obtaining the tone-mapped image through tone mapping processing, white balance processing is performed on the tone-mapped image. White balance processing adjusts the colors in the image to correspond to the colors of the white light source, making the colors of the image more balanced and consistent, and ensuring that the visual effect of the image is more realistic and natural. For example, when performing white balance processing on the tone-mapped image, the brightness and contrast of different color channels can be adjusted according to the current ambient light conditions to achieve white balance processing and obtain a white-balanced image.

[0134] S530: Displays the white balance image in the display interface.

[0135] In step S530, a white balance image is displayed on the display interface to serve as the image corresponding to the preview screen, thus enabling real-time display of the preview screen from the shooting device. Since the preview image undergoes lens shading correction processing based on the target correction value, tone mapping processing, and white balance processing in sequence, the problem of purple edges in the preview screen can be improved, and the color, brightness, and contrast of the preview screen are ensured to be more balanced, thereby guaranteeing the overall visual effect of the preview screen.

[0136] In this embodiment, a tone-mapped image is obtained by performing tone mapping processing on the corrected image, and a white balance image is obtained by performing white balance processing on the tone-mapped image. The white balance image is then displayed on the display interface, realizing the real-time display of the preview screen of the shooting device. By performing post-processing such as tone mapping and white balance processing, the problem of purple edges in the preview screen is improved, and the color, brightness, and contrast of the preview screen are made more balanced, further enhancing the overall visual effect of the preview screen.

[0137] In one exemplary embodiment, an image processing method is provided, applied to a shooting device, with reference to... Figure 9 As shown, the image processing methods include:

[0138] S1. Acquire the initial photosensitive image;

[0139] S2. Perform black level correction on the initial photosensitive image to obtain a preview image;

[0140] S3. In response to the detection of a moving object, activate the motion capture function to adjust the current exposure time to be less than the preset exposure time;

[0141] S4. In response to enabling the motion capture function, a prompt indicating that the function is enabled is displayed on the screen.

[0142] S5. In shooting preview mode, in response to the current illuminance value being greater than or equal to the preset illuminance value and the motion capture function being enabled, the initial correction values ​​of each preset area of ​​the preview image are obtained.

[0143] S6. Determine the reciprocal correction value based on the reciprocal of each initial correction value and the preset correction value;

[0144] S7. Use the reciprocal correction value as the target correction value corresponding to the initial correction value, so that the target correction value is inversely proportional to the initial correction value;

[0145] S8. Based on the target correction value corresponding to each preset area and the initial pixel value of each pixel in each preset area, determine the target pixel value of each pixel;

[0146] S9. Convert the initial pixel value of each pixel in each preset area into the corresponding target pixel value to obtain the corrected image;

[0147] S10. Perform tone mapping processing on the corrected image to obtain a tone-mapped image;

[0148] S11. Perform white balance processing on the tone mapping image to obtain a white balance image;

[0149] S12. Display the white balance image in the display interface.

[0150] In this embodiment, when preset correction conditions are met, initial correction values ​​for each preset region of the preview image are obtained, and corresponding target correction values ​​are determined based on these initial correction values. Lens shadow correction processing is then performed on the corresponding preset regions according to these target correction values ​​to obtain a corrected image, thus adjusting the visual effect of the preview image. Using the target correction values, which are negatively correlated with the initial correction values, as the basis for lens shadow correction processing changes the relative magnitude of the correction intensity among the preset regions. This effectively suppresses the brightness increase in preset regions located at the edges of the preview image, improving the purple tinge at the edges of the preview image while maintaining overall image brightness. This provides users with accurate references for taking photos and enhances the user experience.

[0151] In one exemplary embodiment, an image processing apparatus is provided, applied to a shooting device, with reference to... Figure 10 As shown, the image processing device includes an acquisition module 10, a determination module 20, and a correction module 30. The acquisition module 10, in shooting preview mode, acquires initial correction values ​​for each preset region of the preview image in response to meeting preset correction conditions. These initial correction values ​​are used for lens shading correction processing. The determination module 20 determines a target correction value corresponding to each initial correction value, where the target correction value is negatively correlated with the corresponding initial correction value. The correction module 30 performs lens shading correction processing on the corresponding preset regions based on each target correction value to obtain a corrected image for displaying the preview screen.

[0152] In this embodiment, when the preset correction conditions are met, the initial correction values ​​of each preset area of ​​the preview image are obtained by the acquisition module 10, and the corresponding target correction values ​​are determined by the determination module 20 based on each initial correction value. The correction module 30 then performs lens shadow correction processing on the corresponding preset areas based on each target correction value to obtain a corrected image, thus adjusting the visual effect of the preview image. Using the target correction values, which are negatively correlated with the initial correction values, as the basis for lens shadow correction processing changes the relative magnitude of the correction intensity among the preset areas. This effectively suppresses the brightness increase of preset areas located at the edges of the preview image, improving the purple tinge at the edges of the preview image while maintaining overall image brightness. This provides users with accurate references for taking photos and enhances the user experience.

[0153] In one embodiment, the determining module 20 is further configured to: perform the following processing steps on each initial correction value: determine a reciprocal correction value based on the reciprocal of the initial correction value and a preset correction value; use the reciprocal correction value as the target correction value corresponding to the initial correction value, so that the target correction value is inversely proportional to the initial correction value; or, determine a reciprocal correction value based on the reciprocal of the initial correction value and a preset correction value; scale the reciprocal correction value based on a preset scaling factor to obtain the target correction value corresponding to the initial correction value.

[0154] In one embodiment, the preset correction value is configured as: the maximum value in the preset range of the initial correction value; or, the product of the initial correction value and the reciprocal of each initial correction value is within the preset range of the initial correction value.

[0155] In one embodiment, the preset correction conditions include: the current illuminance value is greater than or equal to the preset illuminance value and the current exposure time is less than the preset exposure time, and the current illuminance value is negatively correlated with the amount of light received.

[0156] In one embodiment, the image processing device further includes an activation module, which is used to activate the motion capture function in response to the detection of a moving object, so as to adjust the current exposure time to be less than a preset exposure time; the preset correction conditions include: the current illuminance value is greater than or equal to the preset illuminance value and the motion capture function is activated, and the current illuminance value is negatively correlated with the amount of light received.

[0157] In one embodiment, the activation module is further configured to: in response to activating the motion capture function, display a function activation prompt on the display interface, the function activation prompt indicating that the motion capture function is in the activated state.

[0158] In one embodiment, the correction module 30 is further configured to: perform the following processing procedure on each preset region: determine the target pixel value of each pixel based on the target correction value corresponding to the preset region and the initial pixel value of each pixel in the preset region; and convert the initial pixel value of each pixel in the preset region into the corresponding target pixel value.

[0159] In one embodiment, each target correction value is greater than or equal to 1.

[0160] In one embodiment, the correction module 30 is further configured to: acquire an initial photosensitive image; perform black level correction processing on the initial photosensitive image to obtain a preview image.

[0161] In one embodiment, the image processing apparatus further includes a display module, which is used to: perform tone mapping processing on the corrected image to obtain a tone-mapped image; perform white balance processing on the tone-mapped image to obtain a white balance image; and display the white balance image on a display interface.

[0162] In one exemplary embodiment, an electronic device is provided, which may include, for example, a mobile phone, a camera, a tablet computer, or other shooting devices with photographic capabilities.

[0163] refer to Figure 11 As shown, the electronic device may include one or more of the following components: processing component 101, memory 102, power component 103, multimedia component 104, audio component 105, input / output (I / O) interface 106, sensor component 107, and communication component 108.

[0164] Processing component 101 typically controls the overall operation of an electronic device, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 101 may include one or more processors 109 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 101 may include one or more modules to facilitate interaction between processing component 101 and other components. For example, processing component 101 may include a multimedia module to facilitate interaction between multimedia component 104 and processing component 101.

[0165] Memory 102 is configured to store various types of data to support the operation of the electronic device. Examples of such data include instructions for any application or method used to operate on the electronic device, contact data, phonebook data, messages, pictures, videos, etc. Memory 102 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.

[0166] Power component 103 provides power to various components of the electronic device. Power component 103 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device.

[0167] Multimedia component 104 includes a screen that provides an output interface between the electronic device and the 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 may 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 may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 104 includes a front-facing camera and / or a rear-facing camera. When the electronic device 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.

[0168] Audio component 105 is configured to output and / or input audio signals. For example, audio component 105 includes a microphone (MIC) configured to receive external audio signals when the electronic device 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 102 or transmitted via communication component 108. In some embodiments, audio component 105 also includes a speaker for outputting audio signals.

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

[0170] Sensor assembly 107 includes one or more sensors for providing state assessments of various aspects of the electronic device. For example, sensor assembly 107 can detect the on / off state of the electronic device, the relative positioning of components such as the display and keypad of the electronic device, changes in the position of the electronic device or a component of the electronic device, the presence or absence of user contact with the electronic device, the orientation or acceleration / deceleration of the electronic device, and temperature changes of the electronic device. Sensor assembly 107 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 107 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 107 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0171] Communication component 108 is configured to facilitate wired or wireless communication between electronic devices and other devices. Devices can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 108 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 108 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) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0172] In an exemplary embodiment, the electronic device 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 to perform the image processing method described above applied to the electronic device.

[0173] In one exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 102 including instructions, which can be executed by a processor 109 of an electronic device to perform the image processing method applied to the electronic device described above. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc. When the instructions in the storage medium are executed by the processor 109 of the electronic device, the electronic device is able to perform the image processing method shown in the above embodiments.

[0174] In one exemplary embodiment, a computer program product is also provided, including a computer program that, when executed by processor 109, implements the image processing method shown in the above embodiments.

[0175] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention 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 the invention are indicated by the following claims.

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

Claims

1. An image processing method, characterized in that, The image processing method includes: In shooting preview mode, in response to meeting the preset correction conditions, the initial correction values ​​of each preset area of ​​the preview image are obtained, and the initial correction values ​​are used for lens shadow correction processing; Based on each of the initial correction values, a target correction value corresponding to each of the initial correction values ​​is determined, wherein the target correction value is negatively correlated with the corresponding initial correction value; Based on the target correction values, lens shadow correction processing is performed on the corresponding preset areas to obtain a corrected image for displaying a preview screen.

2. The image processing method according to claim 1, characterized in that, The step of determining the target correction value corresponding to each of the initial correction values ​​includes: The following process is performed on each of the initial correction values: Based on the reciprocal of the initial correction value and the preset correction value, the reciprocal correction value is determined; Use the reciprocal correction value as the target correction value corresponding to the initial correction value, so that the target correction value is inversely proportional to the initial correction value; or, Based on the reciprocal of the initial correction value and the preset correction value, the reciprocal correction value is determined; Based on a preset scaling factor, the reciprocal correction value is scaled to obtain the target correction value corresponding to the initial correction value.

3. The image processing method according to claim 2, characterized in that, The preset correction value is configured as follows: The maximum value within the preset range of the initial correction value; or... The product of each initial correction value and the reciprocal of each initial correction value is within the preset range of the initial correction value.

4. The image processing method according to claim 1, characterized in that, The preset correction conditions include: The current illuminance value is greater than or equal to the preset illuminance value and the current exposure time is less than the preset exposure time. The current illuminance value is negatively correlated with the amount of light entering the body.

5. The image processing method according to claim 1, characterized in that, The image processing method further includes: In response to the detection of a moving object, the motion capture function is activated to adjust the current exposure time to be less than the preset exposure time; The preset correction conditions include: the current illuminance value is greater than or equal to the preset illuminance value and the motion capture function is enabled, and the current illuminance value is negatively correlated with the amount of light entering the camera.

6. The image processing method according to claim 5, characterized in that, The image processing method further includes: In response to enabling the motion capture function, a function activation prompt is displayed on the display interface to indicate that the motion capture function is enabled.

7. The image processing method according to any one of claims 1 to 6, characterized in that, The step of performing lens shadow correction processing on the corresponding preset area based on each of the target correction values ​​includes: The following processing procedure is performed on each of the preset regions: Based on the target correction value corresponding to the preset region and the initial pixel value of each pixel in the preset region, the target pixel value of each pixel is determined; The initial pixel values ​​of each pixel within the preset area are converted into the corresponding target pixel values.

8. The image processing method according to claim 7, characterized in that, All of the target correction values ​​are greater than or equal to 1.

9. The image processing method according to any one of claims 1 to 6, characterized in that, Before performing the lens shading correction process, the image processing method further includes: Acquire the initial photosensitive image; The initial photosensitive image is subjected to black level correction processing to obtain the preview image.

10. The image processing method according to any one of claims 1 to 6, characterized in that, After obtaining the corrected image, the image processing method further includes: The corrected image is subjected to tone mapping processing to obtain a tone-mapped image; The tone-mapped image is subjected to white balance processing to obtain a white balance image; The white balance image is displayed in the display interface.

11. An image processing apparatus, characterized in that, The image processing device includes: The acquisition module is used to acquire the initial correction values ​​of each preset area of ​​the preview image in the shooting preview mode in response to the satisfaction of preset correction conditions. The initial correction values ​​are used for lens shadow correction processing. The determining module is configured to determine a target correction value corresponding to each of the initial correction values ​​based on each of the initial correction values, wherein the target correction value is negatively correlated with the corresponding initial correction value; The correction module is used to perform lens shadow correction processing on the corresponding preset area based on each of the target correction values ​​to obtain a corrected image for displaying a preview screen.

12. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store processor-executable instructions; The processor is configured to perform the image processing method as described in any one of claims 1 to 10.

13. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the image processing method as described in any one of claims 1 to 10.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the image processing method as described in any one of claims 1 to 10.