CN111630839A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN111630839A
CN111630839A CN201880087278.3A CN201880087278A CN111630839A CN 111630839 A CN111630839 A CN 111630839A CN 201880087278 A CN201880087278 A CN 201880087278A CN 111630839 A CN111630839 A CN 111630839A
Authority
CN
China
Prior art keywords
luminance
determining
blocks
value
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201880087278.3A
Other languages
Chinese (zh)
Other versions
CN111630839B (en
Inventor
李居珉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN111630839A publication Critical patent/CN111630839A/en
Application granted granted Critical
Publication of CN111630839B publication Critical patent/CN111630839B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

The application provides an image processing method and device, relates to the field of image processing, and aims to improve the quality of a shot image. The method comprises the following steps: determining, based on a luminance of each of a plurality of blocks in a current frame image, that each block is located within one of a plurality of luminance ranges; determining a first luminance value from luminances of at least one block within a first luminance range having a highest luminance among the plurality of luminance ranges; determining a second luminance value from luminances of at least one block within a second luminance range having a lowest luminance among the plurality of luminance ranges; determining an exposure compensation amount according to the first brightness value and the second brightness value; and carrying out exposure compensation on the next frame of image by using the exposure compensation amount.

Description

Image processing method and device Technical Field
The present application relates to the field of image processing, and in particular, to an image processing method and apparatus.
Background
Auto Exposure (AE) is a method for adjusting image brightness of a camera, and the aim of adjusting the image brightness is achieved by controlling exposure time (exposure time), gain of sensitivity (ISO) and aperture (aperture), and a good AE algorithm can keep all bright and dark details in a shot scene as much as possible, so that the shot image or photo has proper brightness.
At present, when the brightness of an image is adjusted through an AE algorithm, parameters such as the proportion of bright and dark regions in the image, the peak value of the brightness, or the variance of the brightness value are generally counted by using a brightness histogram, whether a high contrast scene enters is judged according to the parameters, when the high contrast scene is determined to enter, exposure compensation is performed on the image, and the exposure amount is increased, so as to improve the overall brightness of the image, where the high contrast scene may mean that the difference between the brightness values of the high brightness region and the low brightness region in the image is large and exceeds the range that a camera can capture.
However, the luminance histogram only reflects the overall brightness of the image, and cannot determine the specific position of the bright and dark region, and the quality of the image or the picture is rather degraded after exposure compensation is performed on some images with high local brightness (for example, an image obtained by shooting a group of scattered point light sources in a scattered distribution, or an image obtained by shooting a light emitting state of lamp light in a low-illumination environment). In addition, the data of the luminance histogram is very sensitive, and a slight change in the angle of view during shooting generally affects the luminance distribution of the histogram, so that there is a certain error in adjusting the luminance of the image based on the above method, resulting in a poor effect of the final image.
Disclosure of Invention
The embodiment of the application provides an image processing method and device, which are used for improving the quality of an image.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, an image processing method is provided, which includes: determining that each block is located within one of a plurality of luminance ranges (e.g., three luminance ranges respectively representing high luminance, medium luminance, and low luminance) based on the luminance of each of a plurality of blocks (e.g., 8 × 8 blocks, 16 × 16 blocks, etc.) in the current frame image; determining a first luminance value from luminances of at least one block within a first luminance range having a highest luminance among a plurality of luminance ranges; determining a second luminance value from the luminance of at least one block within a second luminance range having the lowest luminance among the plurality of luminance ranges; determining an exposure compensation amount according to the first brightness value and the second brightness value; and carrying out exposure compensation on the next frame of image by using the exposure compensation amount.
In the technical scheme, the calculated exposure compensation amount of the next frame image is related to the position of the bright and dark area in the current frame image, so that when exposure compensation is performed on the next frame image by using the exposure compensation amount, the accuracy of the exposure compensation can be improved, the quality of the image is further improved, and the image shooting experience of a user is improved.
In a possible implementation manner of the first aspect, before determining that each block is located in one of a plurality of luminance ranges according to luminance of each block of a plurality of blocks of a current frame image, the method further includes: determining at least one brightness threshold value according to the brightness of each block in a plurality of blocks in the current frame image; a plurality of luminance ranges is determined based on at least one luminance threshold. In the above possible implementation, a simple and efficient way of determining a plurality of luminance ranges is provided.
In a possible implementation manner of the first aspect, determining a plurality of luminance threshold values according to luminance of each of a plurality of blocks in the current frame image includes: determining the average brightness value of a plurality of blocks according to the brightness of the blocks in the current frame image; a plurality of luminance threshold values are determined based on the average luminance values of the plurality of blocks. In the above possible implementation, a simple and efficient way of determining multiple luminance thresholds is provided.
In a possible implementation manner of the first aspect, before determining that each block is located in one of the plurality of luminance ranges according to luminance of each block in the plurality of blocks in the current frame image, the method further includes: determining the brightness of each block in the plurality of blocks, wherein each block comprises a plurality of sub-blocks, and the brightness of each block is obtained by the brightness of the plurality of sub-blocks. In the above possible implementation manner, the determined brightness of each block may embody continuity of brightness in the current frame image, thereby contributing to improving accuracy of subsequent exposure compensation.
In one possible implementation manner of the first aspect, determining that each block is located in one of a plurality of luminance ranges according to luminance of each block of the plurality of blocks in the current frame image includes: when the luminance of each block falls within the one luminance range, it is determined that each block is located within the one luminance range.
In another possible implementation manner of the first aspect, determining that each block is located in one of a plurality of luminance ranges according to luminance of each block of the plurality of blocks in the current frame image includes: when the brightness of each block falls within the brightness range, determining that each block is located within a preliminary brightness range; each block is downsampled to determine that each block is within the one luminance range. For example, the down-sampling includes: and calculating the mark of a macro block comprising a plurality of blocks according to the mark of the preliminary brightness range of each block, and determining that the plurality of blocks in the macro block are all positioned in the brightness range according to the mark of the macro block.
In a possible implementation manner of the first aspect, before determining the exposure compensation amount according to the first luminance value and the second luminance value, the method further includes: based on the first and second brightness values, an entry into a high contrast scene is determined to trigger an operation to determine an exposure compensation amount based on the first and second brightness values. In the above possible implementation, by determining whether to enter a high contrast scene and triggering a subsequent operation when it is determined that the high contrast scene is entered, it is possible to avoid performing an operation of exposure compensation without requiring exposure compensation, thereby improving the accuracy of exposure compensation.
In one possible implementation manner of the first aspect, determining that the current frame image is in the high contrast scene according to the first luminance value and the second luminance value includes: determining to enter a high contrast scene when a ratio of the first luminance value to the second luminance value is greater than or equal to a first value; alternatively, when the difference between the first luminance value and the second luminance value is greater than or equal to a second value, it is determined that a high contrast scene is entered. In the above possible implementation manner, two manners of determining entry into the high contrast scene are provided, and the determination of entry into the high contrast scene is more stable when the ratio of the first luminance value to the second luminance value is greater than or equal to the first value, and the determination of entry into the high contrast scene is simple when the difference between the first luminance value and the second luminance value is greater than or equal to the second value.
In a possible implementation manner of the first aspect, the first luminance value is an average luminance value of the at least one block in a first luminance range, and the second luminance value is an average luminance value of the at least one block in a second luminance range. Alternatively, the luminance average value of any at least one block may be an average value or a weighted average value of the luminances of the at least one block.
In a possible implementation manner of the first aspect, determining the exposure compensation amount according to the first luminance value and the second luminance value includes: and determining the exposure compensation amount according to the average brightness value of the blocks, the first brightness value, the second brightness value and the proportion of at least one block in the second brightness range to the blocks. In the above possible implementation, a way of determining the exposure compensation amount is provided.
In one possible implementation manner of the first aspect, the plurality of blocks are M × N blocks in the current frame image, and M and N are positive integers.
In a second aspect, there is provided an image processing apparatus comprising: a determining unit configured to determine, based on a luminance of each of a plurality of blocks in a current frame image, that each of the blocks is located in one of a plurality of luminance ranges; determining a first luminance value from luminances of at least one block within a first luminance range having a highest luminance among a plurality of luminance ranges; determining a second luminance value from the luminance of at least one block within a second luminance range having the lowest luminance among the plurality of luminance ranges; determining an exposure compensation amount according to the first brightness value and the second brightness value; and the compensation unit is used for carrying out exposure compensation on the next frame image by using the exposure compensation amount.
In a possible implementation manner of the second aspect, the determining unit is further configured to: determining at least one brightness threshold value according to the brightness of each block in a plurality of blocks in the current frame image; a plurality of luminance ranges is determined based on at least one luminance threshold.
In a possible implementation manner of the second aspect, the determining unit is further configured to: determining the average brightness value of a plurality of blocks according to the brightness of the blocks in the current frame image; a plurality of luminance threshold values are determined based on the average luminance values of the plurality of blocks.
In a possible implementation manner of the second aspect, the determining unit is further configured to: determining the brightness of each block in the plurality of blocks, wherein each block comprises a plurality of sub-blocks, and the brightness of each block is obtained by the brightness of the plurality of sub-blocks.
In a possible implementation manner of the second aspect, in determining that each block is located in one of a plurality of luminance ranges according to luminance of each block in a plurality of blocks in the current frame image, the determining unit is specifically configured to: when the luminance of each block falls within the one luminance range, it is determined that each block is located within the one luminance range.
In another possible implementation manner of the second aspect, in determining that each block is located in one of a plurality of luminance ranges according to luminance of each block in a plurality of blocks in the current frame image, the determining unit is specifically configured to: when the brightness of each block falls within the brightness range, determining that each block is located within a preliminary brightness range; each block is downsampled to determine that each block is within the one luminance range. For example, the down-sampling includes: and calculating the mark of a macro block comprising a plurality of blocks according to the mark of the preliminary brightness range of each block, and determining that the plurality of blocks in the macro block are all positioned in the brightness range according to the mark of the macro block.
In a possible implementation manner of the second aspect, the determining unit is further configured to: based on the first and second brightness values, an entry into a high contrast scene is determined to trigger an operation to determine an exposure compensation amount based on the first and second brightness values.
In a possible implementation manner of the second aspect, the determining unit is further configured to: determining to enter a high contrast scene when a ratio of the first luminance value to the second luminance value is greater than or equal to a first value; alternatively, when the difference between the first luminance value and the second luminance value is greater than or equal to a second value, it is determined that a high contrast scene is entered.
In one possible implementation manner of the second aspect, the first luminance value is an average luminance value of at least one block in a first luminance range, and the second luminance value is an average luminance value of at least one block in a second luminance range.
In a possible implementation manner of the second aspect, the determining unit is further configured to: and determining the exposure compensation amount according to the average brightness value of the blocks, the first brightness value, the second brightness value and the proportion of at least one block in the second brightness range to the blocks.
In one possible implementation manner of the second aspect, the plurality of blocks are M × N blocks in the current frame image, and M and N are positive integers.
In a third aspect, there is provided an image processing apparatus comprising: a processor and an interface; wherein, the processor is configured to read the software program in the memory through the interface and process the following operations under the driving of the software program: determining, based on a luminance of each of a plurality of blocks in a current frame image, that each block is located within one of a plurality of luminance ranges; determining a first luminance value from luminances of at least one block within a first luminance range having a highest luminance among a plurality of luminance ranges; determining a second luminance value from the luminance of at least one block within a second luminance range having the lowest luminance among the plurality of luminance ranges; determining an exposure compensation amount according to the first brightness value and the second brightness value; and carrying out exposure compensation on the next frame of image by using the exposure compensation amount.
In one possible implementation manner of the third aspect, the processor further performs the following operations: determining at least one brightness threshold value according to the brightness of each block in a plurality of blocks in the current frame image; a plurality of luminance ranges is determined based on at least one luminance threshold.
In one possible implementation manner of the third aspect, the processor further performs the following operations: determining the average brightness value of a plurality of blocks according to the brightness of the blocks in the current frame image; a plurality of luminance threshold values are determined based on the average luminance values of the plurality of blocks.
In one possible implementation manner of the third aspect, the processor further performs the following operations: determining the brightness of each block in the plurality of blocks, wherein each block comprises a plurality of sub-blocks, and the brightness of each block is obtained by the brightness of the plurality of sub-blocks.
In one possible implementation manner of the third aspect, the processor further performs the following operations: based on the first and second brightness values, an entry into a high contrast scene is determined to trigger an operation to determine an exposure compensation amount based on the first and second brightness values.
In a possible implementation manner of the third aspect, when determining that each block is located in one of the luminance ranges according to the luminance of each block in the plurality of blocks in the current frame image, the processor specifically performs the following operations: when the luminance of each block falls within the one luminance range, it is determined that each block is located within the one luminance range.
In another possible implementation manner of the third aspect, when determining that each block is located in one of the luminance ranges according to the luminance of each block in the plurality of blocks in the current frame image, the processor specifically performs the following operations: when the brightness of each block falls within the brightness range, determining that each block is located within a preliminary brightness range; each block is downsampled to determine that each block is within the one luminance range. For example, the down-sampling includes: and calculating the mark of a macro block comprising a plurality of blocks according to the mark of the preliminary brightness range of each block, and determining that the plurality of blocks in the macro block are all positioned in the brightness range according to the mark of the macro block.
In one possible implementation manner of the third aspect, the processor further performs the following operations: determining to enter a high contrast scene when a ratio of the first luminance value to the second luminance value is greater than or equal to a first value; alternatively, when the difference between the first luminance value and the second luminance value is greater than or equal to a second value, it is determined that a high contrast scene is entered.
In a possible implementation manner of the third aspect, the first luminance value is an average luminance value of at least one block in the first luminance range, and the second luminance value is an average luminance value of at least one block in the second luminance range.
In one possible implementation manner of the third aspect, the processor further performs the following operations: and determining the exposure compensation amount according to the average brightness value of the blocks, the first brightness value, the second brightness value and the proportion of at least one block in the second brightness range to the blocks.
In one possible implementation manner of the third aspect, the plurality of blocks are M × N blocks in the current frame image, and M and N are positive integers.
In a fourth aspect, a chip system is provided, where the chip system includes a processor and a memory, the memory stores codes and data, and the processor executes the codes in the memory to make the chip system execute the image processing method provided in the first aspect or any possible implementation manner of the first aspect.
In a fifth aspect, a readable storage medium is provided, which has stored therein instructions, which when run on a device (such as a computer or a processor) cause the device to execute the image processing method provided by the first aspect or any possible implementation manner of the first aspect.
A sixth aspect provides a computer program product which, when run on a computer or processor, causes the computer or processor to perform the image processing method provided by the first aspect or any possible implementation manner of the first aspect.
It is understood that the apparatus, the computer storage medium, or the computer program product of any of the image processing methods provided above is used for executing the corresponding method provided above, and therefore, the beneficial effects achieved by the apparatus, the computer storage medium, or the computer program product may refer to the beneficial effects of the corresponding method provided above, and are not described herein again.
Drawings
Fig. 1 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application;
fig. 2 is a schematic flowchart of an image processing method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a plurality of blocks in a current frame image according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating the luminance of a plurality of blocks in a current frame image according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of luminances of a plurality of blocks in a current frame image according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
Detailed Description
In the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. In addition, in the embodiments of the present application, the words "first", "second", and the like do not limit the number and the execution order.
Fig. 1 is a schematic structural diagram of an image processing device according to an embodiment of the present disclosure, where the image processing device may be a mobile phone, a tablet computer, a video camera, a computer, a wearable device, an in-vehicle device, or a portable device. For convenience of description, the above-mentioned apparatuses or the above-mentioned apparatuses with a built-in chip system are collectively referred to as an image processing apparatus in the present application. In the embodiment of the present application, the image processing apparatus is taken as a mobile phone as an example for explanation, and the mobile phone or a chip system built in the mobile phone includes: memory 101, processor 102, sensor component 103, multimedia component 104, and input/output interface 105.
The following describes each component of the mobile phone or the chip system built in the mobile phone in detail with reference to fig. 1:
memory 101 may be used to store data, software programs, and modules; the system mainly comprises a program storage area and a data storage area, wherein the program storage area can store software programs including instructions formed by codes, including but not limited to an operating system, application programs required by at least one function, such as a sound playing function, an image playing function and the like; the storage data area may store data created according to the use of the cellular phone, such as audio data, image data, a phonebook, and the like. In the embodiment of the present application, the memory 101 may be configured to store a plurality of frame images, such as a current frame image, and further include a brightness of each block in the current frame image, a first brightness value, a second brightness value, an exposure compensation amount, a next frame image, and the like. In some possible embodiments, there may be one memory or multiple memories; the memory may be a floppy disk, a hard disk such as a built-in hard disk and a removable hard disk, a magnetic disk, an optical disk, a magneto-optical disk such as a CD ROM, a DCD ROM, a non-volatile memory device such as a RAM, a ROM, a PROM, an EPROM, an EEPROM, a flash memory, or any other form of storage medium known in the art.
The processor 102 is a control center of the mobile phone, connects various parts of the entire apparatus by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or software modules stored in the memory 101 and calling data stored in the memory 101, thereby performing overall monitoring of the mobile phone. In the embodiment of the present application, the processor 102 may be configured to perform one or more steps of the method embodiment of the present application, for example, the processor 102 may be configured to perform one or more steps of S200a, S200b, S203a, and S201 to S204 in the method embodiment described below. In some possible embodiments, the processor 102 may be a single processor structure, a multi-processor structure, a single threaded processor, a multi-threaded processor, or the like; in some possible embodiments, the processor 102 may include a central processing unit, a general purpose processor, a digital signal processor, a microcontroller or microprocessor, or the like. In addition, the processor 102 may further include other hardware circuits or accelerators, such as application specific integrated circuits, field programmable gate arrays or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 102 may also be a combination that performs a computing function, such as a combination comprising one or more microprocessors, a digital signal processor and a microprocessor, or the like.
The sensor component 103 includes one or more sensors for providing various aspects of state assessment for the handset. The sensor assembly 103 may include, among other things, a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications, i.e., as an integral part of a camera or a video camera. In the embodiment of the present application, the sensor component 103 can be used to support a camera in the multimedia component 104 to acquire a current frame image and a next frame image, and the like. In addition, the sensor assembly 103 may further include an acceleration sensor, a gyro sensor, a magnetic sensor, a pressure sensor or a temperature sensor, and acceleration/deceleration, orientation, on/off state of the cellular phone, relative positioning of the components, or temperature change of the cellular phone, etc. may be detected by the sensor assembly 103.
The multimedia component 104 provides a screen of an output interface between the handset and the user, which may be a touch panel, and when the screen is a touch panel, the screen may be implemented as a touch screen to receive an input signal from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In addition, the multimedia component 104 may further include at least one camera, for example, the multimedia component 104 may include a front camera and/or a rear camera. When the handset is in an operational mode, such as a capture mode or a video mode, the front-facing camera and/or the rear-facing camera may sense external multimedia signals that are used to form image frames. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability. In the embodiment of the present application, a camera in the multimedia component 104 may be used to support acquiring a current frame image and a next frame image, and the like.
Input/output interface 105 provides an interface between processor 102 and peripheral interface modules, which may include, for example, a keyboard, mouse, or USB (universal serial bus) device. In the embodiment of the application, the input interface can be used for acquiring a current frame image, a next frame image and the like; the output interface can be used for outputting the exposure compensation amount, the next frame image after the exposure compensation and the like. In one possible implementation, the input/output interface 105 may have only one input/output interface or a plurality of input/output interfaces.
Although not shown, the mobile phone may further include an audio component, a communication component, and the like, for example, the audio component includes a microphone, and the communication component includes a Wireless Fidelity (WiFi) module, a bluetooth module, and the like, which is not described herein again. Those skilled in the art will appreciate that the handset configuration shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
Fig. 2 is a schematic flowchart of an image processing method according to an embodiment of the present application, where the method is applicable to the image processing apparatus shown in fig. 1, and specifically can be executed by the processor 102, and referring to fig. 2, the method includes the following steps.
S201: it is determined that each block is located within one of a plurality of luminance ranges based on the luminance of each block of a plurality of blocks in the current frame image. The current frame image may include a plurality of blocks (blocks), and each block may include a plurality of pixel points. Optionally, the current frame image includes M × N blocks, where M and N are both positive integers, that is, the current frame image is divided into M × N blocks, where M and N may be equal to or different from each other, for example, the current frame image may include 8 × 8 blocks, 16 × 16 blocks, 32 × 16 blocks, or 32 × 32 blocks, and the like, which is not specifically limited in this embodiment of the present application.
In addition, each of the plurality of blocks may include a plurality of pixel points, or a plurality of sub-blocks (each sub-block including a plurality of pixel points). Taking an example that each block includes a plurality of pixel points, the luminance of each block may be obtained from the luminance of the plurality of pixel points included in each block, the luminance of one block may be a luminance average of the plurality of pixel points included in the block, and the luminance average may be a ratio of a sum of the luminances of the plurality of pixel points to the number of the plurality of pixel points, or a ratio of a sum of weighted luminances of the plurality of pixel points to a sum of weights of the plurality of pixel points, or a luminance average calculated by other methods, and the like. For example, assuming that each block includes x pixels, and the luminances of the x pixels are a1, a2, … …, and ax in sequence, the average luminance value of the block may be (a1+ a2+ … + ax)/x. When determining the luminance average value by weighting the luminance, assuming that the weighted values corresponding to the x pixel points are b1, b2, … …, and bx in this order, the luminance average value of the block may be (a1 × b1+ a2 × b2+ … + ax × bx)/(b1+ b2+ … + bx).
Further, the plurality of luminance ranges may include at least two luminance ranges, that is, the plurality of luminance ranges may include two or more luminance ranges. For example, the plurality of luminance ranges may include three luminance ranges, which may be sequentially represented as [0, 80], [80, 160], and [160, 255] assuming that the luminance may have 256 levels. The above numerical values are only for example and are not intended to limit the implementation of the scheme.
Specifically, for each of a plurality of blocks in the current frame image, the image processing apparatus may compare the luminance of the block with each of the plurality of luminance ranges, and may determine that the luminance of the block belongs to the luminance range when the luminance of the block is greater than or equal to a minimum value of a luminance range of the plurality of luminance ranges and less than or equal to a maximum value of the luminance range.
For example, assuming that the luminance of a certain block in the plurality of blocks is 70, since 70 is greater than the minimum value 0 and greater than the maximum value 80 in the luminance range [0, 80), it is determined that the luminance of the block falls within the luminance range [0, 80), i.e., falls within the low luminance range; if the luminance of another block is 160, since 160 is equal to 160 in the luminance range [160, 255], it can be determined that the luminance 160 of the block falls within the luminance range [160, 255 ].
S202: a first luminance value is determined from the luminance of at least one block in a first luminance range, and a second luminance value is determined from the luminance of at least one block in a second luminance range, wherein the first luminance range is assumed to have the highest luminance in the plurality of luminance ranges, i.e., a high luminance range, and the second luminance range has the lowest luminance in the plurality of luminance ranges, i.e., a low luminance range.
Wherein the plurality of luminance ranges have different luminances, respectively. For example, of the three luminance ranges [0, 80], [80, 160] and [160, 255], the first luminance range may be [160, 255] and the second luminance range may be [0, 80 ].
The first luminance value may be used to represent the overall luminance of at least one block in a first luminance range, and the second luminance value may be used to represent the overall luminance of at least one block in a second luminance range. Optionally, the first luminance value is an average luminance value of at least one block in the first luminance range, and the second luminance value is an average luminance value of at least one block in the second luminance range.
It should be noted that the first luminance value may be a ratio of a sum of luminances of at least one block in the first luminance range to the number of the at least one block, or a ratio of a sum of weighted luminances of the at least one block to a sum of weights of the at least one block, or an average luminance value calculated by other methods, and the like. The second luminance value may be a ratio of a sum of luminances of at least one block in the second luminance range to the number of the at least one block, or a ratio of a sum of weighted luminances of the at least one block to a sum of weights of the at least one block, or an average of luminances calculated by other methods, etc. The specific process of determining the first luminance value and the second luminance value is similar to the specific process of determining the luminance of each block according to the luminance of the plurality of pixel points in step S201, which is specifically referred to the above description, and the embodiment of the present application is not described herein again.
S203: and determining an exposure compensation amount according to the first brightness value and the second brightness value. The exposure compensation amount is used to adjust an exposure amount, which may be obtained by the camera according to an Auto Exposure (AE) algorithm, that is, an exposure amount calculated by the camera through automatic photometry during image capturing.
Optionally, the determining, by the image processing apparatus, an exposure compensation amount according to the first luminance value and the second luminance value includes: and determining the exposure compensation amount according to the average brightness value of the plurality of blocks in the current frame image, the first brightness value, the second brightness value and the proportion of at least one block in the second brightness range to the plurality of blocks.
The average luminance value of the blocks may be a ratio of a sum of luminances of the blocks to the number of the blocks, a ratio of a sum of weighted luminances of the blocks to a sum of weights of the blocks, or an average luminance value calculated by other methods. It should be noted that the specific process of determining the average luminance values of the multiple blocks is similar to the specific process of determining the luminance of each block according to the luminance of the multiple pixels in step S201, which is specifically referred to the above description, and the embodiment of the present application is not described herein again.
The ratio of the at least one block in the second luminance range to the plurality of blocks may be used to indicate the ratio of the luminance area represented by the second luminance range in the current frame image, for example, if the number of the plurality of blocks is 64, and the number of the at least one block in the second luminance range is 8, the ratio is 8/64-1/8.
Specifically, if the average luminance value of the plurality of blocks is represented as W, the first luminance value is represented as H, the second luminance value is represented as D, the ratio of at least one block in the second luminance range to the plurality of blocks is represented as α, and the desired luminance value is represented as L, the exposure compensation amount may be a ratio of the average luminance value W of the plurality of blocks to the desired luminance value L, and if the exposure compensation amount is represented as C, the image processing apparatus may determine the exposure compensation amount C according to the following equations (1) and (2).
Figure PCTCN2018097292-APPB-000001
Figure PCTCN2018097292-APPB-000002
In the formula, HthdDenotes an inhibitor, HthdIs constant and can be set according to the actual situation, when the set suppression factor HthdWhen the value of (A) is large, the brightness of the obtained image is high, and when the set suppression factor H is largethdWhen the value of (d) is small, the brightness of the obtained image is low. HthdMay be obtained by testing or following experience of a person skilled in the art.
Further, before S203, the method may further include: s203 a.
S203 a: from the first and second luminance values, it is determined whether a high contrast scene is entered to trigger the operation of S203. A high contrast scene may refer to an image in which the difference in luminance values between the region with the highest luminance and the region with the lowest luminance is large, beyond what the camera can capture. Of course, the present embodiment may also automatically proceed to S203 after executing S202 without executing S203 a.
That is, the image processing apparatus determines whether to enter the high contrast scene based on the first luminance value and the second luminance value after determining the first luminance value and the second luminance value by S202. Step S203 may be triggered to determine the exposure compensation amount when it is determined that the high contrast scene is entered, step S203 may not be triggered when it is determined that the high contrast scene is not entered, and execution of the present embodiment may be terminated.
Specifically, the image processing apparatus may determine whether to enter the high contrast scene from the first luminance value and the second luminance value by: when the ratio of the first brightness value to the second brightness value is greater than or equal to a preset first value, determining to enter a high-contrast scene; or, when the difference value between the first brightness value and the second brightness value is larger than or equal to a preset second value, determining to enter the high-contrast scene. Otherwise, a high contrast scene is not entered.
It should be noted that the preset first numerical value and the preset second numerical value may be set in advance by a person skilled in the art, and the specific numerical value may be set according to an actual situation, which is not specifically limited in this embodiment of the application. In addition, the manner of determining the high contrast scene according to the first brightness value and the second brightness value is only exemplary, and the high contrast scene may also be determined by other manners, which is also not specifically limited by the embodiment of the present application.
S204: and carrying out exposure compensation on the next frame of image by using the exposure compensation amount. The next frame image is a frame image after the current frame image, and the current frame image and the next frame image may be images obtained by shooting the same scene, so that the image processing device may perform exposure compensation on the next frame image by using the exposure compensation amount.
Specifically, the image processing apparatus may perform exposure processing on the next frame image according to the sum of the exposure compensation amount and the exposure amount (i.e., the exposure amount obtained by the AE algorithm). For example, the image processing apparatus determines the exposure time and the gain of the sensitivity based on the sum of the exposure compensation amount and the exposure amount, and exposes the next frame image according to the determined exposure time and the gain of the sensitivity to realize exposure compensation for the next frame image. The exposure compensation is carried out on the next frame of image by utilizing the exposure compensation amount, so that the brightness of the next frame of image can be improved, the details of the area with low brightness in the image are improved, and the photographing experience of a user is improved.
Further, referring to fig. 2, before step S201, the method further includes: s200 b.
S200 b: the image processing apparatus determines a plurality of luminance ranges. Optionally, the image processing apparatus determines at least one luminance threshold value according to the luminance of each of the plurality of blocks in the current frame image, and determines the plurality of luminance ranges according to the at least one luminance threshold value.
The at least one brightness threshold may comprise one or more brightness thresholds. The image processing apparatus determining at least one luminance threshold value from the luminance of each of the plurality of blocks may include: determining the average brightness values of a plurality of blocks according to the brightness of the plurality of blocks in the current frame image; at least one luminance threshold is determined based on the average luminance values of the plurality of blocks.
The average luminance value of the blocks may be a ratio of a sum of luminances of the blocks to the number of the blocks, a ratio of a sum of weighted luminances of the blocks to a sum of weights of the blocks, or an average luminance value calculated by other methods. It should be noted that the specific process of determining the average luminance values of the multiple blocks is similar to the specific process of determining the luminance of each block according to the luminance of the multiple pixels in step S201, which is specifically referred to the above description, and the embodiment of the present application is not described herein again.
In addition, the image processing device may determine at least one brightness threshold according to the average brightness value of the plurality of blocks, and specifically may include: at least one luminance threshold is determined based on the average luminance values of the plurality of blocks and a preset value. For example, if the average luminance value of the plurality of blocks is W and the preset value is Q, the image processing apparatus may determine the product of W and Q and the quotient of W and Q as the two luminance threshold values.
It should be noted that the preset value may be set in advance, for example, the preset value Q may be set to 4, the above method for determining the brightness threshold according to the product of W and Q and the quotient of W and Q is only exemplary and not limited to the embodiment of the present application, and the image processing apparatus may also determine the at least one brightness threshold in other manners.
After determining the at least one brightness threshold, the image processing apparatus divides the specified brightness length into a plurality of brightness ranges according to the at least one brightness threshold. For example, if the specified brightness length is [0, 255], and the at least one brightness threshold includes two brightness thresholds, respectively 80 and 160, the image processing apparatus may divide the specified brightness length [0, 255] into three brightness ranges, respectively [0, 80], [80, 160) and [160, 255], according to the brightness thresholds 80 and 160, and the three brightness ranges may be used to represent a low-brightness region, a medium-brightness region and a high-brightness region in the current frame image. The number of luminance ranges is determined by the number of luminance thresholds. For example, one brightness threshold divides a given brightness length into two brightness ranges, and so on. The present embodiment is described by taking two luminance thresholds and three luminance ranges as an example, but is not limited thereto. In practical application, how many brightness ranges are set can be flexibly selected, and only two or more brightness ranges can be set.
The specified brightness length may be set in advance, for example, the specified brightness length may be [0, 255] or [0, 160], and the like, and this is not particularly limited in the embodiment of the present application.
Further, referring to fig. 2, before step S201, the method further includes: s200 a.
S200 a: determining the brightness of each block in the plurality of blocks, wherein each block comprises a plurality of sub-blocks, and the brightness of each block is obtained by the brightness of the plurality of sub-blocks.
Specifically, determining the luminance of each block of the plurality of blocks may include: the image processing apparatus divides the current frame image into a plurality of sub-blocks, for example, divides the current frame image into 16 × 16 sub-blocks, 32 × 16 sub-blocks, or 32 × 32 sub-blocks, etc.; the plurality of sub-blocks obtained by division may be downsampled to obtain a plurality of blocks in the current frame image, for example, when downsampling is performed, four adjacent sub-blocks are determined to be one block, and then downsampling 16 × 16 sub-blocks is an 8 × 8 block. Then, the luminance of each block is determined according to the luminances of the plurality of sub-blocks included in each block. Therefore, the present scheme performs downsampling directly in 200a, and then determines the luminance of the block formed after downsampling according to the luminance of a plurality of sub-blocks. In an alternative embodiment, the determined luminance of a block may be an average luminance value of a plurality of sub-blocks included in the block. Alternatively, the luminance of one block may be a ratio of the sum of luminances of the sub-blocks to the number of the sub-blocks, or a ratio of the sum of weighted luminances of the sub-blocks to the sum of weights of the sub-blocks, or an average luminance value of the sub-blocks calculated by another method. It should be noted that the specific process of determining the luminance of one block is similar to the specific process of determining the luminance of each block according to the luminances of multiple pixel points in step S201, and for specific reference, the above description is specifically referred to, and no further description is given in this embodiment of the present application.
In addition, when the plurality of sub-blocks obtained by division are downsampled to obtain the plurality of blocks in the current frame image, the image processing device may perform downsampling on the plurality of sub-blocks obtained by division once to obtain the plurality of blocks in the current frame image, or may perform downsampling on the plurality of sub-blocks obtained by division multiple times to obtain the plurality of blocks in the current frame image, where the specific downsampling times are not specifically limited in this embodiment of the application. For example, if the current frame image is divided into 32 × 32 sub-blocks by performing downsampling so that four adjacent sub-blocks are determined to be one block, the 32 × 32 sub-blocks are downsampled once to obtain 16 × 16 blocks, and the 16 × 16 blocks are downsampled once again to obtain 8 × 8 blocks.
In an alternative implementation, the downsampling may be performed not only in 200a but in S201. For example, after determining the luminance range of each block in S201 of the embodiment according to fig. 2, the non-smoothness may be eliminated by down-sampling, each macro block after down-sampling may include a plurality of blocks, and the luminance range in which the plurality of blocks in each macro block are located is further determined in S201. That is, the macroblock after down-sampling is taken as a whole, and the blocks inside it are determined to belong to the luminance range in a unified manner, instead of determining the luminance range of each block individually. Here, taking the case where the plurality of luminance ranges includes three luminance ranges (e.g., high luminance, medium luminance, and low luminance) as an example, it is assumed that the current frame image is divided into 16 × 16 blocks as shown in fig. 3. First, a preliminary luminance range of each block is confirmed in S201, as previously described in the embodiment corresponding to fig. 2. For the convenience of observation, it is possible to mark which brightness range of the three brightness ranges the brightness of each block belongs to, and assuming that the corresponding marks are 0/1/2, the marked image may be as shown in fig. 4, where white in fig. 4 represents highlight, i.e. mark 0, gray in fig. 4 represents medium light, i.e. mark 1, and black in fig. 2. Secondly, further down-sampling is performed to finally determine the luminance range of each block. At the time of down-sampling, assuming that each 4 blocks becomes one macroblock, the 16 × 16 blocks become 8 × 8 macroblocks, and when determining which luminance range of the three luminance ranges each macroblock belongs to, the luminance range to which the macroblock as a whole belongs may be determined from the sum of the flags corresponding to the plurality of blocks included in each macroblock, which is regarded as the flag of the macroblock. For example, taking an example that each macroblock includes 4 blocks, if the sum of the labels corresponding to the 4 blocks is less than or equal to 2, it is determined that the macroblock belongs to a highlight; if the sum of the marks corresponding to the 4 blocks is more than 2 and less than 4, determining that the macro block belongs to the middle brightness; if the sum of the flags corresponding to the 4 blocks is greater than or equal to 4, it is determined that the macroblock belongs to low luminance. For example, determining the luminance range to which each block in any macroblock belongs from 16 × 16 blocks is shown in fig. 5. By downsampling, the luminance range division of individual blocks within the image of one frame becomes more regular and reliable. Comparing fig. 4 and 5, the shape of one or more blocks in the three luminance ranges in the image is smoother, i.e., the boundaries of the three luminance ranges become more natural. The plurality of blocks within each macroblock are determined as a whole to which luminance ranges they belong, thereby finally determining which blocks are included in each of the three luminance ranges, and then further performing S202, the method being further described with particular reference to the previous embodiment.
The image processing method provided by the embodiment of the present application is mainly described from the perspective of an image processing apparatus. It is to be understood that the image processing apparatus includes hardware structures and/or software modules corresponding to the respective functions for realizing the above-described functions. Those of skill in the art will readily appreciate that the present application is capable of hardware or a combination of hardware and computer software implementing the various illustrative structures and algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The image processing apparatus according to the embodiment of the present application may divide the functional modules according to the method, for example, each functional module may be divided according to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
Fig. 6 shows a schematic diagram of a possible structure of the image processing apparatus according to the above embodiment, in the case of dividing each functional module by corresponding functions. The image processing apparatus includes: a determination unit 301 and a compensation unit 302. Wherein the determination unit 301 is to enable the apparatus to perform one or more of steps S200a, S200b, S203a, S201 to S203 in a method embodiment, and/or other processes for the techniques described herein; the compensation unit 302 is used to support the apparatus to execute S204 in the method embodiment. Specifically, referring to fig. 1, in an implementation scheme, when the determining unit 301 and the compensating unit 302 are implemented in software, that is, software programs corresponding to the determining unit 301 and the compensating unit 302 are included in the memory 101, the processor 102 executes the software programs including the determining unit 301 and the compensating unit 302 in the memory 101 to implement functions corresponding to the determining unit 301 and the compensating unit 302. In another implementation, when the determining unit 301 and the compensating unit 302 are implemented in hardware, the determining unit 301 and the compensating unit 302 may be hardware circuits or accelerators included in the processor 102 or directly used to replace the processor 102, and each of the determining unit 301 and the compensating unit 302 may be implemented by hardware circuits or accelerators and may include at least one of electronic circuits, digital circuits, logic circuits, or analog circuits. In addition, the compensation unit 302 or the processor 102 implemented in software or hardware may control the exposure of the light sensor or the light compensation element through an electrical signal to implement the exposure compensation at the electronic level, and finally the exposure compensation at the optical level is performed by the light sensor or the light compensation element.
An image processing apparatus in the present embodiment is described above from the perspective of a modular functional entity, and is described below from the perspective of hardware processing.
The embodiment of the present application further provides an image processing apparatus, and the structure of the image processing apparatus may be as shown in fig. 1. In the embodiment of the present application, the processor 102 is configured to process the functions of the parts S200a, S200b, S203a, S201 to S203 of the above-mentioned image processing method, for example, the processor 102 is configured to determine the luminance of each of the plurality of blocks, determine a plurality of luminance ranges, determine that each of the blocks is located in one of the plurality of luminance ranges according to the luminance of each of the plurality of blocks, determine a first luminance value according to the luminance of at least one of the blocks in the first luminance range, determine a second luminance value according to the luminance of at least one of the blocks in the second luminance range, and determine the exposure compensation amount according to the first luminance value and the second luminance value, and the like.
In some possible embodiments, the above information output by the input/output interface 105 may be sent to the memory 101 for storage, or may be sent to another processing flow for further processing, or the output current frame image and next frame image are sent to a display device for display, and sent to a player terminal for playing, etc.
The memory 101: the memory can store the current frame image, the brightness of each block in the current frame image, the first brightness value, the second brightness value, the exposure compensation amount, the next frame image, relevant instructions for configuring the processor, and the like.
The sensor module 103 may include a light compensation element, for example, the light compensation element is a photo sensor, and the processor 102 may control the exposure time and the sensitivity gain of the photo sensor, so that the processor 102 may adjust the exposure time and the sensitivity gain of the photo sensor according to the exposure compensation amount to perform the exposure compensation function for the next frame image by using the exposure compensation amount.
The components of the image processing apparatus provided in the embodiment of the present application are respectively used to implement the functions of the corresponding steps of the image processing method, and since the steps have been described in detail in the embodiment of the image processing method, no further description is given here.
The embodiment of the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a device (for example, the device may be a single chip, a computer, a processor, or the like), the device is caused to perform one or more steps of S200a, S200b, S203a, S201-S204 of the above-mentioned image processing method. The respective constituent modules of the image processing apparatus described above may be stored in the computer-readable storage medium if they are implemented in the form of software functional units and sold or used as independent products.
Based on such understanding, the embodiments of the present application also provide a computer program product containing instructions, where a part of or all or part of the technical solution that substantially contributes to the prior art may be embodied in the form of a software product stored in a storage medium, and the computer program product contains instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor therein to execute all or part of the steps of the method described in the embodiments of the present application.
In the embodiment of the application, a first brightness value is determined by the brightness of at least one block in a first brightness range with the highest brightness, and a second brightness value is determined by the brightness of at least one block in a second brightness range with the lowest brightness, so that an exposure compensation amount is determined according to the first brightness value and the second brightness value, and therefore the exposure compensation amount is related to the position of a bright and dark area in a current frame image, and when exposure compensation is performed on a next frame image by using the exposure compensation amount, the accuracy of exposure compensation can be improved, and the quality of the image is improved, so that the experience of a user for shooting the image is improved.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (27)

  1. An image processing method, characterized in that the method comprises:
    determining, based on a luminance of each of a plurality of blocks in a current frame image, that each block is located within one of a plurality of luminance ranges;
    determining a first luminance value from luminances of at least one block within a first luminance range having a highest luminance among the plurality of luminance ranges;
    determining a second luminance value from luminances of at least one block within a second luminance range having a lowest luminance among the plurality of luminance ranges;
    determining an exposure compensation amount according to the first brightness value and the second brightness value;
    and carrying out exposure compensation on the next frame of image by using the exposure compensation amount.
  2. The method of claim 1, wherein the determining, based on the luminance of each of the plurality of blocks of the current frame image, that each block is located in one of a plurality of luminance ranges is preceded by:
    determining at least one brightness threshold according to the brightness of each block in a plurality of blocks in the current frame image;
    determining the plurality of luminance ranges according to the at least one luminance threshold.
  3. The method of claim 2, wherein determining a plurality of luminance thresholds based on the luminance of each of a plurality of blocks in the current frame image comprises:
    determining the average brightness value of a plurality of blocks according to the brightness of the blocks in the current frame image;
    determining a plurality of brightness threshold values according to the average brightness values of the plurality of blocks.
  4. The image processing method according to any one of claims 1 to 3, wherein before determining that each block is located in one of a plurality of luminance ranges based on the luminance of each of a plurality of blocks in the current frame image, the method further comprises:
    determining a luminance of each of the plurality of blocks, wherein each block includes a plurality of sub-blocks, and the luminance of each block is derived from the luminances of the plurality of sub-blocks.
  5. The image processing method according to any one of claims 1 to 4, wherein before determining the exposure compensation amount based on the first luminance value and the second luminance value, the method further comprises:
    and determining to enter a high contrast scene according to the first brightness value and the second brightness value so as to trigger the operation of determining the exposure compensation amount according to the first brightness value and the second brightness value.
  6. The method of claim 5, wherein said determining that said current frame image is in a high contrast scene based on said first and second luminance values comprises:
    determining to enter the high contrast scene when a ratio of the first luminance value to the second luminance value is greater than or equal to a first value; or,
    determining to enter the high contrast scene when a difference between the first luminance value and the second luminance value is greater than or equal to a second value.
  7. The image processing method according to any one of claims 1 to 6, wherein the first luminance value is an average luminance value of the at least one block in the first luminance range, and the second luminance value is an average luminance value of the at least one block in the second luminance range.
  8. The image processing method according to any one of claims 1 to 7, wherein said determining an exposure compensation amount based on the first luminance value and the second luminance value comprises:
    determining the exposure compensation amount according to the average luminance value of the plurality of blocks, the first luminance value, the second luminance value, and the ratio of the at least one block to the plurality of blocks in the second luminance range.
  9. The image processing method according to any one of claims 1 to 8, wherein the plurality of blocks are M x N blocks in the current frame image, and M and N are positive integers.
  10. An image processing apparatus, characterized in that the apparatus comprises:
    a determining unit configured to determine, based on a luminance of each of a plurality of blocks in a current frame image, that each of the blocks is located in one of a plurality of luminance ranges;
    determining a first luminance value from luminances of at least one block within a first luminance range having a highest luminance among the plurality of luminance ranges;
    determining a second luminance value from luminances of at least one block within a second luminance range having a lowest luminance among the plurality of luminance ranges;
    determining an exposure compensation amount according to the first brightness value and the second brightness value;
    and the compensation unit is used for carrying out exposure compensation on the next frame image by utilizing the exposure compensation amount.
  11. The image processing apparatus according to claim 10, wherein the determination unit is further configured to:
    determining at least one brightness threshold according to the brightness of each block in a plurality of blocks in the current frame image;
    determining the plurality of luminance ranges according to the at least one luminance threshold.
  12. The image processing apparatus according to claim 11, wherein the determination unit is further configured to:
    determining the average brightness value of a plurality of blocks according to the brightness of the blocks in the current frame image;
    determining a plurality of brightness threshold values according to the average brightness values of the plurality of blocks.
  13. The image processing apparatus according to any one of claims 10 to 12, wherein the determination unit is further configured to:
    determining a luminance of each of the plurality of blocks, wherein each block includes a plurality of sub-blocks, and the luminance of each block is derived from the luminances of the plurality of sub-blocks.
  14. The image processing apparatus according to any one of claims 10 to 13, wherein the determination unit is further configured to:
    and determining to enter a high contrast scene according to the first brightness value and the second brightness value so as to trigger the operation of determining the exposure compensation amount according to the first brightness value and the second brightness value.
  15. The image processing apparatus according to claim 14, wherein the determination unit is further configured to:
    determining to enter the high contrast scene when a ratio of the first luminance value to the second luminance value is greater than or equal to a first value; or,
    determining to enter the high contrast scene when a difference between the first luminance value and the second luminance value is greater than or equal to a second value.
  16. The image processing apparatus according to any one of claims 10 to 15, wherein the first luminance value is an average luminance value of the at least one block in the first luminance range, and the second luminance value is an average luminance value of the at least one block in the second luminance range.
  17. The image processing apparatus according to any one of claims 10 to 16, wherein the determination unit is further configured to:
    determining the exposure compensation amount according to the average luminance value of the plurality of blocks, the first luminance value, the second luminance value, and the ratio of the at least one block to the plurality of blocks in the second luminance range.
  18. The image processing apparatus according to any one of claims 10 to 17, wherein the plurality of blocks are mxn blocks in the current frame image, and M and N are positive integers.
  19. An image processing apparatus, characterized in that the apparatus comprises: a processor and an interface;
    the processor is configured to read the software program in the memory through the interface and process the following operations under the driving of the software program:
    determining, based on a luminance of each of a plurality of blocks in a current frame image, that each block is located within one of a plurality of luminance ranges;
    determining a first luminance value from luminances of at least one block within a first luminance range having a highest luminance among the plurality of luminance ranges;
    determining a second luminance value from luminances of at least one block within a second luminance range having a lowest luminance among the plurality of luminance ranges;
    determining an exposure compensation amount according to the first brightness value and the second brightness value;
    and carrying out exposure compensation on the next frame of image by using the exposure compensation amount.
  20. The image processing apparatus of claim 19, wherein the processor further performs the operations of:
    determining at least one brightness threshold according to the brightness of each block in a plurality of blocks in the current frame image;
    determining the plurality of luminance ranges according to the at least one luminance threshold.
  21. The image processing apparatus of claim 20, wherein the processor further performs the following:
    determining the average brightness value of a plurality of blocks according to the brightness of the blocks in the current frame image;
    determining a plurality of brightness threshold values according to the average brightness values of the plurality of blocks.
  22. The image processing apparatus according to any of claims 19 to 21, wherein the processor further performs the following operations:
    determining a luminance of each of the plurality of blocks, wherein each block includes a plurality of sub-blocks, and the luminance of each block is derived from the luminances of the plurality of sub-blocks.
  23. The image processing apparatus according to any one of claims 19 to 22, wherein the processor further performs the operations of:
    and determining to enter a high contrast scene according to the first brightness value and the second brightness value so as to trigger the operation of determining the exposure compensation amount according to the first brightness value and the second brightness value.
  24. The image processing apparatus of claim 23, wherein the processor further performs the following:
    determining to enter the high contrast scene when a ratio of the first luminance value to the second luminance value is greater than or equal to a first value; or,
    determining to enter the high contrast scene when a difference between the first luminance value and the second luminance value is greater than or equal to a second value.
  25. The image processing apparatus according to any one of claims 19 to 24, wherein the first luminance value is an average luminance value of the at least one block in the first luminance range, and the second luminance value is an average luminance value of the at least one block in the second luminance range.
  26. The image processing apparatus according to any one of claims 19 to 25, wherein the processor further performs the operations of:
    determining the exposure compensation amount according to the average luminance value of the plurality of blocks, the first luminance value, the second luminance value, and the ratio of the at least one block to the plurality of blocks in the second luminance range.
  27. The image processing apparatus according to any one of claims 19 to 26, wherein the plurality of blocks are mxn blocks in the current frame image, and M and N are positive integers.
CN201880087278.3A 2018-07-26 2018-07-26 Image processing method and device Active CN111630839B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/097292 WO2020019266A1 (en) 2018-07-26 2018-07-26 Image processing method and device

Publications (2)

Publication Number Publication Date
CN111630839A true CN111630839A (en) 2020-09-04
CN111630839B CN111630839B (en) 2021-08-31

Family

ID=69182099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880087278.3A Active CN111630839B (en) 2018-07-26 2018-07-26 Image processing method and device

Country Status (2)

Country Link
CN (1) CN111630839B (en)
WO (1) WO2020019266A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113364994A (en) * 2021-08-11 2021-09-07 浙江芯昇电子技术有限公司 Backlight compensation method and backlight compensation circuit

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335840A (en) * 2007-06-25 2008-12-31 三洋电机株式会社 Camera
CN103957362A (en) * 2014-05-05 2014-07-30 广东欧珀移动通信有限公司 Method and system for automatically adjusting exposure effect of camera
CN104038703A (en) * 2014-05-26 2014-09-10 四川长虹电器股份有限公司 Digital camera photosensitive self-adaptation control method
US20140307117A1 (en) * 2013-04-15 2014-10-16 Htc Corporation Automatic exposure control for sequential images
CN104125410A (en) * 2014-07-02 2014-10-29 深圳英飞拓科技股份有限公司 Panoramic video multi-lens exposure compensation method and device thereof
CN104301624A (en) * 2014-10-30 2015-01-21 青岛海信移动通信技术股份有限公司 Image shooting brightness control method and device
CN105208281A (en) * 2015-10-09 2015-12-30 广东欧珀移动通信有限公司 Night scene shooting method and device
CN105827995A (en) * 2016-03-30 2016-08-03 金三立视频科技(深圳)有限公司 Automatic exposure method and system based on histogram
CN106791472A (en) * 2016-12-29 2017-05-31 努比亚技术有限公司 A kind of exposure method and terminal
CN106791475A (en) * 2017-01-23 2017-05-31 上海兴芯微电子科技有限公司 Exposure adjustment method and the vehicle mounted imaging apparatus being applicable
CN106847150A (en) * 2017-01-04 2017-06-13 捷开通讯(深圳)有限公司 Adjust the device and method of brightness of display screen
CN107438163A (en) * 2017-07-31 2017-12-05 努比亚技术有限公司 A kind of photographic method, terminal and computer-readable recording medium
CN107463051A (en) * 2017-08-25 2017-12-12 维沃移动通信有限公司 A kind of exposure method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102368809B (en) * 2011-09-02 2013-09-04 深圳市先河系统技术有限公司 Exposure compensation device, method and infrared camera
CN105959585B (en) * 2016-05-12 2019-08-16 南昌黑鲨科技有限公司 Multistage backlighting detecting and device

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335840A (en) * 2007-06-25 2008-12-31 三洋电机株式会社 Camera
US20140307117A1 (en) * 2013-04-15 2014-10-16 Htc Corporation Automatic exposure control for sequential images
CN103957362A (en) * 2014-05-05 2014-07-30 广东欧珀移动通信有限公司 Method and system for automatically adjusting exposure effect of camera
CN104038703A (en) * 2014-05-26 2014-09-10 四川长虹电器股份有限公司 Digital camera photosensitive self-adaptation control method
CN104125410A (en) * 2014-07-02 2014-10-29 深圳英飞拓科技股份有限公司 Panoramic video multi-lens exposure compensation method and device thereof
CN104301624A (en) * 2014-10-30 2015-01-21 青岛海信移动通信技术股份有限公司 Image shooting brightness control method and device
CN105208281A (en) * 2015-10-09 2015-12-30 广东欧珀移动通信有限公司 Night scene shooting method and device
CN105827995A (en) * 2016-03-30 2016-08-03 金三立视频科技(深圳)有限公司 Automatic exposure method and system based on histogram
CN106791472A (en) * 2016-12-29 2017-05-31 努比亚技术有限公司 A kind of exposure method and terminal
CN106847150A (en) * 2017-01-04 2017-06-13 捷开通讯(深圳)有限公司 Adjust the device and method of brightness of display screen
CN106791475A (en) * 2017-01-23 2017-05-31 上海兴芯微电子科技有限公司 Exposure adjustment method and the vehicle mounted imaging apparatus being applicable
CN107438163A (en) * 2017-07-31 2017-12-05 努比亚技术有限公司 A kind of photographic method, terminal and computer-readable recording medium
CN107463051A (en) * 2017-08-25 2017-12-12 维沃移动通信有限公司 A kind of exposure method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113364994A (en) * 2021-08-11 2021-09-07 浙江芯昇电子技术有限公司 Backlight compensation method and backlight compensation circuit

Also Published As

Publication number Publication date
WO2020019266A1 (en) 2020-01-30
CN111630839B (en) 2021-08-31

Similar Documents

Publication Publication Date Title
AU2019326496B2 (en) Method for capturing images at night, apparatus, electronic device, and storage medium
CN111028189B (en) Image processing method, device, storage medium and electronic equipment
CN110445988B (en) Image processing method, image processing device, storage medium and electronic equipment
CN108322646B (en) Image processing method, image processing device, storage medium and electronic equipment
JP6911202B2 (en) Imaging control method and imaging device
CN108900782B (en) Exposure control method, exposure control device and electronic equipment
CN108989700B (en) Imaging control method, imaging control device, electronic device, and computer-readable storage medium
US9451173B2 (en) Electronic device and control method of the same
CN111028190A (en) Image processing method, image processing device, storage medium and electronic equipment
US20200045219A1 (en) Control method, control apparatus, imaging device, and electronic device
CN110445989B (en) Image processing method, image processing device, storage medium and electronic equipment
CN105611185B (en) image generating method, device and terminal device
CN109005369B (en) Exposure control method, exposure control device, electronic apparatus, and computer-readable storage medium
JP2016519822A (en) Reference image selection for motion ghost filtering
CN107704798B (en) Image blurring method and device, computer readable storage medium and computer device
US10382671B2 (en) Image processing apparatus, image processing method, and recording medium
CN110708463B (en) Focusing method, focusing device, storage medium and electronic equipment
CN108401110B (en) Image acquisition method and device, storage medium and electronic equipment
CN105391940B (en) A kind of image recommendation method and device
US10972676B2 (en) Image processing method and electronic device capable of optimizing hdr image by using depth information
CN112312035B (en) Exposure parameter adjusting method, exposure parameter adjusting device and electronic equipment
CN110740266B (en) Image frame selection method and device, storage medium and electronic equipment
CN111028276A (en) Image alignment method and device, storage medium and electronic equipment
CN113411498A (en) Image shooting method, mobile terminal and storage medium
JP2009164838A (en) Image processing device and method, and imaging device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant