Image processing method and electronic device

CN117750220BActive Publication Date: 2026-09-22LENOVO (BEIJING) LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311865023.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2026-09-22
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

[0008]但是拍摄使用face awb会出现色彩跳变问题,因为不同大小的人脸会设置不一样的权重,大脸和小脸由于具有不同权重,故会出现颜色差异

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117750220B_ABST
    Figure CN117750220B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an image processing method and an electronic device. The image processing method comprises: obtaining sensing data used for constituting an Nth acquisition image; processing the sensing data; if a processing result indicates that a shooting environment of the Nth acquisition image belongs to a single color environment, obtaining color compensation data corresponding to a white balance parameter used for constituting an N-1th acquisition image; and adjusting sensing data used for constituting an N+1th acquisition image based on the color compensation data, wherein N is an integer greater than or equal to 1.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image processing method and electronic device. Background Technology

[0002] When a camera takes a picture, it collects the R, G, and B information of each pixel and then uses the platform's algorithm to automatically calibrate the white balance. Currently, the most basic algorithm used across different platforms is based on the assumption that in an image with a large number of color variations, the average of the RGB components of all pixels tends to the same grayscale value. However, this assumption does not work with solid color backgrounds. That is, when all or most of the image is a single, non-neutral color, such as all blue or a large area of ​​blue, the existing algorithm fails because calculations based on this algorithm will lead to significant errors, such as processing a blue background as gray, resulting in severe color cast.

[0003] The existing solution is to add a color temperature sensor to the device. When the algorithm performs automatic white balance processing on the acquired image, it will refer to the color temperature data sensed by the color temperature sensor and perform white balance processing based on the correct color temperature data to achieve the accuracy requirements of white balance (AWB).

[0004] However, the drawback of this method is that adding a color temperature sensor to the device requires an additional component, increasing the device cost.

[0005] Another solution is to add some auxiliary modules to the system to address this problem. However, the settings of these modules will cause a large number of blue or green areas to appear in the image, which will drive the white balance algorithm to pull the final decision point on color temperature to a set value. The algorithm can achieve the accuracy standard when performing white balance calibration based on this value.

[0006] However, this mechanism can only be used when shooting outdoor images, because the color temperature outdoors is basically between 4800k and 7000k. Forcing the decision point to be within this range will not cause color cast visible to the user. But it cannot be used indoors, because indoor light sources are varied and the range may be between 2000k and 7000k. Therefore, using only one decision point to cover the entire color temperature range is not enough, and color cast will still occur.

[0007] Another solution is to use Face awb, which is to achieve white balance based on human facial color. For example, in scenes with portraits, even if the background has a lot of misleading colors, white balance can be processed based solely on the color temperature corresponding to the human face color.

[0008] However, using Face AWB for shooting can cause color abruptness issues because different face sizes are assigned different weights; large faces and small faces have different weights, resulting in color differences. Secondly, this solution is relatively limited, only applicable to image acquisition with human figures, and cannot be adapted to image acquisition without human figures. Summary of the Invention

[0009] This application provides an image processing method, including:

[0010] Obtain the sensing data used to construct the Nth frame of the acquired image;

[0011] Process the sensed data;

[0012] If the processing result indicates that the shooting environment of the Nth frame image belongs to a single color environment, color compensation data corresponding to the white balance parameters used to constitute the (N-1)th frame image is obtained.

[0013] The sensor data used to construct the Nth frame of the acquired image is adjusted based on the color compensation data, where N is an integer greater than or equal to 1.

[0014] In some embodiments, the method further includes:

[0015] If color compensation data corresponding to the white balance parameters used to construct the N-1th frame of the acquired image is not obtained, obtain standard compensation data;

[0016] The sensor data constituting the Nth frame of the acquired image is adjusted based on the standard compensation data.

[0017] In some embodiments, the method further includes:

[0018] The cache processing results represent color compensation data for images captured in environments that do not belong to a single color environment.

[0019] In some embodiments, processing the sensed data includes:

[0020] The sensed data is processed by a reference unit, which includes at least one red pixel, one green pixel, and one blue pixel.

[0021] Obtain the target unit that satisfies the first condition from the reference unit;

[0022] The processing result is determined based on the number of target units and the number of reference units;

[0023] Wherein, the percentage of the number of target units to the number of reference units is higher than the second condition, indicating that the shooting environment of the Nth frame image belongs to a single color environment.

[0024] In some embodiments, the first condition includes one of the following:

[0025] The values ​​of the blue pixels are multiples of the values ​​of the red pixels;

[0026] The values ​​of the green pixels are multiples of the values ​​of the red pixels;

[0027] The values ​​of the green pixels are multiples of the values ​​of the blue pixels;

[0028] In some embodiments, the method further includes:

[0029] If the processing result indicates that the shooting environment of the Nth frame image belongs to a single color environment, the automatic white balance function module is controlled to switch from the working state to the non-working state. The automatic white balance function module includes at least a face-based automatic white balance algorithm module.

[0030] Another embodiment of this application also provides an electronic device, including:

[0031] An image acquisition device, including a sensing chip for generating sensing data to form the Nth frame of the acquired image;

[0032] A processing device is configured to obtain sensor data of the Nth frame of the captured image and process the sensor data. If the processing result indicates that the shooting environment of the Nth frame of the captured image is a single color environment, color compensation data corresponding to the white balance parameters used to constitute the (N-1)th frame of the captured image is obtained, and the sensor data constituting the Nth frame of the captured image is adjusted based on the color compensation data, wherein N is an integer greater than or equal to 1.

[0033] In some embodiments, the processing apparatus is further configured to:

[0034] If color compensation data corresponding to the white balance parameters used to construct the N-1th frame of the acquired image is not obtained, obtain standard compensation data;

[0035] The sensor data constituting the Nth frame of the acquired image is adjusted based on the standard compensation data.

[0036] In some embodiments, the processing apparatus is further configured to:

[0037] The cache processing results represent color compensation data for images captured in environments that do not belong to a single color environment.

[0038] In some embodiments, processing the sensed data includes:

[0039] The sensed data is processed by a reference unit, which includes at least one red pixel, one green pixel, and one blue pixel.

[0040] Obtain the target unit that satisfies the first condition from the reference unit;

[0041] The processing result is determined based on the number of target units and the number of reference units;

[0042] Wherein, the percentage of the number of target units to the number of reference units is higher than the second condition, indicating that the shooting environment of the Nth frame image belongs to a single color environment.

[0043] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.

[0044] The technical solution of this application will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0045] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a flowchart of the image processing method in an embodiment of this application.

[0047] Figure 2 This is a flowchart illustrating the application of the image processing method in the embodiments of this application.

[0048] Figure 3 This is a flowchart of an image processing method according to another embodiment of this application.

[0049] Figure 4 This is a schematic diagram of the structure of the electronic device in the embodiments of this application. Detailed Implementation

[0050] The specific embodiments of this application will now be described in detail with reference to the accompanying drawings, but these are not intended to limit the scope of this application.

[0051] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the following description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.

[0052] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0053] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.

[0054] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application, which have the features described in the claims and are therefore all within the scope of protection defined herein.

[0055] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.

[0056] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.

[0057] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.

[0058] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0059] like Figure 1 As shown, this application provides an image processing method, including:

[0060] S1: Obtain the sensing data used to construct the Nth frame of the acquired image;

[0061] S2: Process the sensed data;

[0062] S3: If the processing result indicates that the shooting environment of the Nth frame image belongs to a single color environment, obtain the color compensation data corresponding to the white balance parameters used to constitute the (N-1)th frame image.

[0063] S4: Adjust the sensing data that constitutes the Nth frame of the acquired image based on the color compensation data, where N is an integer greater than or equal to 1.

[0064] like Figure 2 As shown, when a user takes a picture using an electronic device, the system obtains the sensor data of each frame of the image captured by the camera, that is, the data captured by the camera during the acquisition process, which is the data before the image is taken. After obtaining the sensor data, the system processes it, such as analyzing and calculating the color information, image content, etc., in the sensor data, and obtains the processing result. Analysis of the processing result reveals that if the processing result indicates that the shooting environment of the current frame's captured image is a single-color environment, that is, the color distribution of the current frame's captured image is a single color, or a large area of ​​the image presents a single color, in order to avoid the white balance algorithm in the system being unable to accurately determine the color temperature of the current frame's captured image, resulting in a severe color cast after white balance calibration, this embodiment obtains the color compensation data corresponding to the white balance parameters of the previous frame's captured image. The color compensation data can be, but is not limited to, gain compensation data for red, green, and blue, and the previous frame's captured image can be a colored background image or a single-color image. When the background image is colored, its white balance parameters and color compensation data are calculated and generated by the white balance algorithm within the system. However, when the background image is a single color, its color compensation data is the previous frame image. That is, if the current frame is N-1 frames, the previous frame is N-2 frames, and so on. Therefore, when the current frame is determined to be a single-color background image, color compensation data is not calculated based on the system's white balance algorithm. Instead, the color compensation data of the previous frame or the frame before that, corresponding to a colored environment, is used to participate in the calculation of the white balance processing of the current frame's sensor data. In this embodiment, the previous frame or N-1 frame image can be a colored environment image or a single-color environment image. Regardless of the type of image, the color compensation data used is the color compensation data of the colored environment image. Therefore, the current frame using the color compensation data of the previous frame does not necessarily mean that the current frame is colored environment data. Of course, the "previous frame image" can also refer to the color environment image of the previous frame, such as the most recent color environment image. Both schemes are supported.

[0065] Based on the above-described scheme of this embodiment, during the image acquisition process, the system can identify and process the sensing data of the corresponding frame image to determine whether it is a single-color environment image. If so, the system does not use the white balance algorithm to calculate the color compensation data, but instead uses the color compensation data of the previous frame, that is, the previously captured color environment image, and uses the color compensation data to participate in the white balance processing of the sensing data of the current frame image. This effectively avoids the problem of serious color cast in the generated image caused by the white balance algorithm's inability to accurately determine the color temperature of a single-color environment image. The method based on this embodiment requires no additional devices, such as devices for detecting color temperature, and does not require combining human images to determine white balance parameters. It only needs to analyze and process the sensor data generated when acquiring the frame image to determine whether it is a single-color environment. If so, the color compensation data of the previously captured color environment image is used to achieve the current white balance processing. The process is simple and convenient, with a wide range of applications. It can be applied to image acquisition in any scene or environment, including those with or without human images, outdoor or indoor settings. Moreover, it can effectively achieve white balance calibration for single-color environment images, solving the color shift problem that occurs when existing white balance algorithms process single-color environment images.

[0066] In another embodiment, such as Figure 3 As shown, the method further includes:

[0067] S5: If color compensation data corresponding to the white balance parameters used to construct the N-1th frame of the acquired image is not obtained, obtain standard compensation data;

[0068] S6: Adjust the sensing data that constitutes the Nth frame of the acquired image based on the standard compensation data.

[0069] Assuming the device is being used for the first time, or has been initialized to factory settings, or has undergone a cold start, and such devices have no prior usage record, or the color compensation data for white balance parameters has been cleared, when the device is put into use for shooting, if the sensor data of the currently captured image indicates that the image is a monochromatic environment image, the system cannot obtain the color compensation data of the previous frame or a previously captured color environment image. In this case, the system will obtain standard compensation data. Alternatively, if the device's previous frame image also shows monochromatic environment data, the system can choose to reject the color compensation data of that frame image and instead obtain the standard compensation data. Once the system obtains the standard compensation data, it can perform white balance processing on the sensor data of the current frame image based on the standard compensation data.

[0070] In this embodiment, the standard compensation data is a pre-set set of color compensation data. When performing white balance processing based on this color compensation data or the color compensation data of the color environment image, the white balance algorithm can apply color adjustments within the normal range to the image's sensing data. That is, the image colors are adjusted based on neutral colors to make the colors softer and the imaging effect more in line with the actual acquisition environment.

[0071] Furthermore, to facilitate the system's white balance processing of images in a single-color environment by prioritizing the acquisition of color compensation data from previously captured color environment images to assist in the processing of the current frame image, the method further includes:

[0072] S7: The cache processing result represents the color compensation data of the captured image, which does not belong to a single color environment.

[0073] In other words, for each captured image frame, if analysis determines it to be a color environment image, the color compensation data calculated during white balance processing is recorded. If it's a single-color environment image, the color compensation data used is discarded and not recorded. The storage rule for color compensation data is to update the color compensation data of the previous frame using the color compensation data of the latest color environment image; that is, the system always stores the color compensation data of the latest color ambient light image. Furthermore, color compensation data can be stored in memory or on the hard drive; that is, it can be stored in either non-volatile or volatile storage areas. Standard compensation data is stored in non-volatile storage areas such as the hard drive to ensure that it is not lost after a cold start.

[0074] In one embodiment, after the system obtains the sensing data of the frame image, the processing of the sensing data includes:

[0075] S8: The sensed data is processed by a reference unit, wherein the reference unit includes at least one red pixel, one green pixel, and one blue pixel;

[0076] S9: Obtain the target unit that satisfies the first condition from the reference unit;

[0077] S10: Determine the processing result based on the number of target units and the number of reference units;

[0078] Wherein, the percentage of the number of target units to the number of reference units is higher than the second condition, indicating that the shooting environment of the Nth frame image belongs to a single color environment.

[0079] For example, the reference unit described in this embodiment can be a pixel unit, which can be a single pixel or a combination of multiple pixels. When it is a single pixel, the red, green, and blue pixels are three sub-pixels within the pixel. First, let's take a single pixel as an example. The pixel is any pixel in the currently captured image. Specifically, the values ​​of the red, green, and blue sub-pixels in the sensing data corresponding to each pixel are determined. If the values ​​of the three sub-pixels are comparable, with no significant difference and no abnormally high sub-pixel values, then the output color of this pixel can be determined to be neutral, and the first condition is not met. However, if one of the three sub-pixel values ​​is abnormally high, and much higher than the values ​​of one or two other sub-pixels, such as a red sub-pixel value of 180, while the values ​​of the green and blue sub-pixels are 80 and 110 respectively, then the red sub-pixel value is abnormal. For such a pixel, the first condition is met, and it is determined to be a target unit or target pixel. Alternatively, if the value of the red subpixel is 180, the value of the green subpixel is 160, and the value of the blue pixel is 70 or even lower, then the color of this pixel can also be determined to be a non-neutral color, belonging to a single color, thus satisfying the first condition. In other words, the first condition is used to select pixel units (reference units) with abnormally high subpixel or pixel values, because the color exhibited by such pixel units is a single color, i.e., a non-neutral color. By statistically analyzing the number of selected target units and the number of all reference units—that is, by statistically analyzing the number of single-color pixels in the current frame and the total number of pixels in the frame—the two quantities are compared, such as by calculating percentages or ratios, to obtain the processing result. Alternatively, the comparison result can be further compared with a preset ratio threshold or percentage threshold, and the processing result is formed based on this comparison result.

[0080] For a pixel unit composed of multiple pixels, also known as a reference unit, the color value of each pixel in each unit can be identified. If the number of pixels with a certain color in the pixel unit reaches or exceeds a preset value, then the pixel unit can be determined to meet the first condition and is a target unit, meaning it is a pixel unit that displays a single color, and the color of this pixel unit is consistent with the color of pixels with abnormally high values. Alternatively, each pixel unit can form a display unit, containing red, green, and blue pixels, which share a common color and are mixed to form the color displayed by the display unit. For this type of pixel unit, the color of the pixel with an abnormal total pixel value among the three colors can be identified. If the total pixel value of one color is much higher than the total pixel value of another one or two colors, then the pixel unit can be determined to meet the first condition and belong to a single-color pixel unit, i.e., a target unit. After all pixel units of the captured image in the current frame have been judged, the number of target units and the number of all pixel units are counted. All pixel units cover all pixels of the captured image in the current frame. The two quantities are compared, such as by calculating percentage or ratio, to obtain the processing result, or the comparison result is further compared with a preset ratio threshold or percentage threshold, and the processing result is formed based on the comparison result.

[0081] Furthermore, a second condition is preset. This second condition can be, but is not limited to, a quantity threshold or quantity limit value. Specifically, if the processing result exceeds the preset or threshold value in the second condition, it indicates that the environment in which the current frame image was captured is a monochromatic environment; conversely, if the result does not exceed the threshold value, it indicates that the environment in which the current frame image was captured is a color environment. Accordingly, after the system obtains the processing result, it compares the value of the processing result with the threshold or limit value in the second condition to determine whether the current frame image is a monochromatic environment image.

[0082] The specific circumstances of the first condition are not unique. Taking a single pixel as the reference unit, the first condition could be, for example, that the pixel value of a certain color exceeds a threshold value, while the pixel values ​​of other colors are all within that threshold value; or that the color value of a certain pixel is abnormally high, while the pixel values ​​of other colors are all small, or even 0 or single-digit values ​​greater than zero, etc. Alternatively, it could be set as in this embodiment, where the first condition includes one of the following:

[0083] The values ​​of the blue pixels are multiples of the values ​​of the red pixels;

[0084] The values ​​of the green pixels are multiples of the values ​​of the red pixels;

[0085] The values ​​of the green pixels are multiples of the values ​​of the blue pixels.

[0086] The aforementioned multiple relationship is not fixed and can be 1x, 1.5x, 2x, etc. In addition, the first condition may also include satisfying the first condition when the number of pixels of a certain color in a pixel unit exceeds a preset threshold.

[0087] Through the above-described method and the setting of the first condition in this embodiment, non-neutral color pixels in the current frame captured image can be accurately identified. When the proportion of the value of non-neutral color pixels to all pixels in the captured image exceeds the corresponding threshold or limit value, such as exceeding 70%, 80%, 85%, etc., it can be determined that the environment in which the current frame captured image was captured is a single color environment.

[0088] Furthermore, the method also includes:

[0089] S11: If the processing result indicates that the shooting environment of the Nth frame image belongs to a single color environment, control the automatic white balance function module to switch from working state to non-working state, wherein the automatic white balance function module includes at least a face-based automatic white balance algorithm module.

[0090] The above steps are to ensure that when the system determines, based on the processing results, that the shooting environment of the current frame image belongs to a single-color environment, the white balance algorithm within the system will not calculate color compensation parameters for that frame image, thus avoiding severe color cast in the generated image. In this embodiment, the system will promptly control the automatic white balance function module to switch from a working state to a non-working state. For example, it will control the module in the automatic white balance algorithm used to calculate color compensation parameters to stop working, and the automatic white balance algorithm module based on human faces to stop working, so as to prevent their operation from affecting the white balance processing of the frame image. After the white balance processing of the current frame is completed, the system will automatically wake up the aforementioned function modules that have been controlled to stop running. For example, the system can control the aforementioned function modules to stop running within a target time period, which is related to the completion of the white balance processing of the current frame image. When the function module is controlled to stop running, a timer begins. After the timer ends, the function module will automatically wake up in response to the end of the timer, or the function module will wake up based on a signal issued by the system, whichever is more specific.

[0091] like Figure 4 As shown, another embodiment of this application also provides an electronic device, including:

[0092] An image acquisition device, including a sensing chip for generating sensing data to form the Nth frame of the acquired image;

[0093] A processing device is configured to obtain sensor data of the Nth frame of the captured image and process the sensor data. If the processing result indicates that the shooting environment of the Nth frame of the captured image is a single color environment, color compensation data corresponding to the white balance parameters used to constitute the (N-1)th frame of the captured image is obtained, and the sensor data constituting the N+1th frame of the captured image is adjusted based on the color compensation data, wherein N is an integer greater than or equal to 1.

[0094] In some embodiments, the processing apparatus is further configured to:

[0095] If color compensation data corresponding to the white balance parameters used to construct the N-1th frame of the acquired image is not obtained, obtain standard compensation data;

[0096] The sensor data constituting the acquired image of the (N+1)th frame is adjusted based on the standard compensation data.

[0097] In some embodiments, the processing apparatus is further configured to:

[0098] The cache processing results represent color compensation data for images captured in environments that do not belong to a single color environment.

[0099] In some embodiments, processing the sensed data includes:

[0100] The sensed data is processed by a reference unit, which includes at least one red pixel, one green pixel, and one blue pixel.

[0101] Obtain the target unit that satisfies the first condition from the reference unit;

[0102] The processing result is determined based on the number of target units and the number of reference units;

[0103] Wherein, the percentage of the number of target units to the number of reference units is higher than the second condition, indicating that the shooting environment of the Nth frame image belongs to a single color environment.

[0104] In some embodiments, the first condition includes one of the following:

[0105] The values ​​of the blue pixels are multiples of the values ​​of the red pixels;

[0106] The values ​​of the green pixels are multiples of the values ​​of the red pixels;

[0107] The values ​​of the green pixels are multiples of the values ​​of the blue pixels;

[0108] In some embodiments, the processing apparatus is further configured to:

[0109] If the processing result indicates that the shooting environment of the Nth frame image belongs to a single color environment, the automatic white balance function module is controlled to switch from the working state to the non-working state. The automatic white balance function module includes at least a face-based automatic white balance algorithm module.

[0110] Another embodiment of this application also provides a storage medium including a stored program, wherein, when the program is executed, a device including the storage medium is controlled to perform the image processing method as described in any of the embodiments above.

[0111] This application also provides a computer program product, which is tangibly stored on a computer-readable medium and includes computer-readable instructions. When executed, these computer-executable instructions cause at least one processor to perform an image processing method as described in the embodiments above. It should be understood that the various solutions in this embodiment have the corresponding technical effects in the above method embodiments, and will not be repeated here.

[0112] It should be noted that the computer storage medium of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access storage media (RAM), read-only storage media (ROM), erasable programmable read-only storage media (EPROM or flash memory), optical fibers, portable compact disk read-only storage media (CD-ROM), optical storage media, magnetic storage media, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program configured for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, antenna, optical fiber, RF, etc., or any suitable combination thereof.

[0113] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of protection of this application is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of one or more embodiments of this application as described above, which are not provided in detail for the sake of brevity.

[0114] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.

Claims

1. An image processing method, comprising: Obtain the sensing data used to construct the Nth frame of the acquired image; Process the sensed data; If the processing result indicates that the shooting environment of the Nth frame image belongs to a single-color environment, color compensation data corresponding to the white balance parameters used to construct the (N-1)th frame image is obtained; wherein, When the shooting environment of the N-1th frame image is a single color environment, the color compensation data corresponding to the white balance parameters used to constitute the N-1th frame image is the color compensation data of the previous frame or the frame before that that was taken earlier and corresponding to a color environment. The sensor data constituting the Nth frame of the acquired image is adjusted based on the color compensation data, where N is an integer greater than or equal to 1.

2. The image processing method according to claim 1, wherein, The method further includes: If color compensation data corresponding to the white balance parameters used to construct the N-1th frame of the acquired image is not obtained, obtain standard compensation data; The sensor data constituting the Nth frame of the acquired image is adjusted based on the standard compensation data.

3. The image processing method according to claim 1, wherein, The method further includes: The cache processing results represent color compensation data for images captured in environments that do not belong to a single color environment.

4. The image processing method according to claim 1, wherein, The processing of the sensed data includes: The sensed data is processed by a reference unit, which includes at least one red pixel, one green pixel, and one blue pixel. Obtain the target unit that satisfies the first condition from the reference unit; The processing result is determined based on the number of target units and the number of reference units; Wherein, the percentage of the number of target units to the number of reference units is higher than the second condition, indicating that the shooting environment of the Nth frame image belongs to a single color environment.

5. The image processing method according to claim 4, wherein, The first condition includes one of the following: The values ​​of the blue pixels are multiples of the values ​​of the red pixels; The values ​​of the green pixels are multiples of the values ​​of the red pixels; The values ​​of the green pixels are multiples of the values ​​of the blue pixels.

6. The image processing method according to claim 1, wherein, The method further includes: If the processing result indicates that the shooting environment of the Nth frame image belongs to a single color environment, the automatic white balance function module is controlled to switch from the working state to the non-working state. The automatic white balance function module includes at least a face-based automatic white balance algorithm module.

7. An electronic device, comprising: An image acquisition device, including a sensing chip for generating sensing data to form the Nth frame of the acquired image; A processing device is configured to obtain sensor data of the Nth frame captured image and process the sensor data. If the processing result indicates that the shooting environment of the Nth frame captured image is a single-color environment, the device obtains color compensation data corresponding to the white balance parameters used to constitute the (N-1)th frame captured image and adjusts the sensor data constituting the Nth frame captured image based on the color compensation data. Wherein, when the shooting environment of the (N-1)th frame captured image is a single-color environment, the color compensation data corresponding to the white balance parameters used to constitute the (N-1)th frame captured image is the color compensation data of the previous frame or the frame before that, which corresponds to a color environment. Wherein, N is an integer greater than or equal to 1.

8. The electronic device according to claim 7, wherein, The processing device is also used for: If color compensation data corresponding to the white balance parameters used to construct the N-1th frame of the acquired image is not obtained, obtain standard compensation data; The sensor data constituting the Nth frame of the acquired image is adjusted based on the standard compensation data.

9. The electronic device according to claim 7, wherein, The processing device is also used for: The cache processing results represent color compensation data for images captured in environments that do not belong to a single color environment.

10. The electronic device according to claim 7, wherein, The processing of the sensed data includes: The sensed data is processed by a reference unit, which includes at least one red pixel, one green pixel, and one blue pixel. Obtain the target unit that satisfies the first condition from the reference unit; The processing result is determined based on the number of target units and the number of reference units; Wherein, the percentage of the number of target units to the number of reference units is higher than the second condition, indicating that the shooting environment of the Nth frame image belongs to a single color environment.

11. An image processing method, comprising: Obtain the sensing data used to construct the Nth frame of the acquired image; Process the sensed data; If the processing result indicates that the shooting environment of the Nth frame image belongs to a single-color environment, color compensation data corresponding to the white balance parameters used to construct the (N-1)th frame image is obtained; wherein, When the shooting environment of the N-1th frame image is a color environment, the color compensation data corresponding to the white balance parameters used to constitute the N-1th frame image is the color compensation data of the image corresponding to the color environment of the N-1th frame image. The sensor data constituting the Nth frame of the acquired image is adjusted based on the color compensation data, where N is an integer greater than or equal to 1.

12. An electronic device, comprising: An image acquisition device, including a sensing chip for generating sensing data to form the Nth frame of the acquired image; A processing device is configured to obtain sensor data of the Nth frame captured image and process the sensor data. If the processing result indicates that the shooting environment of the Nth frame captured image belongs to a single-color environment, color compensation data corresponding to the white balance parameters used to constitute the (N-1)th frame captured image is obtained, and the sensor data constituting the Nth frame captured image is adjusted based on the color compensation data. Wherein, when the shooting environment of the (N-1)th frame captured image belongs to a color environment, the color compensation data corresponding to the white balance parameters used to constitute the (N-1)th frame captured image is the color compensation data of the image corresponding to the color environment of the (N-1)th frame captured image; wherein, N is an integer greater than or equal to 1.

Citation Information

Patent Citations

  • White balance processing method and device

    CN116134808A

  • Image processing method and related device

    WO2023005870A1