WO2022041287A1 - Image acquisition method and apparatus, device, and computer-readable storage medium - Google Patents

Image acquisition method and apparatus, device, and computer-readable storage medium Download PDF

Info

Publication number
WO2022041287A1
WO2022041287A1 PCT/CN2020/112740 CN2020112740W WO2022041287A1 WO 2022041287 A1 WO2022041287 A1 WO 2022041287A1 CN 2020112740 W CN2020112740 W CN 2020112740W WO 2022041287 A1 WO2022041287 A1 WO 2022041287A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
value
type
control parameter
brightness control
Prior art date
Application number
PCT/CN2020/112740
Other languages
French (fr)
Chinese (zh)
Inventor
程敏
胡彬林
邓志鹏
刘俊
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202080006227.0A priority Critical patent/CN114450934B/en
Priority to PCT/CN2020/112740 priority patent/WO2022041287A1/en
Publication of WO2022041287A1 publication Critical patent/WO2022041287A1/en

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

Definitions

  • the present application relates to the technical field of image capturing, and in particular, to a method, apparatus, device, and computer-readable storage medium for acquiring an image.
  • the present application provides a method, apparatus, device and computer-readable storage medium for acquiring an image, which can improve the quality of the acquired image and solve the problem of motion smearing.
  • a method for acquiring an image is provided, and the method is applied to a processor of an electronic device, where the electronic device includes but is not limited to a device capable of acquiring images, such as a camera and a video camera.
  • the processor acquires the pixel values of at least two types of pixel points in the image pixel array.
  • the pixel values of different types of pixel points are generated according to different brightness control parameters.
  • the class pixels are all black and white pixels, or the at least two types of pixels are all color pixels.
  • the processor obtains images corresponding to each brightness control parameter according to the pixel values of at least two types of pixel points; and fuses the images corresponding to each brightness control parameter.
  • each type is photographed with different brightness control parameters, so that pixels at different positions in the same frame use different Shooting with brightness control parameters can retain both highlight details and dark details to achieve a higher dynamic range.
  • the pixels at different positions are shot with different brightness control parameters, they all end the exposure at the same time in the same frame, and the images corresponding to the fused different brightness control parameters are also obtained based on the same frame of image, so it can be Minimize motion smearing.
  • the brightness control parameters include but are not limited to exposure duration and gain, and different brightness control parameters refer to the same exposure duration and different gains; or, different brightness control parameters refer to different exposure durations and the same gain; or, different brightness control parameters.
  • the brightness control parameter means that the exposure time is different, and the gain is also different. In the case of different exposure durations, it is necessary to end the exposure at the same time. That is to say, when shooting according to different brightness control parameters, the exposure start time can be different, but the exposure end time needs to be the same, so as to ensure that the images captured according to different brightness control parameters are the same frame image.
  • the at least two types of pixel points include a first type of pixel point and a second type of pixel point, the pixel value of the first type of pixel point is generated according to the first brightness control parameter, and the second type of pixel point The pixel value is photographed and generated according to the second brightness control parameter;
  • Obtaining an image corresponding to each brightness control parameter according to the pixel values of at least two types of pixels includes: obtaining a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel, and obtaining a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel; Acquiring a second image corresponding to the second brightness control parameter; fusing the images corresponding to each brightness control parameter includes: fusing the first image and the second image.
  • acquiring the first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel in an interpolation manner includes: determining the second type of pixel according to the pixel value of the first target pixel The first cross-correlation interpolation of the point under the first brightness control parameter, the first image is obtained according to the pixel value of the first type of pixel point and the first cross-correlation interpolation, and the first target pixel point includes pixels adjacent to the second type of pixel points.
  • the first type of pixel point includes:
  • Acquiring the second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel includes: determining the second cross-correlation of the first type of pixel under the second brightness control parameter according to the pixel value of the second target pixel Interpolation, obtaining a second image according to the pixel value of the second type of pixel point and the second cross-correlation interpolation, and the second target pixel point includes the second type of pixel point adjacent to the first type of pixel point.
  • determining the first cross-correlation interpolation value of the second type of pixel point under the first brightness control parameter according to the pixel value of the first target pixel point includes: determining according to the pixel value of the second type of pixel point The weighted weight of the first target pixel point, the weighted weight of the first target pixel point is positively correlated with the difference between the second type of pixel point and the first target pixel point; the first cross-correlation interpolation of the pixel-like point under the first brightness control parameter;
  • Determining the second cross-correlation interpolation of the first type of pixels under the second brightness control parameter according to the pixel value of the second target pixel includes: determining the weighting weight of the second target pixel according to the pixel value of the first type of pixel, The weighted weight of the second target pixel is positively correlated with the difference between the first type of pixel and the second target pixel; according to the pixel value of the second target pixel and the weighted weight, the first type of pixel is determined in the second brightness control parameter The second cross-correlation interpolation under .
  • determining the first cross-correlation interpolation value of the second type of pixel point under the first brightness control parameter according to the pixel value of the first target pixel point and the weighted weight including:
  • any first target pixel For any first target pixel, multiply the pixel value and weighted weight of any first target pixel to obtain a product result corresponding to any first target pixel; multiply the product result corresponding to each first target pixel Accumulate to obtain the first accumulated sum; accumulate the weighted weights of each first target pixel point to obtain the second accumulated sum; take the quotient of the first accumulated sum and the second accumulated sum as the second type of pixel point in the first brightness first cross-correlation interpolation under control parameters;
  • Determining the first cross-correlation interpolation of the second type of pixel point under the first brightness control parameter includes: determining the second type of pixel point under the first brightness control parameter according to the pixel value of the first target pixel point and the weighted weight according to the following formula.
  • the second cross-correlation interpolation of the first type of pixels under the second brightness control parameter is determined according to the pixel value of the second target pixel and the weighted weight, including:
  • any second target pixel point For any second target pixel point, multiply the pixel value and weighted weight of any second target pixel point to obtain the product result corresponding to any second target pixel point; multiply the product result corresponding to each second target pixel point Accumulate to obtain the third cumulative sum; accumulate the weighted weights of each second target pixel point to obtain the fourth cumulative sum; take the quotient of the third cumulative sum and the fourth cumulative sum as the first type of pixel point in the second brightness
  • the second cross-correlation interpolation under the control parameter.
  • the second cross-correlation interpolation W′ 1 of the first type of pixel under the second brightness control parameter is determined according to the following formula:
  • ⁇ 1i is the weighted weight of the second target pixel
  • W 1i is the pixel value of the second target pixel
  • N 2 is the number of the second target pixel.
  • the second brightness control parameter is smaller than the first brightness control parameter
  • fusing the first image and the second image includes:
  • the brightness smoothing algorithm is used to achieve the imaging target that the highlight area is not exposed and the dark area is not too dark, so as to keep the clarity of the final image obtained without loss.
  • the pixel value of the first type of pixel point and the second cross-correlation interpolation value are aligned according to the first luminance control parameter to obtain the first luminance alignment result, including:
  • the pixel value of the first type of pixel point and the second cross-correlation interpolation are brightness aligned according to the first brightness control parameter, and the first brightness alignment result is obtained,
  • the difference multiple is obtained based on the comprehensive difference between the first brightness control parameter and the second brightness control parameter;
  • the pixel value of the first type of pixel point and the second cross-correlation interpolation are brightness aligned according to the first brightness control parameter, Get the first brightness alignment result
  • K is the difference multiple of the first brightness control parameter and the second brightness control parameter
  • BL is the value of the black level
  • W′ 2 is the second cross-correlation interpolation.
  • Perform luminance alignment on the pixel values of the second type of pixel points and the first cross-correlation interpolation according to the first luminance control parameter to obtain a second luminance alignment result including: according to the difference between the first luminance control parameter and the second luminance control parameter Multiples, the pixel values of the second type of pixels and the first cross-correlation interpolation are brightness aligned according to the first brightness control parameter to obtain a second brightness alignment result.
  • the pixel value of the second type of pixel point and the first cross-correlation interpolation are brightness aligned according to the first brightness control parameter, and the second brightness alignment result is obtained:
  • W 2 is the pixel value of the second type of pixel point.
  • fusing the pixel value of the first type of pixel point and the first brightness alignment result includes:
  • the quotient of the values is used as the fusion result of the pixel value of the first type of pixel point and the first luminance alignment result.
  • the pixel value of the first type of pixel point and the corresponding weighted weight are fused according to the following formula:
  • W F1 is the pixel value W 1 of the first type of pixel point and the first brightness alignment result
  • the fusion result of ⁇ 11 is the first weighting weight
  • ⁇ 12 is the second weighting weight.
  • Fusion of the first cross-correlation interpolation and the second luminance alignment results including:
  • the first cross-correlation interpolation and the second luminance alignment result are fused according to the following formula :
  • W F2 is the first cross-correlation interpolation W′ 1 and the second luminance alignment result
  • ⁇ 21 is the third weighting weight
  • ⁇ 22 is the fourth weighting weight.
  • the method before fusing the pixel values of the first type of pixel points and the first brightness alignment result, the method further includes: based on the fact that W 1 is less than the first excessive dark threshold, determining ⁇ 11 as the first value, and ⁇ 12 as the first value the second value, where the first value is greater than the second value; or, based on the fact that W 1 is greater than or equal to the first over-dark threshold, determine that ⁇ 11 is the second value and ⁇ 12 is the first value;
  • the method further includes: determining ⁇ 21 as the second value and ⁇ 22 as the first value based on W′ 1 being greater than the first overexposure threshold; or, based on W′ 1 being less than the first overexposure threshold Equal to the first overexposure threshold, determine ⁇ 21 as the first value and ⁇ 22 as the second value.
  • the method before fusing the pixel values of the first type of pixels and the first brightness alignment result, the method further includes: based on the fact that W 1 is less than the second dark threshold, determining that ⁇ 11 is the first value, and ⁇ 12 is the first value. the second value, the first value is greater than the second value; or, based on W 1 greater than the second overexposure threshold, determine ⁇ 11 to be the second value, and ⁇ 12 to be the first value; or, based on W 1 between the second overexposure threshold Between the threshold and the second overexposure threshold, it is determined that ⁇ 11 starts from the first value and decreases as W 1 increases, and ⁇ 12 starts from the second value and increases as W 1 increases;
  • the method further includes: based on the fact that W′ 1 is smaller than the second over-darkness threshold, determining that ⁇ 21 is a first value, ⁇ 22 is a second value, and the first value is greater than the second value ; or, based on W′ 1 being greater than the second overexposure threshold, determine the second value of ⁇ 21 , and ⁇ 22 as the first value; or, based on W′ 1 being between the second overexposure threshold and the second overexposure threshold, It is determined that ⁇ 21 decreases from the first value as W' 1 increases, and ⁇ 22 increases from the second value as W' 1 increases.
  • the method is applied to a processor of an electronic device, and the electronic device further includes an image sensor and at least two control circuits, and the at least two control circuits are used to control the image sensor to shoot according to different brightness control parameters Generate pixel values in different classes of pixels.
  • an apparatus for acquiring an image comprising:
  • the first acquisition module is used to acquire the pixel values of at least two types of pixel points in the image pixel array.
  • the pixel values of different types of pixel points are generated according to different brightness control parameters, and at least two types of pixel points are generated. All are black and white pixels, or at least two types of pixels are color pixels;
  • a second acquisition module configured to acquire an image corresponding to each brightness control parameter according to pixel values of at least two types of pixel points
  • the fusion module is used to fuse the images corresponding to each brightness control parameter.
  • the at least two types of pixel points include a first type of pixel point and a second type of pixel point, the pixel value of the first type of pixel point is generated according to the first brightness control parameter, and the second type of pixel point The pixel value is photographed and generated according to the second brightness control parameter;
  • a second obtaining module configured to obtain a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel, and obtain a second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel;
  • the fusion module is used to fuse the first image and the second image.
  • the second obtaining module is configured to determine the first cross-correlation interpolation value of the second type of pixel under the first brightness control parameter according to the pixel value of the first target pixel, and according to the first type of pixel
  • the first image is obtained by interpolating the pixel value of the point and the first cross-correlation, and the first target pixel includes the first-type pixel point adjacent to the second-type pixel point;
  • the second acquisition module is configured to determine the second cross-correlation interpolation value of the first type of pixel point under the second brightness control parameter according to the pixel value of the second target pixel point, according to the pixel value of the second type of pixel point and the second cross-correlation value
  • the second image is obtained by interpolation, and the second target pixel point includes a second type of pixel point adjacent to the first type of pixel point.
  • the second acquisition module is configured to determine the weighted weight of the first target pixel point according to the pixel value of the second type of pixel point, and the weighted weight of the first target pixel point is related to the second type of pixel point and The difference of the first target pixel is positively correlated; the first cross-correlation interpolation of the second type of pixel under the first brightness control parameter is determined according to the pixel value of the first target pixel and the weighted weight;
  • the second acquisition module is configured to determine the weighted weight of the second target pixel point according to the pixel value of the first type of pixel point, and the weighted weight of the second target pixel point is positively related to the difference between the first type of pixel point and the second target pixel point Correlation; determining the second cross-correlation interpolation value of the first type of pixels under the second brightness control parameter according to the pixel value of the second target pixel and the weighted weight.
  • the second obtaining module is configured to multiply the pixel value of any first target pixel and the weighted weight for any first target pixel to obtain any first target pixel Corresponding product results; the product results corresponding to each first target pixel are accumulated to obtain a first cumulative sum; the weighted weights of each first target pixel are accumulated to obtain a second cumulative sum; the first cumulative sum and The quotient of the second accumulated sum is used as the first cross-correlation interpolation of the second type of pixels under the first brightness control parameter;
  • the second obtaining module is used for multiplying the pixel value of any second target pixel and the weighted weight for any second target pixel to obtain a product result corresponding to any second target pixel;
  • the product results corresponding to the target pixels are accumulated to obtain the third accumulated sum;
  • the weighted weights of each second target pixel are accumulated to obtain the fourth accumulated sum;
  • the quotient of the third accumulated sum and the fourth accumulated sum is taken as the first
  • the second brightness control parameter is smaller than the first brightness control parameter
  • the fusion module is configured to perform brightness alignment between the pixel value of the first type of pixel and the second cross-correlation interpolation value according to the first brightness control parameter , obtain the first brightness alignment result, fuse the pixel value of the first type of pixel point and the first brightness alignment result; align the pixel value of the second type of pixel point and the first cross-correlation interpolation according to the first brightness control parameter.
  • the fusion module is configured to interpolate the pixel value of the first type of pixel and the second cross-correlation interpolation according to the difference multiple between the first brightness control parameter and the second brightness control parameter according to the first
  • the brightness control parameters are brightness aligned to obtain a first brightness alignment result, and the difference multiple is obtained based on the comprehensive difference between the first brightness control parameter and the second brightness control parameter;
  • the fusion module is configured to perform brightness alignment on the pixel value of the second type of pixel point and the first cross-correlation interpolation according to the first brightness control parameter according to the difference multiple between the first brightness control parameter and the second brightness control parameter, to obtain the first brightness control parameter. Two luminance alignment results.
  • the fusion module is used to multiply the pixel values of the first type of pixel points and the corresponding weighted weights to obtain a first product result, and multiply the first brightness alignment result and the corresponding weighted weights , obtain the second product result; sum the first product result and the second product result to obtain the first sum value; sum the weighting weight corresponding to the first type of pixel point and the weighting weight corresponding to the first brightness alignment result to obtain The second sum value; the quotient of the first sum value and the second sum value is used as the fusion result of the pixel value of the first type of pixel point and the first brightness alignment result;
  • the fusion module is used to multiply the first cross-correlation interpolation and the corresponding weighted weight to obtain the third product result, and multiply the second brightness alignment result and the corresponding weighted weight to obtain the fourth product result; Sum the result of the fourth product to obtain the third sum value; sum the weighted weight corresponding to the second type of pixel point and the weighted weight corresponding to the second brightness alignment result to obtain the fourth sum value; combine the third sum value with the first The quotient of the four-sum value is used as the fusion result of the first cross-correlation interpolation and the second luminance alignment result.
  • the fusion module is further configured to determine that ⁇ 11 is a first value, ⁇ 12 is a second value, and the first value is greater than the second value based on the fact that W 1 is smaller than the first over-dark threshold; or, Based on W 1 being greater than or equal to the first over-dark threshold, determine that ⁇ 11 is the second value, and ⁇ 12 is the first value;
  • the fusion module is further configured to determine that ⁇ 21 is the second value and ⁇ 22 is the first value based on the fact that W′ 1 is greater than the first overexposure threshold; or, based on the fact that W′ 1 is less than or equal to the first overexposure threshold, determine that ⁇ 21 is The first value, ⁇ 22 is the second value.
  • the fusion module is further configured to determine that ⁇ 11 is the first value, ⁇ 12 is the second value, and the first value is greater than the second value based on the fact that W 1 is less than the second over-dark threshold; or, Based on W 1 being greater than the second overexposure threshold, it is determined that ⁇ 11 is the second value and ⁇ 12 is the first value ; The first value starts to decrease with the increase of W 1 , and ⁇ 12 starts to increase with the increase of W 1 from the second value;
  • the fusion module is further configured to determine that ⁇ 21 is the first value, ⁇ 22 is the second value, and the first value is greater than the second value based on W′ 1 being less than the second over-dark threshold; or, based on W′ 1 being greater than the second over-dark threshold exposure threshold, determine the second value of ⁇ 21 and ⁇ 22 as the first value; or, based on W′ 1 being between the second over-dark threshold and the second over-exposure threshold, determine that ⁇ 21 starts from the first value and increases with W′ 1 decreases and ⁇ 22 increases from the second value as W′ 1 increases.
  • an electronic device in a third aspect, includes a processor, an image sensor, and at least two control circuits, where the at least two control circuits are used to control the image sensor to generate different types of pixels according to different brightness control parameters.
  • the processor is configured to perform the first aspect and the method for acquiring an image in any one of the first aspects.
  • a computer-readable storage medium comprising at least one instruction, the instruction being executed by a processor to implement the first aspect and any possible implementation manner of the first aspect of acquiring an image. method.
  • a computer program (product) comprising: computer program code which, when executed by a computer, causes the computer to perform the methods in the above-mentioned aspects.
  • a chip includes a processor for invoking and executing instructions stored in the memory from a memory to cause a communication device on which the chip is mounted to perform the methods of the above aspects.
  • FIG. 1 is a structural diagram of an image pixel array provided by an embodiment of the present application.
  • FIG. 2 is a structural diagram of an image pixel array provided by an embodiment of the present application.
  • FIG. 3 is a structural diagram of an image pixel array provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 5 is a flowchart of a method for acquiring an image provided by an embodiment of the present application.
  • FIG. 6 is a flowchart of a method for acquiring an image provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a process of acquiring an image according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a 3*3 pixel array provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of the relationship between the weighted weights corresponding to the first type of pixel points and the weighted weights corresponding to the first brightness alignment result provided by the embodiment of the present application;
  • FIG. 10 is a schematic structural diagram of an apparatus for acquiring an image provided by an embodiment of the present application.
  • an embodiment of the present application proposes a method for acquiring an image, which adopts multiple exposures within a frame, that is, different brightness control parameters are used for pixels in the same frame at different positions to achieve higher dynamic Scope. Since pixels at different positions are exposed simultaneously, motion smearing is minimized.
  • the embodiments of the present application improve the image sensor.
  • the image pixel array included in the color filter array (color filter array, CFA) image sensor shown in FIG. 1 includes two types of pixel points, one is a color pixel point, and the pixels of the color pixel point are Value dimension color value; one is black and white pixel point, black and white pixel point is also called grayscale pixel point, the pixel value of this black and white pixel point is gray value.
  • R, G, and B shown in FIG. 1 are color pixels, and color information can be obtained by restoring the color pixels.
  • W is a black and white pixel point, through which a black and white image can be obtained. Combining color and black and white results in a high-quality color image.
  • the same type of pixel in the image pixel array is divided into at least two types, and each type is photographed with different brightness control parameters, so as to achieve, within the same frame, Pixels at different positions are shot with different brightness control parameters to achieve a higher dynamic range.
  • black and white pixels are divided into at least two categories, or color pixels are divided into at least two categories.
  • the black and white pixels are divided into two categories, one is the black and white pixels in odd rows, and the other is black and white pixels in even rows.
  • Mark the black and white pixels of odd rows as W1 mark the black and white pixels of even rows as W2, and use the black and white pixels of odd rows (W1) and the black and white pixels of even rows (W2) to be controlled by different circuits to achieve the same configuration.
  • W1 is controlled by control circuit 1
  • W2 is controlled by control circuit 2.
  • the brightness control parameters of W1 and W2 are the same, it is a linear exposure mode, which is suitable for scenes with relatively uniform ambient lighting conditions.
  • FIG. 3 shows a pixel array included in a CFA array sensor in which different brightness control parameters are set in rows and columns respectively.
  • W1 is controlled by control circuit 1
  • W2 is controlled by control circuit 2
  • W3 is controlled by control circuit 3
  • W4 is controlled by control circuit 4.
  • FIG. 2 and FIG. 3 are only for classifying black and white pixels and configuring different brightness control parameters as an example to illustrate, but are not used to limit the present application.
  • the color pixels are divided into at least two types, and different brightness control parameters are configured for each type of color pixels.
  • the process of applying the method provided by the embodiment of the present application for classifying based on color pixels is consistent with the process of applying the method provided by the embodiment of the present application for classifying based on black and white pixels. Be explained.
  • the embodiments of the present application do not limit brightness control parameters, including but not limited to exposure parameters and gain, and exposure parameters include but are not limited to exposure duration.
  • the execution body of the method may be an electronic device such as a camera, a video camera, etc. that can acquire images.
  • the electronic device includes a lens 401 , an image sensor 402 , a control circuit 403 , a processor 404 and an encoder 405 .
  • the processor 404 is connected with the control circuit 403 and the image sensor 402 .
  • control circuit 403 is used to receive the feedback from the processor 404, and use at least two brightness control parameters to control the image sensor 402; the image sensor 402 is used to perform photoelectric conversion according to the control of the control circuit 403 to generate an image pixel array, wherein, each brightness control parameter of the control circuit 403 corresponds to a type of pixel point.
  • the electronic device includes at least two control circuits 403, and the at least two control circuits are used to control the image sensor 402 to generate pixel values in different types of pixel points by photographing according to different brightness control parameters.
  • the image sensor 402 when acquiring an image, light enters the lens 401, and the lens 401 transmits the light to the image sensor 402; the image sensor 402 performs photoelectric conversion to generate an original image. Since the pixels of the image sensor 402 are controlled by the control circuit 403, corresponding image pixels, that is, the pixel values of the pixels, are generated based on different brightness control parameters.
  • the image directly generated by the image sensor 402 is in RAW format.
  • the format of the RAW image is also different. For example, it can be Bayer RGGB, RYYB, RCCC, RCCB, RGBW, CMYW and other formats.
  • the image sensor 402 sends the initial image to the processor 404, which may have an ISP function, and the processor 404 performs image signal processing. For example, convert RAW images of various formats to RGB format. You can also convert RAW format to YUV format, or HSV format, Lab format, CMY format, YCbCr format. These formats may be referred to as raw media data formats.
  • the processor 404 applies the method provided by the embodiment of the present application to perform processing such as interpolation, and controls the control circuit 403 .
  • the encoder 405 encodes (that is, compresses) the image, and the format of the generated image or video may be: jpeg format, bmp format, tga format, png format, and gif format.
  • Video media formats such as: MPEG format, AVI format, nAVI format, ASF format, MOV format, WMV format, 3GP format, RM format, RMVB format, FLV/F4V format, H.264 format, H.265 format.
  • the processor 404 and the encoder 405 may be integrated together.
  • HiSilicon chip It is a chip that integrates the functions of the processor 404 and the encoder 405 .
  • the method is applied to the processor of the electronic device.
  • the method provided by the embodiment of the present application includes the following processes.
  • step 501 the processor of the electronic device obtains the pixel values of at least two types of pixel points in the image pixel array.
  • the pixel values of different types of pixel points are generated according to different brightness control parameters.
  • the dots are all black and white pixels, or the at least two types of pixels are all color pixels.
  • the same type of pixel in the image pixel array is divided into at least two types, and the at least two types of pixels may be black and white pixels. , or, the at least two types of pixel points are all color pixel points.
  • the pixel values of the at least two types of pixel points are generated according to different brightness control parameters, and the brightness control parameters can be controlled by the control circuit.
  • the electronic device includes an image sensor, a control circuit and a processor, and the processor is connected to the image sensor and the control circuit respectively, the processor can not only read the pixel values of the pixel points in the pixel array included in the image sensor, but also pass the control circuit Determine the brightness control parameters corresponding to the pixels.
  • the embodiments of the present application do not limit the number of at least two types of pixel points into which the same type of pixel point is divided, which may be determined based on the configuration of the electronic device. For example, if the black and white pixels are divided into two types of pixel points W1 and W2 as shown in FIG. 2, the processor obtains the pixel values of the two types of black and white pixel points W1 and W2. If the black and white pixels are divided into four types of pixels W1, W2, W3 and W4 as shown in FIG. 3, the processor obtains the pixel values of the four types of black and white pixels W1, W2, W3 and W4.
  • the brightness control parameters include but are not limited to exposure duration and gain. Different brightness control parameters refer to the same exposure duration and different gains; or, different brightness control parameters refer to different exposure durations and the same gain; or, different brightness control parameters The parameter means that the exposure time is different, and the gain is also different.
  • the exposure start time can be different, but the exposure end time needs to be the same, so as to ensure that the images captured according to different brightness control parameters are the same frame of image.
  • Step 502 the processor of the electronic device obtains images corresponding to each brightness control parameter according to the pixel values of the at least two types of pixel points.
  • an image can be obtained from the pixel values of the pixel points generated according to each brightness control parameter.
  • the brightness control parameter including the exposure parameter, and the exposure parameter being the exposure duration as an example, images with different display effects can be obtained with different exposure durations.
  • the two brightness control parameters as long exposure and short exposure can obtain dark detail information, and short exposure can obtain highlight detail information. Therefore, the electronic device acquires an image with dark detail information and an image with highlight detail information.
  • the embodiment of the present application obtains the pixel value according to the pixel value of the at least two types of pixel points.
  • the image corresponding to each brightness control parameter is a complete image, and the number of pixels in the image is consistent with the number of pixels in the image pixel array. Since the pixel value of each type of pixel point in the at least two types of pixel points is generated according to the corresponding brightness control parameters, it does not have pixel values generated according to other brightness control parameters. For example, taking the image pixel array shown in FIG.
  • the pixel value of W1 controlled by the control circuit 1 is generated according to the brightness control parameter 1 corresponding to W1, and the W1 does not have the brightness control parameter corresponding to W3.
  • 3 Generated pixel values.
  • the pixel value of W3 controlled by the control circuit 3 is generated according to the brightness control parameter 3 corresponding to W3, and the W3 does not have the pixel value generated according to the brightness control parameter 1 corresponding to W1.
  • the embodiment of the present application does not limit the manner of determining the pixel values of other pixel points that do not correspond to any brightness control parameter according to the pixel value of the pixel point corresponding to any brightness control parameter. For example, it can be implemented by means of interpolation or by means of mean value.
  • each black and white pixel in the image pixel array has a pixel value corresponding to the brightness control parameter 1, thereby generating a black and white image corresponding to the brightness control parameter 1.
  • each black and white pixel in the image pixel array has a pixel value corresponding to the brightness control parameter 3 , thereby generating a black and white image corresponding to the brightness control parameter 3 .
  • Step 503 the processor of the electronic device fuses the images corresponding to each brightness control parameter.
  • the method of fusing the images corresponding to each brightness control parameter is not limited in this embodiment of the present application.
  • each type is shot with different brightness control parameters, so as to achieve the same
  • the pixels in the frame and at different positions are shot with different brightness control parameters, which can retain both highlight details and dark details to achieve a higher dynamic range.
  • the pixels at different positions are shot with different brightness control parameters, the exposure is ended at the same time in the frame, and the images corresponding to the different brightness control parameters fused are also obtained based on the same frame image, so the maximum Minimize motion smearing.
  • the method provided by this embodiment of the present application is illustrated by taking the same pixel point in the image pixel array as an example of being divided into two types of pixel points, in conjunction with the image pixel array shown in FIG. 2 . Still taking the execution body of the method as an example of a processor of an electronic device, referring to FIG. 6 , the method provided by the embodiment of the present application includes the following processes.
  • step 601 the processor of the electronic device obtains the pixel value of the first type of pixel point and the pixel value of the second type of pixel point in the image pixel array, the pixel value of the first type of pixel point is captured and generated according to the first brightness control parameter, and the first type of pixel point is photographed and generated.
  • the pixel values of the second type of pixel points are photographed and generated according to the second brightness control parameter.
  • the at least two control circuits included in the electronic device are a first control circuit and a second control circuit; the first control circuit is used to control the image sensor to convert light into an electrical signal according to the first brightness control parameter to capture the image The pixel value of the first type of pixel point; the second control circuit is used to control the image sensor to convert light into an electrical signal according to the second brightness control parameter to obtain the pixel value of the second type of pixel point.
  • the first type of pixel points and the second type of pixel points are both black and white pixel points, or, the first type of pixel points and the second type of pixel points are both color pixel points.
  • the values of the first brightness control parameter and the second brightness control parameter are different, and the embodiments of the present application do not limit the values of the first brightness control parameter and the second brightness control parameter.
  • Both the first brightness control parameter and the second brightness control parameter include, but are not limited to, exposure duration and gain.
  • the exposure duration of the first brightness control parameter and the second brightness control parameter are the same, but the gain is different;
  • the exposure duration of the brightness control parameter is different, and the gain is the same; or, the exposure duration of the first brightness control parameter and the second brightness control parameter are different, and the gain is also different.
  • different exposure durations it is necessary to end the exposure at the same time. That is to say, when shooting according to the first brightness control parameter and the second brightness control parameter, the exposure start time can be different, but the exposure end time needs to be the same, so as to ensure the image obtained according to the first brightness control parameter and the second brightness control parameter. is the same frame image.
  • Step 602 The processor of the electronic device obtains a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel, and obtains a second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel.
  • the first type of pixel point and the second type of pixel point are not all the pixel points in the image pixel array, but one of the pixel points, the first type of pixel point is obtained according to the pixel value of the first type of pixel point in the embodiment of the present application.
  • the first image corresponding to a brightness control parameter and the second image corresponding to the second brightness control parameter obtained according to the pixel values of the second type of pixels are both complete images.
  • the number of pixels in the first image and the second image All are consistent with the number of pixels in the image pixel array. Part of the values of the pixels in the first image are obtained directly from the image pixel array, and the remaining part is calculated from the directly obtained values of this part of the pixels.
  • the first image and the second image are initial images, and the number of pixels in the initial image is the same as the number of pixels in the image pixel array.
  • the image pixel array is an image in RAW format, and the first and second images are also in the same format. Since the pixel value of the first type of pixel point is generated by shooting according to the first brightness control parameter, the first type of pixel point does not have the pixel value generated by shooting according to the second brightness control parameter. The pixel value of the second type of pixel point is generated by shooting according to the second brightness control parameter, and the second type of pixel point does not have the pixel value generated by shooting according to the first brightness control parameter.
  • the pixel value of the first type of pixel corresponding to the first brightness control parameter can be used to determine the The pixel value of the second type of pixel point corresponding to the first brightness control parameter.
  • the embodiment of the present application does not limit the manner of determining the pixel value of the second type of pixel point not corresponding to the first brightness control parameter according to the pixel value of the first type of pixel point corresponding to the first brightness control parameter. For example, it can be implemented by means of mean value or by means of interpolation.
  • the mean value method when determining the pixel value of the second type pixel point under the first brightness control parameter, determine the average value of the pixel value of each first type pixel point adjacent to the second type pixel point, and use The average value is used as the pixel value of the second type of pixel point under the first brightness control parameter.
  • the pixel value of any W1 is generated according to the first brightness control parameter
  • the pixel value of any W2 is generated according to the second brightness control parameter.
  • the pixel values of four W1 adjacent to the W2 are averaged, and the obtained average value is used as the pixel value of the W2 under the first brightness control parameter.
  • the average value is taken as the pixel value of the pixel point of the second type under the first brightness control parameter.
  • the average value of the pixel values of all the pixel points of the first type can also be determined, and the pixel value of each pixel point of the second type under the first brightness control parameter is set as the average value.
  • acquiring the first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel point includes: determining the second type of pixel according to the pixel value of the first target pixel point The first cross-correlation interpolation of the point under the first brightness control parameter; the first image is obtained according to the pixel value of the first type of pixel point and the first cross-correlation interpolation, and the first target pixel point includes pixels adjacent to the second type of pixel point.
  • the first type of pixels includes: determining the second type of pixel according to the pixel value of the first target pixel point The first cross-correlation interpolation of the point under the first brightness control parameter; the first image is obtained according to the pixel value of the first type of pixel point and the first cross-correlation interpolation, and the first target pixel point includes pixels adjacent to the second type of pixel point. The first type of pixels.
  • W1 is the first type of pixel point.
  • the pixel value of each first type of pixel point is recorded as W1, but it does not represent the value of each first type of pixel point.
  • the pixel values are the same, and the pixel values of each first-type pixel point may be determined based on the current environment, and may be different pixel values, which are only for ease of understanding.
  • W2 is the second type of pixel point, and for ease of understanding, the pixel value of each second type of pixel point is denoted as W2.
  • W2' is the pixel value of the second type of pixel by interpolation of the pixel value of the first target pixel under the first brightness control parameter, and the first target pixel is the first type of pixel adjacent to the second type of pixel. point.
  • the pixel points corresponding to each number 1 are the first type of pixel points, and the pixel value of the pixel point corresponding to each number 1 is based on the first brightness control parameter generate.
  • the pixels corresponding to the number 2 in FIG. 8 are the second type of pixels, and the pixels corresponding to each number 1 are the first type of pixels adjacent to the pixels corresponding to the number 2, so the pixels corresponding to each number 1 are of the first type.
  • the points are all first target pixel points, and the pixel value of the pixel point corresponding to the number 2 under the first brightness control parameter is obtained by interpolating the pixel value of the pixel point corresponding to each number 1.
  • determining the first cross-correlation interpolation value of the second type of pixel point under the first brightness control parameter according to the pixel value of the first target pixel point includes: determining the first cross-correlation interpolation value according to the pixel value of the second type of pixel point The weighted weight of the target pixel point, the weighted weight of the first target pixel point is positively correlated with the difference between the second type of pixel point and the first target pixel point; the second type of pixel is determined according to the pixel value of the first target pixel point and the weighted weight. Click the first cross-correlation interpolation under the first brightness control parameter.
  • the embodiment of the present application does not limit the method of determining the weighted weight of the first target pixel point according to the pixel value of the second type of pixel point.
  • the weighted weight of the first target pixel point is related to the second type of pixel point and the first target pixel
  • the difference size of the points is positively correlated, including but not limited to mapping the difference between the second type of pixel point and the first target pixel point as the weighted weight of the first target pixel point, the greater the difference between the second type of pixel point and the first target pixel point. is smaller, the smaller the weighted weight of the first target pixel point, the greater the difference between the second type of pixel point and the first target pixel point, the greater the weighted weight of the first target pixel point.
  • the pixel point corresponding to each number 1 is used as the first target pixel point, and the weighted weight of the pixel point corresponding to each number 1 passes through the pixel point corresponding to each number 1 The size of the difference between the pixels corresponding to the number 2 is determined.
  • determining the first cross-correlation interpolation of the second type of pixel under the first brightness control parameter according to the pixel value of the first target pixel and the weighted weight including: for any first target pixel, determining the The pixel value of a first target pixel is multiplied by the weighted weight of the first target pixel to obtain a product result corresponding to any one of the first target pixels. After that, the product results corresponding to each first target pixel are accumulated to obtain a first accumulated sum. The weighted weights of each first target pixel are accumulated to obtain a second accumulated sum. The quotient of the first accumulated sum and the second accumulated sum is used as the first cross-correlation interpolation of the second type of pixels under the first brightness control parameter.
  • the weighted weight determines the first cross-correlation interpolation of the second type of pixel point under the first brightness control parameter, including: according to the pixel value of the first target pixel point and the weighted weight, according to the following formula, determine the second type of pixel point in the first brightness control
  • acquiring the second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel includes: determining, according to the pixel value of the second target pixel, whether the first type of pixel is in the second brightness control For the second cross-correlation interpolation under the parameters, a second image is obtained according to the pixel value of the second-type pixel point and the second cross-correlation interpolation, and the second target pixel point includes the second-type pixel point adjacent to the first-type pixel point.
  • determining the second cross-correlation interpolation of the first type of pixel under the second brightness control parameter according to the pixel value of the second target pixel includes but not limited to: determining the second target pixel according to the pixel value of the first type of pixel The weighted weight of the point, the weighted weight of the second target pixel point is positively correlated with the difference between the first type of pixel point and the second target pixel point; The second cross-correlation interpolation under the second brightness control parameter.
  • determining the second cross-correlation interpolation of the first type of pixel under the second brightness control parameter according to the pixel value of the second target pixel and the weighted weight including: for any second target pixel, adding any Multiply the pixel value of the second target pixel and the weighted weight to obtain a product result corresponding to any second target pixel; accumulate the product results corresponding to each second target pixel to obtain a third cumulative sum; The weighted weights of the two target pixels are accumulated to obtain a fourth accumulated sum; the quotient of the third accumulated sum and the fourth accumulated sum is used as the second cross-correlation interpolation of the first type of pixels under the second brightness control parameter.
  • the second cross-correlation interpolation W′ 1 of the first type of pixel under the second brightness control parameter is determined according to the following formula:
  • ⁇ 1i is the weighted weight of the second target pixel
  • W 1i is the pixel value of the second target pixel
  • N 2 is the number of the second target pixel.
  • Step 603 the processor of the electronic device fuses the first image and the second image.
  • the first image is an image corresponding to the first brightness control parameter
  • the second image is an image corresponding to the second brightness control parameter
  • the first image and the second image are fused.
  • the pixel value of each pixel point of the first image is fused with the pixel value of each pixel point corresponding to the second image.
  • the embodiment of the present application does not limit the manner of fusing the first image and the second image.
  • the method provided by the embodiment of the present application further includes a process of aligning the brightness of the first image and the second image, so as to Through the brightness smoothing algorithm, the imaging target of not exposing the bright area and not being too dark in the dark area is realized, so as to keep the clarity of the final image obtained without loss.
  • the method for fusing the first image and the second image provided by the embodiments of the present application includes but is not limited to the following processes 603A1 to 603A4.
  • the second cross-correlation interpolation is also the value corresponding to the first type of pixel, but the second cross-correlation interpolation is under the second brightness control parameter. value of . That is to say, for the same first type of pixel point, there is not only a pixel value generated according to the first brightness control parameter, but also a second mutual interpolation corresponding to the second brightness control parameter. Therefore, it is necessary to align the brightness of the two values of the same first-type pixel point. Since the smaller the brightness control parameter is, the darker the obtained image will be. In the case that the second brightness control parameter is smaller than the first brightness control parameter, the pixel value of the first type of pixel and the second cross-correlation according to the first brightness control parameter are adopted. Interpolate for luminance alignment.
  • performing luminance alignment on the pixel value of the first type of pixel point and the second cross-correlation interpolation value according to the first luminance control parameter to obtain the first luminance alignment result comprising: according to the first luminance control parameter and the second luminance alignment
  • the difference multiple between the brightness control parameters, the pixel value of the first type of pixel point and the second cross-correlation interpolation are brightness aligned according to the first brightness control parameter, and the first brightness alignment result is obtained, and the difference multiple is based on the first brightness control parameter and The comprehensive difference between the second brightness control parameters is obtained.
  • the first brightness control parameter includes the first gain and the first exposure duration
  • the second brightness control parameter includes the second gain and the second exposure duration
  • the first brightness control parameter and the second The difference multiple between the brightness control parameters is the difference between the first product result and the second product result.
  • the first product result is the product result of the first gain and the first exposure duration
  • the second product result is the product result of the second gain and the second exposure duration.
  • the pixel value of the first type of pixel point and the second cross-correlation interpolation are brightness aligned according to the first brightness control parameter, Get the first brightness alignment result
  • K is the difference multiple of the first brightness control parameter and the second brightness control parameter
  • BL is the value of the black level
  • W′ 2 is the second cross-correlation interpolation.
  • fusing the pixel value of the first type of pixel point and the first brightness alignment result includes: multiplying the pixel value of the first type of pixel point and the corresponding weighted weight to obtain a first product result, A luminance alignment result and the corresponding weighted weight are multiplied to obtain a second product result. After that, sum the first product result and the second product result to obtain the first sum value. The weighted weight corresponding to the first type of pixel point and the weighted weight corresponding to the first brightness alignment result are summed to obtain a second sum value. The quotient of the first sum value and the second sum value is used as the fusion result of the pixel value of the first type of pixel point and the first brightness alignment result.
  • the pixel value of the first type of pixel point and the corresponding weighted weight are fused according to the following formula:
  • W F1 is the pixel value W 1 of the first type of pixel point and the first brightness alignment result
  • the fusion result of ⁇ 11 is the first weighting weight
  • ⁇ 12 is the second weighting weight.
  • the first image and the second image before fusing the first image and the second image, it further includes a process of determining the weighting weight corresponding to the pixel points of the first type and determining the weighting weight corresponding to the first luminance alignment result. Including but not limited to the following two determination methods:
  • Determining Mode 1 Based on W 1 being less than the first over-dark threshold, determine that ⁇ 11 is the first value, ⁇ 12 is the second value, and the first value is greater than the second value; or, based on W 1 being greater than or equal to the first over-dark threshold, Determine ⁇ 11 as the second value and ⁇ 12 as the first value.
  • the first value is 1 and the second value is 0. If the pixel value of the first type of pixel is less than the first dark threshold, it means that the pixel value of the first type of pixel is not too dark. The weighted weight of is set to 0, then the pixel value of the pixel point at this position is based on the pixel value of the first type of pixel point. Similarly, if the pixel value of the first type of pixel point is greater than or equal to the first dark threshold, it means that the pixel value of the first type of pixel point is too dark, the weighted weight corresponding to the first type of pixel point is set to 0, and the first type of pixel point is set to 0.
  • the weighted weight corresponding to the luminance alignment result is set to 1, and the pixel value of the pixel at this position is subject to the first luminance alignment result.
  • the method of determining the weighting weight corresponding to the first type of pixel point and determining the weighting weight corresponding to the first brightness alignment result makes the image after fusing the pixel value of the first type pixel point and the first brightness alignment result except for overexposure and overexposure. Outside of dark areas, the sharpness is consistent with the linear exposure mode.
  • the second determination method is based on that W 1 is smaller than the second over-dark threshold, and ⁇ 11 is determined to be the first value, ⁇ 12 is the second value, and the first value is greater than the second value; or, based on W 1 greater than the second over-exposure threshold, determine ⁇ 11 is the second value and ⁇ 12 is the first value; or, based on the fact that W 1 is between the second overdark threshold and the second overexposure threshold, it is determined that ⁇ 11 decreases from the first value as W 1 increases. small, ⁇ 12 increases from the second value as W 1 increases.
  • the first value is 1 and the second value is 0.
  • the relationship between the weighted weights corresponding to the first type of pixel points and the weighted weights corresponding to the first luminance alignment result is shown in FIG. 9 . If the pixel value of the first type of pixel point is less than the second dark threshold (corresponding to th1 in Figure 9), it means that the pixel value of the first type of pixel point is not too dark, and the weighting weight corresponding to the first type of pixel point is set to 1 , and the weighting weight corresponding to the first luminance alignment result is set to 0, then the pixel value of the pixel point at this position is based on the pixel value of the first type of pixel point.
  • the second dark threshold corresponding to th1 in Figure 9
  • the pixel value of the first type of pixel point is greater than the second overexposure threshold (corresponding to th2 in Figure 9), it means that the pixel value of the first type of pixel point is overexposed, and the weighted weight corresponding to the first type of pixel point is is set to 0, and the weighting weight corresponding to the first luminance alignment result is set to 1, then the pixel value of the pixel at this position is subject to the first luminance alignment result.
  • the weighting weight corresponding to the first type of pixel starts from 1 and decreases as the first cross-correlation interpolation increases,
  • the weighting weight corresponding to the first luminance alignment result starts from 0 and increases as the first cross-correlation interpolation increases.
  • the weighting weight corresponding to the first type of pixel points and the weighting weight corresponding to the first brightness alignment result are determined by this determination method 2, so that the image after fusing the pixel value of the first type pixel point and the first brightness alignment result is slightly lower than linear
  • the sharpness of the exposure mode but it can effectively prevent the unsmooth problem caused by the poor linearity of the image sensor in the first method.
  • 603A3 Perform luminance alignment on the pixel value of the second type of pixel point and the first cross-correlation interpolation value according to the first luminance control parameter, to obtain a second luminance alignment result.
  • the first cross-correlation Interpolation is the value under the first brightness control parameter. That is, for the same second type of pixel point, there is not only a pixel value generated according to the second brightness control parameter, but also a first mutual interpolation corresponding to the first brightness control parameter. Therefore, it is necessary to align the brightness of the two values of the same second-type pixel point. Since the smaller the brightness control parameter is, the darker the obtained image will be.
  • the first cross-correlation between the pixel value of the second type of pixel point and the first brightness control parameter is adopted according to the first brightness control parameter. Interpolate for luminance alignment.
  • performing luminance alignment on the pixel values of the second type of pixel points and the first cross-correlation interpolation value according to the first luminance control parameter, to obtain a second luminance alignment result includes: according to the first luminance control parameter and the second luminance alignment result.
  • the difference multiple between the brightness control parameters, the pixel value of the second type of pixel point and the first cross-correlation interpolation are brightness aligned according to the first brightness control parameter, and the second brightness alignment result is obtained, and the difference multiple is based on the first brightness control parameter and The comprehensive difference between the second brightness control parameters is obtained.
  • the first brightness control parameter includes the first gain and the first exposure duration
  • the second brightness control parameter includes the second gain and the second exposure duration
  • the first brightness control parameter and the second The difference multiple between the brightness control parameters is the difference between the first product result and the second product result.
  • the first product result is the product result of the first gain and the first exposure duration
  • the second product result is the product result of the second gain and the second exposure duration.
  • the pixel value of the second type of pixel point and the first cross-correlation interpolation are brightness aligned according to the first brightness control parameter to obtain the second brightness alignment result:
  • W 2 is the pixel value of the second type of pixel point.
  • fusing the first cross-correlation interpolation and the second luminance alignment result includes: multiplying the first cross-correlation interpolation and the corresponding weighted weight to obtain a third product result, and combining the second luminance alignment result with the corresponding The weighted weights are multiplied to obtain the fourth product result. After that, the third product result is summed with the fourth product result to obtain the third sum value. The weighted weight corresponding to the second type of pixel point and the weighted weight corresponding to the second brightness alignment result are summed to obtain a fourth sum value. The quotient of the third sum value and the fourth sum value is used as the fusion result of the first cross-correlation interpolation and the second luminance alignment result.
  • the first cross-correlation interpolation and the second luminance alignment result are fused according to the following formula :
  • W F2 is the first cross-correlation interpolation W′ 1 and the second luminance alignment result
  • ⁇ 21 is the third weighting weight
  • ⁇ 22 is the fourth weighting weight.
  • the method before fusing the first cross-correlation interpolation and the second luminance alignment result, the method further includes: a process of determining a third weighting weight and determining a fourth weighting weight. Including but not limited to the following two determination methods:
  • Determining Mode 1 Based on W′ 1 being greater than the first overexposure threshold, determine ⁇ 21 as the second value and ⁇ 22 as the first value; or, based on W′ 1 being less than or equal to the first overexposure threshold, determine ⁇ 21 as the first value value, ⁇ 22 is the second value.
  • the first value is 1 and the second value is 0. If the first cross-correlation interpolation value is smaller than the first too dark threshold, it means that the first cross-correlation interpolation value is not too dark, and the third weighting weight corresponding to the first cross-correlation interpolation value is set to 1, and the weighting weight corresponding to the second luminance alignment result is set to If it is 0, the pixel value of the pixel at this position is subject to the first cross-correlation interpolation.
  • the weighting weight corresponding to the first cross-correlation interpolation is set to 0, and the weighting corresponding to the second luminance alignment result is set to 0. If the weight is set to 1, the pixel value of the pixel at this position is subject to the second luminance alignment result.
  • the method of determining the third weighting weight corresponding to the first cross-correlation interpolation and determining the fourth weighting weight corresponding to the second luminance alignment result makes the image after fusing the first cross-correlation interpolation and the second luminance alignment result except for the overexposure and Consistent with the sharpness of the linear exposure mode, except in overly dark areas.
  • the second determination method is based on that W′ 1 is less than the second over-dark threshold, and ⁇ 21 is determined to be the first value, ⁇ 22 is the second value, and the first value is greater than the second value; or, based on W′ 1 greater than the second over-exposure threshold , determine the second value of ⁇ 21 and ⁇ 22 as the first value; or, based on the fact that W′ 1 is between the second over-dark threshold and the second over-exposure threshold, determine that ⁇ 21 increases with W′ 1 from the first value ⁇ 22 increases from the second value as W′ 1 increases.
  • the first value is 1 and the second value is 0.
  • the relationship between the third weighting weight corresponding to the first cross-correlation interpolation and the fourth weighting weight corresponding to the second luminance alignment result may also be as shown in FIG. 9 .
  • the second determination method is used to determine the third weighted weight and the fourth weighted weight, so that the image after the fusion of the first cross-correlation interpolation and the second brightness alignment result is slightly lower than the sharpness of the linear exposure mode, but the determination method can be effectively prevented.
  • each type is photographed with different brightness control parameters, so that pixels at different positions in the same frame use different Shooting with brightness control parameters can retain both highlight details and dark details to achieve a higher dynamic range.
  • the pixels at different positions are shot with different brightness control parameters, they all end the exposure at the same time in the same frame, and the images corresponding to the fused different brightness control parameters are also obtained based on the same frame of image, so it can be Minimize motion smearing.
  • An embodiment of the present application provides an apparatus for acquiring an image, and the apparatus is configured to execute the method for acquiring an image shown in FIG. 5 and FIG. 6 through the modules shown in FIG. 10 .
  • the device includes:
  • the first acquisition module 1001 is used to acquire the pixel values of at least two types of pixel points in the image pixel array.
  • the pixel values of different types of pixel points are generated by shooting according to different brightness control parameters, and at least two types of pixels are generated.
  • the points are all black and white pixels, or at least two types of pixels are color pixels; the functions performed by the first acquisition module 1001 can refer to 501 shown in FIG. 5 , and details are not repeated here.
  • the second acquisition module 1002 is configured to acquire images corresponding to each brightness control parameter according to the pixel values of at least two types of pixel points; the functions performed by the second acquisition module 1002 can refer to 502 shown in FIG. 5 , which will not be repeated here. .
  • the fusion module 1003 is used to fuse images corresponding to each brightness control parameter.
  • the functions performed by the fusion module 1003 reference may be made to 503 shown in FIG. 5, and details are not repeated here.
  • At least two types of pixel points include a first type of pixel point and a second type of pixel point, the pixel value of the first type of pixel point is photographed and generated according to the first brightness control parameter, and the pixel value of the second type of pixel point is Shooting and generating according to the second brightness control parameter;
  • a second obtaining module 1002 configured to obtain a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel, and obtain a second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel; For example, refer to the related description of 602 shown in FIG. 6 , which will not be repeated here.
  • the fusion module 1003 is used to fuse the first image and the second image. For example, refer to the related description of 603 shown in FIG. 6 , which will not be repeated here.
  • the second obtaining module 1002 is configured to determine, according to the pixel value of the first target pixel, a first cross-correlation interpolation value of the second type of pixel under the first brightness control parameter, and according to the first type of pixel The pixel value and the first cross-correlation interpolation obtain the first image, and the first target pixel point includes the first type pixel point adjacent to the second type pixel point;
  • the second obtaining module 1002 determines, according to the pixel value of the second target pixel point, a second cross-correlation interpolation value of the first type of pixel point under the second brightness control parameter, according to the pixel value of the second type of pixel point
  • the second image is obtained by interpolating the value and the second cross-correlation, and the second target pixel point includes a second type of pixel point adjacent to the first type of pixel point.
  • the second obtaining module 1002 is configured to determine the weighted weight of the first target pixel point according to the pixel value of the second type of pixel point, and the weighted weight of the first target pixel point is related to the second type of pixel point and the first target pixel point.
  • the difference size of a target pixel is positively correlated; the first cross-correlation interpolation of the second type of pixel under the first brightness control parameter is determined according to the pixel value of the first target pixel and the weighted weight;
  • the second acquisition module 1002 is configured to determine the weighted weight of the second target pixel point according to the pixel value of the first type of pixel point, and the difference between the weighted weight of the second target pixel point and the first type of pixel point and the second target pixel point Positive correlation; according to the pixel value of the second target pixel point and the weighted weight, determine the second cross-correlation interpolation value of the first type of pixel point under the second brightness control parameter.
  • the second obtaining module 1002 is configured to, for any first target pixel, multiply the pixel value of any first target pixel and the weighted weight to obtain the corresponding value of any first target pixel. Accumulate the product results corresponding to each first target pixel to obtain the first cumulative sum; accumulate the weighted weights of each first target pixel to obtain the second cumulative sum; combine the first cumulative sum with the first cumulative sum The quotient of the two accumulated sums is used as the first cross-correlation interpolation of the second type of pixels under the first brightness control parameter;
  • the second obtaining module 1002 is configured to multiply the pixel value and the weighted weight of any second target pixel for any second target pixel to obtain a product result corresponding to any second target pixel;
  • the product results corresponding to the two target pixels are accumulated to obtain the third accumulated sum;
  • the weighted weights of each second target pixel are accumulated to obtain the fourth accumulated sum;
  • the quotient of the third accumulated sum and the fourth accumulated sum is taken as the third accumulated sum.
  • the second cross-correlation interpolation of a class of pixels under the second luminance control parameter is configured to multiply the pixel value and the weighted weight of any second target pixel for any second target pixel to obtain a product result corresponding to any second target pixel;
  • the product results corresponding to the two target pixels are accumulated to obtain the third accumulated sum;
  • the weighted weights of each second target pixel are accumulated to obtain the fourth accumulated sum;
  • the brightness control parameter is smaller than the first brightness control parameter
  • the fusion module 1003 is configured to perform brightness alignment between the pixel value of the first type of pixel point and the second cross-correlation interpolation according to the first brightness control parameter to obtain the first brightness control parameter.
  • a brightness alignment result which fuses the pixel values of the first type of pixel points and the first brightness alignment result; performs brightness alignment on the pixel values of the second type of pixel points and the first cross-correlation interpolation according to the first brightness control parameter to obtain the second brightness Alignment results; fuse the first cross-correlation interpolation and the second luminance alignment results.
  • the fusion module 1003 is configured to interpolate the pixel value of the first type of pixel point and the second cross-correlation value according to the first brightness control parameter according to the difference multiple between the first brightness control parameter and the second brightness control parameter. Perform brightness alignment on the control parameters to obtain a first brightness alignment result, and the difference multiple is obtained based on the comprehensive difference between the first brightness control parameter and the second brightness control parameter;
  • the fusion module 1003 is configured to perform brightness alignment on the pixel value of the second type of pixel point and the first cross-correlation interpolation according to the first brightness control parameter according to the difference multiple between the first brightness control parameter and the second brightness control parameter, to obtain The second luminance alignment result.
  • the fusion module 1003 is configured to multiply the pixel values of the first type of pixel points and the corresponding weighted weights to obtain a first product result, and multiply the first brightness alignment result and the corresponding weighted weights, Obtain the second product result; sum the first product result and the second product result to obtain the first sum value; sum the weighted weight corresponding to the first type of pixel point and the weighted weight corresponding to the first brightness alignment result to obtain the first Two-sum value; take the quotient of the first sum value and the second sum value as the fusion result of the pixel value of the first type of pixel point and the first brightness alignment result;
  • the fusion module 1003 is used to multiply the first cross-correlation interpolation and the corresponding weighted weight to obtain the third product result, multiply the second brightness alignment result and the corresponding weighted weight to obtain the fourth product result;
  • the result and the fourth product result are summed to obtain the third sum value;
  • the weighted weight corresponding to the second type of pixel point and the weighted weight corresponding to the second brightness alignment result are summed to obtain the fourth sum value;
  • the third sum value is combined with The quotient of the fourth sum is used as the fusion result of the first cross-correlation interpolation and the second luminance alignment result.
  • the fusion module 1003 is further configured to determine that ⁇ 11 is a first value, ⁇ 12 is a second value, and the first value is greater than the second value based on the fact that W 1 is less than the first over-dark threshold; or, based on W 1 is greater than or equal to the first over-dark threshold, determine that ⁇ 11 is the second value, and ⁇ 12 is the first value;
  • the fusion module 1003 is further configured to determine ⁇ 21 as the second value and ⁇ 22 as the first value based on W′ 1 being greater than the first overexposure threshold; or, based on W′ 1 being less than or equal to the first overexposure threshold, determine ⁇ 21 is the first value, and ⁇ 22 is the second value.
  • the fusion module 1003 is further configured to determine that ⁇ 11 is the first value, ⁇ 12 is the second value, and the first value is greater than the second value based on the fact that W 1 is less than the second over-dark threshold; or, based on If W 1 is greater than the second overexposure threshold, it is determined that ⁇ 11 is the second value and ⁇ 12 is the first value; or, based on the fact that W 1 is between the second over-dark threshold and the second over-exposure threshold, it is determined that ⁇ 11 is from the first The first value begins to decrease with the increase of W 1 , and ⁇ 12 starts to increase with the increase of W 1 from the second value;
  • the fusion module 1003 is further configured to determine that ⁇ 21 is the first value, ⁇ 22 is the second value, and the first value is greater than the second value based on W′ 1 being less than the second dark threshold; or, based on W′ 1 being greater than the second value Overexposure threshold, determine the second value of ⁇ 21 , and ⁇ 22 as the first value; or, based on W′ 1 being between the second over-dark threshold and the second over-exposure threshold, determine that ⁇ 21 starts from the first value and increases with W ' 1 increases and decreases, and ⁇ 22 increases from the second value as W' 1 increases.
  • An embodiment of the present application also provides an electronic device, the electronic device includes a processor, an image sensor, and at least two control circuits, where the at least two control circuits are used to control the image sensor to shoot and generate different types of pixels according to different brightness control parameters pixel value in point;
  • the processor is configured to perform the method of acquiring an image in any one of FIG. 5 or FIG. 6 .
  • An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium includes at least one instruction, and the instruction is executed by a processor to implement any one of the methods for acquiring an image in FIG. 5 or FIG. 6 .
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer program instructions when loaded and executed on a computer, result in whole or in part of the processes or functions described herein.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk), and the like.
  • first, second and other words are used to distinguish the same or similar items with basically the same function and function, and it should be understood that between “first”, “second” and “nth” There are no logical or timing dependencies, and no restrictions on the number and execution order. It will also be understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, a first image may be referred to as a second image, and, similarly, a second image may be referred to as a first image, without departing from the scope of various described examples. Both the first image and the second image may be images, and in some cases, may be separate and distinct images.
  • the size of the sequence number of each process does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not be used in the embodiment of the present application. Implementation constitutes any limitation.
  • the meaning of the term “at least one” refers to one or more, and the meaning of the term “plurality” in this application refers to two or more.
  • a plurality of second messages refers to two or more more than one second message.
  • system and “network” are often used interchangeably herein.
  • determining B according to A does not mean that B is only determined according to A, and B may also be determined according to A and/or other information.
  • references throughout the specification to "one embodiment,” “an embodiment,” and “one possible implementation” mean that a particular feature, structure, or characteristic associated with the embodiment or implementation is included herein. in at least one embodiment of the application. Thus, appearances of "in one embodiment” or “in an embodiment” or “one possible implementation” in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.

Landscapes

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

Abstract

A processor of an electronic device acquires pixel values of at least two types of pixels in an image pixel array. The pixel values of the different types of pixels are generated by means of performing photography according to different brightness control parameters, and exposure times of the pixels are simultaneously ended in the same frame, thereby preserving both highlight details and shadow details. The processor acquires images corresponding to the respective brightness control parameters and fuses same, so as to acquire an improved dynamic range, and effectively reduce motion blur.

Description

获取图像的方法、装置、设备及计算机可读存储介质Method, apparatus, device, and computer-readable storage medium for acquiring images 技术领域technical field
本申请涉及图像拍摄技术领域,特别涉及获取图像的方法、装置、设备及计算机可读存储介质。The present application relates to the technical field of image capturing, and in particular, to a method, apparatus, device, and computer-readable storage medium for acquiring an image.
背景技术Background technique
随着图像拍摄技术的发展,图像质量也越来越高。使用摄像机拍摄动态范围较宽的场景时,往往会出现高亮过曝、暗部区域过黑导致细节丢失的问题。因此,如何获取高亮和暗部细节同时显现的图像,以提高图像质量,是亟待解决的问题。With the development of image capturing technology, the image quality is also getting higher and higher. When using a camera to shoot a scene with a wide dynamic range, there are often problems of overexposed highlights and overexposed dark areas, resulting in loss of details. Therefore, how to obtain an image in which highlights and dark details are simultaneously displayed to improve image quality is an urgent problem to be solved.
相关技术中,为了获取高亮和暗部细节同时显现的图像,采用帧间多次曝光,即前一帧长曝光,获取暗部细节信息,后一帧短曝光,获取高亮细节信息。之后,再通过图像处理技术将长曝光图像和短曝光图像进行融合,获得一幅超宽动态的图像,从而使得最终获取的图像既保留高亮细节又保留暗部细节。In the related art, in order to obtain an image in which highlights and dark details are simultaneously displayed, multiple exposures between frames are used, that is, a long exposure of the previous frame is used to obtain the details of the dark parts, and a short exposure of the next frame is used to obtain the highlight details. After that, the long-exposure image and the short-exposure image are fused through image processing technology to obtain an ultra-wide dynamic image, so that the final obtained image retains both highlight details and dark details.
然而,采用帧间多次曝光的方式会导致帧与帧之间的曝光时间差,当拍摄运动物体时,长短曝光之间会存在运动位移,导致产生运动拖尾的情况发生,因此,采用相关技术所获取的图像质量仍然不佳。However, the use of multiple exposures between frames will result in a difference in exposure time between frames. When shooting moving objects, there will be movement displacement between long and short exposures, resulting in the occurrence of motion trailing. Therefore, related technologies are used. The quality of the acquired images is still not good.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种获取图像的方法、装置、设备及计算机可读存储介质,能够提高获取的图像质量,解决运动拖尾的问题。The present application provides a method, apparatus, device and computer-readable storage medium for acquiring an image, which can improve the quality of the acquired image and solve the problem of motion smearing.
第一方面,提供了一种获取图像的方法,该方法应用于电子设备的处理器中,该电子设备包括但不限于照相机、摄像机等能够获取图像的设备。在获取图像时,首先,处理器获取图像像素阵列中的至少两类像素点的像素值,在图像中,不同类的像素点中的像素值是根据不同的亮度控制参数拍摄生成,该至少两类像素点均为黑白像素点,或者,该至少两类像素点均为彩色像素点。之后,处理器根据至少两类像素点的像素值获取各个亮度控制参数对应的图像;融合各个亮度控制参数对应的图像。In a first aspect, a method for acquiring an image is provided, and the method is applied to a processor of an electronic device, where the electronic device includes but is not limited to a device capable of acquiring images, such as a camera and a video camera. When acquiring an image, first, the processor acquires the pixel values of at least two types of pixel points in the image pixel array. In the image, the pixel values of different types of pixel points are generated according to different brightness control parameters. The class pixels are all black and white pixels, or the at least two types of pixels are all color pixels. Afterwards, the processor obtains images corresponding to each brightness control parameter according to the pixel values of at least two types of pixel points; and fuses the images corresponding to each brightness control parameter.
基于该获取图像的方法,由于图像像素阵列中的同一种像素点分为至少两类,每一类采用不同的亮度控制参数拍摄,以实现在同一帧内、不同位置处的像素点采用不同的亮度控制参数拍摄,能够既保留高亮细节,又保留暗部细节,实现较高的动态范围。另外,虽然不同位置处的像素点采用不同的亮度控制参数拍摄,但均在同一帧内同时结束曝光,且融合的不同亮度控制参数对应的图像,也都是基于同一帧图像得到的,因而能够最大限度地减小运动拖尾。Based on the method for acquiring an image, since the same type of pixel in the image pixel array is divided into at least two types, each type is photographed with different brightness control parameters, so that pixels at different positions in the same frame use different Shooting with brightness control parameters can retain both highlight details and dark details to achieve a higher dynamic range. In addition, although the pixels at different positions are shot with different brightness control parameters, they all end the exposure at the same time in the same frame, and the images corresponding to the fused different brightness control parameters are also obtained based on the same frame of image, so it can be Minimize motion smearing.
示例性地,亮度控制参数包括但不限于曝光时长和增益,不同的亮度控制参数是指曝光时长相同,增益不同;或者,不同的亮度控制参数是指曝光时长不同,增益相同;或者,不同的亮度控制参数是指曝光时长不同,且增益也不同。针对曝光时长不同的情况,需要满足同时结束曝光。也就是说,根据不同的亮度控制参数拍摄时,曝光开始时间可以不同,但曝 光结束时间需要相同,从而保证根据不同的亮度控制参数拍摄得到的图像是同一帧图像。Exemplarily, the brightness control parameters include but are not limited to exposure duration and gain, and different brightness control parameters refer to the same exposure duration and different gains; or, different brightness control parameters refer to different exposure durations and the same gain; or, different brightness control parameters. The brightness control parameter means that the exposure time is different, and the gain is also different. In the case of different exposure durations, it is necessary to end the exposure at the same time. That is to say, when shooting according to different brightness control parameters, the exposure start time can be different, but the exposure end time needs to be the same, so as to ensure that the images captured according to different brightness control parameters are the same frame image.
在一种可能的实现方式中,至少两类像素点包括第一类像素点和第二类像素点,第一类像素点的像素值根据第一亮度控制参数拍摄生成,第二类像素点的像素值根据第二亮度控制参数拍摄生成;In a possible implementation manner, the at least two types of pixel points include a first type of pixel point and a second type of pixel point, the pixel value of the first type of pixel point is generated according to the first brightness control parameter, and the second type of pixel point The pixel value is photographed and generated according to the second brightness control parameter;
根据至少两类像素点的像素值获取各个亮度控制参数对应的图像,包括:根据第一类像素点的像素值获取第一亮度控制参数对应的第一图像,根据第二类像素点的像素值获取第二亮度控制参数对应的第二图像;融合各个亮度控制参数对应的图像,包括:融合第一图像和第二图像。Obtaining an image corresponding to each brightness control parameter according to the pixel values of at least two types of pixels includes: obtaining a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel, and obtaining a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel; Acquiring a second image corresponding to the second brightness control parameter; fusing the images corresponding to each brightness control parameter includes: fusing the first image and the second image.
在一种可能的实现方式中,以插值的方式根据第一类像素点的像素值获取第一亮度控制参数对应的第一图像,包括:根据第一目标像素点的像素值确定第二类像素点在第一亮度控制参数下的第一互相关插值,根据第一类像素点的像素值和第一互相关插值获取第一图像,第一目标像素点包括与第二类像素点相邻的第一类像素点;In a possible implementation manner, acquiring the first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel in an interpolation manner includes: determining the second type of pixel according to the pixel value of the first target pixel The first cross-correlation interpolation of the point under the first brightness control parameter, the first image is obtained according to the pixel value of the first type of pixel point and the first cross-correlation interpolation, and the first target pixel point includes pixels adjacent to the second type of pixel points. The first type of pixel point;
根据第二类像素点的像素值获取第二亮度控制参数对应的第二图像,包括:根据第二目标像素点的像素值确定第一类像素点在第二亮度控制参数下的第二互相关插值,根据第二类像素点的像素值和第二互相关插值获取第二图像,第二目标像素点包括与第一类像素点相邻的第二类像素点。Acquiring the second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel includes: determining the second cross-correlation of the first type of pixel under the second brightness control parameter according to the pixel value of the second target pixel Interpolation, obtaining a second image according to the pixel value of the second type of pixel point and the second cross-correlation interpolation, and the second target pixel point includes the second type of pixel point adjacent to the first type of pixel point.
在一种可能的实现方式中,根据第一目标像素点的像素值确定第二类像素点在第一亮度控制参数下的第一互相关插值,包括:根据第二类像素点的像素值确定第一目标像素点的加权权重,第一目标像素点的加权权重与第二类像素点及第一目标像素点的差异大小正相关;根据第一目标像素点的像素值以及加权权重确定第二类像素点在第一亮度控制参数下的第一互相关插值;In a possible implementation manner, determining the first cross-correlation interpolation value of the second type of pixel point under the first brightness control parameter according to the pixel value of the first target pixel point includes: determining according to the pixel value of the second type of pixel point The weighted weight of the first target pixel point, the weighted weight of the first target pixel point is positively correlated with the difference between the second type of pixel point and the first target pixel point; the first cross-correlation interpolation of the pixel-like point under the first brightness control parameter;
根据第二目标像素点的像素值确定第一类像素点在第二亮度控制参数下的第二互相关插值,包括:根据第一类像素点的像素值确定第二目标像素点的加权权重,第二目标像素点的加权权重与第一类像素点及第二目标像素点的差异大小正相关;根据第二目标像素点的像素值以及加权权重确定第一类像素点在第二亮度控制参数下的第二互相关插值。Determining the second cross-correlation interpolation of the first type of pixels under the second brightness control parameter according to the pixel value of the second target pixel includes: determining the weighting weight of the second target pixel according to the pixel value of the first type of pixel, The weighted weight of the second target pixel is positively correlated with the difference between the first type of pixel and the second target pixel; according to the pixel value of the second target pixel and the weighted weight, the first type of pixel is determined in the second brightness control parameter The second cross-correlation interpolation under .
在一种可能的实现方式中,根据第一目标像素点的像素值以及加权权重确定第二类像素点在第一亮度控制参数下的第一互相关插值,包括:In a possible implementation manner, determining the first cross-correlation interpolation value of the second type of pixel point under the first brightness control parameter according to the pixel value of the first target pixel point and the weighted weight, including:
对于任一第一目标像素点,将任一第一目标像素点的像素值以及加权权重相乘,得到任一第一目标像素点对应的乘积结果;将各个第一目标像素点对应的乘积结果进行累加,得到第一累加和;将各个第一目标像素点的加权权重进行累加,得到第二累加和;将第一累加和与第二累加和的商作为第二类像素点在第一亮度控制参数下的第一互相关插值;For any first target pixel, multiply the pixel value and weighted weight of any first target pixel to obtain a product result corresponding to any first target pixel; multiply the product result corresponding to each first target pixel Accumulate to obtain the first accumulated sum; accumulate the weighted weights of each first target pixel point to obtain the second accumulated sum; take the quotient of the first accumulated sum and the second accumulated sum as the second type of pixel point in the first brightness first cross-correlation interpolation under control parameters;
以α 2i为第一目标像素点的加权权重,W 2i为第一目标像素点的像素值,N 1为第一目标像素点的数量为例,根据第一目标像素点的像素值以及加权权重确定第二类像素点在第一亮度控制参数下的第一互相关插值,包括:根据第一目标像素点的像素值以及加权权重按照如下公式确定第二类像素点在第一亮度控制参数下的第一互相关插值W′ 2Taking α 2i as the weighted weight of the first target pixel point, W 2i as the pixel value of the first target pixel point, and N 1 as the number of the first target pixel point as an example, according to the pixel value of the first target pixel point and the weighted weight Determining the first cross-correlation interpolation of the second type of pixel point under the first brightness control parameter includes: determining the second type of pixel point under the first brightness control parameter according to the pixel value of the first target pixel point and the weighted weight according to the following formula. The first cross-correlation interpolation W′ 2 of :
Figure PCTCN2020112740-appb-000001
Figure PCTCN2020112740-appb-000001
根据第二目标像素点的像素值以及加权权重确定第一类像素点在第二亮度控制参数下的第二互相关插值,包括:The second cross-correlation interpolation of the first type of pixels under the second brightness control parameter is determined according to the pixel value of the second target pixel and the weighted weight, including:
对于任一第二目标像素点,将任一第二目标像素点的像素值以及加权权重相乘,得到任 一第二目标像素点对应的乘积结果;将各个第二目标像素点对应的乘积结果进行累加,得到第三累加和;将各个第二目标像素点的加权权重进行累加,得到第四累加和;将第三累加和与第四累加和的商作为第一类像素点在第二亮度控制参数下的第二互相关插值。For any second target pixel point, multiply the pixel value and weighted weight of any second target pixel point to obtain the product result corresponding to any second target pixel point; multiply the product result corresponding to each second target pixel point Accumulate to obtain the third cumulative sum; accumulate the weighted weights of each second target pixel point to obtain the fourth cumulative sum; take the quotient of the third cumulative sum and the fourth cumulative sum as the first type of pixel point in the second brightness The second cross-correlation interpolation under the control parameter.
例如,根据第二目标像素点的像素值以及加权权重按照如下公式确定第一类像素点在第二亮度控制参数下的第二互相关插值W′ 1For example, according to the pixel value of the second target pixel and the weighted weight, the second cross-correlation interpolation W′ 1 of the first type of pixel under the second brightness control parameter is determined according to the following formula:
Figure PCTCN2020112740-appb-000002
Figure PCTCN2020112740-appb-000002
其中,α 1i为第二目标像素点的加权权重,W 1i为第二目标像素点的像素值,N 2为第二目标像素点的数量。 Wherein, α 1i is the weighted weight of the second target pixel, W 1i is the pixel value of the second target pixel, and N 2 is the number of the second target pixel.
在一种可能的实现方式中,第二亮度控制参数小于第一亮度控制参数,融合第一图像和第二图像,包括:In a possible implementation manner, the second brightness control parameter is smaller than the first brightness control parameter, and fusing the first image and the second image includes:
将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,融合第一类像素点的像素值及第一亮度对齐结果;Perform brightness alignment on the pixel value of the first type of pixel point and the second cross-correlation interpolation according to the first brightness control parameter to obtain a first brightness alignment result, and fuse the pixel value of the first type of pixel point and the first brightness alignment result;
将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果;融合第一互相关插值及第二亮度对齐结果。Perform luminance alignment on the pixel values of the second type of pixel points and the first cross-correlation interpolation according to the first luminance control parameter to obtain a second luminance alignment result; and fuse the first cross-correlation interpolation and the second luminance alignment result.
通过亮度对齐的过程,以通过亮度平滑算法,来实现高亮区域不过曝、暗部区域不过暗的成像目标,从而保持获取到的最终图像的清晰度不损失。Through the process of brightness alignment, the brightness smoothing algorithm is used to achieve the imaging target that the highlight area is not exposed and the dark area is not too dark, so as to keep the clarity of the final image obtained without loss.
在一种可能的实现方式中,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,包括:In a possible implementation manner, the pixel value of the first type of pixel point and the second cross-correlation interpolation value are aligned according to the first luminance control parameter to obtain the first luminance alignment result, including:
根据第一亮度控制参数与第二亮度控制参数之间的差异倍数,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,差异倍数基于第一亮度控制参数与第二亮度控制参数之间的综合差异得到;According to the difference multiple between the first brightness control parameter and the second brightness control parameter, the pixel value of the first type of pixel point and the second cross-correlation interpolation are brightness aligned according to the first brightness control parameter, and the first brightness alignment result is obtained, The difference multiple is obtained based on the comprehensive difference between the first brightness control parameter and the second brightness control parameter;
示例性地,按照如下公式根据第一亮度控制参数与第二亮度控制参数之间的差异倍数,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果
Figure PCTCN2020112740-appb-000003
Exemplarily, according to the following formula, according to the difference multiple between the first brightness control parameter and the second brightness control parameter, the pixel value of the first type of pixel point and the second cross-correlation interpolation are brightness aligned according to the first brightness control parameter, Get the first brightness alignment result
Figure PCTCN2020112740-appb-000003
Figure PCTCN2020112740-appb-000004
Figure PCTCN2020112740-appb-000004
其中,K为第一亮度控制参数与第二亮度控制参数的差异倍数,BL为黑电平的值,W′ 2为第二互相关插值。 Wherein, K is the difference multiple of the first brightness control parameter and the second brightness control parameter, BL is the value of the black level, and W′ 2 is the second cross-correlation interpolation.
将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果,包括:根据第一亮度控制参数与第二亮度控制参数之间的差异倍数,将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果。Perform luminance alignment on the pixel values of the second type of pixel points and the first cross-correlation interpolation according to the first luminance control parameter to obtain a second luminance alignment result, including: according to the difference between the first luminance control parameter and the second luminance control parameter Multiples, the pixel values of the second type of pixels and the first cross-correlation interpolation are brightness aligned according to the first brightness control parameter to obtain a second brightness alignment result.
示例性地,按照如下公式将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果
Figure PCTCN2020112740-appb-000005
Exemplarily, according to the following formula, the pixel value of the second type of pixel point and the first cross-correlation interpolation are brightness aligned according to the first brightness control parameter, and the second brightness alignment result is obtained:
Figure PCTCN2020112740-appb-000005
Figure PCTCN2020112740-appb-000006
Figure PCTCN2020112740-appb-000006
其中,W 2为第二类像素点的像素值。 Among them, W 2 is the pixel value of the second type of pixel point.
在一种可能的实现方式中,融合第一类像素点的像素值及第一亮度对齐结果,包括:In a possible implementation manner, fusing the pixel value of the first type of pixel point and the first brightness alignment result includes:
将第一类像素点的像素值及对应的加权权重相乘,得到第一乘积结果,将第一亮度对齐结果及对应的加权权重相乘,得到第二乘积结果;将第一乘积结果与第二乘积结果求和,得到第一和值;将第一类像素点对应的加权权重与第一亮度对齐结果对应的加权权重求和,得 到第二和值;将第一和值与第二和值的商作为第一类像素点的像素值及第一亮度对齐结果的融合结果。Multiply the pixel value of the first type of pixel point and the corresponding weighted weight to obtain the first product result, multiply the first brightness alignment result and the corresponding weighted weight to obtain the second product result; Sum the results of the square product to obtain the first sum value; sum the weighted weights corresponding to the first type of pixels and the weighted weights corresponding to the first brightness alignment result to obtain the second sum value; add the first sum value to the second sum value The quotient of the values is used as the fusion result of the pixel value of the first type of pixel point and the first luminance alignment result.
示例性地,根据第一类像素点的像素值及对应的加权权重,以及第一亮度对齐结果及对应的加权权重,按照如下公式融合第一类像素点的像素值及第一亮度对齐结果:Exemplarily, according to the pixel value of the first type of pixel point and the corresponding weighted weight, as well as the first brightness alignment result and the corresponding weighted weight, the pixel value of the first type of pixel point and the first brightness alignment result are fused according to the following formula:
Figure PCTCN2020112740-appb-000007
Figure PCTCN2020112740-appb-000007
其中,W F1为第一类像素点的像素值W 1及第一亮度对齐结果
Figure PCTCN2020112740-appb-000008
的融合结果,β 11为第一加权权重,β 12为第二加权权重。
Among them, W F1 is the pixel value W 1 of the first type of pixel point and the first brightness alignment result
Figure PCTCN2020112740-appb-000008
The fusion result of β 11 is the first weighting weight, and β 12 is the second weighting weight.
融合第一互相关插值及第二亮度对齐结果,包括:Fusion of the first cross-correlation interpolation and the second luminance alignment results, including:
将第一互相关插值及对应的加权权重相乘,得到第三乘积结果,将第二亮度对齐结果及对应的加权权重相乘,得到第四乘积结果;将第三乘积结果与第四乘积结果求和,得到第三和值;将第二类像素点对应的加权权重与第二亮度对齐结果对应的加权权重求和,得到第四和值;将第三和值与第四和值的商作为第一互相关插值及第二亮度对齐结果的融合结果。Multiply the first cross-correlation interpolation and the corresponding weighted weight to obtain the third product result, multiply the second luminance alignment result and the corresponding weighted weight to obtain the fourth product result; multiply the third product result and the fourth product result Sum up to get the third sum value; sum the weighted weight corresponding to the second type of pixel point and the weighted weight corresponding to the second brightness alignment result to get the fourth sum value; calculate the quotient of the third sum value and the fourth sum value As the fusion result of the first cross-correlation interpolation and the second luminance alignment result.
例如,以第一互相关插值对应的加权权重为第三加权权重,第二亮度对齐结果对应的加权权重为第四加权权重为例,按照如下公式融合第一互相关插值及第二亮度对齐结果:For example, taking the weighting weight corresponding to the first cross-correlation interpolation as the third weighting weight and the weighting weight corresponding to the second luminance alignment result being the fourth weighting weight as an example, the first cross-correlation interpolation and the second luminance alignment result are fused according to the following formula :
Figure PCTCN2020112740-appb-000009
Figure PCTCN2020112740-appb-000009
其中,W F2为第一互相关插值W′ 1及第二亮度对齐结果
Figure PCTCN2020112740-appb-000010
的融合结果,β 21为第三加权权重,β 22为第四加权权重。
Among them, W F2 is the first cross-correlation interpolation W′ 1 and the second luminance alignment result
Figure PCTCN2020112740-appb-000010
, β 21 is the third weighting weight, and β 22 is the fourth weighting weight.
在一种可能的实现方式中,融合第一类像素点的像素值及第一亮度对齐结果之前,还包括:基于W 1小于第一过暗阈值,确定β 11为第一值,β 12为第二值,第一值大于第二值;或者,基于W 1大于等于第一过暗阈值,确定β 11为第二值,β 12为第一值; In a possible implementation manner, before fusing the pixel values of the first type of pixel points and the first brightness alignment result, the method further includes: based on the fact that W 1 is less than the first excessive dark threshold, determining β 11 as the first value, and β 12 as the first value the second value, where the first value is greater than the second value; or, based on the fact that W 1 is greater than or equal to the first over-dark threshold, determine that β 11 is the second value and β 12 is the first value;
融合第一互相关插值及第二亮度对齐结果之前,还包括:基于W′ 1大于第一过曝阈值,确定β 21为第二值,β 22为第一值;或者,基于W′ 1小于等于第一过曝阈值,确定β 21为第一值,β 22为第二值。 Before fusing the first cross-correlation interpolation and the second luminance alignment result, the method further includes: determining β 21 as the second value and β 22 as the first value based on W′ 1 being greater than the first overexposure threshold; or, based on W′ 1 being less than the first overexposure threshold Equal to the first overexposure threshold, determine β 21 as the first value and β 22 as the second value.
在一种可能的实现方式中,融合第一类像素点的像素值及第一亮度对齐结果之前,还包括:基于W 1小于第二过暗阈值,确定β 11为第一值,β 12为第二值,第一值大于第二值;或者,基于W 1大于第二过曝阈值,确定β 11为第二值,β 12为第一值;或者,基于W 1介于第二过暗阈值与第二过曝阈值之间,确定β 11从第一值开始随W 1增大而减小,β 12从第二值开始随W 1增大而增大; In a possible implementation manner, before fusing the pixel values of the first type of pixels and the first brightness alignment result, the method further includes: based on the fact that W 1 is less than the second dark threshold, determining that β 11 is the first value, and β 12 is the first value. the second value, the first value is greater than the second value; or, based on W 1 greater than the second overexposure threshold, determine β 11 to be the second value, and β 12 to be the first value; or, based on W 1 between the second overexposure threshold Between the threshold and the second overexposure threshold, it is determined that β 11 starts from the first value and decreases as W 1 increases, and β 12 starts from the second value and increases as W 1 increases;
融合第一互相关插值及第二亮度对齐结果之前,还包括:基于W′ 1小于第二过暗阈值,确定β 21为第一值,β 22为第二值,第一值大于第二值;或者,基于W′ 1大于第二过曝阈值,确定β 21第二值,β 22为第一值;或者,基于W′ 1介于第二过暗阈值与第二过曝阈值之间,确定β 21从第一值开始随W′ 1增大而减小,β 22从第二值开始随W′ 1增大而增大。 Before fusing the results of the first cross-correlation interpolation and the second brightness alignment, the method further includes: based on the fact that W′ 1 is smaller than the second over-darkness threshold, determining that β 21 is a first value, β 22 is a second value, and the first value is greater than the second value ; or, based on W′ 1 being greater than the second overexposure threshold, determine the second value of β 21 , and β 22 as the first value; or, based on W′ 1 being between the second overexposure threshold and the second overexposure threshold, It is determined that β 21 decreases from the first value as W' 1 increases, and β 22 increases from the second value as W' 1 increases.
在一种可能的实现方式中,该方法应用于电子设备的处理器中,电子设备还包括图像传感器及至少两个控制电路,至少两个控制电路用于控制图像传感器按照不同的亮度控制参数拍摄生成不同类的像素点中的像素值。In a possible implementation, the method is applied to a processor of an electronic device, and the electronic device further includes an image sensor and at least two control circuits, and the at least two control circuits are used to control the image sensor to shoot according to different brightness control parameters Generate pixel values in different classes of pixels.
第二方面,提供了一种获取图像的装置,该装置包括:In a second aspect, an apparatus for acquiring an image is provided, the apparatus comprising:
第一获取模块,用于获取图像像素阵列中的至少两类像素点的像素值,在图像中,不同类的像素点中的像素值是根据不同的亮度控制参数拍摄生成,至少两类像素点均为黑白像素点,或者,至少两类像素点均为彩色像素点;The first acquisition module is used to acquire the pixel values of at least two types of pixel points in the image pixel array. In the image, the pixel values of different types of pixel points are generated according to different brightness control parameters, and at least two types of pixel points are generated. All are black and white pixels, or at least two types of pixels are color pixels;
第二获取模块,用于根据至少两类像素点的像素值获取各个亮度控制参数对应的图像;a second acquisition module, configured to acquire an image corresponding to each brightness control parameter according to pixel values of at least two types of pixel points;
融合模块,用于融合各个亮度控制参数对应的图像。The fusion module is used to fuse the images corresponding to each brightness control parameter.
在一种可能的实现方式中,至少两类像素点包括第一类像素点和第二类像素点,第一类像素点的像素值根据第一亮度控制参数拍摄生成,第二类像素点的像素值根据第二亮度控制参数拍摄生成;In a possible implementation manner, the at least two types of pixel points include a first type of pixel point and a second type of pixel point, the pixel value of the first type of pixel point is generated according to the first brightness control parameter, and the second type of pixel point The pixel value is photographed and generated according to the second brightness control parameter;
第二获取模块,用于根据第一类像素点的像素值获取第一亮度控制参数对应的第一图像,根据第二类像素点的像素值获取第二亮度控制参数对应的第二图像;a second obtaining module, configured to obtain a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel, and obtain a second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel;
融合模块,用于融合第一图像和第二图像。The fusion module is used to fuse the first image and the second image.
在一种可能的实现方式中,第二获取模块,用于根据第一目标像素点的像素值确定第二类像素点在第一亮度控制参数下的第一互相关插值,根据第一类像素点的像素值和第一互相关插值获取第一图像,第一目标像素点包括与第二类像素点相邻的第一类像素点;In a possible implementation manner, the second obtaining module is configured to determine the first cross-correlation interpolation value of the second type of pixel under the first brightness control parameter according to the pixel value of the first target pixel, and according to the first type of pixel The first image is obtained by interpolating the pixel value of the point and the first cross-correlation, and the first target pixel includes the first-type pixel point adjacent to the second-type pixel point;
第二获取模块,用于根据第二目标像素点的像素值确定第一类像素点在第二亮度控制参数下的第二互相关插值,根据第二类像素点的像素值和第二互相关插值获取第二图像,第二目标像素点包括与第一类像素点相邻的第二类像素点。The second acquisition module is configured to determine the second cross-correlation interpolation value of the first type of pixel point under the second brightness control parameter according to the pixel value of the second target pixel point, according to the pixel value of the second type of pixel point and the second cross-correlation value The second image is obtained by interpolation, and the second target pixel point includes a second type of pixel point adjacent to the first type of pixel point.
在一种可能的实现方式中,第二获取模块,用于根据第二类像素点的像素值确定第一目标像素点的加权权重,第一目标像素点的加权权重与第二类像素点及第一目标像素点的差异大小正相关;根据第一目标像素点的像素值以及加权权重确定第二类像素点在第一亮度控制参数下的第一互相关插值;In a possible implementation manner, the second acquisition module is configured to determine the weighted weight of the first target pixel point according to the pixel value of the second type of pixel point, and the weighted weight of the first target pixel point is related to the second type of pixel point and The difference of the first target pixel is positively correlated; the first cross-correlation interpolation of the second type of pixel under the first brightness control parameter is determined according to the pixel value of the first target pixel and the weighted weight;
第二获取模块,用于根据第一类像素点的像素值确定第二目标像素点的加权权重,第二目标像素点的加权权重与第一类像素点及第二目标像素点的差异大小正相关;根据第二目标像素点的像素值以及加权权重确定第一类像素点在第二亮度控制参数下的第二互相关插值。The second acquisition module is configured to determine the weighted weight of the second target pixel point according to the pixel value of the first type of pixel point, and the weighted weight of the second target pixel point is positively related to the difference between the first type of pixel point and the second target pixel point Correlation; determining the second cross-correlation interpolation value of the first type of pixels under the second brightness control parameter according to the pixel value of the second target pixel and the weighted weight.
在一种可能的实现方式中,第二获取模块,用于对于任一第一目标像素点,将任一第一目标像素点的像素值以及加权权重相乘,得到任一第一目标像素点对应的乘积结果;将各个第一目标像素点对应的乘积结果进行累加,得到第一累加和;将各个第一目标像素点的加权权重进行累加,得到第二累加和;将第一累加和与第二累加和的商作为第二类像素点在第一亮度控制参数下的第一互相关插值;In a possible implementation manner, the second obtaining module is configured to multiply the pixel value of any first target pixel and the weighted weight for any first target pixel to obtain any first target pixel Corresponding product results; the product results corresponding to each first target pixel are accumulated to obtain a first cumulative sum; the weighted weights of each first target pixel are accumulated to obtain a second cumulative sum; the first cumulative sum and The quotient of the second accumulated sum is used as the first cross-correlation interpolation of the second type of pixels under the first brightness control parameter;
第二获取模块,用于对于任一第二目标像素点,将任一第二目标像素点的像素值以及加权权重相乘,得到任一第二目标像素点对应的乘积结果;将各个第二目标像素点对应的乘积结果进行累加,得到第三累加和;将各个第二目标像素点的加权权重进行累加,得到第四累加和;将第三累加和与第四累加和的商作为第一类像素点在第二亮度控制参数下的第二互相关插值。The second obtaining module is used for multiplying the pixel value of any second target pixel and the weighted weight for any second target pixel to obtain a product result corresponding to any second target pixel; The product results corresponding to the target pixels are accumulated to obtain the third accumulated sum; the weighted weights of each second target pixel are accumulated to obtain the fourth accumulated sum; the quotient of the third accumulated sum and the fourth accumulated sum is taken as the first The second cross-correlation interpolation of the pixel-like points under the second luminance control parameter.
在一种可能的实现方式中,第二亮度控制参数小于第一亮度控制参数,融合模块,用于将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,融合第一类像素点的像素值及第一亮度对齐结果;将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果;融合第一互相关插值及第二亮度对齐结果。In a possible implementation manner, the second brightness control parameter is smaller than the first brightness control parameter, and the fusion module is configured to perform brightness alignment between the pixel value of the first type of pixel and the second cross-correlation interpolation value according to the first brightness control parameter , obtain the first brightness alignment result, fuse the pixel value of the first type of pixel point and the first brightness alignment result; align the pixel value of the second type of pixel point and the first cross-correlation interpolation according to the first brightness control parameter. The second luminance alignment result; fusion of the first cross-correlation interpolation and the second luminance alignment result.
在一种可能的实现方式中,融合模块,用于根据第一亮度控制参数与第二亮度控制参数之间的差异倍数,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,差异倍数基于第一亮度控制参数与第二亮度控制参数之间 的综合差异得到;In a possible implementation manner, the fusion module is configured to interpolate the pixel value of the first type of pixel and the second cross-correlation interpolation according to the difference multiple between the first brightness control parameter and the second brightness control parameter according to the first The brightness control parameters are brightness aligned to obtain a first brightness alignment result, and the difference multiple is obtained based on the comprehensive difference between the first brightness control parameter and the second brightness control parameter;
融合模块,用于根据第一亮度控制参数与第二亮度控制参数之间的差异倍数,将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果。The fusion module is configured to perform brightness alignment on the pixel value of the second type of pixel point and the first cross-correlation interpolation according to the first brightness control parameter according to the difference multiple between the first brightness control parameter and the second brightness control parameter, to obtain the first brightness control parameter. Two luminance alignment results.
在一种可能的实现方式中,融合模块,用于将第一类像素点的像素值及对应的加权权重相乘,得到第一乘积结果,将第一亮度对齐结果及对应的加权权重相乘,得到第二乘积结果;将第一乘积结果与第二乘积结果求和,得到第一和值;将第一类像素点对应的加权权重与第一亮度对齐结果对应的加权权重求和,得到第二和值;将第一和值与第二和值的商作为第一类像素点的像素值及第一亮度对齐结果的融合结果;In a possible implementation manner, the fusion module is used to multiply the pixel values of the first type of pixel points and the corresponding weighted weights to obtain a first product result, and multiply the first brightness alignment result and the corresponding weighted weights , obtain the second product result; sum the first product result and the second product result to obtain the first sum value; sum the weighting weight corresponding to the first type of pixel point and the weighting weight corresponding to the first brightness alignment result to obtain The second sum value; the quotient of the first sum value and the second sum value is used as the fusion result of the pixel value of the first type of pixel point and the first brightness alignment result;
融合模块,用于将第一互相关插值及对应的加权权重相乘,得到第三乘积结果,将第二亮度对齐结果及对应的加权权重相乘,得到第四乘积结果;将第三乘积结果与第四乘积结果求和,得到第三和值;将第二类像素点对应的加权权重与第二亮度对齐结果对应的加权权重求和,得到第四和值;将第三和值与第四和值的商作为第一互相关插值及第二亮度对齐结果的融合结果。The fusion module is used to multiply the first cross-correlation interpolation and the corresponding weighted weight to obtain the third product result, and multiply the second brightness alignment result and the corresponding weighted weight to obtain the fourth product result; Sum the result of the fourth product to obtain the third sum value; sum the weighted weight corresponding to the second type of pixel point and the weighted weight corresponding to the second brightness alignment result to obtain the fourth sum value; combine the third sum value with the first The quotient of the four-sum value is used as the fusion result of the first cross-correlation interpolation and the second luminance alignment result.
在一种可能的实现方式中,融合模块,还用于基于W 1小于第一过暗阈值,确定β 11为第一值,β 12为第二值,第一值大于第二值;或者,基于W 1大于等于第一过暗阈值,确定β 11为第二值,β 12为第一值; In a possible implementation manner, the fusion module is further configured to determine that β 11 is a first value, β 12 is a second value, and the first value is greater than the second value based on the fact that W 1 is smaller than the first over-dark threshold; or, Based on W 1 being greater than or equal to the first over-dark threshold, determine that β 11 is the second value, and β 12 is the first value;
融合模块,还用于基于W′ 1大于第一过曝阈值,确定β 21为第二值,β 22为第一值;或者,基于W′ 1小于等于第一过曝阈值,确定β 21为第一值,β 22为第二值。 The fusion module is further configured to determine that β 21 is the second value and β 22 is the first value based on the fact that W′ 1 is greater than the first overexposure threshold; or, based on the fact that W′ 1 is less than or equal to the first overexposure threshold, determine that β 21 is The first value, β 22 is the second value.
在一种可能的实现方式中,融合模块,还用于基于W 1小于第二过暗阈值,确定β 11为第一值,β 12为第二值,第一值大于第二值;或者,基于W 1大于第二过曝阈值,确定β 11为第二值,β 12为第一值;或者,基于W 1介于第二过暗阈值与第二过曝阈值之间,确定β 11从第一值开始随W 1增大而减小,β 12从第二值开始随W 1增大而增大; In a possible implementation manner, the fusion module is further configured to determine that β 11 is the first value, β 12 is the second value, and the first value is greater than the second value based on the fact that W 1 is less than the second over-dark threshold; or, Based on W 1 being greater than the second overexposure threshold, it is determined that β 11 is the second value and β 12 is the first value ; The first value starts to decrease with the increase of W 1 , and β 12 starts to increase with the increase of W 1 from the second value;
融合模块,还用于基于W′ 1小于第二过暗阈值,确定β 21为第一值,β 22为第二值,第一值大于第二值;或者,基于W′ 1大于第二过曝阈值,确定β 21第二值,β 22为第一值;或者,基于W′ 1介于第二过暗阈值与第二过曝阈值之间,确定β 21从第一值开始随W′ 1增大而减小,β 22从第二值开始随W′ 1增大而增大。 The fusion module is further configured to determine that β 21 is the first value, β 22 is the second value, and the first value is greater than the second value based on W′ 1 being less than the second over-dark threshold; or, based on W′ 1 being greater than the second over-dark threshold exposure threshold, determine the second value of β 21 and β 22 as the first value; or, based on W′ 1 being between the second over-dark threshold and the second over-exposure threshold, determine that β 21 starts from the first value and increases with W′ 1 decreases and β 22 increases from the second value as W′ 1 increases.
第三方面,提供了一种电子设备,该电子设备包括处理器、图像传感器及至少两个控制电路,至少两个控制电路用于控制图像传感器按照不同的亮度控制参数拍摄生成不同类的像素点中的像素值;In a third aspect, an electronic device is provided, the electronic device includes a processor, an image sensor, and at least two control circuits, where the at least two control circuits are used to control the image sensor to generate different types of pixels according to different brightness control parameters. The pixel value in ;
处理器用于执行第一方面及第一方面中任一的获取图像的方法。The processor is configured to perform the first aspect and the method for acquiring an image in any one of the first aspects.
第四方面,提供了一种计算机可读存储介质,该计算机可读存储介质包括至少一条指令,指令由处理器执行以实现第一方面及第一方面的任一可能实现方式中的获取图像的方法。In a fourth aspect, a computer-readable storage medium is provided, the computer-readable storage medium comprising at least one instruction, the instruction being executed by a processor to implement the first aspect and any possible implementation manner of the first aspect of acquiring an image. method.
提供了一种计算机程序(产品),计算机程序(产品)包括:计算机程序代码,当计算机程序代码被计算机运行时,使得计算机执行上述各方面中的方法。A computer program (product) is provided, the computer program (product) comprising: computer program code which, when executed by a computer, causes the computer to perform the methods in the above-mentioned aspects.
提供了一种芯片,包括处理器,用于从存储器中调用并运行存储器中存储的指令,使得安装有芯片的通信设备执行上述各方面中的方法。A chip is provided that includes a processor for invoking and executing instructions stored in the memory from a memory to cause a communication device on which the chip is mounted to perform the methods of the above aspects.
附图说明Description of drawings
图1为本申请实施例提供的图像像素阵列的结构图;1 is a structural diagram of an image pixel array provided by an embodiment of the present application;
图2为本申请实施例提供的图像像素阵列的结构图;2 is a structural diagram of an image pixel array provided by an embodiment of the present application;
图3为本申请实施例提供的图像像素阵列的结构图;3 is a structural diagram of an image pixel array provided by an embodiment of the present application;
图4为本申请实施例提供的电子设备的结构示意图;4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图5为本申请实施例提供的获取图像的方法流程图;FIG. 5 is a flowchart of a method for acquiring an image provided by an embodiment of the present application;
图6为本申请实施例提供的获取图像的方法流程图;6 is a flowchart of a method for acquiring an image provided by an embodiment of the present application;
图7为本申请实施例提供的获取图像的过程示意图;FIG. 7 is a schematic diagram of a process of acquiring an image according to an embodiment of the present application;
图8为本申请实施例提供的3*3像素阵列的结构示意图;FIG. 8 is a schematic structural diagram of a 3*3 pixel array provided by an embodiment of the present application;
图9为本申请实施例提供的第一类像素点对应的加权权重以及第一亮度对齐结果对应的加权权重的关系示意图;FIG. 9 is a schematic diagram of the relationship between the weighted weights corresponding to the first type of pixel points and the weighted weights corresponding to the first brightness alignment result provided by the embodiment of the present application;
图10为本申请实施例提供的获取图像的装置的结构示意图。FIG. 10 is a schematic structural diagram of an apparatus for acquiring an image provided by an embodiment of the present application.
具体实施方式detailed description
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
随着图像拍摄技术的发展,使用摄像机拍摄动态范围较宽的场景越来越多。摄像机拍摄动态范围较宽的场景时,容易出现高亮过曝、暗部区域过黑导致细节丢失的问题。例如,背光人脸、红外补光环境下的手电筒效应、夜晚马路监控场景的强光抑制、电警场景下交通灯过曝、人车混行场景下人脸过暗、车牌过曝等。因此,需要一种有效的宽动态技术来解决这类问题,达到高亮和暗部细节同时显现的目的。With the development of image capture technology, more and more scenes with wider dynamic range are captured using cameras. When the camera shoots a scene with a wide dynamic range, it is prone to the problem of overexposure of highlights and overexposed dark areas, resulting in loss of details. For example, backlit face, flashlight effect in infrared fill light environment, strong light suppression in night road monitoring scene, overexposure of traffic lights in electric police scene, too dark face in mixed traffic scene, overexposed license plate, etc. Therefore, an effective WDR technology is needed to solve such problems and achieve the purpose of simultaneously revealing the details of highlights and shadows.
对此,本申请实施例提出了一种获取图像的方法,该方法采取帧内多次曝光,即在同一帧内、不同位置处的像素点采用不同的亮度控制参数,来实现较高的动态范围。由于不同位置处的像素点是同时曝光的,因而能够最大限度地减小运动拖尾。In this regard, an embodiment of the present application proposes a method for acquiring an image, which adopts multiple exposures within a frame, that is, different brightness control parameters are used for pixels in the same frame at different positions to achieve higher dynamic Scope. Since pixels at different positions are exposed simultaneously, motion smearing is minimized.
为了实现帧内不同位置的像素点采用不同的亮度控制参数,本申请实施例对图像传感器进行了改进。以图1所示的色彩滤镜阵列(color filter array,CFA)图像传感器包括的图像像素阵列为例,该图像像素阵列包括两种像素点,一种是彩色像素点,该彩色像素点的像素值维彩色值;一种是黑白像素点,黑白像素点也称为灰度像素点,该黑白像素点的像素值为灰度值。如图1所示的R、G和B为彩色像素点,通过该彩色像素点能够还原得到色彩信息。W为黑白像素点,通过该黑白像素点能够得到黑白图像。将彩色和黑白融合则能够得到一幅高质量的彩色图像。In order to implement different brightness control parameters for pixels at different positions in the frame, the embodiments of the present application improve the image sensor. Taking the image pixel array included in the color filter array (color filter array, CFA) image sensor shown in FIG. 1 as an example, the image pixel array includes two types of pixel points, one is a color pixel point, and the pixels of the color pixel point are Value dimension color value; one is black and white pixel point, black and white pixel point is also called grayscale pixel point, the pixel value of this black and white pixel point is gray value. R, G, and B shown in FIG. 1 are color pixels, and color information can be obtained by restoring the color pixels. W is a black and white pixel point, through which a black and white image can be obtained. Combining color and black and white results in a high-quality color image.
在示例性实施例中,基于本申请实施例提供的方法,将图像像素阵列中的同一种像素点分为至少两类,每一类采用不同的亮度控制参数拍摄,以实现在同一帧内、不同位置处的像素点采用不同的亮度控制参数拍摄,来实现较高的动态范围。例如,将黑白像素点分为至少两类,或者,将彩色像素点分为至少两类。In an exemplary embodiment, based on the method provided by the embodiment of the present application, the same type of pixel in the image pixel array is divided into at least two types, and each type is photographed with different brightness control parameters, so as to achieve, within the same frame, Pixels at different positions are shot with different brightness control parameters to achieve a higher dynamic range. For example, black and white pixels are divided into at least two categories, or color pixels are divided into at least two categories.
以图2所示的图像像素阵列为例,将黑白像素点分为两类,一类为奇数行黑白像素点,另一类为偶数行黑白像素点。将奇数行黑白像素点标记为W1,将偶数行黑白像素点标记为W2,采用奇数行黑白像素点(W1)与偶数行黑白像素点(W2)通过不同的电路进行控制的方式,实现配置相同或不同的亮度控制参数拍摄。例如,W1采用控制电路1进行控制,W2采用控制电路2进行控制。当W1与W2的亮度控制参数相同时,为线性曝光模式,适用于 环境光照条件较为均匀的场景,该线性曝光模式下奇、偶行像素点的亮度变化是平滑的。但当环境光照条件不均匀,有较为强烈的明暗对比时,需为W1与W2配置不同的亮度控制参数拍摄以实现宽动态成像技术。Taking the image pixel array shown in FIG. 2 as an example, the black and white pixels are divided into two categories, one is the black and white pixels in odd rows, and the other is black and white pixels in even rows. Mark the black and white pixels of odd rows as W1, mark the black and white pixels of even rows as W2, and use the black and white pixels of odd rows (W1) and the black and white pixels of even rows (W2) to be controlled by different circuits to achieve the same configuration. Or shoot with different brightness control parameters. For example, W1 is controlled by control circuit 1, and W2 is controlled by control circuit 2. When the brightness control parameters of W1 and W2 are the same, it is a linear exposure mode, which is suitable for scenes with relatively uniform ambient lighting conditions. In this linear exposure mode, the brightness changes of odd and even rows of pixels are smooth. However, when the ambient lighting conditions are uneven and there is a relatively strong contrast between light and dark, it is necessary to configure different brightness control parameters for W1 and W2 to shoot to achieve wide dynamic imaging technology.
除了采用CFA阵列传感器以及采用图2所示的控制方式外,本申请实施例提供的方法也可应用扩展到拜耳(bayer)阵列传感器或者其它CFA阵列传感器,也可以不局限于按行设置不同亮度控制参数,还可以按行和列分别设置不同的亮度控制参数。示例性地,图3展示了一种按行和列分别设置不同亮度控制参数的CFA阵列传感器包括的像素阵列。例如,将像素阵列中的黑白像素点分为四类,分别标记为W1、W2、W3和W4。其中,W1采用控制电路1进行控制,W2采用控制电路2进行控制,W3采用控制电路3进行控制,W4采用控制电路4进行控制。In addition to using the CFA array sensor and the control method shown in FIG. 2 , the method provided in this embodiment of the present application can also be applied to a bayer array sensor or other CFA array sensors, and it is not limited to setting different brightness by row. Control parameters, you can also set different brightness control parameters by row and column. Exemplarily, FIG. 3 shows a pixel array included in a CFA array sensor in which different brightness control parameters are set in rows and columns respectively. For example, the black and white pixels in the pixel array are divided into four categories, marked as W1, W2, W3 and W4 respectively. Among them, W1 is controlled by control circuit 1, W2 is controlled by control circuit 2, W3 is controlled by control circuit 3, and W4 is controlled by control circuit 4.
需要说明的是,图2和图3仅为对黑白像素点进行分类,并配置不同亮度控制参数为例进行示例性说明,但并不用于限制本申请,在示例性实施例中,也可将彩色像素点分为至少两类,针对每类彩色像素点配置不同的亮度控制参数。基于彩色像素点进行分类而应用本申请实施例提供的方法流程与基于黑白像素点进行分类而应用本申请实施例提供的方法流程一致,此处不再一一赘述,仅以黑白像素点为例进行说明。此外,本申请实施例不对亮度控制参数进行限定,包括但不限于曝光参数及增益,曝光参数包括但不限于曝光时长。It should be noted that FIG. 2 and FIG. 3 are only for classifying black and white pixels and configuring different brightness control parameters as an example to illustrate, but are not used to limit the present application. The color pixels are divided into at least two types, and different brightness control parameters are configured for each type of color pixels. The process of applying the method provided by the embodiment of the present application for classifying based on color pixels is consistent with the process of applying the method provided by the embodiment of the present application for classifying based on black and white pixels. Be explained. In addition, the embodiments of the present application do not limit brightness control parameters, including but not limited to exposure parameters and gain, and exposure parameters include but are not limited to exposure duration.
接下来,结合图2或图3所示的图像像素阵列的说明,对本申请实施例提供的获取图像的方法进行说明。示例性地,该方法的执行主体可以为照相机、摄像机等能够获取图像的电子设备,如图4所示,该电子设备包括镜头401、图像传感器402、控制电路403、处理器404以及编码器405,处理器404与控制电路403和图像传感器402相连接。Next, with reference to the description of the image pixel array shown in FIG. 2 or FIG. 3 , the method for acquiring an image provided by the embodiment of the present application will be described. Exemplarily, the execution body of the method may be an electronic device such as a camera, a video camera, etc. that can acquire images. As shown in FIG. 4 , the electronic device includes a lens 401 , an image sensor 402 , a control circuit 403 , a processor 404 and an encoder 405 . , the processor 404 is connected with the control circuit 403 and the image sensor 402 .
其中,控制电路403,用于接受处理器404的反馈,使用至少两个亮度控制参数对图像传感器402进行控制;图像传感器402,用于按照控制电路403的控制进行光电转换,生成图像像素阵列,其中,控制电路403的每个亮度控制参数对应一类像素点。Wherein, the control circuit 403 is used to receive the feedback from the processor 404, and use at least two brightness control parameters to control the image sensor 402; the image sensor 402 is used to perform photoelectric conversion according to the control of the control circuit 403 to generate an image pixel array, Wherein, each brightness control parameter of the control circuit 403 corresponds to a type of pixel point.
控制电路403为至少两个,本申请实施例不对控制电路403的数量进行限定。在一种可能的实现方式中,电子设备包括的控制电路403为至少两个,至少两个控制电路用于控制图像传感器402按照不同的亮度控制参数拍摄生成不同类的像素点中的像素值。例如,在获取图像时,光线进入镜头401,镜头401将光线传输给图像传感器402;图像传感器402进行光电转换,生成原始图像。由于图像传感器402的像素点被控制电路403所控制,基于不同的亮度控制参数,生成了相应的图像像素,也即像素点的像素值。图像传感器402直接生成的图像是RAW格式,根据图像传感器402设计的不同,RAW图的格式也相应不同,例如可以是拜耳RGGB,RYYB,RCCC、RCCB、RGBW、CMYW等多种格式。There are at least two control circuits 403 , and the embodiment of the present application does not limit the number of the control circuits 403 . In a possible implementation manner, the electronic device includes at least two control circuits 403, and the at least two control circuits are used to control the image sensor 402 to generate pixel values in different types of pixel points by photographing according to different brightness control parameters. For example, when acquiring an image, light enters the lens 401, and the lens 401 transmits the light to the image sensor 402; the image sensor 402 performs photoelectric conversion to generate an original image. Since the pixels of the image sensor 402 are controlled by the control circuit 403, corresponding image pixels, that is, the pixel values of the pixels, are generated based on different brightness control parameters. The image directly generated by the image sensor 402 is in RAW format. According to the design of the image sensor 402, the format of the RAW image is also different. For example, it can be Bayer RGGB, RYYB, RCCC, RCCB, RGBW, CMYW and other formats.
图像传感器402将初始图像发送给处理器404,该处理器404可具有ISP功能,由处理器404进行图像信号处理。例如,将各种格式的RAW图像转换成RGB格式。也可以将RAW格式转换成YUV格式,或者HSV格式、Lab格式、CMY格式、YCbCr格式。这些格式可以称为原始媒体数据格式。此外,处理器404应用本申请实施例提供的方法进行插值等处理,以及对控制电路403进行控制。The image sensor 402 sends the initial image to the processor 404, which may have an ISP function, and the processor 404 performs image signal processing. For example, convert RAW images of various formats to RGB format. You can also convert RAW format to YUV format, or HSV format, Lab format, CMY format, YCbCr format. These formats may be referred to as raw media data formats. In addition, the processor 404 applies the method provided by the embodiment of the present application to perform processing such as interpolation, and controls the control circuit 403 .
编码器405对图像进行编码(也就是压缩),生成的图像或者视频的格式可以是:jpeg格式、bmp格式、tga格式png格式以及gif格式。视频媒体格式例如:MPEG格式、AVI格式、nAVI格式、ASF格式、MOV格式、WMV格式、3GP格式、RM格式、RMVB格 式、FLV/F4V格式、H.264格式、H.265格式。The encoder 405 encodes (that is, compresses) the image, and the format of the generated image or video may be: jpeg format, bmp format, tga format, png format, and gif format. Video media formats such as: MPEG format, AVI format, nAVI format, ASF format, MOV format, WMV format, 3GP format, RM format, RMVB format, FLV/F4V format, H.264 format, H.265 format.
在示例性实施例中,处理器404和编码器405可以集成在一起。例如海思
Figure PCTCN2020112740-appb-000011
芯片
Figure PCTCN2020112740-appb-000012
为集成了处理器404和编码器405功能的芯片。
In an exemplary embodiment, the processor 404 and the encoder 405 may be integrated together. For example, HiSilicon
Figure PCTCN2020112740-appb-000011
chip
Figure PCTCN2020112740-appb-000012
It is a chip that integrates the functions of the processor 404 and the encoder 405 .
基于上述图4所示的电子设备,该方法应用于电子设备的处理器中。参见图5,本申请实施例提供的方法包括如下几个过程。Based on the above-mentioned electronic device shown in FIG. 4 , the method is applied to the processor of the electronic device. Referring to FIG. 5 , the method provided by the embodiment of the present application includes the following processes.
步骤501,电子设备的处理器获取图像像素阵列中的至少两类像素点的像素值,在图像中,不同类的像素点的像素值是根据不同的亮度控制参数拍摄生成,该至少两类像素点均为黑白像素点,或者,该至少两类像素点均为彩色像素点。In step 501, the processor of the electronic device obtains the pixel values of at least two types of pixel points in the image pixel array. In the image, the pixel values of different types of pixel points are generated according to different brightness control parameters. The dots are all black and white pixels, or the at least two types of pixels are all color pixels.
在本申请实施例中,为了实现帧内不同位置的像素点采用不同的亮度控制参数,图像像素阵列中同一种像素点被分为至少两类,该至少两类像素点可均为黑白像素点,或者,该至少两类像素点均为彩色像素点。此外,该至少两类像素点的像素值根据不同的亮度控制参数生成,该亮度控制参数可由控制电路来控制。In the embodiment of the present application, in order to implement different brightness control parameters for pixels at different positions in the frame, the same type of pixel in the image pixel array is divided into at least two types, and the at least two types of pixels may be black and white pixels. , or, the at least two types of pixel points are all color pixel points. In addition, the pixel values of the at least two types of pixel points are generated according to different brightness control parameters, and the brightness control parameters can be controlled by the control circuit.
由于电子设备包括图像传感器、控制电路以及处理器,处理器分别与图像传感器及控制电路相连,因而处理器不仅能够读取图像传感器包括的像素阵列中的像素点的像素值,还能够通过控制电路确定像素点对应的亮度控制参数。Since the electronic device includes an image sensor, a control circuit and a processor, and the processor is connected to the image sensor and the control circuit respectively, the processor can not only read the pixel values of the pixel points in the pixel array included in the image sensor, but also pass the control circuit Determine the brightness control parameters corresponding to the pixels.
本申请实施例不对同一种像素点被划分的至少两类像素点的数量进行限定,可基于电子设备的配置来确定。例如,如果是如图2所示的将黑白像素划分成两类像素点W1和W2,则处理器获取W1和W2这两类黑白像素点的像素值。如果是如图3所示的将黑白像素点划分成四类像素点W1、W2、W3和W4,则处理器获取W1、W2、W3和W4这四类黑白像素点的像素值。The embodiments of the present application do not limit the number of at least two types of pixel points into which the same type of pixel point is divided, which may be determined based on the configuration of the electronic device. For example, if the black and white pixels are divided into two types of pixel points W1 and W2 as shown in FIG. 2, the processor obtains the pixel values of the two types of black and white pixel points W1 and W2. If the black and white pixels are divided into four types of pixels W1, W2, W3 and W4 as shown in FIG. 3, the processor obtains the pixel values of the four types of black and white pixels W1, W2, W3 and W4.
此外,亮度控制参数包括但不限于曝光时长和增益,不同的亮度控制参数是指曝光时长相同,增益不同;或者,不同的亮度控制参数是指曝光时长不同,增益相同;或者,不同的亮度控制参数是指曝光时长不同,且增益也不同。In addition, the brightness control parameters include but are not limited to exposure duration and gain. Different brightness control parameters refer to the same exposure duration and different gains; or, different brightness control parameters refer to different exposure durations and the same gain; or, different brightness control parameters The parameter means that the exposure time is different, and the gain is also different.
针对曝光时长不同的情况,需要满足同时结束曝光。也就是说,根据不同的亮度控制参数拍摄时,曝光开始时间可以不同,但曝光结束时间需要相同,从而保证根据不同的亮度控制参数拍摄得到的图像是同一帧图像。In the case of different exposure durations, it is necessary to end the exposure at the same time. That is to say, when shooting according to different brightness control parameters, the exposure start time can be different, but the exposure end time needs to be the same, so as to ensure that the images captured according to different brightness control parameters are the same frame of image.
步骤502,电子设备的处理器根据该至少两类像素点的像素值获取各个亮度控制参数对应的图像。 Step 502, the processor of the electronic device obtains images corresponding to each brightness control parameter according to the pixel values of the at least two types of pixel points.
由于该至少两类像素点的像素值是根据不同亮度控制参数生成的,根据每一个亮度控制参数生成的像素点的像素值均可得到一张图像。示例性地,以亮度控制参数包括曝光参数,且该曝光参数为曝光时长为例,不同曝光时长能够得到不同显示效果的图像。例如,以两种亮度控制参数分别为长曝光和短曝光为例,长曝光能够获取暗部细节信息,而短曝光能够获取高亮细节信息。因此,电子设备获取具有暗部细节信息的图像以及具有高亮细节信息的图像。Since the pixel values of the at least two types of pixel points are generated according to different brightness control parameters, an image can be obtained from the pixel values of the pixel points generated according to each brightness control parameter. Exemplarily, taking the brightness control parameter including the exposure parameter, and the exposure parameter being the exposure duration as an example, images with different display effects can be obtained with different exposure durations. For example, taking the two brightness control parameters as long exposure and short exposure as an example, long exposure can obtain dark detail information, and short exposure can obtain highlight detail information. Therefore, the electronic device acquires an image with dark detail information and an image with highlight detail information.
需要说明的是,虽然该至少两类像素点并不是图像像素阵列中的全部像素点,而是其中的一种像素点,但本申请实施例根据该至少两类像素点的像素值获取到的各个亮度控制参数对应的图像均为完整图像,图像中的像素点数量与图像像素阵列中的像素点数量一致。由于该至少两类像素点中的每一类像素点的像素值均是根据各自对应的亮度控制参数生成的,并不具有根据其他亮度控制参数生成的像素值。例如,以图3所示的图像像素阵列为例,控制电路1所控制的W1的像素值是根据W1所对应的亮度控制参数1生成的,该W1并不具有根据W3 所对应的亮度控制参数3生成的像素值。同理,控制电路3所控制的W3的像素值是根据W3所对应的亮度控制参数3生成的,该W3并不具有根据W1所对应的亮度控制参数1生成的像素值。It should be noted that, although the at least two types of pixel points are not all the pixel points in the image pixel array, but one of the pixel points, the embodiment of the present application obtains the pixel value according to the pixel value of the at least two types of pixel points. The image corresponding to each brightness control parameter is a complete image, and the number of pixels in the image is consistent with the number of pixels in the image pixel array. Since the pixel value of each type of pixel point in the at least two types of pixel points is generated according to the corresponding brightness control parameters, it does not have pixel values generated according to other brightness control parameters. For example, taking the image pixel array shown in FIG. 3 as an example, the pixel value of W1 controlled by the control circuit 1 is generated according to the brightness control parameter 1 corresponding to W1, and the W1 does not have the brightness control parameter corresponding to W3. 3 Generated pixel values. Similarly, the pixel value of W3 controlled by the control circuit 3 is generated according to the brightness control parameter 3 corresponding to W3, and the W3 does not have the pixel value generated according to the brightness control parameter 1 corresponding to W1.
因此,为了获取每个亮度控制参数对应的完整的图像,在获取任一亮度控制参数对应的图像时,可根据该任一亮度控制参数对应的像素点的像素值来确定未对应该任一亮度控制参数的其他像素点的像素值。关于根据该任一亮度控制参数对应的像素点的像素值来确定未对应该任一亮度控制参数的其他像素点的像素值的方式,本申请实施例不进行限定。例如,可通过插值的方式实现,也可通过均值的方式实现。Therefore, in order to obtain a complete image corresponding to each brightness control parameter, when obtaining the image corresponding to any brightness control parameter, it can be determined according to the pixel value of the pixel corresponding to any brightness control parameter that no brightness corresponds to any one of the brightness control parameters. Controls the pixel values of other pixels of the parameter. The embodiment of the present application does not limit the manner of determining the pixel values of other pixel points that do not correspond to any brightness control parameter according to the pixel value of the pixel point corresponding to any brightness control parameter. For example, it can be implemented by means of interpolation or by means of mean value.
仍以图3中W1所对应的亮度控制参数为亮度控制参数1为例,在获取该亮度控制参数1对应的图像时,由于W1的像素值是根据该亮度控制参数1生成的,而W2、W3和W4并不具有根据该亮度控制参数1生成的像素值,因而可根据W1的像素值来确定W2、W3和W4在该亮度控制参数1下的像素值。从而使得图像像素阵列中的各个黑白像素点均具有对应该亮度控制参数1的像素值,由此生成该亮度控制参数1对应的一张黑白图像。Still taking the brightness control parameter corresponding to W1 in FIG. 3 as brightness control parameter 1 as an example, when acquiring the image corresponding to the brightness control parameter 1, since the pixel value of W1 is generated according to the brightness control parameter 1, and W2, W3 and W4 do not have pixel values generated according to the brightness control parameter 1, so the pixel values of W2, W3 and W4 under the brightness control parameter 1 can be determined according to the pixel value of W1. Therefore, each black and white pixel in the image pixel array has a pixel value corresponding to the brightness control parameter 1, thereby generating a black and white image corresponding to the brightness control parameter 1.
同理,针对W3所对应的亮度控制参数3,在获取该亮度控制参数3对应的图像时,由于W3的像素值是根据该亮度控制参数3生成的,而W1、W2和W4并不具有根据该亮度控制参数3生成的像素值,因而可根据W3的像素值来确定W1、W2和W4在该亮度控制参数3下的像素值。从而使得图像像素阵列中的各个黑白像素点均具有对应该亮度控制参数3的像素值,由此生成该亮度控制参数3对应的黑白图像。Similarly, for the brightness control parameter 3 corresponding to W3, when the image corresponding to the brightness control parameter 3 is obtained, since the pixel value of W3 is generated according to the brightness control parameter 3, and W1, W2 and W4 do not have the basis of The pixel value generated by the brightness control parameter 3, therefore, the pixel values of W1, W2 and W4 under the brightness control parameter 3 can be determined according to the pixel value of W3. Therefore, each black and white pixel in the image pixel array has a pixel value corresponding to the brightness control parameter 3 , thereby generating a black and white image corresponding to the brightness control parameter 3 .
步骤503,电子设备的处理器融合各个亮度控制参数对应的图像。 Step 503 , the processor of the electronic device fuses the images corresponding to each brightness control parameter.
得到各个亮度控制参数对应的图像后,关于融合各个亮度控制参数对应的图像的方式,本申请实施例不进行限定,可参见下面图6所示的融合方式,此处暂不赘述。After the images corresponding to each brightness control parameter are obtained, the method of fusing the images corresponding to each brightness control parameter is not limited in this embodiment of the present application.
基于本申请实施例提供的获取图像的方法,基于该获取图像的方法,由于图像像素阵列中的同一种像素点分为至少两类,每一类采用不同的亮度控制参数拍摄,以实现在同一帧内、不同位置处的像素点采用不同的亮度控制参数拍摄,能够既保留高亮细节,又保留暗部细节,实现较高的动态范围。另外,虽然不同位置处的像素点采用不同的亮度控制参数拍摄,但均在帧内同时结束曝光,且融合的不同亮度控制参数对应的图像,也都是基于同一帧图像得到的,因而能够最大限度地减小运动拖尾。Based on the method for acquiring an image provided by the embodiment of the present application, based on the method for acquiring an image, since the same type of pixel in the image pixel array is divided into at least two types, each type is shot with different brightness control parameters, so as to achieve the same The pixels in the frame and at different positions are shot with different brightness control parameters, which can retain both highlight details and dark details to achieve a higher dynamic range. In addition, although the pixels at different positions are shot with different brightness control parameters, the exposure is ended at the same time in the frame, and the images corresponding to the different brightness control parameters fused are also obtained based on the same frame image, so the maximum Minimize motion smearing.
为便于理解,以将图像像素阵列中的同一种像素点分为两类像素点为例,结合图2所示的图像像素阵列,对本申请实施例提供的方法进行举例说明。仍以该方法的执行主体为电子设备的处理器为例,参见图6,本申请实施例提供的方法包括如下几个过程。For ease of understanding, the method provided by this embodiment of the present application is illustrated by taking the same pixel point in the image pixel array as an example of being divided into two types of pixel points, in conjunction with the image pixel array shown in FIG. 2 . Still taking the execution body of the method as an example of a processor of an electronic device, referring to FIG. 6 , the method provided by the embodiment of the present application includes the following processes.
步骤601,电子设备的处理器获取图像像素阵列中的第一类像素点的像素值以及第二类像素点的像素值,第一类像素点的像素值根据第一亮度控制参数拍摄生成,第二类像素点的像素值根据第二亮度控制参数拍摄生成。In step 601, the processor of the electronic device obtains the pixel value of the first type of pixel point and the pixel value of the second type of pixel point in the image pixel array, the pixel value of the first type of pixel point is captured and generated according to the first brightness control parameter, and the first type of pixel point is photographed and generated. The pixel values of the second type of pixel points are photographed and generated according to the second brightness control parameter.
在示例性实施例中,电子设备包括的至少两个控制电路为第一控制电路和第二控制电路;第一控制电路用于控制图像传感器按照第一亮度控制参数将光转换成电信号拍摄得到第一类像素点的像素值;第二控制电路用于控制图像传感器按照第二亮度控制参数将光转换成电信号拍摄得到第二类像素点的像素值。In an exemplary embodiment, the at least two control circuits included in the electronic device are a first control circuit and a second control circuit; the first control circuit is used to control the image sensor to convert light into an electrical signal according to the first brightness control parameter to capture the image The pixel value of the first type of pixel point; the second control circuit is used to control the image sensor to convert light into an electrical signal according to the second brightness control parameter to obtain the pixel value of the second type of pixel point.
其中,第一类像素点和第二类像素点均为黑白像素点,或者,第一类像素点和第二类像素点均为彩色像素点。第一亮度控制参数与第二亮度控制参数的值不同,本申请实施例不对 第一亮度控制参数及第二亮度控制参数的值进行限定。Wherein, the first type of pixel points and the second type of pixel points are both black and white pixel points, or, the first type of pixel points and the second type of pixel points are both color pixel points. The values of the first brightness control parameter and the second brightness control parameter are different, and the embodiments of the present application do not limit the values of the first brightness control parameter and the second brightness control parameter.
第一亮度控制参数及第二亮度控制参数均包括但不限于曝光时长和增益,第一亮度控制参数及第二亮度控制参数的曝光时长相同,增益不同;或者,第一亮度控制参数及第二亮度控制参数的曝光时长不同,增益相同;或者,第一亮度控制参数及第二亮度控制参数的曝光时长不同,且增益也不同。针对曝光时长不同的情况,需要满足同时结束曝光。也就是说,根据第一亮度控制参数及第二亮度控制参数拍摄时,曝光开始时间可以不同,但曝光结束时间需要相同,从而保证根据第一亮度控制参数及第二亮度控制参数拍摄得到的图像是同一帧图像。Both the first brightness control parameter and the second brightness control parameter include, but are not limited to, exposure duration and gain. The exposure duration of the first brightness control parameter and the second brightness control parameter are the same, but the gain is different; The exposure duration of the brightness control parameter is different, and the gain is the same; or, the exposure duration of the first brightness control parameter and the second brightness control parameter are different, and the gain is also different. In the case of different exposure durations, it is necessary to end the exposure at the same time. That is to say, when shooting according to the first brightness control parameter and the second brightness control parameter, the exposure start time can be different, but the exposure end time needs to be the same, so as to ensure the image obtained according to the first brightness control parameter and the second brightness control parameter. is the same frame image.
步骤602,电子设备的处理器根据第一类像素点的像素值获取第一亮度控制参数对应的第一图像,根据第二类像素点的像素值获取第二亮度控制参数对应的第二图像。Step 602: The processor of the electronic device obtains a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel, and obtains a second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel.
虽然第一类像素点和第二类像素点并不是图像像素阵列中的全部像素点,而是其中的一种像素点,但本申请实施例根据第一类像素点的像素值获取到的第一亮度控制参数对应的第一图像,以及根据第二类像素点的像素值获取到的第二亮度控制参数对应的第二图像均为完整图像,第一图像和第二图像中的像素点数量均与图像像素阵列中的像素点数量一致。第一图像中的像素点的值一部分是直接从图像像素阵列中获取得到的,余下一部分由直接获取的这部分像素点的值计算得到。同理,第二图像中的像素点的值一部分是直接从图像像素阵列中获取得到的,余下一部分由直接获取的这部分像素点的值计算得到。也就是说,第一图像及所述第二图像为初始图像,初始图像的像素点数量与图像像素阵列中的像素点数量相同。图像像素阵列是RAW格式的图像,而第一图像和第二图像也是同样格式。由于该第一类像素点的像素值是根据第一亮度控制参数拍摄生成的,该第一类像素点并不具有根据第二亮度控制参数拍摄生成的像素值。而第二类像素点的像素值是根据第二亮度控制参数拍摄生成的,该第二类像素点并不具有根据第一亮度控制参数拍摄生成的像素值。Although the first type of pixel point and the second type of pixel point are not all the pixel points in the image pixel array, but one of the pixel points, the first type of pixel point is obtained according to the pixel value of the first type of pixel point in the embodiment of the present application. The first image corresponding to a brightness control parameter and the second image corresponding to the second brightness control parameter obtained according to the pixel values of the second type of pixels are both complete images. The number of pixels in the first image and the second image All are consistent with the number of pixels in the image pixel array. Part of the values of the pixels in the first image are obtained directly from the image pixel array, and the remaining part is calculated from the directly obtained values of this part of the pixels. Similarly, a part of the values of the pixel points in the second image is obtained directly from the image pixel array, and the remaining part is calculated from the directly obtained values of this part of the pixel points. That is, the first image and the second image are initial images, and the number of pixels in the initial image is the same as the number of pixels in the image pixel array. The image pixel array is an image in RAW format, and the first and second images are also in the same format. Since the pixel value of the first type of pixel point is generated by shooting according to the first brightness control parameter, the first type of pixel point does not have the pixel value generated by shooting according to the second brightness control parameter. The pixel value of the second type of pixel point is generated by shooting according to the second brightness control parameter, and the second type of pixel point does not have the pixel value generated by shooting according to the first brightness control parameter.
因此,为了获取第一亮度控制参数对应的第一图像,在获取第一亮度控制参数对应的第一图像时,可根据该第一亮度控制参数对应的第一类像素点的像素值来确定未对应该第一亮度控制参数的第二类像素点的像素值。关于根据该第一亮度控制参数对应的第一类像素点的像素值来确定未对应该第一亮度控制参数的第二类像素点的像素值的方式,本申请实施例不进行限定。例如,可通过均值的方式实现,也可通过插值的方式实现。Therefore, in order to obtain the first image corresponding to the first brightness control parameter, when obtaining the first image corresponding to the first brightness control parameter, the pixel value of the first type of pixel corresponding to the first brightness control parameter can be used to determine the The pixel value of the second type of pixel point corresponding to the first brightness control parameter. The embodiment of the present application does not limit the manner of determining the pixel value of the second type of pixel point not corresponding to the first brightness control parameter according to the pixel value of the first type of pixel point corresponding to the first brightness control parameter. For example, it can be implemented by means of mean value or by means of interpolation.
以通过均值的方式为例,确定第二类像素点在第一亮度控制参数下的像素值时,确定与第二类像素点相邻的各个第一类像素点的像素值的平均值,将该平均值作为该第二类像素点在第一亮度控制参数下的像素值。如图2所示,任一W1的像素值是根据第一亮度控制参数生成的,任一W2的像素值是根据第二亮度控制参数生成的,对于其中一个W2,如果需要确定该W2在第一亮度控制参数下的像素值,则将于该W2相邻的四个W1的像素值求平均,得到的均值作为该W2在第一亮度控制参数下的像素值。Taking the mean value method as an example, when determining the pixel value of the second type pixel point under the first brightness control parameter, determine the average value of the pixel value of each first type pixel point adjacent to the second type pixel point, and use The average value is used as the pixel value of the second type of pixel point under the first brightness control parameter. As shown in Figure 2, the pixel value of any W1 is generated according to the first brightness control parameter, and the pixel value of any W2 is generated according to the second brightness control parameter. For a pixel value under a brightness control parameter, the pixel values of four W1 adjacent to the W2 are averaged, and the obtained average value is used as the pixel value of the W2 under the first brightness control parameter.
可选地,除了确定与第二类像素点相邻的各个第一类像素点的像素值的平均值,将该平均值作为该第二类像素点在第一亮度控制参数下的像素值之外,还可确定所有第一类像素点的像素值的平均值,将各个第二类像素点在第一亮度控制参数下的像素值均设为该平均值。Optionally, in addition to determining the average value of the pixel values of each pixel point of the first type adjacent to the pixel point of the second type, the average value is taken as the pixel value of the pixel point of the second type under the first brightness control parameter. In addition, the average value of the pixel values of all the pixel points of the first type can also be determined, and the pixel value of each pixel point of the second type under the first brightness control parameter is set as the average value.
针对通过插值的方式,在示例性实施例中,根据第一类像素点的像素值获取第一亮度控制参数对应的第一图像,包括:根据第一目标像素点的像素值确定第二类像素点在第一亮度控制参数下的第一互相关插值;根据第一类像素点的像素值和第一互相关插值获取第一图像, 第一目标像素点包括与第二类像素点相邻的第一类像素点。For the interpolation method, in an exemplary embodiment, acquiring the first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel point includes: determining the second type of pixel according to the pixel value of the first target pixel point The first cross-correlation interpolation of the point under the first brightness control parameter; the first image is obtained according to the pixel value of the first type of pixel point and the first cross-correlation interpolation, and the first target pixel point includes pixels adjacent to the second type of pixel point. The first type of pixels.
以图7所示的获取图像过程为例,W1为第一类像素点,为便于理解,将各个第一类像素点的像素值均记为W1,但并不代表各个第一类像素点的像素值相同,各个第一类像素点的像素值可基于当前环境来确定,可以是不同的像素值,这里只是为了便于理解。同理,W2为第二类像素点,为便于理解,将各个第二类像素点的像素值记为W2。W2’是第二类像素点在第一亮度控制参数下通过第一目标像素点的像素值进行插值得到的像素值,该第一目标像素点是第二类像素点相邻的第一类像素点。Taking the image acquisition process shown in Figure 7 as an example, W1 is the first type of pixel point. For ease of understanding, the pixel value of each first type of pixel point is recorded as W1, but it does not represent the value of each first type of pixel point. The pixel values are the same, and the pixel values of each first-type pixel point may be determined based on the current environment, and may be different pixel values, which are only for ease of understanding. Similarly, W2 is the second type of pixel point, and for ease of understanding, the pixel value of each second type of pixel point is denoted as W2. W2' is the pixel value of the second type of pixel by interpolation of the pixel value of the first target pixel under the first brightness control parameter, and the first target pixel is the first type of pixel adjacent to the second type of pixel. point.
为了进一步理解,可参见图8所示的3*3像素阵列,其中,各个数字1所对应的像素点为第一类像素点,各个数字1对应的像素点的像素值根据第一亮度控制参数生成。图8中的数字2对应的像素点为第二类像素点,各个数字1所对应的像素点均是与数字2对应的像素点相邻的第一类像素点,因而各个数字1对应的像素点均为第一目标像素点,该数字2对应的像素点在第一亮度控制参数下的像素值通过各个数字1对应的像素点的像素值进行插值得到。For further understanding, please refer to the 3*3 pixel array shown in FIG. 8, in which the pixel points corresponding to each number 1 are the first type of pixel points, and the pixel value of the pixel point corresponding to each number 1 is based on the first brightness control parameter generate. The pixels corresponding to the number 2 in FIG. 8 are the second type of pixels, and the pixels corresponding to each number 1 are the first type of pixels adjacent to the pixels corresponding to the number 2, so the pixels corresponding to each number 1 are of the first type. The points are all first target pixel points, and the pixel value of the pixel point corresponding to the number 2 under the first brightness control parameter is obtained by interpolating the pixel value of the pixel point corresponding to each number 1.
关于获取插值的方式,本申请实施例不进行限定。在示例性实施例中,根据第一目标像素点的像素值确定第二类像素点在第一亮度控制参数下的第一互相关插值,包括:根据第二类像素点的像素值确定第一目标像素点的加权权重,第一目标像素点的加权权重与第二类像素点及第一目标像素点的差异大小正相关;根据第一目标像素点的像素值以及加权权重确定第二类像素点在第一亮度控制参数下的第一互相关插值。The manner of obtaining the interpolation value is not limited in this embodiment of the present application. In an exemplary embodiment, determining the first cross-correlation interpolation value of the second type of pixel point under the first brightness control parameter according to the pixel value of the first target pixel point includes: determining the first cross-correlation interpolation value according to the pixel value of the second type of pixel point The weighted weight of the target pixel point, the weighted weight of the first target pixel point is positively correlated with the difference between the second type of pixel point and the first target pixel point; the second type of pixel is determined according to the pixel value of the first target pixel point and the weighted weight. Click the first cross-correlation interpolation under the first brightness control parameter.
其中,本申请实施例不对根据第二类像素点的像素值确定第一目标像素点的加权权重的方式进行限定,该第一目标像素点的加权权重与第二类像素点及第一目标像素点的差异大小正相关,包括但不限于将第二类像素点及第一目标像素点的差异映射为第一目标像素点的加权权重,第二类像素点及第一目标像素点的差异越小,则第一目标像素点的加权权重越小,第二类像素点及第一目标像素点的差异越大,则第一目标像素点的加权权重越大。The embodiment of the present application does not limit the method of determining the weighted weight of the first target pixel point according to the pixel value of the second type of pixel point. The weighted weight of the first target pixel point is related to the second type of pixel point and the first target pixel The difference size of the points is positively correlated, including but not limited to mapping the difference between the second type of pixel point and the first target pixel point as the weighted weight of the first target pixel point, the greater the difference between the second type of pixel point and the first target pixel point. is smaller, the smaller the weighted weight of the first target pixel point, the greater the difference between the second type of pixel point and the first target pixel point, the greater the weighted weight of the first target pixel point.
例如,仍以图7所示的3*3像素阵列为例,各个数字1对应的像素点作为第一目标像素点,该各个数字1对应的像素点的加权权重通过各个数字1对应的像素点与数字2对应的像素点之间的差异大小确定。For example, still taking the 3*3 pixel array shown in FIG. 7 as an example, the pixel point corresponding to each number 1 is used as the first target pixel point, and the weighted weight of the pixel point corresponding to each number 1 passes through the pixel point corresponding to each number 1 The size of the difference between the pixels corresponding to the number 2 is determined.
示例性地,根据第一目标像素点的像素值以及加权权重确定第二类像素点在第一亮度控制参数下的第一互相关插值,包括:对于任一第一目标像素点,将该任一第一目标像素点的像素值与该第一目标像素点的加权权重相乘,得到该任一第一目标像素点对应的乘积结果。之后,将各个第一目标像素点对应的乘积结果进行累加,得到第一累加和。将各个第一目标像素点的加权权重进行累加,得到第二累加和。将第一累加和与第二累加和的商作为第二类像素点在第一亮度控制参数下的第一互相关插值。Exemplarily, determining the first cross-correlation interpolation of the second type of pixel under the first brightness control parameter according to the pixel value of the first target pixel and the weighted weight, including: for any first target pixel, determining the The pixel value of a first target pixel is multiplied by the weighted weight of the first target pixel to obtain a product result corresponding to any one of the first target pixels. After that, the product results corresponding to each first target pixel are accumulated to obtain a first accumulated sum. The weighted weights of each first target pixel are accumulated to obtain a second accumulated sum. The quotient of the first accumulated sum and the second accumulated sum is used as the first cross-correlation interpolation of the second type of pixels under the first brightness control parameter.
例如,以α 2i为第一目标像素点的加权权重,W 2i为第一目标像素点的像素值,N 1为第一目标像素点的数量为例,根据第一目标像素点的像素值以及加权权重确定第二类像素点在第一亮度控制参数下的第一互相关插值,包括:根据第一目标像素点的像素值以及加权权重按照如下公式确定第二类像素点在第一亮度控制参数下的第一互相关插值W′ 2For example, taking α 2i as the weighted weight of the first target pixel, W 2i as the pixel value of the first target pixel, and N 1 as the number of the first target pixel, according to the pixel value of the first target pixel and The weighted weight determines the first cross-correlation interpolation of the second type of pixel point under the first brightness control parameter, including: according to the pixel value of the first target pixel point and the weighted weight, according to the following formula, determine the second type of pixel point in the first brightness control The first cross-correlation interpolation W′ 2 under the parameter:
Figure PCTCN2020112740-appb-000013
Figure PCTCN2020112740-appb-000013
需要说明的是,获取第二图像的方式与获取第一图像的方式在原理上一致,可参考上述获取第一图像的过程。在示例性实施例中,根据第二类像素点的像素值获取第二亮度控制参数对应的第二图像,包括:根据第二目标像素点的像素值确定第一类像素点在第二亮度控制 参数下的第二互相关插值,根据第二类像素点的像素值和第二互相关插值获取第二图像,第二目标像素点包括与第一类像素点相邻的第二类像素点。It should be noted that the method of acquiring the second image is the same in principle as the method of acquiring the first image, and reference may be made to the above-mentioned process of acquiring the first image. In an exemplary embodiment, acquiring the second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel includes: determining, according to the pixel value of the second target pixel, whether the first type of pixel is in the second brightness control For the second cross-correlation interpolation under the parameters, a second image is obtained according to the pixel value of the second-type pixel point and the second cross-correlation interpolation, and the second target pixel point includes the second-type pixel point adjacent to the first-type pixel point.
其中,根据第二目标像素点的像素值确定第一类像素点在第二亮度控制参数下的第二互相关插值,包括但不限于:根据第一类像素点的像素值确定第二目标像素点的加权权重,第二目标像素点的加权权重与第一类像素点及第二目标像素点的差异大小正相关;根据第二目标像素点的像素值以及加权权重确定第一类像素点在第二亮度控制参数下的第二互相关插值。Wherein, determining the second cross-correlation interpolation of the first type of pixel under the second brightness control parameter according to the pixel value of the second target pixel includes but not limited to: determining the second target pixel according to the pixel value of the first type of pixel The weighted weight of the point, the weighted weight of the second target pixel point is positively correlated with the difference between the first type of pixel point and the second target pixel point; The second cross-correlation interpolation under the second brightness control parameter.
示例性地,根据第二目标像素点的像素值以及加权权重确定第一类像素点在第二亮度控制参数下的第二互相关插值,包括:对于任一第二目标像素点,将任一第二目标像素点的像素值以及加权权重相乘,得到任一第二目标像素点对应的乘积结果;将各个第二目标像素点对应的乘积结果进行累加,得到第三累加和;将各个第二目标像素点的加权权重进行累加,得到第四累加和;将第三累加和与第四累加和的商作为第一类像素点在第二亮度控制参数下的第二互相关插值。Exemplarily, determining the second cross-correlation interpolation of the first type of pixel under the second brightness control parameter according to the pixel value of the second target pixel and the weighted weight, including: for any second target pixel, adding any Multiply the pixel value of the second target pixel and the weighted weight to obtain a product result corresponding to any second target pixel; accumulate the product results corresponding to each second target pixel to obtain a third cumulative sum; The weighted weights of the two target pixels are accumulated to obtain a fourth accumulated sum; the quotient of the third accumulated sum and the fourth accumulated sum is used as the second cross-correlation interpolation of the first type of pixels under the second brightness control parameter.
例如,根据第二目标像素点的像素值以及加权权重按照如下公式确定第一类像素点在第二亮度控制参数下的第二互相关插值W′ 1For example, according to the pixel value of the second target pixel and the weighted weight, the second cross-correlation interpolation W′ 1 of the first type of pixel under the second brightness control parameter is determined according to the following formula:
Figure PCTCN2020112740-appb-000014
Figure PCTCN2020112740-appb-000014
其中,α 1i为第二目标像素点的加权权重,W 1i为第二目标像素点的像素值,N 2为第二目标像素点的数量。 Wherein, α 1i is the weighted weight of the second target pixel, W 1i is the pixel value of the second target pixel, and N 2 is the number of the second target pixel.
步骤603,电子设备的处理器融合第一图像和第二图像。 Step 603, the processor of the electronic device fuses the first image and the second image.
由于第一图像是第一亮度控制参数对应的图像,而第二图像是第二亮度控制参数对应的图像,为了获取同一帧图像,在示例性实施例中,融合第一图像和第二图像。例如,将第一图像的各个像素点的像素值与第二图像对应的各个像素点的像素值进行融合。本申请实施例不对融合第一图像及第二图像的方式进行限定,在示例性实施例中,本申请实施例提供的方法还包括对第一图像和对第二图像进行亮度对齐的过程,以通过亮度平滑算法,来实现高亮区域不过曝、暗部区域不过暗的成像目标,从而保持获取到的最终图像的清晰度不损失。示例性地,以第二亮度控制参数小于第一亮度控制参数为例,本申请实施例提供的融合第一图像和第二图像的方式,包括但不限于如下603A1至603A4几个过程。Since the first image is an image corresponding to the first brightness control parameter, and the second image is an image corresponding to the second brightness control parameter, in order to obtain the same frame of image, in an exemplary embodiment, the first image and the second image are fused. For example, the pixel value of each pixel point of the first image is fused with the pixel value of each pixel point corresponding to the second image. The embodiment of the present application does not limit the manner of fusing the first image and the second image. In an exemplary embodiment, the method provided by the embodiment of the present application further includes a process of aligning the brightness of the first image and the second image, so as to Through the brightness smoothing algorithm, the imaging target of not exposing the bright area and not being too dark in the dark area is realized, so as to keep the clarity of the final image obtained without loss. Exemplarily, taking the second brightness control parameter smaller than the first brightness control parameter as an example, the method for fusing the first image and the second image provided by the embodiments of the present application includes but is not limited to the following processes 603A1 to 603A4.
603A1,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果。603A1. Perform luminance alignment on the pixel value of the first type of pixel point and the second cross-correlation interpolation value according to the first luminance control parameter, to obtain a first luminance alignment result.
由于第一类像素点的像素值是根据第一亮度控制参数生成的,而第二互相关插值也是该第一类像素点对应的值,只是该第二互相关插值是第二亮度控制参数下的值。也就是说,对于同一个第一类像素点,既有一个根据第一亮度控制参数生成的像素值,还有一个对应第二亮度控制参数的第二互相插值。因此,需要将同一个第一类像素点的两个值进行亮度对齐。由于亮度控制参数越小,得到的图像越暗,在第二亮度控制参数小于第一亮度控制参数的情况下,采用按照第一亮度控制参数将第一类像素点的像素值和第二互相关插值进行亮度对齐。Because the pixel value of the first type of pixel is generated according to the first brightness control parameter, and the second cross-correlation interpolation is also the value corresponding to the first type of pixel, but the second cross-correlation interpolation is under the second brightness control parameter. value of . That is to say, for the same first type of pixel point, there is not only a pixel value generated according to the first brightness control parameter, but also a second mutual interpolation corresponding to the second brightness control parameter. Therefore, it is necessary to align the brightness of the two values of the same first-type pixel point. Since the smaller the brightness control parameter is, the darker the obtained image will be. In the case that the second brightness control parameter is smaller than the first brightness control parameter, the pixel value of the first type of pixel and the second cross-correlation according to the first brightness control parameter are adopted. Interpolate for luminance alignment.
在示例性实施例中,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,包括:根据第一亮度控制参数与第二亮度控制参数之间的差异倍数,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,差异倍数基于第一亮度控制参数与第二亮度控制参数之间的综合差异得到。In an exemplary embodiment, performing luminance alignment on the pixel value of the first type of pixel point and the second cross-correlation interpolation value according to the first luminance control parameter to obtain the first luminance alignment result, comprising: according to the first luminance control parameter and the second luminance alignment The difference multiple between the brightness control parameters, the pixel value of the first type of pixel point and the second cross-correlation interpolation are brightness aligned according to the first brightness control parameter, and the first brightness alignment result is obtained, and the difference multiple is based on the first brightness control parameter and The comprehensive difference between the second brightness control parameters is obtained.
以亮度参数包括增益及曝光时长为例,第一亮度控制参数包括第一增益及第一曝光时长,第二亮度控制参数包括第二增益及第二曝光时长,则第一亮度控制参数与第二亮度控制参数之间的差异倍数为第一乘积结果与第二乘积结果的差异。其中,第一乘积结果为第一增益与第一曝光时长的乘积结果,第二乘积结果为第二增益与第二曝光时长的乘积结果。Taking the brightness parameter including the gain and the exposure duration as an example, the first brightness control parameter includes the first gain and the first exposure duration, the second brightness control parameter includes the second gain and the second exposure duration, then the first brightness control parameter and the second The difference multiple between the brightness control parameters is the difference between the first product result and the second product result. The first product result is the product result of the first gain and the first exposure duration, and the second product result is the product result of the second gain and the second exposure duration.
示例性地,按照如下公式根据第一亮度控制参数与第二亮度控制参数之间的差异倍数,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果
Figure PCTCN2020112740-appb-000015
Exemplarily, according to the following formula, according to the difference multiple between the first brightness control parameter and the second brightness control parameter, the pixel value of the first type of pixel point and the second cross-correlation interpolation are brightness aligned according to the first brightness control parameter, Get the first brightness alignment result
Figure PCTCN2020112740-appb-000015
Figure PCTCN2020112740-appb-000016
Figure PCTCN2020112740-appb-000016
其中,K为第一亮度控制参数与第二亮度控制参数的差异倍数,BL为黑电平的值,W′ 2为第二互相关插值。 Wherein, K is the difference multiple of the first brightness control parameter and the second brightness control parameter, BL is the value of the black level, and W′ 2 is the second cross-correlation interpolation.
603A2,融合第一类像素点的像素值及第一亮度对齐结果。603A2, fuse the pixel value of the first type of pixel point and the first brightness alignment result.
在示例性实施例中,融合第一类像素点的像素值及第一亮度对齐结果,包括:将第一类像素点的像素值及对应的加权权重相乘,得到第一乘积结果,将第一亮度对齐结果及对应的加权权重相乘,得到第二乘积结果。之后,将第一乘积结果与第二乘积结果求和,得到第一和值。将第一类像素点对应的加权权重与第一亮度对齐结果对应的加权权重求和,得到第二和值。将第一和值与第二和值的商作为第一类像素点的像素值及第一亮度对齐结果的融合结果。In an exemplary embodiment, fusing the pixel value of the first type of pixel point and the first brightness alignment result includes: multiplying the pixel value of the first type of pixel point and the corresponding weighted weight to obtain a first product result, A luminance alignment result and the corresponding weighted weight are multiplied to obtain a second product result. After that, sum the first product result and the second product result to obtain the first sum value. The weighted weight corresponding to the first type of pixel point and the weighted weight corresponding to the first brightness alignment result are summed to obtain a second sum value. The quotient of the first sum value and the second sum value is used as the fusion result of the pixel value of the first type of pixel point and the first brightness alignment result.
示例性地,根据第一类像素点的像素值及对应的加权权重,以及第一亮度对齐结果及对应的加权权重,按照如下公式融合第一类像素点的像素值及第一亮度对齐结果:Exemplarily, according to the pixel value of the first type of pixel point and the corresponding weighted weight, as well as the first brightness alignment result and the corresponding weighted weight, the pixel value of the first type of pixel point and the first brightness alignment result are fused according to the following formula:
Figure PCTCN2020112740-appb-000017
Figure PCTCN2020112740-appb-000017
其中,W F1为第一类像素点的像素值W 1及第一亮度对齐结果
Figure PCTCN2020112740-appb-000018
的融合结果,β 11为第一加权权重,β 12为第二加权权重。
Among them, W F1 is the pixel value W 1 of the first type of pixel point and the first brightness alignment result
Figure PCTCN2020112740-appb-000018
The fusion result of β 11 is the first weighting weight, and β 12 is the second weighting weight.
在示例性实施例中,融合第一图像和第二图像之前,还包括确定第一类像素点对应的加权权重以及确定第一亮度对齐结果对应的加权权重的过程。包括但不限于如下两种确定方式:In an exemplary embodiment, before fusing the first image and the second image, it further includes a process of determining the weighting weight corresponding to the pixel points of the first type and determining the weighting weight corresponding to the first luminance alignment result. Including but not limited to the following two determination methods:
确定方式一,基于W 1小于第一过暗阈值,确定β 11为第一值,β 12为第二值,第一值大于第二值;或者,基于W 1大于等于第一过暗阈值,确定β 11为第二值,β 12为第一值。 Determining Mode 1: Based on W 1 being less than the first over-dark threshold, determine that β 11 is the first value, β 12 is the second value, and the first value is greater than the second value; or, based on W 1 being greater than or equal to the first over-dark threshold, Determine β 11 as the second value and β 12 as the first value.
示例性地,第一值为1,第二值为0。如果第一类像素点的像素值小于第一过暗阈值,说明第一类像素点的像素值不过暗,将第一类像素点对应的加权权重设为1,而将第一亮度对齐结果对应的加权权重设为0,则该位置的像素点的像素值以第一类像素点的像素值为准。同理,如果第一类像素点的像素值大于等于第一过暗阈值,说明第一类像素点的像素值过暗,将第一类像素点对应的加权权重设为0,而将第一亮度对齐结果对应的加权权重设为1,则该位置的像素点的像素值以第一亮度对齐结果为准。该种确定第一类像素点对应的加权权重以及确定第一亮度对齐结果对应的加权权重的方式,使得融合第一类像素点的像素值及第一亮度对齐结果之后的图像除过曝和过暗区域外,与线性曝光模式的清晰度一致。Illustratively, the first value is 1 and the second value is 0. If the pixel value of the first type of pixel is less than the first dark threshold, it means that the pixel value of the first type of pixel is not too dark. The weighted weight of is set to 0, then the pixel value of the pixel point at this position is based on the pixel value of the first type of pixel point. Similarly, if the pixel value of the first type of pixel point is greater than or equal to the first dark threshold, it means that the pixel value of the first type of pixel point is too dark, the weighted weight corresponding to the first type of pixel point is set to 0, and the first type of pixel point is set to 0. The weighted weight corresponding to the luminance alignment result is set to 1, and the pixel value of the pixel at this position is subject to the first luminance alignment result. The method of determining the weighting weight corresponding to the first type of pixel point and determining the weighting weight corresponding to the first brightness alignment result makes the image after fusing the pixel value of the first type pixel point and the first brightness alignment result except for overexposure and overexposure. Outside of dark areas, the sharpness is consistent with the linear exposure mode.
确定方式二,基于W 1小于第二过暗阈值,确定β 11为第一值,β 12为第二值,第一值大于第二值;或者,基于W 1大于第二过曝阈值,确定β 11为第二值,β 12为第一值;或者,基于W 1介于第二过暗阈值与第二过曝阈值之间,确定β 11从第一值开始随W 1增大而减小,β 12从第二值开始随W 1增大而增大。 The second determination method is based on that W 1 is smaller than the second over-dark threshold, and β 11 is determined to be the first value, β 12 is the second value, and the first value is greater than the second value; or, based on W 1 greater than the second over-exposure threshold, determine β 11 is the second value and β 12 is the first value; or, based on the fact that W 1 is between the second overdark threshold and the second overexposure threshold, it is determined that β 11 decreases from the first value as W 1 increases. small, β 12 increases from the second value as W 1 increases.
示例性地,第一值为1,第二值为0。该方式二中,第一类像素点对应的加权权重以及第一亮度对齐结果对应的加权权重的关系如图9所示。如果第一类像素点的像素值小于第二过暗 阈值(对应于图9中的th1),说明第一类像素点的像素值不过暗,将第一类像素点对应的加权权重设为1,而将第一亮度对齐结果对应的加权权重设为0,则该位置的像素点的像素值以第一类像素点的像素值为准。同理,如果第一类像素点的像素值大于第二过曝阈值(对应于图9中的th2),说明第一类像素点的像素值过曝,将第一类像素点对应的加权权重设为0,而将第一亮度对齐结果对应的加权权重设为1,则该位置的像素点的像素值以第一亮度对齐结果为准。如果第一类像素点的像素值介于第二过暗阈值与第二过曝阈值之间,确定第一类像素点对应的加权权重从1开始随第一互相关插值增大而减小,第一亮度对齐结果对应的加权权重从0开始随第一互相关插值增大而增大。Illustratively, the first value is 1 and the second value is 0. In the second method, the relationship between the weighted weights corresponding to the first type of pixel points and the weighted weights corresponding to the first luminance alignment result is shown in FIG. 9 . If the pixel value of the first type of pixel point is less than the second dark threshold (corresponding to th1 in Figure 9), it means that the pixel value of the first type of pixel point is not too dark, and the weighting weight corresponding to the first type of pixel point is set to 1 , and the weighting weight corresponding to the first luminance alignment result is set to 0, then the pixel value of the pixel point at this position is based on the pixel value of the first type of pixel point. Similarly, if the pixel value of the first type of pixel point is greater than the second overexposure threshold (corresponding to th2 in Figure 9), it means that the pixel value of the first type of pixel point is overexposed, and the weighted weight corresponding to the first type of pixel point is is set to 0, and the weighting weight corresponding to the first luminance alignment result is set to 1, then the pixel value of the pixel at this position is subject to the first luminance alignment result. If the pixel value of the first type of pixel is between the second over-dark threshold and the second over-exposure threshold, it is determined that the weighting weight corresponding to the first type of pixel starts from 1 and decreases as the first cross-correlation interpolation increases, The weighting weight corresponding to the first luminance alignment result starts from 0 and increases as the first cross-correlation interpolation increases.
通过该确定方式二确定第一类像素点对应的加权权重以及确定第一亮度对齐结果对应的加权权重,使得融合第一类像素点的像素值及第一亮度对齐结果之后的图像略低于线性曝光模式的清晰度,但是能够有效防止采用方式一由于图像传感器的线性度不佳导致的不平滑问题。The weighting weight corresponding to the first type of pixel points and the weighting weight corresponding to the first brightness alignment result are determined by this determination method 2, so that the image after fusing the pixel value of the first type pixel point and the first brightness alignment result is slightly lower than linear The sharpness of the exposure mode, but it can effectively prevent the unsmooth problem caused by the poor linearity of the image sensor in the first method.
603A3,将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果。603A3: Perform luminance alignment on the pixel value of the second type of pixel point and the first cross-correlation interpolation value according to the first luminance control parameter, to obtain a second luminance alignment result.
同第一类像素点一样,由于第二类像素点的像素值是根据第二亮度控制参数生成的,而第一互相关插值也是该第二类像素点对应的值,只是该第一互相关插值是第一亮度控制参数下的值。也就是说,对于同一个第二类像素点,既有一个根据第二亮度控制参数生成的像素值,还有一个对应第一亮度控制参数的第一互相插值。因此,需要将同一个第二类像素点的两个值进行亮度对齐。由于亮度控制参数越小,得到的图像越暗,在第二亮度控制参数小于第一亮度控制参数的情况下,采用按照第一亮度控制参数将第二类像素点的像素值和第一互相关插值进行亮度对齐。Like the first type of pixels, since the pixel value of the second type of pixel is generated according to the second brightness control parameter, and the first cross-correlation interpolation is also the value corresponding to the second type of pixel, but the first cross-correlation Interpolation is the value under the first brightness control parameter. That is, for the same second type of pixel point, there is not only a pixel value generated according to the second brightness control parameter, but also a first mutual interpolation corresponding to the first brightness control parameter. Therefore, it is necessary to align the brightness of the two values of the same second-type pixel point. Since the smaller the brightness control parameter is, the darker the obtained image will be. When the second brightness control parameter is smaller than the first brightness control parameter, the first cross-correlation between the pixel value of the second type of pixel point and the first brightness control parameter is adopted according to the first brightness control parameter. Interpolate for luminance alignment.
在示例性实施例中,将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果,包括:根据第一亮度控制参数与第二亮度控制参数之间的差异倍数,将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果,差异倍数基于第一亮度控制参数与第二亮度控制参数之间的综合差异得到。In an exemplary embodiment, performing luminance alignment on the pixel values of the second type of pixel points and the first cross-correlation interpolation value according to the first luminance control parameter, to obtain a second luminance alignment result, includes: according to the first luminance control parameter and the second luminance alignment result. The difference multiple between the brightness control parameters, the pixel value of the second type of pixel point and the first cross-correlation interpolation are brightness aligned according to the first brightness control parameter, and the second brightness alignment result is obtained, and the difference multiple is based on the first brightness control parameter and The comprehensive difference between the second brightness control parameters is obtained.
以亮度参数包括增益及曝光时长为例,第一亮度控制参数包括第一增益及第一曝光时长,第二亮度控制参数包括第二增益及第二曝光时长,则第一亮度控制参数与第二亮度控制参数之间的差异倍数为第一乘积结果与第二乘积结果的差异。其中,第一乘积结果为第一增益与第一曝光时长的乘积结果,第二乘积结果为第二增益与第二曝光时长的乘积结果。Taking the brightness parameter including the gain and the exposure duration as an example, the first brightness control parameter includes the first gain and the first exposure duration, the second brightness control parameter includes the second gain and the second exposure duration, then the first brightness control parameter and the second The difference multiple between the brightness control parameters is the difference between the first product result and the second product result. The first product result is the product result of the first gain and the first exposure duration, and the second product result is the product result of the second gain and the second exposure duration.
示例性地,按照如下公式将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果
Figure PCTCN2020112740-appb-000019
Exemplarily, according to the following formula, the pixel value of the second type of pixel point and the first cross-correlation interpolation are brightness aligned according to the first brightness control parameter to obtain the second brightness alignment result:
Figure PCTCN2020112740-appb-000019
Figure PCTCN2020112740-appb-000020
Figure PCTCN2020112740-appb-000020
其中,W 2为第二类像素点的像素值。 Among them, W 2 is the pixel value of the second type of pixel point.
603A4,融合第一互相关插值及第二亮度对齐结果。603A4, fuse the first cross-correlation interpolation and the second luminance alignment result.
在示例性实施例中,融合第一互相关插值及第二亮度对齐结果,包括:将第一互相关插值及对应的加权权重相乘,得到第三乘积结果,将第二亮度对齐结果及对应的加权权重相乘,得到第四乘积结果。之后,将第三乘积结果与第四乘积结果求和,得到第三和值。将第二类像素点对应的加权权重与第二亮度对齐结果对应的加权权重求和,得到第四和值。将第三和 值与第四和值的商作为第一互相关插值及第二亮度对齐结果的融合结果。In an exemplary embodiment, fusing the first cross-correlation interpolation and the second luminance alignment result includes: multiplying the first cross-correlation interpolation and the corresponding weighted weight to obtain a third product result, and combining the second luminance alignment result with the corresponding The weighted weights are multiplied to obtain the fourth product result. After that, the third product result is summed with the fourth product result to obtain the third sum value. The weighted weight corresponding to the second type of pixel point and the weighted weight corresponding to the second brightness alignment result are summed to obtain a fourth sum value. The quotient of the third sum value and the fourth sum value is used as the fusion result of the first cross-correlation interpolation and the second luminance alignment result.
例如,以第一互相关插值对应的加权权重为第三加权权重,第二亮度对齐结果对应的加权权重为第四加权权重为例,按照如下公式融合第一互相关插值及第二亮度对齐结果:For example, taking the weighting weight corresponding to the first cross-correlation interpolation as the third weighting weight and the weighting weight corresponding to the second luminance alignment result being the fourth weighting weight as an example, the first cross-correlation interpolation and the second luminance alignment result are fused according to the following formula :
Figure PCTCN2020112740-appb-000021
Figure PCTCN2020112740-appb-000021
其中,W F2为第一互相关插值W′ 1及第二亮度对齐结果
Figure PCTCN2020112740-appb-000022
的融合结果,β 21为第三加权权重,β 22为第四加权权重。
Among them, W F2 is the first cross-correlation interpolation W′ 1 and the second luminance alignment result
Figure PCTCN2020112740-appb-000022
, β 21 is the third weighting weight, and β 22 is the fourth weighting weight.
在示例性实施例中,融合第一互相关插值及第二亮度对齐结果之前之前,还包括:确定第三加权权重以及确定第四加权权重的过程。包括但不限于如下两种确定方式:In an exemplary embodiment, before fusing the first cross-correlation interpolation and the second luminance alignment result, the method further includes: a process of determining a third weighting weight and determining a fourth weighting weight. Including but not limited to the following two determination methods:
确定方式一,基于W′ 1大于第一过曝阈值,确定β 21为第二值,β 22为第一值;或者,基于W′ 1小于等于第一过曝阈值,确定β 21为第一值,β 22为第二值。 Determining Mode 1: Based on W′ 1 being greater than the first overexposure threshold, determine β 21 as the second value and β 22 as the first value; or, based on W′ 1 being less than or equal to the first overexposure threshold, determine β 21 as the first value value, β 22 is the second value.
示例性地,第一值为1,第二值为0。如果第一互相关插值小于第一过暗阈值,说明第一互相关插值不过暗,将第一互相关插值对应的第三加权权重设为1,而将第二亮度对齐结果对应的加权权重设为0,则该位置的像素点的像素值以第一互相关插值为准。同理,如果第一互相关插值大于等于第一过暗阈值,说明第一互相关插值过暗,将第一互相关插值对应的加权权重设为0,而将第二亮度对齐结果对应的加权权重设为1,则该位置的像素点的像素值以第二亮度对齐结果为准。该种确定第一互相关插值对应的第三加权权重以及确定第二亮度对齐结果对应的第四加权权重的方式,使得融合第一互相关插值及第二亮度对齐结果之后的图像除过曝和过暗区域外,与线性曝光模式的清晰度一致。Illustratively, the first value is 1 and the second value is 0. If the first cross-correlation interpolation value is smaller than the first too dark threshold, it means that the first cross-correlation interpolation value is not too dark, and the third weighting weight corresponding to the first cross-correlation interpolation value is set to 1, and the weighting weight corresponding to the second luminance alignment result is set to If it is 0, the pixel value of the pixel at this position is subject to the first cross-correlation interpolation. Similarly, if the first cross-correlation interpolation is greater than or equal to the first overdark threshold, it means that the first cross-correlation interpolation is too dark, the weighting weight corresponding to the first cross-correlation interpolation is set to 0, and the weighting corresponding to the second luminance alignment result is set to 0. If the weight is set to 1, the pixel value of the pixel at this position is subject to the second luminance alignment result. The method of determining the third weighting weight corresponding to the first cross-correlation interpolation and determining the fourth weighting weight corresponding to the second luminance alignment result makes the image after fusing the first cross-correlation interpolation and the second luminance alignment result except for the overexposure and Consistent with the sharpness of the linear exposure mode, except in overly dark areas.
确定方式二,基于W′ 1小于第二过暗阈值,确定β 21为第一值,β 22为第二值,第一值大于第二值;或者,基于W′ 1大于第二过曝阈值,确定β 21第二值,β 22为第一值;或者,基于W′ 1介于第二过暗阈值与第二过曝阈值之间,确定β 21从第一值开始随W′ 1增大而减小,β 22从第二值开始随W′ 1增大而增大。 The second determination method is based on that W′ 1 is less than the second over-dark threshold, and β 21 is determined to be the first value, β 22 is the second value, and the first value is greater than the second value; or, based on W′ 1 greater than the second over-exposure threshold , determine the second value of β 21 and β 22 as the first value; or, based on the fact that W′ 1 is between the second over-dark threshold and the second over-exposure threshold, determine that β 21 increases with W′ 1 from the first value β 22 increases from the second value as W′ 1 increases.
示例性地,第一值为1,第二值为0。该确定方式二中,第一互相关插值对应的第三加权权重以及第二亮度对齐结果对应的第四加权权重的关系也可如图9所示。通过该确定方式二确定第三加权权重以及确定第四加权权重,使得融合第一互相关插值及第二亮度对齐结果之后的图像略低于线性曝光模式的清晰度,但是能够有效防止采用确定方式一由于图像传感器的线性度不佳导致的不平滑问题。Illustratively, the first value is 1 and the second value is 0. In the second determination method, the relationship between the third weighting weight corresponding to the first cross-correlation interpolation and the fourth weighting weight corresponding to the second luminance alignment result may also be as shown in FIG. 9 . The second determination method is used to determine the third weighted weight and the fourth weighted weight, so that the image after the fusion of the first cross-correlation interpolation and the second brightness alignment result is slightly lower than the sharpness of the linear exposure mode, but the determination method can be effectively prevented. A non-smoothing problem due to poor linearity of the image sensor.
基于该获取图像的方法,由于图像像素阵列中的同一种像素点分为至少两类,每一类采用不同的亮度控制参数拍摄,以实现在同一帧内、不同位置处的像素点采用不同的亮度控制参数拍摄,能够既保留高亮细节,又保留暗部细节,实现较高的动态范围。另外,虽然不同位置处的像素点采用不同的亮度控制参数拍摄,但均在同一帧内同时结束曝光,且融合的不同亮度控制参数对应的图像,也都是基于同一帧图像得到的,因而能够最大限度地减小运动拖尾。Based on the method for acquiring an image, since the same type of pixel in the image pixel array is divided into at least two types, each type is photographed with different brightness control parameters, so that pixels at different positions in the same frame use different Shooting with brightness control parameters can retain both highlight details and dark details to achieve a higher dynamic range. In addition, although the pixels at different positions are shot with different brightness control parameters, they all end the exposure at the same time in the same frame, and the images corresponding to the fused different brightness control parameters are also obtained based on the same frame of image, so it can be Minimize motion smearing.
本申请实施例提供了一种获取图像的装置,该装置用于通过图10所示的模块来执行图5和图6所示的获取图像的方法。参见图10,该装置包括:An embodiment of the present application provides an apparatus for acquiring an image, and the apparatus is configured to execute the method for acquiring an image shown in FIG. 5 and FIG. 6 through the modules shown in FIG. 10 . Referring to Figure 10, the device includes:
第一获取模块1001,用于获取图像像素阵列中的至少两类像素点的像素值,在图像中,不同类的像素点中的像素值是根据不同的亮度控制参数拍摄生成,至少两类像素点均为黑白像素点,或者,至少两类像素点均为彩色像素点;该第一获取模块1001所执行的功能可参考图5所示的501,此处不再赘述。The first acquisition module 1001 is used to acquire the pixel values of at least two types of pixel points in the image pixel array. In the image, the pixel values of different types of pixel points are generated by shooting according to different brightness control parameters, and at least two types of pixels are generated. The points are all black and white pixels, or at least two types of pixels are color pixels; the functions performed by the first acquisition module 1001 can refer to 501 shown in FIG. 5 , and details are not repeated here.
第二获取模块1002,用于根据至少两类像素点的像素值获取各个亮度控制参数对应的图像;该第二获取模块1002所执行的功能可参考图5所示的502,此处不再赘述。The second acquisition module 1002 is configured to acquire images corresponding to each brightness control parameter according to the pixel values of at least two types of pixel points; the functions performed by the second acquisition module 1002 can refer to 502 shown in FIG. 5 , which will not be repeated here. .
融合模块1003,用于融合各个亮度控制参数对应的图像。该融合模块1003所执行的功能可参考图5所示的503,此处不再赘述。The fusion module 1003 is used to fuse images corresponding to each brightness control parameter. For the functions performed by the fusion module 1003, reference may be made to 503 shown in FIG. 5, and details are not repeated here.
在示例性实施例中,至少两类像素点包括第一类像素点和第二类像素点,第一类像素点的像素值根据第一亮度控制参数拍摄生成,第二类像素点的像素值根据第二亮度控制参数拍摄生成;In an exemplary embodiment, at least two types of pixel points include a first type of pixel point and a second type of pixel point, the pixel value of the first type of pixel point is photographed and generated according to the first brightness control parameter, and the pixel value of the second type of pixel point is Shooting and generating according to the second brightness control parameter;
第二获取模块1002,用于根据第一类像素点的像素值获取第一亮度控制参数对应的第一图像,根据第二类像素点的像素值获取第二亮度控制参数对应的第二图像;例如,参考图6所示的602的相关描述,此处不再赘述。A second obtaining module 1002, configured to obtain a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel, and obtain a second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel; For example, refer to the related description of 602 shown in FIG. 6 , which will not be repeated here.
融合模块1003,用于融合第一图像和第二图像。例如,参考图6所示的603的相关描述,此处不再赘述。The fusion module 1003 is used to fuse the first image and the second image. For example, refer to the related description of 603 shown in FIG. 6 , which will not be repeated here.
在示例性实施例中,第二获取模块1002,用于根据第一目标像素点的像素值确定第二类像素点在第一亮度控制参数下的第一互相关插值,根据第一类像素点的像素值和第一互相关插值获取第一图像,第一目标像素点包括与第二类像素点相邻的第一类像素点;In an exemplary embodiment, the second obtaining module 1002 is configured to determine, according to the pixel value of the first target pixel, a first cross-correlation interpolation value of the second type of pixel under the first brightness control parameter, and according to the first type of pixel The pixel value and the first cross-correlation interpolation obtain the first image, and the first target pixel point includes the first type pixel point adjacent to the second type pixel point;
在示例性实施例中,第二获取模块1002,根据第二目标像素点的像素值确定第一类像素点在第二亮度控制参数下的第二互相关插值,根据第二类像素点的像素值和第二互相关插值获取第二图像,第二目标像素点包括与第一类像素点相邻的第二类像素点。In an exemplary embodiment, the second obtaining module 1002 determines, according to the pixel value of the second target pixel point, a second cross-correlation interpolation value of the first type of pixel point under the second brightness control parameter, according to the pixel value of the second type of pixel point The second image is obtained by interpolating the value and the second cross-correlation, and the second target pixel point includes a second type of pixel point adjacent to the first type of pixel point.
在示例性实施例中,第二获取模块1002,用于根据第二类像素点的像素值确定第一目标像素点的加权权重,第一目标像素点的加权权重与第二类像素点及第一目标像素点的差异大小正相关;根据第一目标像素点的像素值以及加权权重确定第二类像素点在第一亮度控制参数下的第一互相关插值;In an exemplary embodiment, the second obtaining module 1002 is configured to determine the weighted weight of the first target pixel point according to the pixel value of the second type of pixel point, and the weighted weight of the first target pixel point is related to the second type of pixel point and the first target pixel point. The difference size of a target pixel is positively correlated; the first cross-correlation interpolation of the second type of pixel under the first brightness control parameter is determined according to the pixel value of the first target pixel and the weighted weight;
第二获取模块1002,用于根据第一类像素点的像素值确定第二目标像素点的加权权重,第二目标像素点的加权权重与第一类像素点及第二目标像素点的差异大小正相关;根据第二目标像素点的像素值以及加权权重确定第一类像素点在第二亮度控制参数下的第二互相关插值。The second acquisition module 1002 is configured to determine the weighted weight of the second target pixel point according to the pixel value of the first type of pixel point, and the difference between the weighted weight of the second target pixel point and the first type of pixel point and the second target pixel point Positive correlation; according to the pixel value of the second target pixel point and the weighted weight, determine the second cross-correlation interpolation value of the first type of pixel point under the second brightness control parameter.
在示例性实施例中,第二获取模块1002,用于对于任一第一目标像素点,将任一第一目标像素点的像素值以及加权权重相乘,得到任一第一目标像素点对应的乘积结果;将各个第一目标像素点对应的乘积结果进行累加,得到第一累加和;将各个第一目标像素点的加权权重进行累加,得到第二累加和;将第一累加和与第二累加和的商作为第二类像素点在第一亮度控制参数下的第一互相关插值;In an exemplary embodiment, the second obtaining module 1002 is configured to, for any first target pixel, multiply the pixel value of any first target pixel and the weighted weight to obtain the corresponding value of any first target pixel. Accumulate the product results corresponding to each first target pixel to obtain the first cumulative sum; accumulate the weighted weights of each first target pixel to obtain the second cumulative sum; combine the first cumulative sum with the first cumulative sum The quotient of the two accumulated sums is used as the first cross-correlation interpolation of the second type of pixels under the first brightness control parameter;
第二获取模块1002,用于对于任一第二目标像素点,将任一第二目标像素点的像素值以及加权权重相乘,得到任一第二目标像素点对应的乘积结果;将各个第二目标像素点对应的乘积结果进行累加,得到第三累加和;将各个第二目标像素点的加权权重进行累加,得到第四累加和;将第三累加和与第四累加和的商作为第一类像素点在第二亮度控制参数下的第二互相关插值。The second obtaining module 1002 is configured to multiply the pixel value and the weighted weight of any second target pixel for any second target pixel to obtain a product result corresponding to any second target pixel; The product results corresponding to the two target pixels are accumulated to obtain the third accumulated sum; the weighted weights of each second target pixel are accumulated to obtain the fourth accumulated sum; the quotient of the third accumulated sum and the fourth accumulated sum is taken as the third accumulated sum. The second cross-correlation interpolation of a class of pixels under the second luminance control parameter.
在示例性实施例中,亮度控制参数小于第一亮度控制参数,融合模块1003,用于将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,融合第一类像素点的像素值及第一亮度对齐结果;将第二类像素点的像素值和第一 互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果;融合第一互相关插值及第二亮度对齐结果。In an exemplary embodiment, the brightness control parameter is smaller than the first brightness control parameter, and the fusion module 1003 is configured to perform brightness alignment between the pixel value of the first type of pixel point and the second cross-correlation interpolation according to the first brightness control parameter to obtain the first brightness control parameter. A brightness alignment result, which fuses the pixel values of the first type of pixel points and the first brightness alignment result; performs brightness alignment on the pixel values of the second type of pixel points and the first cross-correlation interpolation according to the first brightness control parameter to obtain the second brightness Alignment results; fuse the first cross-correlation interpolation and the second luminance alignment results.
在示例性实施例中,融合模块1003,用于根据第一亮度控制参数与第二亮度控制参数之间的差异倍数,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,差异倍数基于第一亮度控制参数与第二亮度控制参数之间的综合差异得到;In an exemplary embodiment, the fusion module 1003 is configured to interpolate the pixel value of the first type of pixel point and the second cross-correlation value according to the first brightness control parameter according to the difference multiple between the first brightness control parameter and the second brightness control parameter. Perform brightness alignment on the control parameters to obtain a first brightness alignment result, and the difference multiple is obtained based on the comprehensive difference between the first brightness control parameter and the second brightness control parameter;
融合模块1003,用于根据第一亮度控制参数与第二亮度控制参数之间的差异倍数,将第二类像素点的像素值和第一互相关插值按照第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果。The fusion module 1003 is configured to perform brightness alignment on the pixel value of the second type of pixel point and the first cross-correlation interpolation according to the first brightness control parameter according to the difference multiple between the first brightness control parameter and the second brightness control parameter, to obtain The second luminance alignment result.
在示例性实施例中,融合模块1003,用于将第一类像素点的像素值及对应的加权权重相乘,得到第一乘积结果,将第一亮度对齐结果及对应的加权权重相乘,得到第二乘积结果;将第一乘积结果与第二乘积结果求和,得到第一和值;将第一类像素点对应的加权权重与第一亮度对齐结果对应的加权权重求和,得到第二和值;将第一和值与第二和值的商作为第一类像素点的像素值及第一亮度对齐结果的融合结果;In an exemplary embodiment, the fusion module 1003 is configured to multiply the pixel values of the first type of pixel points and the corresponding weighted weights to obtain a first product result, and multiply the first brightness alignment result and the corresponding weighted weights, Obtain the second product result; sum the first product result and the second product result to obtain the first sum value; sum the weighted weight corresponding to the first type of pixel point and the weighted weight corresponding to the first brightness alignment result to obtain the first Two-sum value; take the quotient of the first sum value and the second sum value as the fusion result of the pixel value of the first type of pixel point and the first brightness alignment result;
融合模块1003,用于将第一互相关插值及对应的加权权重相乘,得到第三乘积结果,将第二亮度对齐结果及对应的加权权重相乘,得到第四乘积结果;将第三乘积结果与第四乘积结果求和,得到第三和值;将第二类像素点对应的加权权重与第二亮度对齐结果对应的加权权重求和,得到第四和值;将第三和值与第四和值的商作为第一互相关插值及第二亮度对齐结果的融合结果。The fusion module 1003 is used to multiply the first cross-correlation interpolation and the corresponding weighted weight to obtain the third product result, multiply the second brightness alignment result and the corresponding weighted weight to obtain the fourth product result; The result and the fourth product result are summed to obtain the third sum value; the weighted weight corresponding to the second type of pixel point and the weighted weight corresponding to the second brightness alignment result are summed to obtain the fourth sum value; the third sum value is combined with The quotient of the fourth sum is used as the fusion result of the first cross-correlation interpolation and the second luminance alignment result.
在示例性实施例中,融合模块1003,还用于基于W 1小于第一过暗阈值,确定β 11为第一值,β 12为第二值,第一值大于第二值;或者,基于W 1大于等于第一过暗阈值,确定β 11为第二值,β 12为第一值; In an exemplary embodiment, the fusion module 1003 is further configured to determine that β 11 is a first value, β 12 is a second value, and the first value is greater than the second value based on the fact that W 1 is less than the first over-dark threshold; or, based on W 1 is greater than or equal to the first over-dark threshold, determine that β 11 is the second value, and β 12 is the first value;
融合模块1003,还用于基于W′ 1大于第一过曝阈值,确定β 21为第二值,β 22为第一值;或者,基于W′ 1小于等于第一过曝阈值,确定β 21为第一值,β 22为第二值。 The fusion module 1003 is further configured to determine β 21 as the second value and β 22 as the first value based on W′ 1 being greater than the first overexposure threshold; or, based on W′ 1 being less than or equal to the first overexposure threshold, determine β 21 is the first value, and β 22 is the second value.
在示例性实施例中,融合模块1003,还用于基于W 1小于第二过暗阈值,确定β 11为第一值,β 12为第二值,第一值大于第二值;或者,基于W 1大于第二过曝阈值,确定β 11为第二值,β 12为第一值;或者,基于W 1介于第二过暗阈值与第二过曝阈值之间,确定β 11从第一值开始随W 1增大而减小,β 12从第二值开始随W 1增大而增大; In an exemplary embodiment, the fusion module 1003 is further configured to determine that β 11 is the first value, β 12 is the second value, and the first value is greater than the second value based on the fact that W 1 is less than the second over-dark threshold; or, based on If W 1 is greater than the second overexposure threshold, it is determined that β 11 is the second value and β 12 is the first value; or, based on the fact that W 1 is between the second over-dark threshold and the second over-exposure threshold, it is determined that β 11 is from the first The first value begins to decrease with the increase of W 1 , and β 12 starts to increase with the increase of W 1 from the second value;
融合模块1003,还用于基于W′ 1小于第二过暗阈值,确定β 21为第一值,β 22为第二值,第一值大于第二值;或者,基于W′ 1大于第二过曝阈值,确定β 21第二值,β 22为第一值;或者,基于W′ 1介于第二过暗阈值与第二过曝阈值之间,确定β 21从第一值开始随W′ 1增大而减小,β 22从第二值开始随W′ 1增大而增大。 The fusion module 1003 is further configured to determine that β 21 is the first value, β 22 is the second value, and the first value is greater than the second value based on W′ 1 being less than the second dark threshold; or, based on W′ 1 being greater than the second value Overexposure threshold, determine the second value of β 21 , and β 22 as the first value; or, based on W′ 1 being between the second over-dark threshold and the second over-exposure threshold, determine that β 21 starts from the first value and increases with W ' 1 increases and decreases, and β 22 increases from the second value as W' 1 increases.
应理解的是,上述图10提供的装置在实现其功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be understood that, when the device provided in FIG. 10 realizes its functions, it is only illustrated by the division of the above-mentioned functional modules. The internal structure is divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
本申请实施例还提供了一种电子设备,该电子设备包括处理器、图像传感器及至少两个控制电路,至少两个控制电路用于控制图像传感器按照不同的亮度控制参数拍摄生成不同类的像素点中的像素值;An embodiment of the present application also provides an electronic device, the electronic device includes a processor, an image sensor, and at least two control circuits, where the at least two control circuits are used to control the image sensor to shoot and generate different types of pixels according to different brightness control parameters pixel value in point;
处理器用于执行图5或图6中任一的获取图像的方法。The processor is configured to perform the method of acquiring an image in any one of FIG. 5 or FIG. 6 .
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质包括至少一条指令,指令由处理器执行以实现图5或图6任一的获取图像的方法。An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium includes at least one instruction, and the instruction is executed by a processor to implement any one of the methods for acquiring an image in FIG. 5 or FIG. 6 .
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer program instructions, when loaded and executed on a computer, result in whole or in part of the processes or functions described herein. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk), and the like.
本申请中术语“第一”“第二”等字样用于对作用和功能基本相同的相同项或相似项进行区分,应理解,“第一”、“第二”、“第n”之间不具有逻辑或时序上的依赖关系,也不对数量和执行顺序进行限定。还应理解,尽管以下描述使用术语第一、第二等来描述各种元素,但这些元素不应受术语的限制。这些术语只是用于将一元素与另一元素区别分开。例如,在不脱离各种所述示例的范围的情况下,第一图像可以被称为第二图像,并且类似地,第二图像可以被称为第一图像。第一图像和第二图像都可以是图像,并且在某些情况下,可以是单独且不同的图像。In this application, the terms "first", "second" and other words are used to distinguish the same or similar items with basically the same function and function, and it should be understood that between "first", "second" and "nth" There are no logical or timing dependencies, and no restrictions on the number and execution order. It will also be understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, a first image may be referred to as a second image, and, similarly, a second image may be referred to as a first image, without departing from the scope of various described examples. Both the first image and the second image may be images, and in some cases, may be separate and distinct images.
还应理解,在本申请的各个实施例中,各个过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should also be understood that, in each embodiment of the present application, the size of the sequence number of each process does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not be used in the embodiment of the present application. Implementation constitutes any limitation.
本申请中术语“至少一个”的含义是指一个或多个,本申请中术语“多个”的含义是指两个或两个以上,例如,多个第二报文是指两个或两个以上的第二报文。本文中术语“系统”和“网络”经常可互换使用。In this application, the meaning of the term "at least one" refers to one or more, and the meaning of the term "plurality" in this application refers to two or more. For example, a plurality of second messages refers to two or more more than one second message. The terms "system" and "network" are often used interchangeably herein.
应理解,在本文中对各种所述示例的描述中所使用的术语只是为了描述特定示例,而并非旨在进行限制。如在对各种所述示例的描述和所附权利要求书中所使用的那样,单数形式“一个(“a”,“an”)”和“该”旨在也包括复数形式,除非上下文另外明确地指示。It is to be understood that the terminology used in describing the various described examples herein is for the purpose of describing particular examples and is not intended to be limiting. As used in the description of the various described examples and the appended claims, the singular forms "a", "an")" and "the" are intended to include the plural forms as well, unless the context dictates otherwise. clearly instructed.
还应理解,本文中所使用的术语“和/或”是指并且涵盖相关联的所列出的项目中的一个或多个项目的任何和全部可能的组合。术语“和/或”,是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请中的字符“/”,一般表示前后关联对象是一种“或”的关系。It will also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and/or" is an association relationship that describes an associated object, indicating that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist simultaneously, and B exists alone. a situation. In addition, the character "/" in this application generally indicates that the related objects are an "or" relationship.
还应理解,术语“包括”(也称“includes”、“including”、“comprises”和/或“comprising”)当在本说明书中使用时指定存在所陈述的特征、整数、步骤、操作、元素、和/或部件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元素、部件、和/或其分组。It will also be understood that the term "includes" (also referred to as "includes", "including", "comprises" and/or "comprising") when used in this specification designates the presence of stated features, integers, steps, operations, elements , and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groupings thereof.
还应理解,术语“若”和“如果”可被解释为意指“当...时”(“when”或“upon”)或“响应于确定”或“响应于检测到”。类似地,根据上下文,短语“若确定...”或“若检测到 [所陈述的条件或事件]”可被解释为意指“在确定...时”或“响应于确定...”或“在检测到[所陈述的条件或事件]时”或“响应于检测到[所陈述的条件或事件]”。It should also be understood that the terms "if" and "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, depending on the context, the phrases "if it is determined..." or "if the [stated condition or event] is detected" can be interpreted to mean "when determining..." or "in response to determining... ” or “on detection of [recited condition or event]” or “in response to detection of [recited condition or event]”.
应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。It should be understood that determining B according to A does not mean that B is only determined according to A, and B may also be determined according to A and/or other information.
还应理解,说明书通篇中提到的“一个实施例”、“一实施例”、“一种可能的实现方式”意味着与实施例或实现方式有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”、“一种可能的实现方式”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。It should also be understood that references throughout the specification to "one embodiment," "an embodiment," and "one possible implementation" mean that a particular feature, structure, or characteristic associated with the embodiment or implementation is included herein. in at least one embodiment of the application. Thus, appearances of "in one embodiment" or "in an embodiment" or "one possible implementation" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.
以上所述仅为本申请的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only examples of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. Inside.

Claims (23)

  1. 一种获取图像的方法,其特征在于,所述方法包括:A method for acquiring an image, characterized in that the method comprises:
    获取图像像素阵列中的至少两类像素点的像素值,在所述图像中,不同类的所述像素点中的像素值是根据不同的亮度控制参数拍摄生成,所述至少两类像素点均为黑白像素点,或者,所述至少两类像素点均为彩色像素点;Obtain the pixel values of at least two types of pixel points in the image pixel array, in the image, the pixel values of different types of the pixel points are generated according to different brightness control parameters, and the at least two types of pixel points are are black and white pixels, or, the at least two types of pixels are color pixels;
    根据所述至少两类像素点的像素值获取各个亮度控制参数对应的图像;Acquiring images corresponding to each brightness control parameter according to the pixel values of the at least two types of pixel points;
    融合所述各个亮度控制参数对应的图像。The images corresponding to the respective brightness control parameters are fused.
  2. 根据权利要求1所述的方法,其特征在于,所述至少两类像素点包括第一类像素点和第二类像素点,所述第一类像素点的像素值根据第一亮度控制参数拍摄生成,所述第二类像素点的像素值根据第二亮度控制参数拍摄生成;The method according to claim 1, wherein the at least two types of pixel points include a first type of pixel point and a second type of pixel point, and the pixel value of the first type of pixel point is captured according to a first brightness control parameter generating, and the pixel values of the second type of pixel points are photographed and generated according to the second brightness control parameter;
    所述根据所述至少两类像素点的像素值获取各个亮度控制参数对应的图像,包括:The obtaining the image corresponding to each brightness control parameter according to the pixel values of the at least two types of pixel points includes:
    根据所述第一类像素点的像素值获取第一亮度控制参数对应的第一图像,根据所述第二类像素点的像素值获取第二亮度控制参数对应的第二图像;Obtain a first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel point, and obtain a second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel point;
    所述融合所述各个亮度控制参数对应的图像,包括:The image fusion corresponding to each brightness control parameter includes:
    融合所述第一图像和所述第二图像。The first image and the second image are fused.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述第一类像素点的像素值获取第一亮度控制参数对应的第一图像,包括:The method according to claim 2, wherein the obtaining the first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel point comprises:
    根据第一目标像素点的像素值确定所述第二类像素点在所述第一亮度控制参数下的第一互相关插值,根据所述第一类像素点的像素值和所述第一互相关插值获取第一图像,所述第一目标像素点包括与所述第二类像素点相邻的第一类像素点;Determine the first cross-correlation interpolation value of the second type of pixel under the first brightness control parameter according to the pixel value of the first target pixel, and according to the pixel value of the first type of pixel and the first cross-correlation interpolation Obtaining a first image by correlation interpolation, and the first target pixel point includes a first type pixel point adjacent to the second type pixel point;
    所述根据所述第二类像素点的像素值获取第二亮度控制参数对应的第二图像,包括:The obtaining of the second image corresponding to the second brightness control parameter according to the pixel value of the second type of pixel includes:
    根据第二目标像素点的像素值确定所述第一类像素点在所述第二亮度控制参数下的第二互相关插值,根据所述第二类像素点的像素值和所述第二互相关插值获取第二图像,所述第二目标像素点包括与所述第一类像素点相邻的第二类像素点。The second cross-correlation interpolation of the first type of pixels under the second brightness control parameter is determined according to the pixel value of the second target pixel, and according to the pixel value of the second type of pixel and the second cross-correlation interpolation A second image is obtained by correlation interpolation, and the second target pixel point includes a second type of pixel point adjacent to the first type of pixel point.
  4. 根据权利要求3所述的方法,其特征在于,所述根据第一目标像素点的像素值确定所述第二类像素点在所述第一亮度控制参数下的第一互相关插值,包括:根据所述第二类像素点的像素值确定所述第一目标像素点的加权权重,所述第一目标像素点的加权权重与所述第二类像素点及所述第一目标像素点的差异大小正相关;根据所述第一目标像素点的像素值以及加权权重确定所述第二类像素点在所述第一亮度控制参数下的第一互相关插值;The method according to claim 3, wherein the determining, according to the pixel value of the first target pixel, the first cross-correlation interpolation of the second type of pixel under the first brightness control parameter, comprising: The weighted weight of the first target pixel is determined according to the pixel value of the second type of pixel, and the weighted weight of the first target pixel is the same as the weight of the second type of pixel and the first target pixel. The difference is positively correlated; according to the pixel value of the first target pixel point and the weighted weight, determine the first cross-correlation interpolation value of the second type of pixel point under the first brightness control parameter;
    所述根据第二目标像素点的像素值确定所述第一类像素点在所述第二亮度控制参数下的第二互相关插值,包括:根据所述第一类像素点的像素值确定所述第二目标像素点的加权权重,所述第二目标像素点的加权权重与所述第一类像素点及所述第二目标像素点的差异大小正相关;根据所述第二目标像素点的像素值以及加权权重确定所述第一类像素点在所述第二亮度控制参数下的第二互相关插值。The determining, according to the pixel value of the second target pixel, the second cross-correlation interpolation of the first type of pixel under the second brightness control parameter includes: determining the first type of pixel according to the pixel value of the first type of pixel. The weighted weight of the second target pixel point, the weighted weight of the second target pixel point is positively correlated with the difference between the first type of pixel point and the second target pixel point; according to the second target pixel point The pixel value of and the weighting weight determine the second cross-correlation interpolation of the first type of pixel point under the second brightness control parameter.
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述第一目标像素点的像素值以及加权权重确定所述第二类像素点在所述第一亮度控制参数下的第一互相关插值,包括:The method according to claim 4, wherein the first mutual relationship between the second type of pixels under the first brightness control parameter is determined according to the pixel value of the first target pixel and the weighted weight. Relevant interpolation, including:
    对于任一第一目标像素点,将所述任一第一目标像素点的像素值以及加权权重相乘,得到所述任一第一目标像素点对应的乘积结果;将各个第一目标像素点对应的乘积结果进行累加,得到第一累加和;将各个第一目标像素点的加权权重进行累加,得到第二累加和;将第一累加和与第二累加和的商作为所述第二类像素点在所述第一亮度控制参数下的第一互相关插值;For any first target pixel, multiply the pixel value and the weighted weight of the any first target pixel to obtain a product result corresponding to the any first target pixel; The corresponding product results are accumulated to obtain the first accumulated sum; the weighted weights of each first target pixel point are accumulated to obtain the second accumulated sum; the quotient of the first accumulated sum and the second accumulated sum is used as the second type. the first cross-correlation interpolation of the pixel point under the first brightness control parameter;
    所述根据第二目标像素点的像素值以及加权权重确定第一类像素点在第二亮度控制参数下的第二互相关插值,包括:The determining of the second cross-correlation interpolation of the first type of pixels under the second brightness control parameter according to the pixel value of the second target pixel and the weighted weight includes:
    对于任一第二目标像素点,将所述任一第二目标像素点的像素值以及加权权重相乘,得到所述任一第二目标像素点对应的乘积结果;将各个第二目标像素点对应的乘积结果进行累加,得到第三累加和;将各个第二目标像素点的加权权重进行累加,得到第四累加和;将第三累加和与第四累加和的商作为所述第一类像素点在第二亮度控制参数下的第二互相关插值。For any second target pixel point, multiply the pixel value and weighted weight of the any second target pixel point to obtain the product result corresponding to the any second target pixel point; The corresponding product results are accumulated to obtain the third accumulated sum; the weighted weights of each second target pixel are accumulated to obtain the fourth accumulated sum; the quotient of the third accumulated sum and the fourth accumulated sum is taken as the first type The second cross-correlation interpolation of the pixel point under the second luminance control parameter.
  6. 根据权利要求3-5任一所述的方法,其特征在于,所述第二亮度控制参数小于所述第一亮度控制参数,所述融合所述第一图像和所述第二图像,包括:The method according to any one of claims 3-5, wherein the second brightness control parameter is smaller than the first brightness control parameter, and the fusion of the first image and the second image comprises:
    将所述第一类像素点的像素值和所述第二互相关插值按照所述第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,融合所述第一类像素点的像素值及所述第一亮度对齐结果;Perform brightness alignment on the pixel value of the first type of pixel point and the second cross-correlation interpolation according to the first brightness control parameter to obtain a first brightness alignment result, and fuse the pixel value of the first type of pixel point and the first luminance alignment result;
    将所述第二类像素点的像素值和所述第一互相关插值按照所述第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果;融合所述第一互相关插值及所述第二亮度对齐结果。Perform luminance alignment on the pixel values of the second type of pixel points and the first cross-correlation interpolation according to the first luminance control parameter to obtain a second luminance alignment result; fuse the first cross-correlation interpolation and the first cross-correlation interpolation. Two luminance alignment results.
  7. 根据权利要求6所述的方法,其特征在于,所述将所述第一类像素点的像素值和所述第二互相关插值按照所述第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,包括:The method according to claim 6, wherein the pixel value of the first type of pixel point and the second cross-correlation interpolation are luminance aligned according to the first luminance control parameter to obtain the first luminance Align results, including:
    根据所述第一亮度控制参数与所述第二亮度控制参数之间的差异倍数,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,所述差异倍数基于所述第一亮度控制参数与所述第二亮度控制参数之间的综合差异得到;According to the difference multiple between the first brightness control parameter and the second brightness control parameter, the pixel value of the first type of pixel point and the second cross-correlation interpolation are brightness aligned according to the first brightness control parameter to obtain the first brightness control parameter. Brightness alignment result, the difference multiple is obtained based on the comprehensive difference between the first brightness control parameter and the second brightness control parameter;
    所述将所述第二类像素点的像素值和所述第一互相关插值按照所述第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果,包括:The performing luminance alignment on the pixel value of the second type of pixel point and the first cross-correlation interpolation value according to the first luminance control parameter to obtain a second luminance alignment result, including:
    根据所述第一亮度控制参数与所述第二亮度控制参数之间的差异倍数,将所述第二类像素点的像素值和所述第一互相关插值按照所述第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果。According to the difference multiple between the first brightness control parameter and the second brightness control parameter, perform the pixel value of the second type of pixel point and the first cross-correlation interpolation according to the first brightness control parameter Align the luminance to obtain the second luminance alignment result.
  8. 根据权利要求6或7所述的方法,其特征在于,所述融合所述第一类像素点的像素值及所述第一亮度对齐结果,包括:The method according to claim 6 or 7, wherein the fusing the pixel values of the first type of pixel points and the first brightness alignment result comprises:
    将所述第一类像素点的像素值及对应的加权权重相乘,得到第一乘积结果,将所述第一亮度对齐结果及对应的加权权重相乘,得到第二乘积结果;将所述第一乘积结果与所述第二乘积结果求和,得到第一和值;将所述第一类像素点对应的加权权重与所述第一亮度对齐结果对应的加权权重求和,得到第二和值;将所述第一和值与所述第二和值的商作为所述第一 类像素点的像素值及所述第一亮度对齐结果的融合结果;Multiply the pixel value of the first type of pixel point and the corresponding weighted weight to obtain a first product result, and multiply the first brightness alignment result and the corresponding weighted weight to obtain a second product result; The first product result and the second product result are summed to obtain a first sum value; the weighted weight corresponding to the first type of pixel point and the weighted weight corresponding to the first brightness alignment result are summed to obtain the second Sum value; take the quotient of the first sum value and the second sum value as the fusion result of the pixel value of the first type of pixel point and the first brightness alignment result;
    所述融合所述第一互相关插值及所述第二亮度对齐结果,包括:The fusion of the first cross-correlation interpolation and the second luminance alignment result includes:
    将所述第一互相关插值及对应的加权权重相乘,得到第三乘积结果,将所述第二亮度对齐结果及对应的加权权重相乘,得到第四乘积结果;将所述第三乘积结果与所述第四乘积结果求和,得到第三和值;将所述第二类像素点对应的加权权重与所述第二亮度对齐结果对应的加权权重求和,得到第四和值;将所述第三和值与所述第四和值的商作为所述第一互相关插值及所述第二亮度对齐结果的融合结果。Multiply the first cross-correlation interpolation value and the corresponding weighted weight to obtain a third product result, multiply the second luminance alignment result and the corresponding weighted weight to obtain a fourth product result; multiply the third product The result is summed with the result of the fourth product to obtain a third sum value; the weighted weight corresponding to the second type of pixel point and the weighted weight corresponding to the second brightness alignment result are summed to obtain a fourth sum value; The quotient of the third sum value and the fourth sum value is used as a fusion result of the first cross-correlation interpolation and the second luminance alignment result.
  9. 根据权利要求8所述的方法,其特征在于,所述融合所述第一类像素点的像素值及所述第一亮度对齐结果之前,还包括:The method according to claim 8, wherein before the fusion of the pixel values of the first type of pixel points and the first luminance alignment result, the method further comprises:
    基于所述W 1小于第一过暗阈值,确定所述β 11为第一值,所述β 12为第二值,所述第一值大于第二值;或者,基于所述W 1大于等于所述第一过暗阈值,确定所述β 11为第二值,所述β 12为第一值; Based on the fact that the W 1 is smaller than the first over-dark threshold, it is determined that the β 11 is a first value, the β 12 is a second value, and the first value is greater than the second value; or, based on the W 1 being greater than or equal to For the first over-dark threshold, determine that β 11 is the second value and β 12 is the first value;
    所述融合所述第一互相关插值及所述第二亮度对齐结果之前,还包括:Before the fusion of the first cross-correlation interpolation and the second luminance alignment result, the method further includes:
    基于所述W 1′大于第一过曝阈值,确定所述β 21为第二值,所述β 22为第一值;或者,基于所述W 1′小于等于所述第一过曝阈值,确定所述β 21为第一值,所述β 22为第二值。 Based on the fact that the W 1 ′ is greater than the first overexposure threshold, it is determined that the β 21 is the second value and the β 22 is the first value; or, based on the W 1 ′ being less than or equal to the first overexposure threshold, The β 21 is determined to be the first value, and the β 22 is determined to be the second value.
  10. 根据权利要求8所述的方法,其特征在于,所述融合所述第一类像素点的像素值及所述第一亮度对齐结果之前,还包括:The method according to claim 8, wherein before the fusion of the pixel values of the first type of pixel points and the first luminance alignment result, the method further comprises:
    基于所述W 1小于第二过暗阈值,确定所述β 11为第一值,所述β 12为第二值,所述第一值大于第二值;或者,基于所述W 1大于第二过曝阈值,确定所述β 11为第二值,所述β 12为第一值;或者,基于所述W 1介于所述第二过暗阈值与所述第二过曝阈值之间,确定所述β 11从所述第一值开始随所述W 1增大而减小,所述β 12从所述第二值开始随所述W 1增大而增大; Based on the fact that the W 1 is smaller than the second over-dark threshold, it is determined that the β 11 is a first value, the β 12 is a second value, and the first value is greater than the second value; or, based on the W 1 greater than the first value Two overexposure thresholds, determine that the β 11 is the second value and the β 12 is the first value; or, based on the W 1 , is between the second overexposure threshold and the second overexposure threshold , it is determined that the β 11 decreases with the increase of the W 1 from the first value, and the β 12 increases with the increase of the W 1 from the second value;
    所述融合所述第一互相关插值及所述第二亮度对齐结果之前,还包括:Before the fusion of the first cross-correlation interpolation and the second luminance alignment result, the method further includes:
    基于所述W 1′小于第二过暗阈值,确定所述β 21为第一值,所述β 22为第二值,所述第一值大于第二值;或者,基于所述W 1′大于第二过曝阈值,确定所述β 21第二值,所述β 22为第一值;或者,基于所述W 1′介于所述第二过暗阈值与所述第二过曝阈值之间,确定所述β 21从所述第一值开始随所述W 1′增大而减小,所述β 22从所述第二值开始随所述W 1′增大而增大。 Based on the W 1 ′ being less than the second over-dark threshold, it is determined that the β 21 is a first value, the β 22 is a second value, and the first value is greater than the second value; or, based on the W 1 ′ greater than the second overexposure threshold, determine the second value of β 21 , and the β 22 is the first value; or, based on the W 1 ′ between the second over-dark threshold and the second over-exposure threshold In between, it is determined that the β 21 decreases from the first value as the W 1 ′ increases, and the β 22 increases from the second value as the W 1 ′ increases.
  11. 根据权利要求1-10任一所述的方法,其特征在于,所述方法应用于电子设备的处理器中,所述电子设备还包括图像传感器及控制电路:The method according to any one of claims 1-10, wherein the method is applied to a processor of an electronic device, and the electronic device further comprises an image sensor and a control circuit:
    所述控制电路,用于接受所述处理器的反馈,使用至少两个亮度控制参数对所述图像传感器进行控制;the control circuit, configured to accept the feedback from the processor and use at least two brightness control parameters to control the image sensor;
    所述图像传感器,用于按照所述控制电路的控制进行光电转换,生成所述图像阵列,其中,所述控制电路的每个控制参数对应一类像素点。The image sensor is configured to perform photoelectric conversion according to the control of the control circuit to generate the image array, wherein each control parameter of the control circuit corresponds to a type of pixel point.
  12. 一种获取图像的装置,其特征在于,所述装置包括:A device for acquiring images, characterized in that the device comprises:
    第一获取模块,用于获取图像像素阵列中的至少两类像素点的像素值,在所述图像中,不同类的所述像素点中的像素值是根据不同的亮度控制参数拍摄生成,所述至少两类像素点 均为黑白像素点,或者,所述至少两类像素点均为彩色像素点;The first acquisition module is used to acquire the pixel values of at least two types of pixel points in the image pixel array. In the image, the pixel values of different types of the pixel points are generated according to different brightness control parameters. The at least two types of pixels are both black and white pixels, or the at least two types of pixels are color pixels;
    第二获取模块,用于根据所述至少两类像素点的像素值获取各个亮度控制参数对应的图像;a second acquisition module, configured to acquire images corresponding to respective brightness control parameters according to the pixel values of the at least two types of pixel points;
    融合模块,用于融合所述各个亮度控制参数对应的图像。The fusion module is used to fuse the images corresponding to the respective brightness control parameters.
  13. 根据权利要求12所述的装置,其特征在于,所述至少两类像素点包括第一类像素点和第二类像素点,所述第一类像素点的像素值根据第一亮度控制参数拍摄生成,所述第二类像素点的像素值根据第二亮度控制参数拍摄生成;The device according to claim 12, wherein the at least two types of pixel points include a first type of pixel point and a second type of pixel point, and the pixel value of the first type of pixel point is captured according to a first brightness control parameter generating, and the pixel values of the second type of pixel points are photographed and generated according to the second brightness control parameter;
    所述第二获取模块,用于根据所述第一类像素点的像素值获取第一亮度控制参数对应的第一图像,根据所述第二类像素点的像素值获取第二亮度控制参数对应的第二图像;The second obtaining module is configured to obtain the first image corresponding to the first brightness control parameter according to the pixel value of the first type of pixel, and obtain the corresponding second brightness control parameter according to the pixel value of the second type of pixel. the second image;
    所述融合模块,用于融合所述第一图像和所述第二图像。The fusion module is used to fuse the first image and the second image.
  14. 根据权利要求13所述的装置,其特征在于,所述第二获取模块,用于根据第一目标像素点的像素值确定所述第二类像素点在所述第一亮度控制参数下的第一互相关插值,根据所述第一类像素点的像素值和所述第一互相关插值获取第一图像,所述第一目标像素点包括与所述第二类像素点相邻的第一类像素点;The device according to claim 13, wherein the second obtaining module is configured to determine the first pixel value of the second type of pixel under the first brightness control parameter according to the pixel value of the first target pixel. a cross-correlation interpolation, obtaining a first image according to the pixel values of the first-type pixel points and the first cross-correlation interpolation, and the first target pixel point includes a first target pixel point adjacent to the second-type pixel point class pixel;
    所述第二获取模块,用于根据第二目标像素点的像素值确定所述第一类像素点在所述第二亮度控制参数下的第二互相关插值,根据所述第二类像素点的像素值和所述第二互相关插值获取第二图像,所述第二目标像素点包括与所述第一类像素点相邻的第二类像素点。The second acquisition module is configured to determine the second cross-correlation interpolation value of the first type of pixel point under the second brightness control parameter according to the pixel value of the second target pixel point, and according to the second type of pixel point A second image is obtained by interpolating the pixel value of , and the second cross-correlation, and the second target pixel includes a second type of pixel adjacent to the first type of pixel.
  15. 根据权利要求14所述的装置,其特征在于,所述第二获取模块,用于根据所述第二类像素点的像素值确定所述第一目标像素点的加权权重,所述第一目标像素点的加权权重与所述第二类像素点及所述第一目标像素点的差异大小正相关;根据所述第一目标像素点的像素值以及加权权重确定所述第二类像素点在所述第一亮度控制参数下的第一互相关插值;The device according to claim 14, wherein the second obtaining module is configured to determine the weighting weight of the first target pixel point according to the pixel value of the second type of pixel point, the first target pixel point The weighted weight of the pixel point is positively related to the difference between the second type of pixel point and the first target pixel point; according to the pixel value of the first target pixel point and the weighted weight, it is determined that the second type of pixel point is in the the first cross-correlation interpolation under the first brightness control parameter;
    所述第二获取模块,用于根据所述第一类像素点的像素值确定所述第二目标像素点的加权权重,所述第二目标像素点的加权权重与所述第一类像素点及所述第二目标像素点的差异大小正相关;根据所述第二目标像素点的像素值以及加权权重确定所述第一类像素点在所述第二亮度控制参数下的第二互相关插值。The second acquisition module is configured to determine the weighted weight of the second target pixel point according to the pixel value of the first type of pixel point, and the weighted weight of the second target pixel point is the same as the first type of pixel point. and the difference of the second target pixel point is positively correlated; according to the pixel value of the second target pixel point and the weighted weight, determine the second cross-correlation of the first type pixel point under the second brightness control parameter interpolation.
  16. 根据权利要求15所述的装置,其特征在于,所述第二获取模块,用于对于任一第一目标像素点,将所述任一第一目标像素点的像素值以及加权权重相乘,得到所述任一第一目标像素点对应的乘积结果;将各个第一目标像素点对应的乘积结果进行累加,得到第一累加和;将各个第一目标像素点的加权权重进行累加,得到第二累加和;将第一累加和与第二累加和的商作为所述第二类像素点在所述第一亮度控制参数下的第一互相关插值;The device according to claim 15, wherein the second obtaining module is configured to multiply the pixel value and the weighted weight of any first target pixel for any first target pixel, Obtain the product result corresponding to any of the first target pixel points; accumulate the product results corresponding to each first target pixel point to obtain a first cumulative sum; accumulate the weighted weights of each first target pixel point to obtain the first Two cumulative sums; taking the quotient of the first cumulative sum and the second cumulative sum as the first cross-correlation interpolation of the second type of pixel point under the first brightness control parameter;
    所述第二获取模块,用于对于任一第二目标像素点,将所述任一第二目标像素点的像素值以及加权权重相乘,得到所述任一第二目标像素点对应的乘积结果;将各个第二目标像素点对应的乘积结果进行累加,得到第三累加和;将各个第二目标像素点的加权权重进行累加,得到第四累加和;将第三累加和与第四累加和的商作为所述第一类像素点在第二亮度控制参数下的第二互相关插值。The second obtaining module is used for multiplying the pixel value and the weighted weight of any second target pixel to obtain the product corresponding to the any second target pixel. Result: Accumulate the product results corresponding to each second target pixel point to obtain a third cumulative sum; Accumulate the weighted weights of each second target pixel point to obtain a fourth cumulative sum; Combine the third cumulative sum and the fourth cumulative sum The quotient of the sum is used as the second cross-correlation interpolation of the first type of pixels under the second brightness control parameter.
  17. 根据权利要求14-16任一所述的装置,其特征在于,所述第二亮度控制参数小于所述第一亮度控制参数,所述融合模块,用于将所述第一类像素点的像素值和所述第二互相关插值按照所述第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,融合所述第一类像素点的像素值及所述第一亮度对齐结果;将所述第二类像素点的像素值和所述第一互相关插值按照所述第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果;融合所述第一互相关插值及所述第二亮度对齐结果。The device according to any one of claims 14-16, wherein the second brightness control parameter is smaller than the first brightness control parameter, and the fusion module is configured to combine the pixels of the first type of pixels The value and the second cross-correlation interpolation are luminance aligned according to the first luminance control parameter to obtain a first luminance alignment result, and the pixel values of the first type of pixel points and the first luminance alignment result are fused; The pixel values of the second type of pixel points and the first cross-correlation interpolation are luminance aligned according to the first luminance control parameter to obtain a second luminance alignment result; the first cross-correlation interpolation and the second luminance are fused Align the results.
  18. 根据权利要求17所述的装置,其特征在于,所述融合模块,用于根据所述第一亮度控制参数与所述第二亮度控制参数之间的差异倍数,将第一类像素点的像素值和第二互相关插值按照第一亮度控制参数进行亮度对齐,得到第一亮度对齐结果,所述差异倍数基于所述第一亮度控制参数与所述第二亮度控制参数之间的综合差异得到;The device according to claim 17, wherein the fusion module is configured to combine the pixels of the first type of pixels according to the difference multiple between the first brightness control parameter and the second brightness control parameter. The value and the second cross-correlation interpolation are luminance aligned according to the first luminance control parameter to obtain a first luminance alignment result, and the difference multiple is obtained based on the comprehensive difference between the first luminance control parameter and the second luminance control parameter ;
    所述融合模块,用于根据所述第一亮度控制参数与所述第二亮度控制参数之间的差异倍数,将所述第二类像素点的像素值和所述第一互相关插值按照所述第一亮度控制参数进行亮度对齐,得到第二亮度对齐结果。The fusion module is configured to interpolate the pixel value of the second type of pixel and the first cross-correlation interpolation according to the difference multiple between the first brightness control parameter and the second brightness control parameter. The brightness alignment is performed using the first brightness control parameter to obtain a second brightness alignment result.
  19. 根据权利要求17或18所述的装置,其特征在于,所述融合模块,用于将所述第一类像素点的像素值及对应的加权权重相乘,得到第一乘积结果,将所述第一亮度对齐结果及对应的加权权重相乘,得到第二乘积结果;将所述第一乘积结果与所述第二乘积结果求和,得到第一和值;将所述第一类像素点对应的加权权重与所述第一亮度对齐结果对应的加权权重求和,得到第二和值;将所述第一和值与所述第二和值的商作为所述第一类像素点的像素值及所述第一亮度对齐结果的融合结果;The device according to claim 17 or 18, wherein the fusion module is configured to multiply the pixel values of the first type of pixel points and the corresponding weighted weights to obtain a first product result, and the Multiplying the first brightness alignment result and the corresponding weighted weight to obtain a second product result; summing the first product result and the second product result to obtain a first sum value; adding the first type of pixel point The corresponding weighted weight is summed with the weighted weight corresponding to the first brightness alignment result to obtain a second sum value; the quotient of the first sum value and the second sum value is used as the first type of pixel point. the fusion result of the pixel value and the first luminance alignment result;
    所述融合模块,用于将所述第一互相关插值及对应的加权权重相乘,得到第三乘积结果,将所述第二亮度对齐结果及对应的加权权重相乘,得到第四乘积结果;将所述第三乘积结果与所述第四乘积结果求和,得到第三和值;将所述第二类像素点对应的加权权重与所述第二亮度对齐结果对应的加权权重求和,得到第四和值;将所述第三和值与所述第四和值的商作为所述第一互相关插值及所述第二亮度对齐结果的融合结果。The fusion module is used to multiply the first cross-correlation interpolation value and the corresponding weighted weight to obtain a third product result, and multiply the second brightness alignment result and the corresponding weighted weight to obtain a fourth product result. ; Summing the third product result and the fourth product result to obtain the third sum value; Summing the weighting weight corresponding to the second type of pixel point and the weighting weight corresponding to the second brightness alignment result , to obtain a fourth sum; the quotient of the third sum and the fourth sum is used as a fusion result of the first cross-correlation interpolation and the second luminance alignment result.
  20. 根据权利要求19所述的装置,其特征在于,所述融合模块,还用于基于所述W 1小于第一过暗阈值,确定所述β 11为第一值,所述β 12为第二值,所述第一值大于第二值;或者,基于所述W 1大于等于所述第一过暗阈值,确定所述β 11为第二值,所述β 12为第一值; The apparatus according to claim 19, wherein the fusion module is further configured to determine that the β 11 is a first value and the β 12 is a second value based on the W 1 being less than a first over-dark threshold value value, the first value is greater than the second value; or, based on the W 1 being greater than or equal to the first over-dark threshold, it is determined that the β 11 is the second value and the β 12 is the first value;
    所述融合模块,还用于基于所述W 1′大于第一过曝阈值,确定所述β 21为第二值,所述β 22为第一值;或者,基于所述W 1′小于等于所述第一过曝阈值,确定所述β 21为第一值,所述β 22为第二值。 The fusion module is further configured to determine that the β 21 is the second value and the β 22 is the first value based on the W 1 ' being greater than the first overexposure threshold; or, based on the W 1 ' being less than or equal to For the first overexposure threshold, it is determined that the β 21 is the first value, and the β 22 is the second value.
  21. 根据权利要求19所述的装置,其特征在于,所述融合模块,还用于基于所述W 1小于第二过暗阈值,确定所述β 11为第一值,所述β 12为第二值,所述第一值大于第二值;或者,基于所述W 1大于第二过曝阈值,确定所述β 11为第二值,所述β 12为第一值;或者,基于所述W 1介于所述第二过暗阈值与所述第二过曝阈值之间,确定所述β 11从所述第一值开始随所述W 1 增大而减小,所述β 12从所述第二值开始随所述W 1增大而增大; The apparatus according to claim 19, wherein the fusion module is further configured to determine that the β 11 is a first value and the β 12 is a second value based on the W 1 being less than a second over-dark threshold value, the first value is greater than the second value; or, based on the W 1 greater than the second overexposure threshold, it is determined that the β 11 is the second value, and the β 12 is the first value; or, based on the W 1 is between the second overdark threshold and the second overexposure threshold, it is determined that the β 11 decreases from the first value as the W 1 increases, and the β 12 decreases from the first value the second value begins to increase as the Wi increases ;
    所述融合模块,还用于基于所述W 1′小于第二过暗阈值,确定所述β 21为第一值,所述β 22为第二值,所述第一值大于第二值;或者,基于所述W 1′大于第二过曝阈值,确定所述β 21第二值,所述β 22为第一值;或者,基于所述W 1′介于所述第二过暗阈值与所述第二过曝阈值之间,确定所述β 21从所述第一值开始随所述W 1′增大而减小,所述β 22从所述第二值开始随所述W 1′增大而增大。 The fusion module is further configured to determine that the β 21 is a first value, the β 22 is a second value, and the first value is greater than the second value based on the W 1 ′ being less than a second dark threshold; Or, based on the fact that the W 1 ′ is greater than the second overexposure threshold, the second value of β 21 is determined, and the β 22 is the first value; or, based on the W 1 ′ being between the second over-dark threshold value Between the second overexposure threshold, it is determined that the β 21 decreases as the W 1 ′ increases from the first value, and the β 22 decreases with the W 1 ′ from the second value 1 ' increases and increases.
  22. 一种电子设备,其特征在于,所述电子设备包括处理器、图像传感器及至少两个控制电路,所述至少两个控制电路用于控制所述图像传感器按照不同的亮度控制参数拍摄生成不同类的像素点中的像素值;An electronic device, characterized in that the electronic device includes a processor, an image sensor and at least two control circuits, the at least two control circuits are used to control the image sensor to generate different types of images according to different brightness control parameters. The pixel value in the pixel point of ;
    所述控制电路,用于接受所述图像传感器的反馈,生成至少两个亮度控制参数发送给所述图像传感器;The control circuit is configured to receive feedback from the image sensor, generate at least two brightness control parameters and send them to the image sensor;
    所述图像传感器,用于按照所述至少两个亮度控制参数生成所述生成图像像素阵列,每个亮度控制参数对应一类像素点;the image sensor, configured to generate the generated image pixel array according to the at least two brightness control parameters, and each brightness control parameter corresponds to a type of pixel point;
    所述处理器用于执行所述权利要求1-10中任一所述的获取图像的方法。The processor is configured to execute the method for acquiring an image according to any one of claims 1-10.
  23. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括至少一条指令,所述指令由处理器执行以实现权利要求1-10任一所述的获取图像的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium comprises at least one instruction, and the instruction is executed by a processor to implement the method for acquiring an image according to any one of claims 1-10.
PCT/CN2020/112740 2020-08-31 2020-08-31 Image acquisition method and apparatus, device, and computer-readable storage medium WO2022041287A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080006227.0A CN114450934B (en) 2020-08-31 2020-08-31 Method, apparatus, device and computer readable storage medium for acquiring image
PCT/CN2020/112740 WO2022041287A1 (en) 2020-08-31 2020-08-31 Image acquisition method and apparatus, device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/112740 WO2022041287A1 (en) 2020-08-31 2020-08-31 Image acquisition method and apparatus, device, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
WO2022041287A1 true WO2022041287A1 (en) 2022-03-03

Family

ID=80354450

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/112740 WO2022041287A1 (en) 2020-08-31 2020-08-31 Image acquisition method and apparatus, device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN114450934B (en)
WO (1) WO2022041287A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008131187A (en) * 2006-11-17 2008-06-05 Rohm Co Ltd Color interpolation device, electronic equipment, and color interpolation program
CN108717690A (en) * 2018-05-21 2018-10-30 电子科技大学 A kind of synthetic method of high dynamic range photo
CN110418081A (en) * 2018-04-27 2019-11-05 北京展讯高科通信技术有限公司 High dynamic range images full resolution method for reconstructing, device and electronic equipment
CN110418065A (en) * 2018-04-27 2019-11-05 北京展讯高科通信技术有限公司 High dynamic range images motion compensation process, device and electronic equipment
CN111479072A (en) * 2020-04-14 2020-07-31 深圳市道通智能航空技术有限公司 High dynamic range image synthesis method and device, image processing chip and aerial camera

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6862372B2 (en) * 2001-12-27 2005-03-01 Koninklijke Philips Electronics N.V. System for and method of sharpness enhancement using coding information and local spatial features
JP4238586B2 (en) * 2003-01-30 2009-03-18 ソニー株式会社 Calibration processing apparatus, calibration processing method, and computer program
US8346009B2 (en) * 2009-06-29 2013-01-01 Thomson Licensing Automatic exposure estimation for HDR images based on image statistics
US20110292258A1 (en) * 2010-05-28 2011-12-01 C2Cure, Inc. Two sensor imaging systems
CN103208126B (en) * 2013-04-17 2016-04-06 同济大学 Moving object monitoring method under a kind of physical environment
CN108683861A (en) * 2018-08-06 2018-10-19 Oppo广东移动通信有限公司 Shoot exposal control method, device, imaging device and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008131187A (en) * 2006-11-17 2008-06-05 Rohm Co Ltd Color interpolation device, electronic equipment, and color interpolation program
CN110418081A (en) * 2018-04-27 2019-11-05 北京展讯高科通信技术有限公司 High dynamic range images full resolution method for reconstructing, device and electronic equipment
CN110418065A (en) * 2018-04-27 2019-11-05 北京展讯高科通信技术有限公司 High dynamic range images motion compensation process, device and electronic equipment
CN108717690A (en) * 2018-05-21 2018-10-30 电子科技大学 A kind of synthetic method of high dynamic range photo
CN111479072A (en) * 2020-04-14 2020-07-31 深圳市道通智能航空技术有限公司 High dynamic range image synthesis method and device, image processing chip and aerial camera

Also Published As

Publication number Publication date
CN114450934B (en) 2023-06-09
CN114450934A (en) 2022-05-06

Similar Documents

Publication Publication Date Title
CN110445988B (en) Image processing method, image processing device, storage medium and electronic equipment
US10021313B1 (en) Image adjustment techniques for multiple-frame images
US8150201B2 (en) Image processing apparatus, method, and computer program with pixel brightness-change detection and value correction
US8363131B2 (en) Apparatus and method for local contrast enhanced tone mapping
CN112532855B (en) Image processing method and device
TWI722283B (en) Multiplexed high dynamic range images
CN110381263B (en) Image processing method, image processing device, storage medium and electronic equipment
CN108337446B (en) High dynamic range image acquisition method, device and equipment based on double cameras
WO2014093042A1 (en) Determining an image capture payload burst structure based on metering image capture sweep
CN108616689B (en) Portrait-based high dynamic range image acquisition method, device and equipment
KR20060045424A (en) Digital cameras with luminance correction
US11671715B2 (en) High dynamic range technique selection for image processing
JP7285791B2 (en) Image processing device, output information control method, and program
CN110290325B (en) Image processing method, image processing device, storage medium and electronic equipment
US11258956B2 (en) Image capturing apparatus, image capturing method, and program
CN116324882A (en) Image signal processing in a multi-camera system
CN113259594A (en) Image processing method and device, computer readable storage medium and terminal
US11496694B2 (en) Dual sensor imaging system and imaging method thereof
van Beek Improved image selection for stack-based hdr imaging
CN110266965B (en) Image processing method, image processing device, storage medium and electronic equipment
WO2015192545A1 (en) Photographing method and apparatus and computer storage medium
CN112598609A (en) Dynamic image processing method and device
WO2023219466A1 (en) Methods and systems for enhancing low light frame in a multi camera system
CN110266967B (en) Image processing method, image processing device, storage medium and electronic equipment
CN117135293B (en) Image processing method and electronic device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20950956

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20950956

Country of ref document: EP

Kind code of ref document: A1