[go: up one dir, main page]

CN112581376A - Image processing method and device and electronic equipment - Google Patents

Image processing method and device and electronic equipment Download PDF

Info

Publication number
CN112581376A
CN112581376A CN201910936028.9A CN201910936028A CN112581376A CN 112581376 A CN112581376 A CN 112581376A CN 201910936028 A CN201910936028 A CN 201910936028A CN 112581376 A CN112581376 A CN 112581376A
Authority
CN
China
Prior art keywords
image block
processed
image
belongs
dynamic range
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.)
Pending
Application number
CN201910936028.9A
Other languages
Chinese (zh)
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.)
Beijing Megvii Technology Co Ltd
Original Assignee
Beijing Megvii Technology 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 Beijing Megvii Technology Co Ltd filed Critical Beijing Megvii Technology Co Ltd
Priority to CN201910936028.9A priority Critical patent/CN112581376A/en
Publication of CN112581376A publication Critical patent/CN112581376A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the application provides an image processing method, an image processing device and electronic equipment, wherein the method comprises the following steps: dividing an image to be processed into a plurality of image blocks to be processed; determining an image block type of each to-be-processed image block in a plurality of to-be-processed image blocks based on image block parameters of the to-be-processed image blocks, and generating a plurality of to-be-processed image block sets, wherein each to-be-processed image block in the to-be-processed image block sets belongs to the same image block type; for each to-be-processed image block set in the plurality of to-be-processed image block sets, acquiring preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs; and adjusting the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set based on the preset dynamic range adjustment parameter information.

Description

Image processing method and device and electronic equipment
Technical Field
The present application relates to the field of image processing, and in particular, to an image processing method and apparatus, and an electronic device.
Background
After a user takes an image, the dynamic range of the image often needs to be adjusted to improve the image quality. Currently, the commonly adopted method for adjusting the dynamic range of an image is to calculate the adjustment coefficient of each image block one by one according to the correlation of the adjacent image blocks in the image on the brightness and the correlation of the pixels in the same image block on the brightness, and adjust the pixel values of the pixels in each image block according to the adjustment coefficient of each image block.
However, each time the dynamic range of an image is adjusted, the adjustment coefficient of each image block in the image needs to be calculated one by one, which results in a long time required for performing the dynamic range of the image.
Disclosure of Invention
In order to overcome the problems in the related art, the application provides an image processing method, an image processing device and electronic equipment.
According to a first aspect of embodiments of the present application, there is provided an image processing method, including:
dividing an image to be processed into a plurality of image blocks to be processed;
determining an image block type of each to-be-processed image block in a plurality of to-be-processed image blocks based on image block parameters of the to-be-processed image blocks, and generating a plurality of to-be-processed image block sets, wherein each to-be-processed image block in the same to-be-processed image block set belongs to the same image block type;
for each to-be-processed image block set in the plurality of to-be-processed image block sets, acquiring preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs; and adjusting the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set based on the preset dynamic range adjustment parameter information.
According to a second aspect of embodiments of the present application, there is provided an image processing apparatus including:
the image processing device comprises a dividing unit, a processing unit and a processing unit, wherein the dividing unit is configured to divide an image to be processed into a plurality of image blocks to be processed;
the generating unit is configured to determine an image block type to which each to-be-processed image block in a plurality of to-be-processed image blocks belongs and generate a plurality of to-be-processed image block sets based on image block parameters of the to-be-processed image blocks, wherein each to-be-processed image block in the same to-be-processed image block set belongs to the same image block type;
the adjusting unit is configured to acquire preset dynamic range adjusting parameter information corresponding to an image block type to which an image block to be processed in the image block set to be processed belongs for each image block set to be processed in the plurality of image block sets to be processed; and adjusting the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set based on the preset dynamic range adjustment parameter information.
The image processing method and the image processing device provided by the embodiment of the application realize that the dynamic range of one to-be-processed image is adjusted each time, only the image block type of each to-be-processed image block in the to-be-processed image needs to be determined, the preset dynamic range adjustment parameter information corresponding to the pre-calculated image block type is obtained, the pixel value of the pixel in each to-be-processed image block is adjusted respectively based on the preset dynamic range adjustment parameter information corresponding to the pre-calculated image block type, and the dynamic range adjustment of the to-be-processed image is completed rapidly.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
FIG. 1 is a flow chart illustrating an image processing method provided by an embodiment of the present application;
fig. 2 is a block diagram showing a configuration of an image processing apparatus according to an embodiment of the present application;
fig. 3 shows a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present application, the embodiments and parameters in the embodiments may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows a flowchart of an image processing method provided in an embodiment of the present application, where the method includes:
step 101, dividing an image to be processed into a plurality of image blocks to be processed.
In this application, an image that needs to be subjected to dynamic range adjustment may be referred to as an image to be processed.
In the present application, the size of each to-be-processed image block in the to-be-processed image may be the same. For example, the size of the image block to be processed is 5x5, each image block to be processed comprises 25 pixels, and the image to be processed is divided into a plurality of image blocks to be processed with the size of 5x 5.
Step 102, determining an image block type of each to-be-processed image block in the plurality of to-be-processed image blocks based on the image block parameters of the to-be-processed image blocks, and generating a plurality of to-be-processed image block sets.
In this application, an image block located in an image to be processed is referred to as an image block to be processed, and an image block located in an input image is referred to as an input image block. For any image block to be processed or any input image block, the image block type to which the image block belongs is one of all image block types.
In some embodiments, determining, based on the image block parameters of the to-be-processed image block, an image block type to which each of the plurality of to-be-processed image blocks belongs includes: for each to-be-processed image block, determining a value interval in which each item in image block parameters of the to-be-processed image block is located, and obtaining a value interval set comprising the value interval in which each item is located; and taking the image block type corresponding to the obtained value interval set as the image block type of the image block to be processed, wherein each image block type corresponds to one value interval set in advance.
In the present application, an image block type to which an image block belongs is determined according to a value range in which each item in image block parameters of the image block is located.
In the present application, each item in the image block parameter corresponds to a plurality of value intervals. Different value intervals corresponding to different items in the image block parameters are combined, and a plurality of value interval sets can be obtained. For each value interval set, the value interval set comprises: and each item in the image block parameters corresponds to a value interval. Each value interval set corresponds to one image block type, so that all image block types are obtained.
For example, the image block parameters include: luminance, edge direction. The value range [0, 255] of the brightness is divided into 10 value intervals, and the brightness in the image block parameters corresponds to the 10 value intervals. For each image block, the brightness in the image block parameters of the image block is within one of the 10 value intervals. The value range [0, 180] of the edge direction is divided into 8 value intervals, and the edge direction in the image block parameter corresponds to 8 value intervals. For each image block, the edge direction in the image block parameter of the image block is within one of the 8 value intervals. By combining the value intervals corresponding to different items, a 10x8 value interval set can be obtained. For each value interval set, the value interval set comprises: one value interval of 10 value intervals corresponding to the brightness and one value interval of 8 value intervals corresponding to the edge direction. Each value interval set corresponds to one image block type, so that 10x8 image block types are obtained.
In the application, for each to-be-processed image block, a value interval in which each item in the image block parameters of the to-be-processed image block is located may be determined, and the value interval in which each item is located is determined to form a value interval set, where an image block type corresponding to the value interval set is an image block type to which the to-be-processed image block belongs.
For example, a value range set corresponding to an image block type includes: a brightness interval and an edge direction interval. And when the brightness in the image block parameters of one to-be-processed image block is within the value interval of the brightness and the edge direction of the to-be-processed image block is within the value interval of the edge direction, the type of the to-be-processed image block is the type of the image block.
In the application, after the image block type to which each image block to be processed belongs is determined, all the image blocks to be processed can be classified according to the image block type to which the image block to be processed belongs, and one or more image blocks to be processed belonging to one image block type form a set of image blocks to be processed.
For example, a value range set corresponding to an image block type includes: a brightness interval and an edge direction interval. The brightness of 100 image block parameters of the to-be-processed image blocks in all the to-be-processed image blocks in the to-be-processed image is in the value interval of the brightness, and the edge directions of the 100 to-be-processed image blocks are in the value interval of the edge direction, so that the image block type to which each of the 100 image blocks belongs is the image block type, and the 100 image blocks to be processed form a to-be-processed image block set.
In some embodiments, the image block parameters of the image block include: brightness, edge direction, edge strength. The luminance in an image block parameter of an image block may refer to the pixel luminance of a pixel in the image block. The luminance in an image block parameter of an image block may be an average of the luminances of the pixels in the image block. The brightness, the edge direction and the edge intensity respectively correspond to a plurality of value intervals. And combining the value intervals corresponding to the brightness, the edge intensity and the direction to obtain a plurality of value interval sets. For each value interval set, the value interval set comprises: and each item of brightness, edge direction and edge intensity corresponds to a value interval. Each value interval set corresponds to one image block type, so that all image block types are obtained.
For example, the value range [0, 255] of the luminance is divided into 10 intervals, and the luminance in the image block parameter corresponds to the 10 value intervals. For each image block, the brightness in the image block parameters of the image block is within one of the 10 value intervals. The value range [0, 180] of the edge direction is divided into 8 value intervals, and the edge direction in the image block parameter corresponds to the 8 value intervals. For each image block, the edge direction in the image block parameter of the image block is within one of the 8 value intervals. The value range [0, 1] of the edge strength is divided into 3 value intervals. For each image block, the edge intensity in the image block parameter of the image block is within one of 3 value intervals. By combining the value intervals corresponding to different items in the image block parameters, a set of 10x8x3 value intervals can be obtained. The value interval set comprises: one of 10 value intervals corresponding to brightness, one of 8 value intervals corresponding to edge direction, and one of 3 value intervals corresponding to edge intensity. Each value interval set corresponds to one image block type, so that 10x8x3 image block types are obtained.
For each to-be-processed image block, the value intervals in which the brightness, the edge intensity, and the edge direction in the image block parameters of the to-be-processed image block are respectively located may be determined, the value intervals in which the brightness, the edge intensity, and the edge direction in the image block parameters of the to-be-processed image block are respectively located form a value interval set, and the image block type corresponding to the value interval set is the image block type to which the to-be-processed image block belongs.
For example, a value range set corresponding to an image block type includes: a brightness interval, an edge direction interval, and an edge intensity interval. And if the brightness in the image block parameters of one to-be-processed image block is within the value interval of the brightness, the edge direction of the to-be-processed image block is within the value interval of the edge direction, and the edge intensity of the to-be-processed image block is within the value interval of the edge intensity, the type of the to-be-processed image block is the type of the image block.
In some embodiments, the luminance in the image block parameter of the image block is an average luminance of a divided area to which a center pixel in the image block belongs, and the divided area to which the center pixel in the image block belongs is one of a plurality of divided areas obtained by area-dividing an image to which the image block belongs.
In the present application, a region Segmentation algorithm, for example, a Graph-Based Image Segmentation (Efficient Graph-Based Image Segmentation) algorithm, may be used to segment an Image into a plurality of segmented regions. For each image block, the luminance in the image block parameters of the image block may be an average luminance of a divided area to which the central pixel in the image block belongs.
In the present application, considering that some areas in an image include an interfering object such as a noise spot and a noise patch with abnormal brightness, and the adjustment coefficient of a determined image block with the interfering object is greatly different from the adjustment coefficient of an image block adjacent to the image block, by performing area division on the image, the difference of image blocks belonging to the same divided area can be made smaller, and it is ensured that the change of dynamic range adjustment tends to be consistent.
In this application, when an image block is a to-be-processed image block, the luminance in the image block parameter of the to-be-processed image block may be an average luminance of a partition area to which a central pixel in the to-be-processed image block belongs, where the partition area is one of a plurality of partition areas obtained by performing area partition on the to-be-processed image.
In this application, when an image block is an input image block for determining preset dynamic range adjustment parameter information, the luminance in the image block parameters of the input image block may be an average luminance of a divided area to which a center pixel in the input image block belongs, the divided area being one of a plurality of divided areas obtained by area-dividing an input image to which the input image block belongs.
In the present application, the average luminance of the divided region may be an average of the luminance of all pixels within the divided region.
In this application, when an image block is a target image block for determining preset dynamic range adjustment parameter information, the luminance in the image block parameters of the target image block may be an average luminance of a divided region to which a central pixel in the target image block belongs, where the divided region is one of a plurality of divided regions obtained by performing region division on a target image to which the target image block belongs.
Step 103, adjusting the pixel value of the pixel in each to-be-processed image block based on the preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs.
In the present application, each image block type corresponds to a preset dynamic range adjustment parameter information. For each image block type, the preset dynamic range adjustment parameter information corresponding to the image block type can be calculated in advance.
In the present application, for each to-be-processed image block set, the image block types to which each to-be-processed image block in the to-be-processed image block set belongs are the same image block type.
When the dynamic range is adjusted, for each to-be-processed image block set, adjusting the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set according to preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs. After adjustment, for each to-be-processed image block set, the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set is the adjusted pixel value.
In other words, for each to-be-processed image block in one to-be-processed image block set, the same preset dynamic range adjustment parameter information is used to respectively adjust the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set, and the same preset dynamic range adjustment parameter information is the preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs.
For example, the image block parameters include: brightness, edge direction, edge strength. The value range [0, 255] of the brightness is divided into 10 intervals, the value range [0, 180] of the edge direction is divided into 8 value intervals, and the edge intensity range [0, 1] is divided into 3 value intervals. The number of image block types is 10x8x3, i.e. 240.
And when the dynamic range is adjusted, the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set is respectively adjusted according to preset dynamic range adjustment parameter information corresponding to the image block type. After adjustment, for each to-be-processed image block in the to-be-processed image block set, the pixel value of the pixel in the to-be-processed image block is the adjusted pixel value.
In this application, the preset dynamic range adjustment parameter information may be an adjustment coefficient matrix, and each element in the adjustment coefficient matrix is an adjustment coefficient. For each image block type, an adjustment coefficient matrix corresponding to the image block type is pre-calculated.
In the application, when the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set is adjusted according to the adjustment coefficient matrix corresponding to the image block type to which the to-be-processed image block belongs, for each to-be-processed image block, a matrix corresponding to the to-be-processed image block may be generated, and the matrix corresponding to the to-be-processed image block is multiplied by the adjustment coefficient matrix corresponding to the image block type to which the to-be-processed image block belongs, so as to obtain a matrix including the adjusted pixel value of the pixel in the to-be-processed image block. Each element in the matrix including the adjusted pixel values of the pixels in the image block to be processed is an adjusted pixel value of one pixel in the image block to be processed.
For example, for one image block to be processed with a size of 5 × 5 in the image blocks to be processed, a matrix a corresponding to the image block to be processed is generated. The number of rows of the matrix a is 1, the number of columns is 25, and each element in a row is a current pixel value of one pixel in the image block to be processed. The number of rows and the number of columns of the adjustment coefficient matrix h corresponding to the image block type to which the image block to be processed belongs are 25 and 25, respectively. And multiplying the matrix A and the matrix h to obtain a target matrix, wherein each element in the target matrix is the adjusted pixel value of each pixel in the image block to be processed.
In the present application, in order to determine the adjustment coefficient matrix corresponding to each image block type, a plurality of images continuously captured may be acquired in advance. An image with a high photographing quality is selected from a plurality of continuously photographed images as a target image. Meanwhile, one image may be selected from a plurality of continuously photographed images as an input image.
The input image may then be divided into a plurality of input image blocks, for example, the input image is divided into a plurality of input image blocks of size 5x 5. Each input image block corresponds to a respective one of the target image blocks in the target image. And determining a target image block corresponding to each image block in the target image according to the coordinates of each input image block. For each input image block, the position of the input image block in the input image is the same as the position of the target image block corresponding to the input image block in the target image. The image block type to which each input image block belongs may be determined according to image block parameters of the input image blocks. And referring to the above-mentioned manner for determining the image block type of each to-be-processed image block, and respectively determining the image block type of each input image block according to the value intervals in which the brightness, the edge intensity and the edge direction in the image block parameters of each input image block are respectively located. All input image blocks may be classified according to the image block type to which each input image block belongs, and one or more input image blocks belonging to the same image block type constitute one input image block set.
In this application, for each input image block set, the target image block corresponding to each input image block in the input image block set constitutes the target image block set corresponding to the input image block set.
In the present application, when calculating the preset dynamic range adjustment parameter information corresponding to an image block type to which an input image block in an input image block set belongs, the preset dynamic range adjustment parameter information corresponding to the image block type is calculated by using a least square method.
For example, the set of input image blocks corresponds to the matrix a, and the set of target image blocks corresponding to the set of input image blocks corresponds to the matrix B. It is assumed that each input image block of the set of input image blocks, each having 25 pixels, has a size of 5x 5. Each input image block of size 5x5 in the set of input image blocks is represented by a column of 1x 25. Each element in a column is the pixel value of a pixel in the input image block. The number of rows of matrix a is 25 and the number of columns is the number of input image blocks in the set of input image blocks. And calculating the product of the transpose matrix of the matrix A and the matrix A to obtain a matrix A2, wherein the row number of the matrix A2 is 25 rows, and the column number of the matrix A2 is 25 columns. Similarly, the number of rows in the matrix B is 25, and the number of columns is the number of target image blocks in the target image block set corresponding to the input image block set. And calculating the product of the transpose matrix of the matrix B and the matrix B to obtain a matrix B2, wherein the row number of the matrix B2 is 25 rows, and the column number of the matrix B2 is 25 columns. A matrix h which can minimize the difference from the matrix B2 after multiplication with the matrix a2 is calculated by the least square method, the number of rows of the matrix h is 25, and the number of columns of the matrix h is 25. The calculated matrix h is an adjustment coefficient matrix, and the adjustment coefficient matrix is used as preset dynamic range adjustment parameter information corresponding to the image block type to which the input image block in the input image block set belongs.
In this application, for each input image block set, an adjustment coefficient matrix serving as preset dynamic range adjustment parameter information corresponding to an image block type to which an input image block in the input image block set belongs may be calculated in the manner described above.
In the present application, the image block type to which each input image block in an input image block set belongs is the same image block type, and the preset dynamic range adjustment parameter information corresponding to the image block type to which the input image block in an input image block set belongs is determined each time, which is actually the preset dynamic range adjustment parameter information corresponding to one image block type.
In the present application, each time the preset dynamic range adjustment parameter information corresponding to the image block type to which the input image block in the input image block set belongs is determined, the preset dynamic range adjustment parameter information corresponding to one image block type is actually determined, so when the number of the input image block sets is equal to the number of the image block types, the preset dynamic range adjustment parameter information corresponding to each image block type can be determined. When the number of the input image block sets is smaller than the number of the image block types, it may be determined that the preset dynamic range adjustment parameter information corresponding to a partial image block type among all the image block types, and then, a plurality of continuously shot images may be obtained again, and when the input image in the plurality of continuously shot images includes an image block belonging to an image block type for which the corresponding preset dynamic range adjustment parameter information is not calculated, it may be determined that the preset dynamic range adjustment parameter information corresponding to the image block type for which the corresponding preset dynamic range adjustment parameter information is not calculated is obtained again.
In some embodiments, the image blocks to be processed which are adjacent in position in the plurality of image blocks to be processed have an overlapping area.
In the application, when the dynamic range is adjusted, in order to avoid a boundary effect caused by different corresponding preset dynamic range adjustment parameter information and/or different average brightness of a partition area where a central pixel is located in adjacent to-be-processed image blocks, the boundary effect is eliminated by overlapping areas of the adjacent to-be-processed image blocks in the plurality of to-be-processed image blocks.
For example, an image block has a size of 5x5, and for each image block, the image block has an overlapping area with each adjacent image block of the image block.
In this application, for an image block to be processed, an image block to be processed adjacent to the image block to be processed in position may be an image block to be processed adjacent to the image block to be processed in one of the up, down, left, and right directions with respect to the image block to be processed.
In the present application, for one to-be-processed image block and any one to-be-processed image block adjacent to the to-be-processed image block, when the dynamic range is adjusted, the values of the pixel values of the pixels in the overlapped region are all the average values of all the pixel values in the overlapped region. In the dynamic range adjustment, for each pixel in the overlapped region, the average value of all pixel values in the overlapped region is used as an original value to participate in the dynamic range adjustment. And according to the preset dynamic range adjustment parameter information, after the dynamic range adjustment is carried out, the adjusted pixel value of each pixel in the overlapped area is obtained.
In other words, when the dynamic range is adjusted, for each to-be-processed image block, the pixel value of the pixel in the to-be-processed image block and the pixel value of the pixel in the to-be-processed image block adjacent to the to-be-processed image block both participate in the calculation, and when the pixel values participate in the calculation, the value of the pixel value of each pixel in the overlapped region is the average value of all the pixel values in the overlapped region.
In some embodiments, the preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs is preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs under the illumination condition in which the to-be-processed image is shot.
For an image block type, under different illumination conditions, the image block type corresponds to different preset dynamic range adjustment parameter information.
In the present application, all lighting conditions may include, but are not limited to: weak light condition, common light condition, and strong light condition. The low light condition is that the light intensity is less than a first threshold. The strong illumination condition is that the illumination intensity is greater than a second threshold value. The second threshold is larger than the first threshold, and the common illumination condition is that the illumination intensity is in a preset illumination intensity area interval. The left end point value of the preset illumination intensity area interval is larger than a first threshold value, and the right end point value of the preset illumination intensity area interval is smaller than a second threshold value.
In the present application, a plurality of images are continuously taken with a camera of the user's electronic device in each lighting condition, respectively, before the user's electronic device is used. The illumination condition may be determined by the sensitivity (ISO) of the camera. A plurality of images continuously captured under each of the lighting conditions may be acquired in advance for the lighting condition, and one input image and one target image may be selected from the plurality of images continuously captured under the lighting condition. And calculating the preset dynamic range adjustment parameter information corresponding to each image block type by referring to the mode of calculating the preset dynamic range adjustment parameter information corresponding to each image block type, and taking the calculated preset dynamic range adjustment parameter information corresponding to each image block type as the preset dynamic range adjustment parameter information corresponding to each image block type under the illumination condition.
In the present application, each time a camera on an electronic device of a user captures an image, an illumination condition may be determined by the sensitivity of the camera, and illumination condition information indicating the illumination condition at the time of capturing the image may be generated and stored.
Any image needing dynamic adjustment is an image to be processed. When dynamically adjusting an image to be processed, first, lighting condition information indicating lighting conditions when the image to be processed is shot is acquired, and the lighting conditions when the image to be processed is shot are determined. And then, acquiring pre-calculated preset dynamic range adjustment parameter information corresponding to each image block type under the illumination condition. For each to-be-processed image block set, searching preset dynamic range adjustment parameter information corresponding to the image block type to which the image block in the to-be-processed image block set belongs from the obtained preset dynamic range adjustment parameter information corresponding to each image block type under the illumination condition, and adjusting the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set according to the searched preset dynamic range adjustment parameter information.
In some embodiments, for each lighting condition, a plurality of images taken consecutively under that lighting condition are acquired; generating a target image based on the plurality of images, and selecting an input image from the plurality of images; dividing the input image into a plurality of input image blocks, wherein each input image block respectively corresponds to one target image block in the target image; generating a plurality of input image block sets based on image block parameters of input image blocks, wherein each input image block in the input image block sets belongs to the same image block type; and for each input image block set, generating preset dynamic range adjustment parameter information corresponding to the image block type of an input image block in the input image block set under the illumination condition based on the input image block set and a target image block set corresponding to the input image block set.
In the present application, when determining the preset dynamic range adjustment parameter information corresponding to the image block type to which the input image block in the input image block set belongs under one lighting condition, a plurality of images continuously shot under the lighting condition may be first acquired. Then, one target image may be generated based on a plurality of images continuously taken under the lighting condition. For example, an image with a high noise level is selected from a plurality of images. Meanwhile, a portion having a preferable noise level is selected from each of at least partial images of a plurality of images continuously captured under the illumination condition. And performing optimization processing related to the noise level on the part, which is in the same position as the determined better part with the better noise level, in the selected image by referring to the determined better part with the better noise level through an image processing tool, so that the corresponding part in the processed image reaches the better noise level of the determined part. Thus, a target image having a superior noise level for each portion is obtained. Meanwhile, one input image is selected from a plurality of images continuously photographed under the lighting condition. The input image is divided into a plurality of input image blocks. Each input image block corresponds to a respective one of the target image blocks in the target image. For each input image block, the position of the input image block in the input image is the same as the position of the target image block corresponding to the input image block in the target image.
In some embodiments, generating a target image based on a plurality of images taken consecutively under a lighting condition comprises: fusing the plurality of images based on the fusion association parameters of each image in the plurality of images to obtain a target image, wherein the fusion association parameters comprise: information indicating a noise level of the image.
When one target image is generated based on a plurality of images continuously photographed under the lighting condition, a plurality of images continuously photographed under the lighting condition may be fused to obtain one target image. For example, a portion that is preferable in terms of noise level, imaging effect, and the like is selected from each of at least partial images of a plurality of images continuously captured under the lighting condition, and the selected portions are combined to obtain a composite image having a good noise level, that is, a parameter value indicating noise that is lower than a threshold value. Then, the optimal dynamic range adjustment is performed on the synthesized image with a good noise level by an image processing tool such as ps (photoshop), thereby obtaining a target image with a good dynamic range level. Meanwhile, one input image is selected from a plurality of images continuously photographed under the lighting condition. The input image is divided into a plurality of input image blocks. Each input image block corresponds to a respective one of the target image blocks in the target image. For each input image block, the position of the input image block in the input image is the same as the position of the target image block corresponding to the input image block in the target image.
Referring to the above-mentioned manner of determining the image block type to which each to-be-processed image block belongs, the image block type to which each input image block belongs may be determined according to the value intervals in which the brightness, the edge intensity, and the edge direction in the image block parameter of each input image block in the input image respectively belong. All the input image blocks in the input image blocks can be classified according to the image block type to which each input image block belongs, and one or more input image blocks belonging to the same image block type form an input image block set. For each input image block set, the target image block corresponding to each input image block in the input image block set constitutes the target image block set corresponding to the input image block set.
Then, referring to the above-mentioned manner of calculating the preset dynamic range adjustment parameter information corresponding to each image block type, a matrix corresponding to each image block type is calculated as the preset dynamic range adjustment parameter information, and the calculated matrix corresponding to each image block type is used as the preset dynamic range adjustment parameter information corresponding to each image block type under the illumination condition.
In the present application, referring to the above-mentioned manner of calculating the preset dynamic range adjustment parameter information corresponding to each image block type under one illumination condition, for each illumination condition, the preset dynamic range adjustment parameter information corresponding to each image block type under the illumination condition is calculated.
In the method, when the preset dynamic range adjustment parameter information corresponding to each image block type under one illumination condition is calculated, the used target image is obtained by fusing a plurality of images continuously shot under the same illumination condition, so that the signal-to-noise ratio of the target image is very low relative to the input image, and the obtained preset dynamic range adjustment parameter information can inhibit noise while increasing the dynamic range of the image. When the dynamic range of the image to be processed is adjusted by using the preset dynamic range adjustment parameter information, the synchronous noise amplification condition caused by the dynamic range adjustment cannot occur after the dynamic range of the image to be processed is adjusted.
Referring to fig. 2, a block diagram of an image processing apparatus according to an embodiment of the present disclosure is shown. The image processing apparatus includes: dividing unit 201, generating unit 202 and adjusting unit 203.
The dividing unit 201 is configured to divide an image to be processed into a plurality of image blocks to be processed;
the generating unit 202 is configured to determine, based on image block parameters of the to-be-processed image blocks, an image block type to which each of the to-be-processed image blocks belongs, and generate a plurality of to-be-processed image block sets, where each of the to-be-processed image blocks in the to-be-processed image block sets belongs to the same image block type;
the adjusting unit 203 is configured to, for each to-be-processed image block set in the plurality of to-be-processed image block sets, acquire preset dynamic range adjustment parameter information corresponding to an image block type to which an to-be-processed image block in the to-be-processed image block set belongs; and adjusting the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set based on the preset dynamic range adjustment parameter information.
In some embodiments, the generating unit 202 comprises: the image block type determining unit is configured to determine an image block type to which each of the plurality of image blocks to be processed belongs based on the image block parameters of the image blocks to be processed, and comprises: for each to-be-processed image block, determining a value interval in which each item in image block parameters of the to-be-processed image block is located, and obtaining a value interval set comprising the value interval in which each item is located; and taking the image block type corresponding to the obtained value interval set as the image block type of the image block to be processed, wherein each image block type corresponds to one value interval set in advance. In some embodiments, the preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs is preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs under the illumination condition in which the to-be-processed image is shot.
In some embodiments, the image block parameters include: brightness, edge direction, edge strength.
In some embodiments, the image processing apparatus further comprises:
a preset dynamic range adjustment parameter information determination unit configured to: for each lighting condition, acquiring a plurality of images continuously shot under the lighting condition; generating a target image based on the plurality of images, and selecting an input image from the plurality of images; dividing the input image into a plurality of input image blocks, wherein each input image block corresponds to one target image block in the target image; generating a plurality of input image block sets based on image block parameters of input image blocks, wherein each input image block in the input image block sets belongs to the same image block type; and for each input image block set, generating preset dynamic range adjustment parameter information corresponding to the image block type of an input image block in the input image block set under the illumination condition based on the input image block set and a target image block set corresponding to the input image block set.
In some embodiments, the preset dynamic range adjustment parameter information determining unit includes: a target image generation module configured to fuse the plurality of images based on a fusion association parameter of each of the plurality of images continuously captured under the illumination condition to obtain a target image, wherein the fusion association parameter includes: information indicating a noise level of the image.
In some embodiments, the luminance in the image block parameter of the image block is an average luminance of a divided area to which a central pixel in the image block belongs, and the divided area to which the central pixel in the image block belongs is one of a plurality of divided areas obtained by area-dividing an image to which the image block belongs, where the image block is an input image block or an image block to be processed.
In some embodiments, the image blocks to be processed adjacent in position in the plurality of image blocks to be processed have overlapping areas.
Fig. 3 is a block diagram of an electronic device according to this embodiment. Electronic device 300 includes a processing component 322 that further includes one or more processors, and memory resources, represented by memory 332, for storing instructions, such as application programs, that are executable by processing component 322. The application programs stored in memory 332 may include one or more modules that each correspond to a set of instructions. Further, the processing component 322 is configured to execute instructions to perform the above-described methods.
The electronic device 300 may also include a power component 326 configured to perform power management of the electronic device 400, a wired or wireless network interface 350 configured to connect the electronic device 300 to a network, and an input/output (I/O) interface 358. The electronic device 300 may operate based on an operating system stored in the memory 332, such as Windows Server, MacOS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a storage medium comprising instructions, such as a memory comprising instructions, executable by an electronic device to perform the above method is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (11)

1. An image processing method, characterized in that the method comprises:
dividing an image to be processed into a plurality of image blocks to be processed;
determining an image block type of each to-be-processed image block in a plurality of to-be-processed image blocks based on image block parameters of the to-be-processed image blocks, and generating a plurality of to-be-processed image block sets, wherein each to-be-processed image block in the same to-be-processed image block set belongs to the same image block type;
for each to-be-processed image block set in the plurality of to-be-processed image block sets, acquiring preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs;
and adjusting the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set based on the preset dynamic range adjustment parameter information.
2. The method according to claim 1, wherein determining, based on the image block parameters of the to-be-processed image block, an image block type to which each of the to-be-processed image blocks belongs comprises:
for each to-be-processed image block, determining a value interval in which each item in image block parameters of the to-be-processed image block is located, and obtaining a value interval set comprising the value interval in which each item is located; and taking the image block type corresponding to the obtained value interval set as the image block type of the image block to be processed, wherein each image block type corresponds to one value interval set in advance.
3. The method according to claim 2, wherein the preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs is preset dynamic range adjustment parameter information corresponding to the image block type to which the to-be-processed image block in the to-be-processed image block set belongs under an illumination condition in which the to-be-processed image is captured.
4. The method of claim 3, wherein before dividing the image to be processed into the plurality of image blocks to be processed, the method further comprises:
for each lighting condition, acquiring a plurality of images continuously shot under the lighting condition; generating a target image based on the plurality of images, and selecting an input image from the plurality of images;
dividing the input image into a plurality of input image blocks, wherein each input image block corresponds to one target image block in the target image;
generating a plurality of input image block sets based on image block parameters of input image blocks, wherein each input image block in a same input image block set belongs to a same image block type;
and for each input image block set, generating preset dynamic range adjustment parameter information corresponding to the image block type of an input image block in the input image block set under the illumination condition based on the input image block set and a target image block set corresponding to the input image block set.
5. The method of claim 4, wherein generating a target image based on the plurality of images comprises:
fusing the plurality of images based on the fusion association parameters of each image in the plurality of images to obtain the target image, wherein the fusion association parameters comprise: information indicating a noise level of the image.
6. The method according to one of claims 1 to 5, wherein the image block parameters comprise: brightness, edge direction, edge strength.
7. The method according to claim 6, wherein the luminance in an image block parameter of an image block is an average luminance of a divided area to which a central pixel in the image block belongs, the divided area to which the central pixel in the image block belongs is one of a plurality of divided areas obtained by area-dividing an image to which the image block belongs, and the image block is an input image block or an image block to be processed.
8. The method according to claim 7, wherein neighboring image blocks to be processed among the plurality of image blocks to be processed have overlapping areas.
9. An image processing apparatus, characterized in that the apparatus comprises:
the image processing device comprises a dividing unit, a processing unit and a processing unit, wherein the dividing unit is configured to divide an image to be processed into a plurality of image blocks to be processed;
the generating unit is configured to determine an image block type to which each to-be-processed image block in the plurality of to-be-processed image blocks belongs based on image block parameters of the to-be-processed image blocks, and generate a plurality of to-be-processed image block sets, wherein each to-be-processed image block in the to-be-processed image block sets belongs to the same image block type;
the adjusting unit is configured to acquire preset dynamic range adjusting parameter information corresponding to an image block type to which an image block to be processed in the image block set to be processed belongs for each image block set to be processed in the plurality of image block sets to be processed; and adjusting the pixel value of the pixel in each to-be-processed image block in the to-be-processed image block set based on the preset dynamic range adjustment parameter information.
10. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 8.
11. A storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the method of any of claims 1-8.
CN201910936028.9A 2019-09-29 2019-09-29 Image processing method and device and electronic equipment Pending CN112581376A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910936028.9A CN112581376A (en) 2019-09-29 2019-09-29 Image processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910936028.9A CN112581376A (en) 2019-09-29 2019-09-29 Image processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN112581376A true CN112581376A (en) 2021-03-30

Family

ID=75111107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910936028.9A Pending CN112581376A (en) 2019-09-29 2019-09-29 Image processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112581376A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004274626A (en) * 2003-03-11 2004-09-30 Sony Corp Method and apparatus for imaging and for processing image
CN103959776A (en) * 2011-06-28 2014-07-30 三星电子株式会社 Video encoding method using offset adjustments according to pixel classification and apparatus therefor, video decoding method and apparatus therefor
CN104574455A (en) * 2013-10-29 2015-04-29 华为技术有限公司 Image reestablishing method and device
WO2016051716A1 (en) * 2014-09-29 2016-04-07 日本電気株式会社 Image processing method, image processing device, and recording medium for storing image processing program
CN106911918A (en) * 2015-12-23 2017-06-30 展讯通信(上海)有限公司 The method and device of image pixel correction
CN107945137A (en) * 2017-12-06 2018-04-20 深圳云天励飞技术有限公司 Method for detecting human face, electronic equipment and storage medium
CN107967669A (en) * 2017-11-24 2018-04-27 腾讯科技(深圳)有限公司 Method, apparatus, computer equipment and the storage medium of picture processing
CN110060213A (en) * 2019-04-09 2019-07-26 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004274626A (en) * 2003-03-11 2004-09-30 Sony Corp Method and apparatus for imaging and for processing image
CN103959776A (en) * 2011-06-28 2014-07-30 三星电子株式会社 Video encoding method using offset adjustments according to pixel classification and apparatus therefor, video decoding method and apparatus therefor
CN104574455A (en) * 2013-10-29 2015-04-29 华为技术有限公司 Image reestablishing method and device
WO2016051716A1 (en) * 2014-09-29 2016-04-07 日本電気株式会社 Image processing method, image processing device, and recording medium for storing image processing program
CN106911918A (en) * 2015-12-23 2017-06-30 展讯通信(上海)有限公司 The method and device of image pixel correction
CN107967669A (en) * 2017-11-24 2018-04-27 腾讯科技(深圳)有限公司 Method, apparatus, computer equipment and the storage medium of picture processing
CN107945137A (en) * 2017-12-06 2018-04-20 深圳云天励飞技术有限公司 Method for detecting human face, electronic equipment and storage medium
CN110060213A (en) * 2019-04-09 2019-07-26 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN111028189B (en) Image processing method, device, storage medium and electronic equipment
US10762649B2 (en) Methods and systems for providing selective disparity refinement
US8295606B2 (en) Device and method for detecting shadow in image
EP3496383A1 (en) Image processing method, apparatus and device
US9330446B2 (en) Method and apparatus for processing image
US8600105B2 (en) Combining multiple cues in a visual object detection system
CN108335272B (en) Method and device for shooting picture
CN107241556B (en) Light measuring method and device of image acquisition equipment
US9767387B2 (en) Predicting accuracy of object recognition in a stitched image
US20170337670A1 (en) Inverse tone mapping method and corresponding device
KR20120090491A (en) Image segmentation device and method based on sequential frame imagery of a static scene
JP6389131B2 (en) Detection and removal of ghost artifacts in HDR image generation using local criteria graph criteria selection
CN108364275B (en) Image fusion method and device, electronic equipment and medium
JP6320053B2 (en) Image processing apparatus, image processing method, and computer program
CN111445487A (en) Image segmentation method and device, computer equipment and storage medium
CN111050027B (en) Lens distortion compensation method, device, equipment and storage medium
US8400521B2 (en) Electronic camera
US10863103B2 (en) Setting apparatus, setting method, and storage medium
EP3363193B1 (en) Device and method for reducing the set of exposure times for high dynamic range video imaging
JP2020087005A (en) Image processor, image generation method and program
CN111064864A (en) Method and device for setting distortion correction parameters and endoscope system
JP2019144294A (en) Image processor, microscope system, method for processing image, and image processing program
CN112581376A (en) Image processing method and device and electronic equipment
CN109328373B (en) Image processing method, related device and storage medium thereof
CN111928944B (en) Laser ray detection method, device and system

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