Image processing method and device, chip, electronic equipment and storage medium
By dividing the image into image blocks for brightness statistics and gamma correction, the high power consumption problem caused by pixel-by-pixel correction before image display is solved, achieving low-power image processing and improving image display effect.
Patent Information
- Application Number
- CN202310180694.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-02-27
AI Technical Summary
Existing technologies perform gamma correction on each pixel before image display, resulting in a large amount of data processing and increased device power consumption.
The image to be processed is divided into multiple image blocks, brightness statistics are performed to determine the target brightness value of each image block, and gamma correction is performed on the target brightness value to reduce the amount of data processing required for gamma correction.
It reduces device power consumption and improves image display, especially in night scenes, where bright areas are brightened while dark areas remain unchanged, meeting display requirements.
Smart Images

Figure CN116320776B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and more particularly, to an image processing method, an image processing device, an image processing chip, an electronic device, and a nonvolatile computer readable storage medium. BACKGROUND
[0002] With the popularity of smart devices, such as smart phones, tablet computers, and other mobile devices, people are more accustomed to using mobile devices for shooting. Therefore, people have increasingly high requirements for the imaging quality of mobile devices. Before an image is displayed, gamma correction is generally performed on the image to make the output of the image consistent with the perception of the human eye to brightness, but gamma correction is generally performed on each pixel in the image, resulting in a large amount of data processing of gamma correction, thereby increasing the power consumption of the device. SUMMARY
[0003] The present application provides an image processing method, an image processing device, an image processing chip, an electronic device, and a nonvolatile computer readable storage medium.
[0004] The image processing method of the present application includes dividing a to-be-processed image into a plurality of to-be-processed image blocks, the number of to-be-processed image blocks being less than the number of pixels of the to-be-processed image; performing brightness statistics on each to-be-processed image block to determine a target brightness value of each to-be-processed image block; and performing gamma correction on the target brightness value to output a target image.
[0005] The image processing device of the present application includes a division module, a determination module, and a correction module. The division module is configured to divide a to-be-processed image into a plurality of to-be-processed image blocks, the number of to-be-processed image blocks being less than the number of pixels of the to-be-processed image; the determination module is configured to perform brightness statistics on each to-be-processed image block to determine a target brightness value of each to-be-processed image block; and the correction module is configured to perform gamma correction on the target brightness value to output a target image.
[0006] The image processing chip of the present application is configured to execute the above-mentioned image processing method. The image processing method includes dividing a to-be-processed image into a plurality of to-be-processed image blocks, the number of to-be-processed image blocks being less than the number of pixels of the to-be-processed image; performing brightness statistics on each to-be-processed image block to determine a target brightness value of each to-be-processed image block; and performing gamma correction on the target brightness value to output a target image.
[0007] The electronic device of the embodiments of the present application includes one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the programs include instructions for executing the image processing method described above. The image processing method includes dividing a to-be-processed image into a plurality of to-be-processed image blocks, the number of to-be-processed image blocks being less than the number of pixels of the to-be-processed image; performing brightness statistics on each to-be-processed image block to determine a target brightness value of each to-be-processed image block; and performing gamma correction on the target brightness value to output a target image.
[0008] The computer-readable storage medium of the embodiments of the present application includes a computer program, which, when executed by a processor, causes the processor to execute the image processing method. The image processing method includes dividing a to-be-processed image into a plurality of to-be-processed image blocks, the number of to-be-processed image blocks being less than the number of pixels of the to-be-processed image; performing brightness statistics on each to-be-processed image block to determine a target brightness value of each to-be-processed image block; and performing gamma correction on the target brightness value to output a target image.
[0009] The image processing method, image processing device, image processing chip, electronic device, and computer-readable storage medium of the embodiments of the present application divide a to-be-processed image into a plurality of to-be-processed image blocks, and then perform brightness statistics on the to-be-processed image blocks to obtain a target brightness value of each to-be-processed image block. Compared with performing gamma correction on each pixel of the to-be-processed image, the present application only needs to perform gamma correction on the target brightness value of each to-be-processed image block when performing gamma correction. Since the number of to-be-processed image blocks is less than the number of pixels of the to-be-processed image, the data processing amount of gamma correction can be reduced, and the power consumption of the electronic device can be reduced. It can be understood that gamma correction can brighten the highlight part and darken the low-light part. For example, in a night scene, the highlight part of the image needs to be brightened without darkening the low-light part which already has a low brightness. Therefore, after determining the target brightness value (such as the maximum brightness value) of the to-be-processed image block according to the brightness statistics, only the target brightness value is subjected to gamma correction, so that the data processing amount of gamma correction is reduced and the power consumption of the device is reduced while meeting the display effect in this scene (i.e., brightening the highlight part where the target brightness value is located without darkening the low-light part).
[0010] Additional aspects and advantages of the embodiments of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS
[0011] The above and / or additional aspects and advantages of the present application will become apparent and more readily appreciated from the following description, taken in conjunction with the following drawings in which:
[0012] Figure 1 is a flowchart of an image processing method according to some embodiments of the present application;
[0013] Figure 2 is a scenario diagram of an image processing method according to some embodiments of the present application;
[0014] Figure 3 is a flowchart of an image processing method according to some embodiments of the present application;
[0015] Figure 4 is a flowchart of an image processing method according to some embodiments of the present application;
[0016] Figure 5 is a flowchart of an image processing method according to some embodiments of the present application;
[0017] Figure 6 is a module diagram of an image processing apparatus according to some embodiments of the present application;
[0018] Figure 7 is a plan view of an electronic device according to some embodiments of the present application;
[0019] Figure 8 is a connection state diagram of a non-volatile computer readable storage medium and a processor according to some embodiments of the present application. DETAILED DESCRIPTION
[0020] Embodiments of the present application are described in detail below with reference to the attached drawing figures, wherein the same or like reference numerals and letters in different figures indicate the same or like components or elements having the same or similar function. The embodiments described below are examples of implementing the present application and are intended for purposes of illustration only and are not intended to be limiting of the application.
[0021] For the convenience of understanding the present application, the terms appearing in the present application are explained as follows:
[0022] Gamma (GAMMA) correction: Because the sensitivity of human eyes to different brightness is different, the sensitivity to dark part is higher than that to bright part. This nonlinear feature of the light sensitivity of human eyes to external light source usually needs to perform nonlinear transformation on the gray value of input image, so that the output image and the input image gray value are in exponential relationship. This nonlinear processing is called GAMMA correction.
[0023] Image blurring: in order to highlight the shooting subject, the objects outside the shooting subject are generally blurred. Therefore, when performing image blurring, the depth range of the shooting subject needs to be determined, so that the objects outside the depth range of the shooting subject are blurred, thereby highlighting the shooting subject. Therefore, when performing image blurring, a depth image of the same scene as the shooting scene can be obtained at the same time to assist in performing image blurring, and the accuracy of the depth image affects the blurring effect of the shooting subject.
[0024] Please refer to Figure 1 The embodiment of the application provides an image processing method, which comprises:
[0025] Step 011: dividing the to-be-processed image into a plurality of to-be-processed image blocks, the number of to-be-processed image blocks being less than the number of pixels of the to-be-processed image;
[0026] Wherein, the to-be-processed image can be any image format, such as RGB picture format, Bayer picture format, etc. The RGB picture format is obtained by changing the three color channels of red (R), green (G) and blue (B) and superimposing them on each other. The Bayer picture format is the original picture inside the camera.
[0027] Specifically, in order to reduce the data processing amount of gamma correction, the to-be-processed image can be divided into a plurality of to-be-processed image blocks, each image block can include one or more pixels, so that the number of to-be-processed image blocks after division is less than the number of pixels of the to-be-processed image. In this way, the gamma correction of one brightness value is once gamma correction, and the number of times of gamma correction for each to-be-processed image block in the subsequent process is obviously less than the number of times of gamma correction for each pixel of the to-be-processed image.
[0028] Optionally, when dividing the to-be-processed image, the to-be-processed image can also be divided into a plurality of to-be-processed image blocks based on a preset size.
[0029] Specifically, the preset size can be 2*2, 3*3, 4*4, etc., and the preset size can also be 2*3, 3*4, etc., which is not limited here. Wherein, please refer to Figure 2 Taking the preset size 2*2 as an example, a selection box S of the preset size can be used to slide in the 6*6 to-be-processed image P0, and the image part located in the selection box S after each sliding is the to-be-processed image block M, so that a plurality of to-be-processed image blocks M of the preset size are selected from the to-be-processed image P0, and the specific number is 9 to-be-processed image blocks M. It needs to be explained that, in order to facilitate the display of the to-be-processed image block M in the figure, Figure 2 The size of the dashed box of the corresponding to-be-processed image block M in is slightly larger than the preset size, but the actual size of the to-be-processed image block M is still the preset size (i.e. 2*2).
[0030] It can be understood that the to-be-processed image can be divided into a plurality of preset-size to-be-processed image blocks, but the to-be-processed image can also be divided into a plurality of preset-size to-be-processed image blocks and a plurality of other-size to-be-processed image blocks. For example, when the preset size is 4*4, the to-be-processed image can be divided into four preset-size to-be-processed image blocks, but when the preset size is 5*5, the to-be-processed image can be divided into four preset-size to-be-processed image blocks and a plurality of other-size (for example, 1*1, 2*1, etc.) to-be-processed image blocks.
[0031] Optionally, the corresponding preset size can be set based on the size of the to-be-processed image and the size of the target image required by the actual application scenario, so as to reduce the number of gamma correction as much as possible in the case of outputting the target image with the size required by the scenario, thereby reducing the data processing amount of gamma correction and reducing the power consumption of the electronic device.
[0032] Specifically, taking the scenario of displaying a high-resolution image in a low-resolution device as an example, if all pixels are subjected to gamma correction, unnecessary data processing and power consumption will occur because some pixels subjected to gamma correction will not be displayed. Therefore, after the to-be-processed image is divided based on the preset size according to different scenarios, only the target luminance value of each to-be-processed image block needs to be subjected to gamma correction, which not only ensures the display effect under the current scenario, but also reduces the data processing amount of gamma correction.
[0033] In one example, the preset size can be determined according to the size of the to-be-processed image and the resolution of the electronic device displaying the to-be-processed image. For example, when the size of the to-be-processed image is 4096*2048 and the resolution of the electronic device displaying the to-be-processed image is 2048*1024, the preset size is (4096 / 2048)*(2048 / 1024), that is, 2*2.
[0034] Step 012: performing luminance statistics on each to-be-processed image block to determine the target luminance value of each to-be-processed image block;
[0035] Specifically, when an electronic device processes an input image, brightness information of the input image is often needed, and therefore a brightness statistics module is commonly used in an image signal processor (ISP). Through the brightness statistics module, brightness statistics can be performed on each to-be-processed image block, so as to determine a target brightness value of each to-be-processed image block. For example, a brightness value of each pixel of the to-be-processed image block can be obtained, and a maximum value, a minimum value, and / or an average value of all brightness values of the to-be-processed image block can be taken as the target brightness value of the to-be-processed image block. In other embodiments, a median of all brightness values of the to-be-processed image block can also be taken as the target brightness value of the to-be-processed image block.
[0036] Taking an RGB image format as an example, each pixel of the to-be-processed image includes channel values of three channels of R, G, and B. Therefore, when the brightness value of each pixel of the to-be-processed image block is obtained, the channel value of each channel of each pixel in each to-be-processed image block can be obtained respectively as the brightness value of the to-be-processed image block, and each channel value can be taken as a brightness value, that is, there are three brightness values for each pixel in the to-be-processed image block. When brightness statistics is performed on the to-be-processed image block, a maximum value, a minimum value, and / or an average value of the brightness values corresponding to all pixels in the to-be-processed image block can be taken as the target brightness value of the to-be-processed image block.
[0037] In one example, for a dark-light image captured in a low-brightness environment, the high-brightness part of the dark-light image needs to be brightened, and therefore a maximum value of all brightness values in the to-be-processed image block can be taken as the target brightness value of the to-be-processed image block.
[0038] In another example, for a high-brightness image captured in a high-brightness environment, the low-brightness part of the high-brightness image needs to be darkened, and therefore a minimum value of all brightness values in the to-be-processed image block can be taken as the target brightness value of the to-be-processed image.
[0039] In yet another example, for a scenario in which a high-resolution image is displayed in a low-resolution device, an average value of all brightness values in the to-be-processed image block can be taken as the target brightness value of the to-be-processed image, so that the high-resolution image is not too bright or too dark when displayed.
[0040] In another example, if the electronic device needs to output target images in different scenarios, such as simultaneously outputting a target image in a scenario of highlighting the highlight part in the dark light image and a target image in a scenario of displaying the high-resolution image in the low-resolution device, the target brightness value of the to-be-processed image block contains the minimum value and the average value of all brightness values in the to-be-processed image block. Or, such as simultaneously outputting a target image in a scenario of highlighting the highlight part in the dark light image, a target image in a scenario of darkening the low-light part in the highlight image, and a target image in a scenario of displaying the high-resolution image in the low-resolution device, the target brightness value of the to-be-processed image block contains the minimum value, the minimum value and the average value of all brightness values in the to-be-processed image block.
[0041] Step 013: Gamma correction is performed on the target brightness value to output the target image.
[0042] Specifically, after determining the target brightness value of each to-be-processed image block, the target brightness value of each to-be-processed image block can be subjected to gamma correction to obtain a mapping value of each target brightness value in the gamma curve, and finally the target image is output according to the mapping value.
[0043] Optionally, the target image can be directly output according to the mapping value, that is, each mapping value is a pixel value of a pixel, so as to output the target image, and the size of the target image is smaller than the size of the to-be-processed image. For example, the size of the to-be-processed image is 2048*2048, which is divided into a plurality of 2*2 to-be-processed image blocks (specifically, 1024*1024 to-be-processed image blocks), so that 1024*1024 mapping values are obtained after gamma correction, and the size of the generated target image is 1024*1024. In this way, the target image can be suitable for displaying the high-resolution image in the low-resolution device, or the target image can be used as an input image of other image processing procedures for subsequent image processing.
[0044] Optionally, the target image can be output according to the mapping value and the pixel value of the to-be-processed image. At this time, the size of the target image is the same as the size of the to-be-processed image, and only the target brightness value in the to-be-processed image can be corrected to the corresponding mapping value; or for an RGB image, the pixel corresponding to the target brightness value can be obtained, and then the three channel values of the pixel are subjected to gamma correction.
[0045] For example, for a scenario in which the target brightness value corresponds to the maximum value, the minimum value and / or the median value, the target brightness value is the brightness value of the target pixel, and at this time the brightness value of the target pixel can be directly corrected to the corresponding mapping value; and for a scenario in which the target brightness value corresponds to the average value, the pixel whose brightness value is closest to the target brightness value is determined as the target pixel, so that the brightness value of the target pixel is corrected to the corresponding mapping value.
[0046] As in the image blurring scene, for the image taken in the night scene, there can be various light sources, and when the image is blurred, the part where the light source is still needs to be shown as highlight to fully show the effect of the light source, and the low-light part is already low in brightness, and if gamma correction is still performed, the brightness of the low-light part will be lower, thereby reducing the quality of the image taken in the night scene. Therefore, for the to-be-processed image taken in the night scene, the maximum value of all brightness values of the to-be-processed image block can be taken as the target brightness value of the to-be-processed image block, and then the maximum brightness value of each to-be-processed image block is subjected to gamma correction to correct the maximum brightness value of each to-be-processed image block to the corresponding mapping value, thereby outputting the target image. In this way, the high-light part in the to-be-processed image can be highlighted, and the low-light part in the to-be-processed image is not darkened, and when the image is blurred in the subsequent target image, the high-light part and the low-light part can have good display effects.
[0047] The image processing method of the embodiments of the present application divides the to-be-processed image into a plurality of to-be-processed image blocks, and then performs brightness statistics on the to-be-processed image blocks to obtain the target brightness value of each to-be-processed image block. Compared with performing gamma correction on each pixel of the to-be-processed image, the present application only needs to perform gamma correction on the target brightness value of each to-be-processed image block. Since the number of to-be-processed image blocks is less than the number of pixels of the to-be-processed image, the data processing amount of gamma correction is reduced, and the power consumption of the electronic device is reduced. It can be understood that gamma correction can brighten the high-light part and darken the low-light part. For example, in the night scene, the high-light part of the image needs to be brightened without darkening the low-light part which is already low in brightness. Therefore, after determining the target brightness value (such as the maximum brightness value) of the to-be-processed image block according to the brightness statistics, only the target brightness value is subjected to gamma correction, thereby reducing the data processing amount of gamma correction while meeting the display effect in this scene (i.e., brightening the high-light part where the target brightness value is located without darkening the low-light part), and reducing the power consumption of the device. And because the data processing amount of gamma correction of the to-be-processed image is reduced, the throughput of gamma correction in a unit of time (such as 1 second, 1 minute, etc.) is improved, that is, the number of to-be-processed images that can be processed in a unit of time is improved. In addition, the difference between bright and dark parts in the target image generated after gamma correction is more obvious, which is more in line with the intuitive feeling of the human eye.
[0048] Please refer to Figure 3 In some embodiments, the image processing method further comprises:
[0049] Step 014: obtaining an input image; and
[0050] Step 015: taking the gray-scale image generated by color space conversion of the input image as a to-be-processed image;
[0051] Step 012: performing brightness statistics on each to-be-processed image block to determine a target brightness value of each to-be-processed image block, comprising:
[0052] Step 0121: performing statistics on the gray value of each pixel in each to-be-processed image block to determine a target brightness value of each to-be-processed image block.
[0053] Specifically, in order to facilitate gamma correction, after obtaining the original image captured by the camera as the input image, the input image can be first converted in color space to generate a gray image, and the gray image is taken as the to-be-processed image. For example, the color space conversion can be realized through an HSV (Hue, Saturation, Value) model, in which the parameters of the color are hue (H), saturation (S) and brightness (V), and the brightness component can form a gray image. Of course, the way to generate a gray image is not limited to the HSV model, for example, the to-be-processed image can also be converted to YUV color space to obtain a gray image.
[0054] In the case where the to-be-processed image is a gray image, each pixel in the to-be-processed image only contains one gray value, so the target brightness value of the to-be-processed image block can be determined by performing statistics on the gray value of each pixel in the to-be-processed image block. For example, the maximum value, the minimum value and / or the average value of all the gray values in the to-be-processed image block are taken as the target brightness value.
[0055] Referring to Figure 4 In some embodiments, the image processing method further comprises:
[0056] Step 016: converting the preset gamma correction curve into a numerical range corresponding to the bit number of the image processing, so that the target brightness value has a corresponding mapping value in the converted gamma correction curve;
[0057] Step 013: performing gamma correction on the target brightness value to output a target image, comprising:
[0058] Step 0131: obtaining the mapping value of the target brightness value in the converted gamma correction curve;
[0059] Step 0132: outputting the target image according to the mapping value.
[0060] Specifically, in order to facilitate gamma correction on the target luminance value, it is necessary to convert the preset gamma correction curve into a value range corresponding to the bit number of the current image processing. For example, in the preset gamma correction curve, there is a corresponding mapping value for any value in the interval [0, 1], that is, the mapping interval of the preset gamma correction curve is [0, 1]. However, the value range of the target luminance value is different when the bit number of the image processing is different. For example, when the bit number of the image processing is 8 bits, the value range of the target luminance value is [0, 255], and when the bit number of the image processing is 10 bits, the value range of the target luminance value is [0, 1023]. Therefore, it is necessary to convert the mapping interval of the preset gamma correction curve into a value range corresponding to the bit number of the image processing, so that each target luminance value can determine a corresponding mapping value in the converted gamma correction curve.
[0061] After the conversion of the gamma correction curve is implemented, the target luminance value can be gamma corrected to output a target image. Specifically, the mapping value of the target luminance value in the converted gamma correction curve can be obtained first, and then the target image can be output according to the mapping value. The target image can be directly output according to the mapping value, that is, each mapping value is a pixel value of a pixel, so that the target image is output, and the size of the target image is smaller than the size of the image to be processed. Alternatively, the target image can be output according to the mapping value and the pixel value of the image to be processed. At this time, the size of the target image is the same as the size of the image to be processed, and only the target luminance value in the image to be processed is corrected to the corresponding mapping value.
[0062] Please refer to Figure 5 In some embodiments, step 0132 comprises:
[0063] Step 01321: generating an intermediate image according to the mapping value;
[0064] Step 01322: in the case where the size of the target image is greater than the size of the intermediate image, performing interpolation processing on the intermediate image to generate the target image.
[0065] Specifically, when the target image is directly output according to the mapping value, an intermediate image can be generated according to the mapping value first, and each pixel of the intermediate image is the mapping value corresponding to each target luminance value. At this time, if the target image to be output is the same size as the image to be processed, that is, the size of the target image to be output is greater than the size of the intermediate image, the target image can be generated by performing interpolation processing on the intermediate image.
[0066] The interpolation manner can be: taking the to-be-processed image as a template, interpolating each pixel in each to-be-processed image block corresponding to each mapping value of the intermediate image to the mapping value, and outputting a target image with the same size as the to-be-processed image. At this time, all pixels of the target image are target luminance values, thereby improving the resolution of the target image in the case of meeting the requirements of the scene corresponding to the target luminance value. For example, in a night scene, through the above interpolation manner, the luminance of all pixels in the target image is relatively high, and the shooting effect in the night scene can be improved.
[0067] The interpolation manner can also be: taking the to-be-processed image as a template, determining that all pixels of the to-be-processed image other than the target luminance values are to-be-interpolated pixels, correcting the target luminance values to corresponding mapping values, and then interpolating according to the mapping values around the to-be-interpolated pixels to generate a target image with the same size as the to-be-processed image. At this time, the to-be-interpolated pixels of the target image are interpolated according to the mapping values with relatively high luminance, which can ensure that the luminance of each pixel of the target image is relatively high, thereby improving the effect of shooting in low light.
[0068] Please refer to Figure 6 To better implement the image processing method of the embodiments of the present application, the embodiments of the present application further provide an image processing device 10. The image processing device 10 can include a division module 11, a determination module 12, and a correction module 13. The division module 11 is configured to divide the to-be-processed image into a plurality of to-be-processed image blocks, and the number of to-be-processed image blocks is less than the number of pixels of the to-be-processed image. The determination module 12 is configured to perform luminance statistics on each to-be-processed image block to determine a target luminance value of each to-be-processed image block. The correction module 13 is configured to perform gamma correction on the target luminance value to output a target image.
[0069] The division module 11 is specifically configured to divide the to-be-processed image into a plurality of to-be-processed image blocks based on a preset size.
[0070] The determination module 12 is specifically configured to obtain a luminance value of each pixel in each to-be-processed image block, and take the maximum value, the minimum value, and / or the average value of all luminance values in each to-be-processed image block as the target luminance value of each to-be-processed image block.
[0071] The determination module 12 is specifically configured to obtain a channel value of each channel of each pixel in each to-be-processed image block as the luminance value.
[0072] The image processing apparatus 10 further comprises an acquisition module 14 and a first conversion module 15. The acquisition module 14 is configured to acquire the input image; and the conversion module 15 is configured to generate a grayscale image by color space conversion of the input image as a to-be-processed image. The determination module 12 is specifically configured to count the grayscale value of each pixel in each to-be-processed image block to determine the target brightness value of each to-be-processed image block.
[0073] The image processing apparatus 10 further comprises a second conversion module 16. The second conversion module 16 is configured to convert a preset gamma correction curve into a numerical range corresponding to the bit number of the image processing, so that the target brightness value has a corresponding mapping value in the converted gamma correction curve. The correction module 13 is specifically configured to acquire the mapping value of the target brightness value in the converted gamma correction curve; and output the target image according to the mapping value.
[0074] The correction module 13 is specifically configured to generate an intermediate image according to the mapping value; and perform interpolation processing on the intermediate image to generate the target image in a case where the size of the target image is greater than the size of the intermediate image.
[0075] Referring to Figure 7 The electronic device 100 of the embodiment of the present application comprises one or more processors 20, a memory 30, and one or more programs 40, wherein the one or more programs 40 are stored in the memory 30 and executed by the one or more processors 20, and the program 40 comprises instructions for executing the image processing method of any of the above embodiments.
[0076] The electronic device 100 can be a mobile phone, a tablet computer, a display device, a notebook computer, a teller machine, a gate machine, a smart watch, a head-mounted device, a game machine, etc. The embodiment of the present application takes the mobile phone as an example for illustration, and it can be understood that the specific form of the electronic device 100 is not limited to the mobile phone.
[0077] Referring to Figure 7 The image processing chip 50 of the embodiment of the present application is configured to execute the image processing method of any of the above embodiments, which will not be described herein again for the sake of brevity. The image processing chip 50 can be arranged in the electronic device 100 to serve as an ISP of the electronic device 100.
[0078] Referring to Figure 8 The embodiment of the present application further provides a computer readable storage medium 300 having a computer program 310 stored thereon, and the computer program 310 is configured to implement the steps of the image processing method of any of the above embodiments when executed by the processor 20, which will not be described herein again for the sake of brevity.
[0079] In the description of the specification, the description of the terms "certain embodiments", "in an example", "exemplarily" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiments or examples are included in at least one embodiment or example of the present application. In the specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Also, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples without contradiction.
[0080] Any process or method descriptions or descriptions of the flow diagrams in the flow charts described herein or otherwise described in the specification can be understood as representing code modules, segments, or portions of code which include one or more executable instructions for performing specific logic functions or steps in the process, and the various embodiments of the application include the use of alternative orderings, structures, and combinations of code modules, segments, or portions of code in implementing the functions or steps described in the specification, and that one or more of the code modules, segments, or portions of code can be deleted, modified, or replaced by other code modules, segments, or portions of code in different embodiments of the application.
[0081] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and the person skilled in the art can make changes, modifications, replacements and variations to the above-described embodiments within the scope of the present application.
Claims
1. An image processing method, characterized by, The method comprises the following steps: dividing the image to be processed into a plurality of image blocks to be processed, the number of the image blocks to be processed being less than the number of pixels of the image to be processed; obtaining the brightness value of each pixel in each of the image blocks to be processed; if the image to be processed is a dark image taken in a low-light environment, determining the maximum value of all the brightness values in the plurality of image blocks to be processed, and determining the maximum value as a target brightness value; or if the image to be processed is a highlight image taken in a high-light environment, determining the minimum value of all the brightness values in the plurality of image blocks to be processed, and determining the minimum value as the target brightness value; performing gamma correction on the target brightness value to output a target image. The step of dividing the image to be processed into a plurality of image blocks to be processed comprises the following steps:
2. The image processing method of claim 1, wherein, dividing the image to be processed into a plurality of image blocks to be processed based on a preset size. The step of obtaining the brightness value of each pixel in each of the image blocks to be processed comprises the following steps:
3. The image processing method of claim 1, wherein, obtaining the channel value of each channel of each pixel in each of the image blocks to be processed as the brightness value. The method further comprises the following steps:
4. The image processing method of claim 1, wherein, obtaining an input image; and taking a gray-scale image generated by color space conversion of the input image as the image to be processed; counting the gray-scale value of each pixel in each of the image blocks to be processed to determine the target brightness value of each of the image blocks to be processed. The method further comprises the following steps: based on the number of bits of image processing, converting a preset gamma correction curve into a numerical range corresponding to the number of bits, so that the target brightness value has a corresponding mapping value in the gamma correction curve after conversion; 5. The image processing method of claim 1, wherein, The step of performing gamma correction on the target brightness value to output a target image comprises the following steps: obtaining the mapping value of the target brightness value in the gamma correction curve after conversion; outputting the target image according to the mapping value. The step of outputting the target image according to the mapping value comprises the following steps: generating an intermediate image according to the mapping value; 6. The image processing method of claim 5, wherein, in the case where the size of the target image is greater than the size of the intermediate image, performing interpolation processing on the intermediate image to generate the target image. The method comprises the following steps: a dividing module, configured to divide the image to be processed into a plurality of image blocks to be processed, the number of the image blocks to be processed being less than the number of pixels of the image to be processed; 7. An image processing apparatus characterized by comprising: a determining module, configured to obtain the brightness value of each pixel in each of the image blocks to be processed; if the image to be processed is a dark image taken in a low-light environment, determining the maximum value of all the brightness values in the plurality of image blocks to be processed, and determining the maximum value as a target brightness value; or if the image to be processed is a highlight image taken in a high-light environment, determining the minimum value of all the brightness values in the plurality of image blocks to be processed, and determining the minimum value as the target brightness value; a correction module, configured to perform gamma correction on the target brightness value to output a target image. The image processing chip is configured to perform the image processing method of any one of claims 1-6. The image processing chip comprises one or more processors, a memory, and 8. An image processing chip, characterized by 9. An electronic device, comprising: One or more programs, wherein one or more of the programs are stored in the memory and are executed by one or more of the processors, the programs including instructions for performing the image processing method of any one of claims 1-6.
10. A non-transitory computer readable storage medium containing a computer program which, when executed by a processor, causes the processor to perform the image processing method of any one of claims 1-6.
Citation Information
Patent Citations
Image processing apparatus and image processing method
US20070292045A1