WO2023056926A1 - Image processing method, electronic device, and storage medium - Google Patents

Image processing method, electronic device, and storage medium Download PDF

Info

Publication number
WO2023056926A1
WO2023056926A1 PCT/CN2022/123779 CN2022123779W WO2023056926A1 WO 2023056926 A1 WO2023056926 A1 WO 2023056926A1 CN 2022123779 W CN2022123779 W CN 2022123779W WO 2023056926 A1 WO2023056926 A1 WO 2023056926A1
Authority
WO
WIPO (PCT)
Prior art keywords
calibration
image
grayscale
pixel
curve
Prior art date
Application number
PCT/CN2022/123779
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 上海肇观电子科技有限公司
Publication of WO2023056926A1 publication Critical patent/WO2023056926A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • G06T5/90
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20208High dynamic range [HDR] image processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30244Camera pose

Definitions

  • the present disclosure relates to the technical field of image processing, and in particular to an image processing method, a method for calibrating a response curve of an image sensor, an electronic device, and a storage medium.
  • the dynamic range (Dynamic Range, DR) of the brightness of the real scene is usually greater than the dynamic range of the camera.
  • DR Dynamic Range
  • the present disclosure provides an image processing method, an electronic device and a storage medium, so as to realize high-quality and efficient image fusion.
  • an image processing method including: acquiring a first image and a second image taken for the same scene, wherein the first exposure of the first image is greater than the second exposure of the second image exposure, the first image and the second image have the same image area; based on the first response curve corresponding to the first exposure and the pixel value of at least one first pixel in the first image, determining a grayscale value of a first object in the scene corresponding to a pixel position of at least one first pixel in the first image; based on a second response curve corresponding to the second exposure and in the second image a pixel value of at least one second pixel, determining a gray scale value of a second object in the scene corresponding to the pixel position of the at least one second pixel in the second image; and based on the gray scale value of the first object and The grayscale value of the second object determines the target image.
  • a method for calibrating a response curve of an image sensor comprising: acquiring a first calibration image including a plurality of calibration grayscales in a first calibration grayscale group with a first calibration exposure; based on In the first calibration image, pixel values at multiple first calibration positions respectively corresponding to multiple calibration grayscales in the first calibration grayscale group determine a first calibration curve, and the first calibration curve indicates the The mapping relationship between the pixel values collected by the image sensor under the first calibration exposure and the grayscale values of multiple calibration grayscales in the first calibration grayscale group; different from the first calibration exposure Acquiring a second calibration image including a plurality of calibration grayscales in the second calibration grayscale group based on the second calibration exposure; The pixel values at multiple second calibration positions of the gray scale determine a second calibration curve, and the second calibration curve indicates that the pixel values collected by the image sensor under the second calibration exposure are different from those in the second calibration gray scale group.
  • mapping relationship between the gray scale values of multiple calibration gray scales and determining the response curve of the image sensor based on the first calibration curve and the second calibration curve, wherein the response curve indicates the image sensor collected between the pixel value and the exposure amount used when capturing the image, and the grayscale values within the grayscale range of multiple calibrated grayscales including at least one of the first calibrated grayscale group and the second calibrated grayscale group mapping relationship.
  • an electronic device comprises: a processor; and a memory storing a program comprising instructions which, when executed by the processor, cause the processor to perform the method according to the above.
  • a non-transitory computer-readable storage medium storing a program.
  • the program includes instructions which, when executed by a processor of the electronic device, cause the electronic device to perform the method according to the above.
  • a computer program product comprises a computer program which, when executed by a processor, implements the method described above.
  • the response curve by using the response curve to determine the grayscale value corresponding to the pixel value of the image in the real environment under the current exposure, the real brightness information of the object in the image can be obtained conveniently.
  • response curves corresponding to different exposure levels all dynamic ranges in the scene can be covered, enabling images with high dynamic range to be acquired.
  • FIG. 1 shows a flowchart of an exemplary process of an image processing method according to an embodiment of the present disclosure
  • Figure 2A shows an example of a first response curve and a second response curve according to an embodiment of the present disclosure
  • Figure 2B shows an example of first and second response curves and inverse mapping curves according to an embodiment of the present disclosure
  • FIG. 3 shows a flowchart of an exemplary process of a method for calibrating a response curve according to an embodiment of the present disclosure
  • Figure 4A shows an example of a calibration curve according to an embodiment of the present disclosure
  • Figure 4B shows an example of an extended calibration curve according to an embodiment of the present disclosure
  • FIG. 5A shows an example of an image processing process according to an embodiment of the present disclosure
  • FIG. 5B shows an example of an image captured by an image sensor according to an embodiment of the present disclosure
  • FIG. 5C shows an example of a target image according to an example of the present disclosure.
  • FIG. 6 is a block diagram illustrating an example of an electronic device according to an exemplary embodiment of the present disclosure.
  • first, second, etc. to describe various elements is not intended to limit the positional relationship, temporal relationship or importance relationship of these elements, and such terms are only used for Distinguishes one element from another.
  • first element and the second element may refer to the same instance of the element, and in some cases, they may also refer to different instances based on contextual description.
  • the Debevec method can be utilized to recover high dynamic range radiance maps from photos taken by image sensors based on the physical properties of the imaging system (ie, photochemical and electronic reciprocity).
  • This method multiple photos of the scene are taken with different exposures.
  • the algorithm uses these differently exposed photographs to recover the response function of the imaging process, in terms of scaling factors, using the assumption of reciprocity.
  • Debevec's method fuses multiple photos into a single high dynamic range luminance map with pixel values proportional to the true luminance radiance values in the scene.
  • the most pronounced non-linearity in the response curve is at the saturation point, where any pixel with irradiance above a certain level maps to the same maximum image value, so the dynamic range of a single picture is limited.
  • the range of luminance radiance values of interest can be selected and an appropriate exposure time determined. Cover the entire dynamic range in a scene by taking and blending a series of photos with different exposures.
  • the Debevec method it is possible to obtain a response curve describing the relationship between the pixel values in the image and the exposure value with which the image was acquired, from a series of differently exposed photographs of the scene. Therefore, based on the Debevec method, the real brightness of the scene is not introduced to calibrate the response curve, and the relative brightness between pixels can only be estimated. When the picture is too dark or too bright, the estimated relative brightness also has a large error compared with the real brightness. Furthermore, the Debevec method does not take into account the parameter of exposure gain of current complementary metal-oxide-semiconductor (CMOS) sensors.
  • CMOS complementary metal-oxide-semiconductor
  • the present disclosure provides a new method for acquiring a target image with a high dynamic range by using a response curve.
  • FIG. 1 shows a flowchart of an exemplary process of an image processing method according to an embodiment of the present disclosure.
  • step S102 a first image and a second image taken for the same scene may be acquired.
  • the first exposure amount of the first image may be greater than the second exposure amount of the second image, and the first image and the second image may have the same image area.
  • step S104 based on the first response curve corresponding to the first exposure and the pixel value of at least one first pixel in the first image, the scene corresponding to the pixel position of at least one first pixel in the first image can be determined The grayscale value of the first object.
  • step S106 based on the second response curve corresponding to the second exposure and the pixel value of at least one second pixel in the second image, the scene corresponding to the pixel position of at least one second pixel in the second image can be determined The grayscale value of the second object.
  • the target image may be determined based on the grayscale value of the first object and the grayscale value of the second object.
  • the response curves corresponding to different exposures can be used to determine the real brightness of the object corresponding to each pixel in the scene in the image obtained based on different exposures, so that the scene can be further utilized.
  • the true brightness of the object in the scene determines a target image containing the object in the scene, wherein the dynamic range of the target image is greater than that of the first image and the second image.
  • step S102 the first image and the second image taken for the same scene may be acquired.
  • the first exposure amount of the first image may be greater than the second exposure amount of the second image, and the first image and the second image may have the same image area.
  • nearly identical objects are included in the first image and the second image. Since the first exposure used when acquiring the first image is different from the second exposure used when acquiring the second image, the first image and the second image have different dynamic ranges. In the case where the first exposure amount is greater than the second exposure amount, for an area with higher real brightness in the captured scene, this area may be overexposed in the image acquired by using the first exposure amount.
  • the first exposure amount may be determined based on a first exposure time used when acquiring the first image
  • the second exposure amount may be determined based on a second exposure time used when acquiring the second image.
  • the first exposure amount may be determined based on the first exposure time and the first exposure gain used when acquiring the first image
  • the second exposure amount is determined based on the second exposure amount used when acquiring the second image Time and the second exposure gain are determined.
  • the first exposure amount may be the product of the first exposure time and the first exposure gain
  • the second exposure amount may be the product of the second exposure time and the second exposure gain.
  • step S104 based on the first response curve corresponding to the first exposure and the pixel value of at least one first pixel in the first image, the scene corresponding to the pixel position of at least one first pixel in the first image can be determined The grayscale value of the first object.
  • step S106 based on the second response curve corresponding to the second exposure and the pixel value of at least one second pixel in the second image, the scene corresponding to the pixel position of at least one second pixel in the second image can be determined The grayscale value of the second object.
  • the first response curve used in step S104 may correspond to the pixel value of at least one first pixel in the first image at the first exposure amount indicated by the calibration response curve of the image sensor and the pixel value of at least one first pixel in the scene corresponding to the first pixel.
  • the second response curve used in step S106 corresponds to the pixel value of at least one second pixel in the second image at the second exposure indicated by the calibration response curve and the gray scale of the second object in the scene corresponding to the second pixel A second mapping between values.
  • the gray scale value indicates the real brightness of the object in the scene.
  • the first response curve and second response curve it is possible to determine the true brightness of objects in the captured scene based on the pixel values in the first image and the pixel values in the second image.
  • the gray scale value for the pixel can be determined using the first response curve.
  • the grayscale value for that pixel can be determined using the second response curve. Since both the first response curve and the second response curve indicate the relationship between the pixel value and the real brightness of the object in the scene at the corresponding exposure, the first response curve can be used to determine the corresponding
  • the second grayscale image corresponding to all pixels in the image area in the second image can be determined by using the second response curve.
  • the first grayscale image and the second grayscale image should be the same, that is, both reflect the real brightness of objects in the image area in the scene.
  • grayscale values corresponding to pixels in the image area can be obtained by fusing grayscale images determined from images acquired with different exposures.
  • the grayscale value corresponding to the pixel in the overexposed area may be determined by using an image acquired with a smaller exposure amount (eg, the second image).
  • the image information of the overexposure area in the second image may be acquired using a third image with a third exposure. Wherein the third exposure amount may be smaller than the second exposure amount.
  • the pixel value information and corresponding response curves of two or more images may be used to obtain the true brightness of an object in the scene corresponding to a pixel within an image region.
  • the principle of the present disclosure is described by taking no overexposed area in the second image as an example, but those skilled in the art can understand that the embodiments of the present disclosure are not limited thereto.
  • Overexposed areas in the first image can be determined using a pixel threshold. For example, a set of pixels above a pixel threshold in the first image may be determined as an overexposed area. That is to say, a set of at least one first pixel in the first image with a pixel threshold value not higher than the pixel threshold forms a non-overexposed area in the first image. Wherein, the positions of the over-exposure area and the non-over-exposure area in the image area are different.
  • At least one first pixel in the first image has a pixel value not higher than the pixel threshold, and at least one second pixel in the second image is located in a different position in the image area than the at least one first pixel in position in the image area.
  • the pixel threshold may be smaller than the saturation pixel value of the image sensor.
  • the aforementioned pixel threshold may be determined based on the saturated pixel value and the overexposure coefficient of the image sensor.
  • the overexposure factor may be a factor greater than zero and less than one.
  • the pixel threshold can be smaller than the saturation pixel value of the image sensor.
  • the pixel threshold may also be any pixel value pre-specified by the user that is smaller than the saturation pixel value.
  • the target image may be determined based on the grayscale value of the first object and the grayscale value of the second object.
  • step S104 and step S106 can be Determine the pixel value for each pixel in the target image.
  • the gray scale value of the first object and the gray scale value of the second object may be reverse mapped using an inverse mapping curve to obtain the pixel position of the first object in the target image and the pixel position of the second object Target pixel value.
  • the inverse mapping curve may indicate the mapping relationship between the target pixel value and the grayscale value at each pixel position in the target image. In the reverse mapping curve, the larger the grayscale value, the larger the target pixel value.
  • the specific form of the inverse mapping curve is not limited here.
  • any other data processing method can be used to process the grayscale value of the first object and the grayscale value of the second object to obtain image pixel values corresponding to each grayscale value, as long as the grayscale value The larger is the constraint condition that the target pixel value is larger.
  • the method provided by the present disclosure can be used to process the pixel values of the image of each color channel, so as to obtain the target pixel value of each color channel.
  • a colored target image can be obtained by fusing the target pixel values of each color channel.
  • Figure 2A shows an example of a first response curve and a second response curve according to an embodiment of the disclosure.
  • the first response curve 201 indicates the mapping relationship between the image pixel value at the first exposure level and the grayscale value of the object in the scene
  • the second response curve 202 indicates the image pixel value at the second exposure level. The mapping relationship with the grayscale value of objects in the scene.
  • the saturation cutoff point 203 indicates the cutoff point between the overexposed area and the non-overexposed area in the first image.
  • the pixel value of the saturation cutoff point 203 may be a pixel threshold value slightly smaller than the saturation pixel value of 4096 of the image sensor.
  • the pixel threshold may be determined to be 4090 or any other suitable value.
  • the first response curve 201 can well represent the mapping relationship between image pixel values and grayscale values. In the range of pixel values higher than the saturation cut-off point 203, the first response curve 201 begins to enter the saturation region, and the gray scale value corresponding to the pixel value higher than the pixel threshold cannot be determined by using the first response curve 201, because any Gray scale values above the saturation cut-off point 203 are all mapped to the same saturated pixel value.
  • the grayscale value corresponding to the pixel in the overexposed area can be determined by using the second response curve 202 . It can be seen that since the second exposure amount is smaller than the first exposure amount, the second response curve enters the saturation region later than the first response curve. Pixels located within the overexposed region in the first image are not overexposed in the second image. Therefore, the grayscale value of the object in the scene corresponding to the pixel in the overexposed area can be determined using the second image and the second response curve 202 for the second image.
  • FIG. 2B shows an example of first and second response curves and an inverse mapping curve according to an embodiment of the disclosure.
  • the curve 206 and the curve 207 correspond to the first response curve of the first image at the first exposure level and the second response curve of the second image at the second exposure level, respectively.
  • Curve 204 corresponds to the inverse mapping curve of an embodiment of the present disclosure.
  • the inverse mapping curve 204 can be used to determine the pixel value of each pixel in the target image. The higher the grayscale value, the larger the pixel value of the pixel.
  • At least a portion of the inverse mapping curve 204 may be determined based on a portion of the first response curve 206 .
  • the inverse mapping curve and the first response curve 206 may overlap.
  • the pixel value in the target image obtained by the inverse mapping curve can be the same as the pixel value actually acquired by the image sensor, so that the pixel value close to the real acquisition can be obtained. Image way to generate part of the target image.
  • any mathematical tool can be used to generate the specific form of the inverse mapping curve, as long as the constraint condition that the higher the gray scale value is, the larger the pixel value of the pixel is satisfied.
  • the inverse mapping curve can be implemented as a linear function, a polynomial function, or any possible monotonically increasing function.
  • the present disclosure also provides a method for calibrating the image The sensor response curve method.
  • FIG. 3 shows a flowchart of an exemplary process of a method for calibrating a response curve according to an embodiment of the present disclosure.
  • a first calibration image including a plurality of calibration grayscales in the first calibration grayscale group may be acquired with a first calibration exposure.
  • a first calibration curve may be determined based on pixel values at multiple first calibration positions in the first calibration image corresponding to multiple calibration grayscales in the first calibration grayscale group.
  • the first calibration curve may indicate the mapping relationship between the pixel values collected by the image sensor at the first calibration exposure and the grayscale values of the multiple calibration grayscales in the first calibration grayscale group.
  • a second calibration image including a plurality of calibration grayscales in the second calibration grayscale group may be acquired with a second calibration exposure different from the first calibration exposure.
  • a second calibration curve may be determined based on pixel values at multiple second calibration positions respectively corresponding to multiple calibration gray levels in the second calibration gray scale group in the second calibration image.
  • the second calibration curve may indicate the mapping relationship between the pixel value collected by the image sensor at the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group.
  • step S310 fitting may be performed based on the first calibration curve and the second calibration curve to obtain a response curve of the image sensor.
  • the response curve can indicate the mapping relationship between the pixel value collected by the image sensor, the exposure used when capturing the image, and the grayscale value in the grayscale range including multiple calibrated grayscales.
  • the above-mentioned grayscale range may include at least one of the first calibrated grayscale group and the second calibrated grayscale group.
  • the difference between the calibration gray scale (that is, the real brightness in the environment) and the pixel value in the collected image can be determined based on the images collected under different exposures.
  • the mapping relationship between them, so that the mapping relationship between the real brightness in the environment in the predetermined gray scale range and the pixel value in the collected image can be determined by fusing the image information under different exposures.
  • a first calibration image including a plurality of calibration grayscales in the first calibration grayscale group is acquired with a first calibration exposure.
  • the first calibration image is the raw data (raw image) acquired by the image sensor.
  • an image of a predetermined grayscale card may be acquired at a first calibration exposure as the first calibration image.
  • the predetermined gray scale card may include 20 gray scales that change with a predetermined gray scale variation.
  • the gray scales in the predetermined gray scale card may vary uniformly.
  • a first calibration curve may be determined based on pixel values at multiple first calibration positions in the first calibration image corresponding to multiple calibration grayscales in the first calibration grayscale group.
  • the pixel value in the first calibration image for each calibration gray scale can be calibrated.
  • the pixel value of each calibration gray scale in the first calibration image can be determined.
  • the first calibration curve can be obtained by fitting the pixel values corresponding to each calibration gray scale, wherein the first calibration curve indicates the pixel value collected by the image sensor under the first calibration exposure and the multiple calibration values in the first calibration gray scale group The mapping relationship between the grayscale values of the grayscale.
  • a second calibration image including a plurality of calibration grayscales in the second calibration grayscale group in the second calibration grayscale group may be acquired with a second calibration exposure different from the first calibration exposure.
  • the second calibration image is the original data acquired by the image sensor.
  • the first calibration exposure and the second calibration exposure used in step S304 and step S306 may be determined based on the exposure time used when acquiring the image. Among them, taking a CMOS image at most 30 frames per second as an example, the longest exposure time can be 33ms.
  • the first calibrated exposure amount may be greater than the second calibrated exposure amount, or may be smaller than the second calibrated exposure amount.
  • the minimum calibration exposure time can be determined as 1 ms, and the exposure time used when acquiring images is gradually increased in increments of 1 ms.
  • the exposure time of the first calibration exposure amount may be 1 ms
  • the exposure time of the second calibration exposure amount may be 2 ms.
  • the exposure time of the first calibration exposure amount may be 20 ms, and the exposure time of the second calibration exposure amount may be 3 ms.
  • the specific exposure time of the first calibration exposure amount and the second calibration exposure amount is not limited here, and those skilled in the art can select an appropriate exposure time according to the actual situation.
  • the first calibration exposure amount and the second calibration exposure amount used in step S304 and step S306 may be based on the exposure time and exposure gain used when acquiring the image.
  • the first calibrated exposure amount may be the product of the first calibrated exposure time and the first calibrated exposure gain
  • the second calibrated exposure amount may be the product of the second calibrated exposure time and the second calibrated exposure gain.
  • the exposure used when acquiring the image can be increased by first increasing the exposure time. In the case of reaching the maximum exposure time, keep the exposure time constant while gradually changing the exposure gain to the maximum exposure gain.
  • a second calibration curve may be determined based on pixel values at multiple second calibration positions respectively corresponding to multiple calibration gray levels in the second calibration gray scale group in the second calibration image.
  • the second calibration curve may indicate the mapping relationship between the pixel value collected by the image sensor at the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group.
  • each second calibration position corresponding to each calibration grayscale in the second calibration image can be determined and the pixel value at each second calibration position can be read, and it can be determined that each calibration grayscale is in the second calibration image pixel value.
  • the second calibration curve can be obtained by fitting the pixel values corresponding to each calibration gray scale, wherein the second calibration curve indicates the pixel value collected by the image sensor under the second calibration exposure and the multiple calibration values in the second calibration gray scale group. The mapping relationship between the grayscale values of the grayscale.
  • step S310 fitting may be performed based on the first calibration curve and the second calibration curve to obtain a response curve of the image sensor.
  • the response curve may indicate the mapping relationship between the pixel values collected by the image sensor, the exposure used when capturing the image, and the grayscale values within the grayscale range including multiple calibrated grayscales.
  • the multiple calibration gray scales in the first calibration gray scale group and the multiple calibration gray scales in the second calibration gray scale group may be the same.
  • the first calibration grayscale group may include a plurality of calibration grayscales that start from a reference grayscale value with a predetermined grayscale variation
  • the second calibration grayscale group includes a plurality of calibration grayscales that change from a reference grayscale value with the same predetermined Multiple calibrated grayscales with the same amount of grayscale variation. Since the calibration gray scales contained in the first calibration image and the second calibration image are the same, the first calibration curve and the second calibration curve can be used to determine the corresponding different pixel values.
  • the multiple calibration gray scales in the first calibration gray scale group and the multiple calibration gray scales in the second calibration gray scale group may be different.
  • the first calibration grayscale group may include a first number of multiple calibration grayscales that change with a first predetermined grayscale variation from the first reference grayscale value.
  • the second calibration grayscale group may include a second number of multiple calibration grayscales varying by a second predetermined grayscale variation from the second reference grayscale value.
  • the various first reference gray scale values and the second reference gray scale values may be the same or different.
  • the first predetermined gray scale change amount and the second predetermined gray scale change amount may be the same or different.
  • the first quantity and the second quantity may be the same or different.
  • the grayscale range corresponding to the response curve may include multiple calibration grayscales in the first calibration grayscale group and/or multiple calibration grayscales in the second calibration grayscale group.
  • the grayscale range corresponding to the response curve may be greater than the grayscale range of the first calibration grayscale group and/or the second calibration grayscale group. That is to say, the maximum grayscale value of the grayscale range corresponding to the response curve may be greater than the maximum standardized grayscale value in the first calibration grayscale group and the maximum calibration grayscale value in the second calibration grayscale group.
  • the gray scale range corresponding to the response curve may include 60 gray scales based on a predetermined gray scale change amount.
  • the grayscale range corresponding to the response curve also includes any other number of grayscales based on the predetermined grayscale variation, as long as the grayscale range corresponding to the response curve is not smaller than the first calibration grayscale group and/or the second Just calibrate the gray scale range of the gray scale group.
  • step S310 based on the first calibration curve and the second calibration curve determined in step S306 and step S308, based on the assumption of physical reciprocity (reciprocity) of the image sensor, the calibration curve obtained by translation measurement can be translated into The grayscale range covered by the calibration curve is extended, so that a calibration curve covering a grayscale range larger than the predetermined calibration grayscale group can be obtained without actually photographing a larger range of grayscale values.
  • Figure 4A shows an example of a calibration curve according to an embodiment of the present disclosure.
  • each curve shown in FIG. 4A is measured under different exposure amounts.
  • the higher the exposure the higher the pixel value corresponding to the grayscale value in the image captured by the image sensor.
  • the exposure amount corresponding to the calibration curve 401 is greater than the exposure amount corresponding to the calibration curve 402
  • the exposure amount corresponding to the calibration curve 402 is greater than the exposure amount corresponding to the calibration curve 403 .
  • each calibration curve within the range of 20 gray scales can be directly obtained through the image captured by the image sensor.
  • the calibration curve can be theoretically extended by shifting the curve, so as to obtain a larger gray scale Calibration curves available in the range.
  • Figure 4B shows an example of an extended calibration curve according to an embodiment of the disclosure.
  • the first calibration curve can be used to extend the second calibration curve.
  • the maximum pixel value corresponding to the maximum calibrated grayscale value of the second calibrated grayscale group under the second calibrated exposure amount may be determined based on the second calibration curve. Based on the corresponding maximum pixel value on the second calibration curve, the curve portion of the first calibration curve higher than the maximum pixel value of the second calibration curve is spliced with the second calibration curve to obtain an adjusted second calibration curve, wherein the adjusted The second calibration curve indicates the mapping relationship between at least one grayscale value higher than the maximum calibrated grayscale value in the grayscale range and the pixel value collected by the image sensor under the second calibrated exposure. A response curve of the image sensor is determined based on the first calibration curve and the second calibration curve.
  • the maximum pixel value of the calibration curve 407 at the gray scale 20 can be determined, and the part of the curve on the calibration curve 404 that is greater than the maximum pixel value of the calibration curve 407 can be translated to the gray scale value 20
  • the calibration curve 404' by splicing the calibration curve 404' and the calibration curve 407 at the gray scale value 20, the calibration curve 407 can be extended to the gray scale range with a gray scale value greater than 20 and the saturation of the calibration curve 407 can be obtained area.
  • the calibration curve 405' and the calibration curve 408 obtained after the calibration curve 405 is shifted can be spliced at the gray scale value of 20, and the calibration curve 406' and the calibration curve 409 obtained after the calibration curve 406 is translated at the gray scale value of 20 splicing.
  • the first calibration curve used to extend the second calibration curve can be arbitrary, as long as the first calibration exposure corresponding to the first calibration curve is greater than the second calibration corresponding to the second calibration curve Exposure is fine. In some cases, more than two calibration curves corresponding to different exposures can also be spliced.
  • each calibration curve within the gray scale range can be used for fitting to obtain a response curve of the image sensor.
  • the adjusted second calibration curve can be fitted with the first calibration curve to obtain the response curve of the image sensor.
  • the response curve of the image sensor can be expressed as a function of the image pixel value with respect to the exposure when the image was captured and the gray scale value of the captured object. Multiple calibration curves including the first calibration curve and the adjusted second calibration curve can be used to fit the parameters required by the response curve.
  • the response curve of the image sensor can be represented by formula (1):
  • I represents the pixel value collected by the image sensor
  • S represents the grayscale value
  • E represents the exposure amount
  • a, ⁇ , b, ⁇ , and w are constants.
  • FIG. 5A shows an example of an image processing procedure according to an embodiment of the present disclosure.
  • the image sensor 510 may be used to capture multiple calibration images with multiple calibration exposures.
  • a calibration response curve 530 may be determined according to a predetermined relationship between calibration gray scales and image pixel values in a plurality of calibration images.
  • the calibration response curve 530 indicates the mapping relationship between the pixel values captured by the image sensor, the exposure used when capturing the image, and the gray scale values within the gray scale range including multiple calibration gray scales.
  • the image sensor 510 may capture the first image 520 - 1 , the second image 520 - 2 . . . and the nth image 502 - n under different exposures, where n is an integer greater than 2.
  • step S503 the first image 520 - 1 , the second image 520 - 2 . . . and the nth image 502 - n can be processed respectively by using the calibration response curve 530 . According to the exposure amount corresponding to the first image 520-1, the second image 520-2 ...
  • the calibration response curve 530 can be used to determine the -1, the second image 520-2...and the first brightness-mapped image 540-1 of the nth image 520-n, the second brightness-mapped image 540-2...and the n-th brightness-mapped image 540-n, wherein A luminance mapping image 540-1, a second luminance mapping image 540-2... and an n th luminance mapping image 540-n indicate the grayscale value of the object in the scene corresponding to each pixel in the image area, that is, the real luminance.
  • FIG. 5B shows an example of an image captured by an image sensor according to an embodiment of the present disclosure. It can be seen that there is an overexposed area in FIG. 5B , and image details in the overexposed area cannot be obtained through the original image.
  • step S504 based on the pixel values of the first image 520-1, the second image 520-2... and the nth image 520-n, the first brightness mapping image 540-1, the second brightness mapping image 540-2 ... and the nth brightness map image 540 - n are fused to obtain a fused brightness map 550 .
  • the processing can start from the image with the highest exposure. Taking the first image with the highest exposure as an example, the first brightness mapping image 540-1 corresponding to at least one first pixel (that is, the non-overexposed area) in the first image 520-1 that is not higher than the pixel threshold can be The grayscale value of is determined as the grayscale value of the corresponding pixel in the fused brightness map 550 .
  • grayscale values of at least some of the pixels in the overexposed area may be determined using a brightness mapping image corresponding to an image with a smaller exposure (such as the second image).
  • a brightness mapping image corresponding to an image with a smaller exposure (such as the second image).
  • the target image 560 may be determined by using the grayscale values of the pixels indicated in the fused brightness map 550 . Wherein, pixels with higher grayscale values in the fused brightness map 550 have higher pixel values in the target image.
  • FIG. 5C illustrates an example of a target image according to an example of the present disclosure.
  • the image shown in FIG. 5C is a high dynamic range target image determined based on the image shown in FIG. 5B .
  • Figure 5C by fusing information from other images, the image details in the overexposed area in Figure 5B are restored. Therefore, Fig. 5C has a better visual effect than Fig. 5B.
  • an image processing device may include an image acquisition unit, a first grayscale determination unit, a second grayscale determination unit, and a target image determination unit, wherein the image acquisition unit may be configured to acquire the first image and the second image taken for the same scene, Wherein the first exposure amount of the first image is greater than the second exposure amount of the second image, and the first image and the second image have the same image area.
  • the first grayscale determination unit may be configured to determine the pixel value corresponding to at least one first pixel in the first image based on the first response curve corresponding to the first exposure amount and the pixel value of at least one first pixel in the first image.
  • the second grayscale determination unit may be configured to determine the pixel value corresponding to at least one second pixel in the second image based on the second response curve corresponding to the second exposure amount and the pixel value of at least one second pixel in the second image.
  • the target image determining unit may be configured to determine the target image based on the grayscale value of the first object and the grayscale value of the second object.
  • a device for calibrating a response curve of an image sensor may include a first calibration image acquisition unit, a first calibration curve determination unit, a second calibration image acquisition unit, a second calibration curve determination unit, and a response curve determination unit.
  • the first calibration image acquiring unit may be configured to acquire a first calibration image including a plurality of calibration grayscales in the first calibration grayscale group with a first calibration exposure.
  • the first calibration curve determining unit may be configured to determine the first calibration based on pixel values at multiple first calibration positions in the first calibration image respectively corresponding to multiple calibration grayscales in the first calibration grayscale group Curve, the first calibration curve indicates the mapping relationship between the pixel value collected by the image sensor under the first calibration exposure and the grayscale values of multiple calibration grayscales in the first calibration grayscale group.
  • the second calibration image acquisition unit may be configured to acquire a second calibration image including a plurality of calibration grayscales in the second calibration grayscale group with a second calibration exposure different from the first calibration exposure.
  • the second calibration curve determination unit may be configured to determine the second calibration based on pixel values at multiple second calibration positions in the second calibration image corresponding to multiple calibration grayscales in the second calibration grayscale group.
  • the second calibration curve indicates the mapping relationship between the pixel value collected by the image sensor at the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group.
  • the response curve determination unit may be configured to determine the response curve of the image sensor based on the first calibration curve and the second calibration curve, wherein the response curve indicates the pixel values captured by the image sensor and the exposure used when capturing the image and a mapping relationship between grayscale values within a grayscale range of multiple calibrated grayscales including at least one of the first calibrated grayscale group and the second calibrated grayscale group.
  • an electronic device including: a processor; and a memory storing a program, the program including instructions, which when executed by the processor cause the processor to perform the above-mentioned Methods.
  • a non-transitory computer-readable storage medium storing a program, the program includes instructions, and the instructions, when executed by a processor of an electronic device, cause the electronic device to perform the above-mentioned Methods.
  • a computer program product including a computer program, and when the computer program is executed by a processor, the above method is implemented.
  • Electronic device 600 is an example of a hardware device (electronic device) that can be applied to aspects of the present disclosure.
  • Electronic device 600 may be any machine configured to perform processing and/or computation, which may be, but is not limited to, a workstation, server, desktop computer, laptop computer, tablet computer, personal digital assistant, robot, smartphone, vehicle-mounted computer, or any combination thereof.
  • the above-mentioned image processing method 100 and the method 300 for calibrating the response curve may be fully or at least partially implemented by the electronic device 600 or similar devices or systems.
  • Electronic device 600 may include elements connected to or in communication with bus 602 (possibly via one or more interfaces).
  • electronic device 600 may include a bus 602 , one or more processors 604 , one or more input devices 606 , and one or more output devices 608 .
  • Processor(s) 604 may be any type of processor and may include, but is not limited to, one or more general purpose processors and/or one or more special purpose processors (eg, special processing chips).
  • the input device 606 may be any type of device capable of inputting information into the electronic device 600, and may include, but is not limited to, a mouse, keyboard, touch screen, microphone, and/or remote control.
  • Output devices 608 may be any type of device capable of presenting information, and may include, but are not limited to, displays, speakers, video/audio output terminals, vibrators, and/or printers.
  • the electronic device 600 may also include a non-transitory storage device 610, which may be any storage device that is non-transitory and that enables data storage, including but not limited to disk drives, optical storage devices, solid-state memory, floppy disks, flexible disk, hard disk, tape or any other magnetic medium, optical disk or any other optical medium, ROM (read only memory), RAM (random access memory), cache memory and/or any other memory chips or cartridges, and/or computer Any other medium from which data, instructions and/or code can be read.
  • the non-transitory storage device 610 is detachable from the interface.
  • the non-transitory storage device 610 may have data/programs (including instructions)/codes for implementing the above methods and steps.
  • the electronic device 600 may also include a communication device 612 .
  • the communication device 612 may be any type of device or system that enables communication with external devices and/or with a network, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication devices, and/or chipsets, such as Bluetooth TM device, 1302.11 device, Wi-Fi device, Wi-Max device, cellular communication device, and/or the like.
  • Electronic device 600 may also include working memory 614, which may be any type of working memory that may store programs (including instructions) and/or data useful for the work of processor 604, and may include, but is not limited to, random access memory and and/or read-only memory devices.
  • working memory 614 may be any type of working memory that may store programs (including instructions) and/or data useful for the work of processor 604, and may include, but is not limited to, random access memory and and/or read-only memory devices.
  • Software elements may be located in working memory 614, including but not limited to operating system 616, one or more application programs 618, drivers, and/or other data and code. Instructions for performing the above methods and steps may be included in one or more application programs 618, and the above image processing method 100 and the method 300 for calibrating response curves may be read and executed by the processor 604 by one or more The instructions of an application program 618 are implemented. More specifically, in the above-mentioned image processing method 100, steps S102-S108 can be implemented, for example, by the processor 604 executing the application program 618 having the instructions of steps S102-S108.
  • steps S302-S310 can be realized, for example, by the processor 604 executing the application program 618 having the instructions of steps S302-S310.
  • steps in the above-mentioned image processing method 100 and the method 300 for calibrating response curves can be realized, for example, by the processor 604 executing the application program 618 having instructions for executing the corresponding steps.
  • the executable code or source code of the instructions of the software elements (programs) may be stored in a non-transitory computer-readable storage medium (such as the above-mentioned storage device 610), and when executed, may be stored in the working memory 614 (possibly compiled and/or install).
  • the executable code or source code of the instructions of the software element (program) may also be downloaded from a remote location.
  • custom hardware could also be used, and/or particular elements could be implemented in hardware, software, firmware, middleware, microcode, hardware description languages, or any combination thereof.
  • some or all of the disclosed methods and devices can be implemented by programming hardware (e.g., including Field Programmable Gate Arrays) in assembly language or hardware programming languages (such as VERILOG, VHDL, C++) using logic and algorithms according to the present disclosure. (FPGA) and/or Programmable Logic Circuits of Programmable Logic Array (PLA)) to implement programming.
  • programming hardware e.g., including Field Programmable Gate Arrays
  • FPGA Field Programmable Gate Array
  • PDA Programmable Logic Circuits of Programmable Logic Array
  • a client may receive user-entered data and send the data to a server.
  • the client may also receive the data input by the user, perform part of the processing in the aforementioned method, and send the processed data to the server.
  • the server may receive data from the client, execute the aforementioned method or another part of the aforementioned method, and return the execution result to the client.
  • the client can receive the execution result of the method from the server, and can present it to the user, for example, through an output device.
  • components of electronic device 600 may be distributed across a network. For example, some processing may be performed using one processor while other processing may be performed by another processor remote from the one processor. Other components of computing system 600 may be similarly distributed. As such, electronic device 600 may be interpreted as a distributed computing system that performs processing at multiple locations.
  • Aspect 1 An image processing method, comprising:
  • a target image is determined based on the gray scale value of the first object and the gray scale value of the second object.
  • Aspect 2 The image processing method according to aspect 1, wherein at least one first pixel in the first image has a pixel value not higher than a pixel threshold, and at least one second pixel in the second image is at The location in the image area is different than the location of the at least one first pixel in the image area.
  • Aspect 3 The image processing method according to aspect 2, wherein the pixel threshold is smaller than a saturation pixel value of the image sensor.
  • Aspect 4 The image processing method according to aspect 3, wherein the pixel threshold is determined based on a saturated pixel value of the image sensor and an overexposure coefficient, and the overexposure coefficient is a coefficient greater than 0 and less than 1.
  • Aspect 5 The image processing method according to aspect 1, wherein determining the target image based on the grayscale value of the first object and the grayscale value of the second object comprises:
  • an inverse mapping curve to perform inverse mapping on the grayscale value of the first object and the grayscale value of the second object, so as to obtain the pixel position of the first object and the pixel position of the second object in the target image A target pixel value at a pixel position, wherein the inverse mapping curve indicates a mapping relationship between the target pixel value at each pixel position in the target image and the gray scale value.
  • Aspect 6 The image processing method according to aspect 5, in the inverse mapping curve, the larger the gray scale value is, the larger the target pixel value is.
  • Aspect 7 The image processing method according to aspect 1, wherein the first exposure amount is determined based on the first exposure time and the first exposure gain used when acquiring the first image, and the second exposure The amount is determined based on a second exposure time and a second exposure gain used when acquiring the second image.
  • Aspect 8 The image processing method according to aspect 1, wherein the first response curve corresponds to at least one first pixel in the first image at the first exposure amount indicated by a calibration response curve of the image sensor
  • the second response curve corresponds to the second response curve indicated by the calibration response curve in the second
  • a first calibration curve is determined based on pixel values at multiple first calibration positions in the first calibration image corresponding to multiple calibration grayscales in the first calibration grayscale group, and the first calibration curve indicates The mapping relationship between the pixel values collected by the image sensor under the first calibration exposure and the grayscale values of multiple calibration grayscales in the first calibration grayscale group;
  • the second calibration curve indicates A mapping relationship between the pixel values collected by the image sensor under the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group;
  • a calibration response curve of the image sensor based on the first calibration curve and the second calibration curve, wherein the calibration response curve indicates the pixel value collected by the image sensor and the exposure used when capturing the image and includes the first calibration curve
  • the calibration response curve indicates the pixel value collected by the image sensor and the exposure used when capturing the image and includes the first calibration curve
  • Aspect 10 The image processing method according to aspect 9, wherein determining the calibration response curve of the image sensor based on the first calibration curve and the second calibration curve comprises:
  • the adjusted second calibration curve indicates a mapping relationship between at least one grayscale value higher than the maximum calibrated grayscale value in the grayscale range and pixel values collected by the image sensor under a second calibrated exposure;
  • Aspect 11 The image processing method according to aspect 9, wherein the second calibrated exposure amount is smaller than the first calibrated exposure amount.
  • Aspect 12 The image processing method according to aspect 9, wherein the first calibration grayscale group includes a plurality of calibration grayscales that change with a predetermined grayscale variation from the reference grayscale value, and the second calibration grayscale The group includes the same number of calibration grayscales varying by the same predetermined grayscale variation from the reference grayscale value.
  • Aspect 13 The image processing method according to any one of aspects 9-12, wherein the calibration response curve is represented by the following formula:
  • I represents the pixel value collected by the image sensor
  • S represents the grayscale value
  • E represents the exposure amount
  • a, ⁇ , b, ⁇ , and w are constants.
  • a method for calibrating a response curve of an image sensor comprising:
  • a first calibration curve is determined based on pixel values at multiple first calibration positions in the first calibration image corresponding to multiple calibration grayscales in the first calibration grayscale group, and the first calibration curve indicates The mapping relationship between the pixel values collected by the image sensor under the first calibration exposure and the grayscale values of multiple calibration grayscales in the first calibration grayscale group;
  • the second calibration curve indicates A mapping relationship between the pixel values collected by the image sensor under the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group;
  • Aspect 15 The method of aspect 14, wherein the exposure amount is determined based on an exposure time and an exposure gain used when acquiring an image with the image sensor.
  • Aspect 16 The method of aspect 14, wherein the second nominal exposure level is less than the first nominal exposure level.
  • Aspect 17 The method according to aspect 14, wherein the first set of calibration grayscales includes a plurality of calibration grayscales that change from a reference grayscale value by a predetermined amount of grayscale variation, and the second set of calibration grayscales includes A plurality of calibration gray scales of the same number varying with the same predetermined gray scale variation from the reference gray scale value.
  • Aspect 18 The method according to aspect 14, wherein the plurality of calibrated gray scales change with a predetermined gray scale variation, and the maximum gray scale value including the gray scale range is greater than the first set of calibrated gray scales and the maximum calibrated gray scale value of the second calibrated gray scale group.
  • Aspect 19 The method of aspect 14, wherein determining a response curve of the image sensor based on the first calibration curve and the second calibration curve comprises:
  • the adjusted second calibration curve indicates a mapping relationship between at least one grayscale value higher than the maximum calibrated grayscale value in the grayscale range and pixel values collected by the image sensor under a second calibrated exposure;
  • Aspect 20 The method of any one of aspects 14-19, wherein the response curve is represented by the following formula:
  • I represents the pixel value collected by the image sensor
  • S represents the grayscale value
  • E represents the exposure amount
  • a, ⁇ , b, ⁇ , and w are constants.
  • An electronic device comprising:
  • a memory storing a program comprising instructions which, when executed by the processor, cause the processor to perform the method according to any one of aspects 1-20.
  • Aspect 22 A non-transitory computer-readable storage medium storing a program comprising instructions which, when executed by a processor of an electronic device, cause the electronic device to perform any of aspects 1-20. method described in the item.
  • a computer program product comprising a computer program, wherein said computer program, when executed by a processor, implements the method according to any one of aspects 1-20.

Abstract

The present disclosure provides an image processing method, an electronic device, and a storage medium. The image processing method comprises: obtaining a first image and a second image that are image captured for the same scene, a first exposure amount of the first image being greater than a second exposure amount of the second image, and the first image and the second image having the same image area; on the basis of a first response curve corresponding to the first exposure amount and a pixel value of at least one first pixel in the first image, determining a grayscale value of a first object in a scene corresponding to the pixel position of the at least one first pixel in the first image; on the basis of a second response curve corresponding to the second exposure amount and a pixel value of at least one second pixel in the second image, determining a grayscale value of a second object in a scene corresponding to the pixel position of the at least one second pixel in the second image; and determining a target image on the basis of the grayscale value of the first object and the grayscale value of the second object.

Description

图像处理方法、电子设备和存储介质Image processing method, electronic device and storage medium 技术领域technical field
本公开涉及图像处理技术领域,特别涉及一种图像处理方法、用于标定图像传感器的响应曲线的方法、电子设备和存储介质。The present disclosure relates to the technical field of image processing, and in particular to an image processing method, a method for calibrating a response curve of an image sensor, an electronic device, and a storage medium.
背景技术Background technique
真实场景的亮度的动态范围(Dynamic Range,DR)通常大于相机的动态范围。相机在采集图像时,一次曝光仅能记录下真实场景中的一部分动态范围,因此采集到的图像中往往会出现过曝区域或欠曝区域,导致场景细节信息的丢失,图像的视觉效果不佳。The dynamic range (Dynamic Range, DR) of the brightness of the real scene is usually greater than the dynamic range of the camera. When the camera captures images, one exposure can only record a part of the dynamic range of the real scene, so there are often overexposed areas or underexposed areas in the captured images, resulting in the loss of scene details and poor visual effects of the images .
在此部分中描述的方法不一定是之前已经设想到或采用的方法。除非另有指明,否则不应假定此部分中描述的任何方法仅因其包括在此部分中就被认为是现有技术。类似地,除非另有指明,否则此部分中提及的问题不应认为在任何现有技术中已被公认。The approaches described in this section are not necessarily approaches that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any approaches described in this section are admitted to be prior art solely by virtue of their inclusion in this section. Similarly, issues mentioned in this section should not be considered to have been recognized in any prior art unless otherwise indicated.
发明内容Contents of the invention
本公开提供一种图像处理方法、电子设备和存储介质,以实现高质量的、高效的图像融合。The present disclosure provides an image processing method, an electronic device and a storage medium, so as to realize high-quality and efficient image fusion.
根据本公开的一方面,提供一种图像处理方法,包括:获取针对同一场景拍摄的第一图像和第二图像,其中所述第一图像的第一曝光量大于所述第二图像的第二曝光量,所述第一图像和所述第二图像具有相同的图像区域;基于对应于所述第一曝光量的第一响应曲线和所述第一图像中至少一个第一像素的像素值,确定对应于所述第一图像中至少一个第一像素的像素位置的场景中的第一对象的灰阶值;基于对应于所述第二曝光量的第二响应曲线和所述第二图像中至少一个第二像素的像素值,确定对应于所述第二图像中至少一个第二像素的像素位置的场景中的第二对象的灰阶值;以及基于所述第一对象的灰阶值和所述第二对象的灰阶值确定目标图像。According to an aspect of the present disclosure, there is provided an image processing method, including: acquiring a first image and a second image taken for the same scene, wherein the first exposure of the first image is greater than the second exposure of the second image exposure, the first image and the second image have the same image area; based on the first response curve corresponding to the first exposure and the pixel value of at least one first pixel in the first image, determining a grayscale value of a first object in the scene corresponding to a pixel position of at least one first pixel in the first image; based on a second response curve corresponding to the second exposure and in the second image a pixel value of at least one second pixel, determining a gray scale value of a second object in the scene corresponding to the pixel position of the at least one second pixel in the second image; and based on the gray scale value of the first object and The grayscale value of the second object determines the target image.
根据本公开的另一方面,提供用于标定图像传感器的响应曲线的方法,包括:以第一标定曝光量获取包括第一标定灰阶组中的多个标定灰阶的第一标定图像;基于所述第一标定图像中分别对应于所述第一标定灰阶组中的多个标定灰阶的多个第一标定位置处的像素值确定第一标定曲线,所述第一标定曲线指示所述第一标定曝光量下图像传感器采集的像素值与所述第一标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系;以不同于所述第一标定曝光量的第二标定曝光量获取包括第二标定灰阶组中的多个标定灰阶 的第二标定图像;基于所述第二标定图像中分别对应于所述第二标定灰阶组中的多个标定灰阶的多个第二标定位置处的像素值确定第二标定曲线,所述第二标定曲线指示所述第二标定曝光量下图像传感器采集的像素值与所述第二标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系;以及基于所述第一标定曲线和所述第二标定曲线确定所述图像传感器的响应曲线,其中所述响应曲线指示图像传感器采集的像素值与采集图像时使用的曝光量以及包含所述第一标定灰阶组和所述第二标定灰阶组中的至少一个的多个标定灰阶的灰阶范围内的灰阶值之间的映射关系。According to another aspect of the present disclosure, there is provided a method for calibrating a response curve of an image sensor, comprising: acquiring a first calibration image including a plurality of calibration grayscales in a first calibration grayscale group with a first calibration exposure; based on In the first calibration image, pixel values at multiple first calibration positions respectively corresponding to multiple calibration grayscales in the first calibration grayscale group determine a first calibration curve, and the first calibration curve indicates the The mapping relationship between the pixel values collected by the image sensor under the first calibration exposure and the grayscale values of multiple calibration grayscales in the first calibration grayscale group; different from the first calibration exposure Acquiring a second calibration image including a plurality of calibration grayscales in the second calibration grayscale group based on the second calibration exposure; The pixel values at multiple second calibration positions of the gray scale determine a second calibration curve, and the second calibration curve indicates that the pixel values collected by the image sensor under the second calibration exposure are different from those in the second calibration gray scale group. The mapping relationship between the gray scale values of multiple calibration gray scales; and determining the response curve of the image sensor based on the first calibration curve and the second calibration curve, wherein the response curve indicates the image sensor collected between the pixel value and the exposure amount used when capturing the image, and the grayscale values within the grayscale range of multiple calibrated grayscales including at least one of the first calibrated grayscale group and the second calibrated grayscale group mapping relationship.
根据本公开的另一方面,提供一种电子设备。该电子设备包括:处理器;以及存储程序的存储器,该程序包括指令,该指令在由处理器执行时使处理器执行根据上述方法。According to another aspect of the present disclosure, an electronic device is provided. The electronic device comprises: a processor; and a memory storing a program comprising instructions which, when executed by the processor, cause the processor to perform the method according to the above.
根据本公开的另一方面,提供一种存储程序的非暂态计算机可读存储介质。该程序包括指令,该指令在由电子设备的处理器执行时,致使电子设备执行根据上述方法。According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing a program is provided. The program includes instructions which, when executed by a processor of the electronic device, cause the electronic device to perform the method according to the above.
根据本公开的另一方面,提供一种计算机程序产品。该计算机程序产品包括计算机程序,该计算机程序在被处理器执行时实现上述方法。According to another aspect of the present disclosure, a computer program product is provided. The computer program product comprises a computer program which, when executed by a processor, implements the method described above.
根据本公开的实施例,通过利用响应曲线确定在当前曝光量下真实环境中与图像像素值对应的灰阶值,能够方便地获取图像中物体的真实亮度信息。利用对应于不同曝光量的响应曲线,可以覆盖场景中的所有动态范围,从而能够获取具有高动态范围的图像。According to the embodiments of the present disclosure, by using the response curve to determine the grayscale value corresponding to the pixel value of the image in the real environment under the current exposure, the real brightness information of the object in the image can be obtained conveniently. With response curves corresponding to different exposure levels, all dynamic ranges in the scene can be covered, enabling images with high dynamic range to be acquired.
根据在下文中所描述的实施例,本公开的这些和其它方面将是清楚明白的,并且将参考在下文中所描述的实施例而被阐明。These and other aspects of the disclosure will be apparent from and will be elucidated with reference to the embodiments described hereinafter.
附图说明Description of drawings
附图示例性地示出了实施例并且构成说明书的一部分,与说明书的文字描述一起用于讲解实施例的示例性实施方式。所示出的实施例仅出于例示的目的,并不限制权利要求的范围。在所有附图中,相同的附图标记指代类似但不一定相同的要素。The drawings exemplarily illustrate the embodiment and constitute a part of the specification, and together with the text description of the specification, serve to explain the exemplary implementation of the embodiment. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, like reference numbers designate similar, but not necessarily identical, elements.
图1示出了根据本公开的实施例的图像处理方法的示例性过程的流程图;FIG. 1 shows a flowchart of an exemplary process of an image processing method according to an embodiment of the present disclosure;
图2A示出了根据本公开的实施例的第一响应曲线和第二响应曲线的示例;Figure 2A shows an example of a first response curve and a second response curve according to an embodiment of the present disclosure;
图2B示出了根据本公开的实施例的第一响应曲线和第二响应曲线以及反映射曲线的示例;Figure 2B shows an example of first and second response curves and inverse mapping curves according to an embodiment of the present disclosure;
图3示出了根据本公开的实施例的用于标定响应曲线的方法的示例性过程的流程图;FIG. 3 shows a flowchart of an exemplary process of a method for calibrating a response curve according to an embodiment of the present disclosure;
图4A示出了根据本公开的实施例的标定曲线的示例;Figure 4A shows an example of a calibration curve according to an embodiment of the present disclosure;
图4B示出了根据本公开的实施例的延伸的标定曲线的示例;Figure 4B shows an example of an extended calibration curve according to an embodiment of the present disclosure;
图5A示出了根据本公开的实施例的图像处理过程的示例;FIG. 5A shows an example of an image processing process according to an embodiment of the present disclosure;
图5B示出了根据本公开的实施例的图像传感器采集的图像的示例;5B shows an example of an image captured by an image sensor according to an embodiment of the present disclosure;
图5C示出了根据本公开的示例的目标图像的示例;以及FIG. 5C shows an example of a target image according to an example of the present disclosure; and
图6是示出根据本公开的示例性实施例的电子设备的示例的框图。FIG. 6 is a block diagram illustrating an example of an electronic device according to an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
在本公开中,除非另有说明,否则使用术语“第一”、“第二”等来描述各种要素不意图限定这些要素的位置关系、时序关系或重要性关系,这种术语只是用于将一个元件与另一元件区分开。在一些示例中,第一要素和第二要素可以指向该要素的同一实例,而在某些情况下,基于上下文的描述,它们也可以指代不同实例。In the present disclosure, unless otherwise stated, using the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship or importance relationship of these elements, and such terms are only used for Distinguishes one element from another. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, they may also refer to different instances based on contextual description.
在本公开中对各种所述示例的描述中所使用的术语只是为了描述特定示例的目的,而并非旨在进行限制。除非上下文另外明确地表明,如果不特意限定要素的数量,则该要素可以是一个也可以是多个。此外,本公开中所使用的术语“和/或”涵盖所列出的项目中的任何一个以及全部可能的组合方式。The terminology used in describing the various described examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, there may be one or more elements. In addition, the term "and/or" used in the present disclosure covers any one and all possible combinations of the listed items.
在相关技术中,可以利用Debevec方法,基于成像系统的物理特性(即光化学和电子的互易性)从图像传感器拍摄的照片中恢复高动态范围辐射度图。在此方法中,场景的多张照片是用不同的曝光量拍摄的。该算法使用这些不同曝光的照片来恢复成像过程的响应函数,根据比例因素,使用互易性的假设。利用已知的响应函数,Debevec方法可以将多张照片融合成单一的高动态范围亮度映射图,其像素值与场景中的真实亮度辐射度值成正比。In related art, the Debevec method can be utilized to recover high dynamic range radiance maps from photos taken by image sensors based on the physical properties of the imaging system (ie, photochemical and electronic reciprocity). In this method, multiple photos of the scene are taken with different exposures. The algorithm uses these differently exposed photographs to recover the response function of the imaging process, in terms of scaling factors, using the assumption of reciprocity. Using a known response function, Debevec's method fuses multiple photos into a single high dynamic range luminance map with pixel values proportional to the true luminance radiance values in the scene.
与胶片一样,响应曲线中最显著的非线性是在饱和点处,在饱和点处,任何辐射度高于某一水平的像素都映射于相同的最大图像值,所以单幅图片的动态范围是有限的。为了获取高动态范围的响应曲线,可以选择感兴趣的亮度辐射度值范围,并确定适当的曝光时间。通过拍摄并融合一系列不同曝光的照片来覆盖场景中的整个动态范围。As with film, the most pronounced non-linearity in the response curve is at the saturation point, where any pixel with irradiance above a certain level maps to the same maximum image value, so the dynamic range of a single picture is limited. To obtain a high dynamic range response curve, the range of luminance radiance values of interest can be selected and an appropriate exposure time determined. Cover the entire dynamic range in a scene by taking and blending a series of photos with different exposures.
利用Debevec方法,能够通过场景的一系列不同曝光的照片获取描述图像中的像素值和获取图像时使用的曝光值之间的关系的响应曲线。因此,基于Debevec方法没有引入场景的真实亮度对响应曲线进行标定,只能通过推算像素之间的相对亮度。在画面过暗或过亮的情况下,推算的相对亮度相比于真实亮度也具有较大的误差。此外,Debevec方法也没有考虑目前的互补金属氧化物半导体(CMOS)传感器的曝光增益的参数。Using the Debevec method, it is possible to obtain a response curve describing the relationship between the pixel values in the image and the exposure value with which the image was acquired, from a series of differently exposed photographs of the scene. Therefore, based on the Debevec method, the real brightness of the scene is not introduced to calibrate the response curve, and the relative brightness between pixels can only be estimated. When the picture is too dark or too bright, the estimated relative brightness also has a large error compared with the real brightness. Furthermore, the Debevec method does not take into account the parameter of exposure gain of current complementary metal-oxide-semiconductor (CMOS) sensors.
为了解决相关技术中的上述问题,本公开提供了一种新的利用响应曲线获取具有高动态范围的目标图像的方法。以下结合附图详细描述本公开的实施例。In order to solve the above-mentioned problems in the related art, the present disclosure provides a new method for acquiring a target image with a high dynamic range by using a response curve. Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
图1示出了根据本公开的实施例的图像处理方法的示例性过程的流程图。FIG. 1 shows a flowchart of an exemplary process of an image processing method according to an embodiment of the present disclosure.
如图1所示,在步骤S102中,可以获取针对同一场景拍摄的第一图像和第二图像。其中,第一图像的第一曝光量可以大于第二图像的第二曝光量,第一图像和第二图像可以具有相同的图像区域。As shown in FIG. 1, in step S102, a first image and a second image taken for the same scene may be acquired. Wherein, the first exposure amount of the first image may be greater than the second exposure amount of the second image, and the first image and the second image may have the same image area.
在步骤S104中,基于对应于第一曝光量的第一响应曲线和第一图像中至少一个第一像素的像素值,可以确定对应于第一图像中至少一个第一像素的像素位置的场景中的第一对象的灰阶值。In step S104, based on the first response curve corresponding to the first exposure and the pixel value of at least one first pixel in the first image, the scene corresponding to the pixel position of at least one first pixel in the first image can be determined The grayscale value of the first object.
在步骤S106中,基于对应于第二曝光量的第二响应曲线和第二图像中至少一个第二像素的像素值,可以确定对应于第二图像中至少一个第二像素的像素位置的场景中的第二对象的灰阶值。In step S106, based on the second response curve corresponding to the second exposure and the pixel value of at least one second pixel in the second image, the scene corresponding to the pixel position of at least one second pixel in the second image can be determined The grayscale value of the second object.
在步骤S108中,可以基于第一对象的灰阶值和第二对象的灰阶值确定目标图像。In step S108, the target image may be determined based on the grayscale value of the first object and the grayscale value of the second object.
利用本公开的实施例提供的图像处理方法,可以利用对应于不同曝光量的响应曲线,分别确定基于不同曝光量获取的图像中各个像素在场景中对应的对象的真实亮度,从而能够进一步利用场景中对象的真实亮度确定包含场景中对象的目标图像,其中目标图像的动态范围大于第一图像和第二图像。Using the image processing method provided by the embodiments of the present disclosure, the response curves corresponding to different exposures can be used to determine the real brightness of the object corresponding to each pixel in the scene in the image obtained based on different exposures, so that the scene can be further utilized. The true brightness of the object in the scene determines a target image containing the object in the scene, wherein the dynamic range of the target image is greater than that of the first image and the second image.
以下详细描述方法100的各个步骤。Each step of the method 100 is described in detail below.
在步骤S102中,可以获取针对同一场景拍摄的第一图像和第二图像。其中,第一图像的第一曝光量可以大于第二图像的第二曝光量,第一图像和第二图像可以具有相同的图像区域。In step S102, the first image and the second image taken for the same scene may be acquired. Wherein, the first exposure amount of the first image may be greater than the second exposure amount of the second image, and the first image and the second image may have the same image area.
在一些实施例中,第一图像和第二图像中包括几乎相同的对象。由于获取第一图像时使用的第一曝光量和获取第二图像时使用的第二曝光量是不同的,因此第一图像和第二图像具有不同的动态范围。在第一曝光量大于第二曝光量的情况下,对于被拍摄的场景中真实亮度较高的区域,利用第一曝光量获取的图像中该区域可能会出现过曝的情况。In some embodiments, nearly identical objects are included in the first image and the second image. Since the first exposure used when acquiring the first image is different from the second exposure used when acquiring the second image, the first image and the second image have different dynamic ranges. In the case where the first exposure amount is greater than the second exposure amount, for an area with higher real brightness in the captured scene, this area may be overexposed in the image acquired by using the first exposure amount.
在一些实现方式中,第一曝光量可以是基于获取第一图像时使用的第一曝光时间而确定的,第二曝光量可以是基于获取第二图像时使用的第二曝光时间而确定的。在另一些实现方式中,第一曝光量可以是基于获取第一图像时使用的第一曝光时间和第一曝光增益而确定的,第二曝光量是基于获取第二图像时使用的第二曝光时间和第二曝光增益而确定的。例如,第一曝光量可以是第一曝光时间和第一曝光增益的乘积,第二曝光量 可以是第二曝光时间和第二曝光增益的乘积。通过控制图像传感器的曝光时间和曝光增益,可以调整图像传感器在获取图像时使用的曝光量,从而能够获取具有不同动态范围的第一图像和第二图像。In some implementations, the first exposure amount may be determined based on a first exposure time used when acquiring the first image, and the second exposure amount may be determined based on a second exposure time used when acquiring the second image. In other implementations, the first exposure amount may be determined based on the first exposure time and the first exposure gain used when acquiring the first image, and the second exposure amount is determined based on the second exposure amount used when acquiring the second image Time and the second exposure gain are determined. For example, the first exposure amount may be the product of the first exposure time and the first exposure gain, and the second exposure amount may be the product of the second exposure time and the second exposure gain. By controlling the exposure time and exposure gain of the image sensor, the exposure used by the image sensor when acquiring images can be adjusted, so that the first image and the second image with different dynamic ranges can be acquired.
在步骤S104中,基于对应于第一曝光量的第一响应曲线和第一图像中至少一个第一像素的像素值,可以确定对应于第一图像中至少一个第一像素的像素位置的场景中的第一对象的灰阶值。In step S104, based on the first response curve corresponding to the first exposure and the pixel value of at least one first pixel in the first image, the scene corresponding to the pixel position of at least one first pixel in the first image can be determined The grayscale value of the first object.
在步骤S106中,基于对应于第二曝光量的第二响应曲线和第二图像中至少一个第二像素的像素值,可以确定对应于第二图像中至少一个第二像素的像素位置的场景中的第二对象的灰阶值。In step S106, based on the second response curve corresponding to the second exposure and the pixel value of at least one second pixel in the second image, the scene corresponding to the pixel position of at least one second pixel in the second image can be determined The grayscale value of the second object.
其中,步骤S104中使用的第一响应曲线可以对应于图像传感器的标定响应曲线指示的在第一曝光量下第一图像中至少一个第一像素的像素值与对应于第一像素的场景中的第一对象的灰阶值之间的第一映射关系。步骤S106中使用的第二响应曲线对应于标定响应曲线指示的在第二曝光量下第二图像中至少一个第二像素的像素值与对应于第二像素的场景中的第二对象的灰阶值之间的第二映射关系。其中,灰阶值指示场景中的对象的真实亮度。Wherein, the first response curve used in step S104 may correspond to the pixel value of at least one first pixel in the first image at the first exposure amount indicated by the calibration response curve of the image sensor and the pixel value of at least one first pixel in the scene corresponding to the first pixel. A first mapping relationship between grayscale values of the first object. The second response curve used in step S106 corresponds to the pixel value of at least one second pixel in the second image at the second exposure indicated by the calibration response curve and the gray scale of the second object in the scene corresponding to the second pixel A second mapping between values. Wherein, the gray scale value indicates the real brightness of the object in the scene.
利用上述第一响应曲线和第二响应曲线,可以基于第一图像中的像素值和第二图像中的像素值确定被拍摄的场景中的对象的真实亮度。对于第一图像中的任一像素,可以利用第一响应曲线确定用于该像素的灰阶值。类似地,对于第二图像中的任一像素,可以利用第二响应曲线确定用于该像素的灰阶值。由于第一响应曲线和第二响应曲线都指示在相应曝光量下像素值和场景中的对象的真实亮度之间的关系,因此,利用第一响应曲线可以确定对应于第一图像中图像区域内所有像素的第一灰阶图,利用第二响应曲线可以确定对应于第二图像中图像区域内所有像素的第二灰阶图。在不存在过曝的情况下,第一灰阶图和第二灰阶图应该是相同的,即都反映了图像区域中的对象在场景中的真实亮度。Using the above-mentioned first response curve and second response curve, it is possible to determine the true brightness of objects in the captured scene based on the pixel values in the first image and the pixel values in the second image. For any pixel in the first image, the gray scale value for the pixel can be determined using the first response curve. Similarly, for any pixel in the second image, the grayscale value for that pixel can be determined using the second response curve. Since both the first response curve and the second response curve indicate the relationship between the pixel value and the real brightness of the object in the scene at the corresponding exposure, the first response curve can be used to determine the corresponding For the first grayscale image of all pixels, the second grayscale image corresponding to all pixels in the image area in the second image can be determined by using the second response curve. In the absence of overexposure, the first grayscale image and the second grayscale image should be the same, that is, both reflect the real brightness of objects in the image area in the scene.
然而,如果图像中出现了过曝,超过某一亮度水平的像素在图像中都对应于相同的饱和像素值,因此将无法利用响应曲线确定过曝区域中像素对应的灰阶值。在这种情况下,可以通过对不同曝光量获取的图像确定的灰阶图进行融合来得到图像区域内像素对应的灰阶值。However, if there is overexposure in the image, pixels above a certain brightness level all correspond to the same saturated pixel value in the image, so the response curve cannot be used to determine the grayscale value corresponding to the pixel in the overexposed area. In this case, grayscale values corresponding to pixels in the image area can be obtained by fusing grayscale images determined from images acquired with different exposures.
可以利用更小曝光量获取的图像(如第二图像)确定过曝区域中像素对应的灰阶值。在一些实施例中,如果第二图像中也存在过曝,则可以使用具有第三曝光量的第三图像 来获取第二图像中的过曝区域的图像信息。其中第三曝光量可以小于第二曝光量。在不脱离本公开的实施例的原理的情况下,可以使用两个或更多个图像的像素值信息和对应的响应曲线来获得对应于图像区域内的像素的场景中的对象的真实亮度。在本公开中以第二图像不存在过曝区域为例描述本公开的原理,然而本领域技术人员可以理解的是,本公开的实施方案不限于此。The grayscale value corresponding to the pixel in the overexposed area may be determined by using an image acquired with a smaller exposure amount (eg, the second image). In some embodiments, if overexposure also exists in the second image, the image information of the overexposure area in the second image may be acquired using a third image with a third exposure. Wherein the third exposure amount may be smaller than the second exposure amount. Without departing from the principles of embodiments of the present disclosure, the pixel value information and corresponding response curves of two or more images may be used to obtain the true brightness of an object in the scene corresponding to a pixel within an image region. In the present disclosure, the principle of the present disclosure is described by taking no overexposed area in the second image as an example, but those skilled in the art can understand that the embodiments of the present disclosure are not limited thereto.
利用像素阈值可以确定第一图像中的过曝区域。例如,可以将第一图像中的高于像素阈值的像素的集合确定为过曝区域。也就是说,第一图像中的具有不高于像素阈值的至少一个第一像素的集合形成第一图像中的非过曝区域。其中,过曝区域与非过曝区域在图像区域中的位置不同。Overexposed areas in the first image can be determined using a pixel threshold. For example, a set of pixels above a pixel threshold in the first image may be determined as an overexposed area. That is to say, a set of at least one first pixel in the first image with a pixel threshold value not higher than the pixel threshold forms a non-overexposed area in the first image. Wherein, the positions of the over-exposure area and the non-over-exposure area in the image area are different.
在一些实施例中,第一图像中的至少一个第一像素具有不高于像素阈值的像素值,第二图像中的至少一个第二像素在图像区域中的位置不同于至少一个第一像素在图像区域中的位置。其中,像素阈值可以小于图像传感器的饱和像素值。其中图像传感器的饱和像素值可以是基于图像传感器的数据位宽确定的。对于具有k位数据位宽的图像传感器来说,饱和像素值可以是2的k次方。例如,对于具有12位数据位宽的图像传感器来说,饱和像素值可以是2 12=4096(即2的12次方)。 In some embodiments, at least one first pixel in the first image has a pixel value not higher than the pixel threshold, and at least one second pixel in the second image is located in a different position in the image area than the at least one first pixel in position in the image area. Wherein, the pixel threshold may be smaller than the saturation pixel value of the image sensor. The saturated pixel value of the image sensor may be determined based on the data bit width of the image sensor. For an image sensor with a data bit width of k bits, the saturated pixel value may be 2 to the k power. For example, for an image sensor with a data width of 12 bits, the saturated pixel value may be 2 12 =4096 (ie, 2 to the 12th power).
在一些实现方式中,上述像素阈值可以是基于图像传感器的饱和像素值和过曝系数确定的。在一些示例中,过曝系数可以是大于0并小于1的系数。因此像素阈值可以小于图像传感器的饱和像素值。在另一些实现方式中,像素阈值也可以是用户预先指定的小于饱和像素值的任何像素值。In some implementation manners, the aforementioned pixel threshold may be determined based on the saturated pixel value and the overexposure coefficient of the image sensor. In some examples, the overexposure factor may be a factor greater than zero and less than one. Thus the pixel threshold can be smaller than the saturation pixel value of the image sensor. In other implementation manners, the pixel threshold may also be any pixel value pre-specified by the user that is smaller than the saturation pixel value.
在步骤S108中,可以基于第一对象的灰阶值和第二对象的灰阶值确定目标图像。In step S108, the target image may be determined based on the grayscale value of the first object and the grayscale value of the second object.
利用步骤S104和步骤S106中确定的第一对象(对应于第一图像中的非过曝区域)的灰阶值和第二对象(对应于第一图像中的过曝区域)的灰阶值可以确定目标图像中的各个像素的像素值。Using the grayscale value of the first object (corresponding to the non-overexposed area in the first image) and the grayscale value of the second object (corresponding to the overexposed area in the first image) determined in step S104 and step S106 can be Determine the pixel value for each pixel in the target image.
在一些实施例中,可以利用反映射曲线对第一对象的灰阶值和第二对象的灰阶值进行反映射,以得到目标图像中第一对象的像素位置和第二对象的像素位置的目标像素值。其中,反映射曲线可以指示目标图像中各个像素位置处的目标像素值与灰阶值之间的映射关系。在反映射曲线中,灰阶值越大,目标像素值越大。在此不限制反映射曲线的具体形式。在另一些实施例中,可以利用任何其他数据处理方式对第一对象的灰阶值和第二对象的灰阶值进行处理以得到对应于各个灰阶值的图像像素值,只要满足灰阶值越大,目标像素值越大的约束条件即可。In some embodiments, the gray scale value of the first object and the gray scale value of the second object may be reverse mapped using an inverse mapping curve to obtain the pixel position of the first object in the target image and the pixel position of the second object Target pixel value. Wherein, the inverse mapping curve may indicate the mapping relationship between the target pixel value and the grayscale value at each pixel position in the target image. In the reverse mapping curve, the larger the grayscale value, the larger the target pixel value. The specific form of the inverse mapping curve is not limited here. In some other embodiments, any other data processing method can be used to process the grayscale value of the first object and the grayscale value of the second object to obtain image pixel values corresponding to each grayscale value, as long as the grayscale value The larger is the constraint condition that the target pixel value is larger.
针对彩色的目标图像,可以利用本公开提供的方式对各个颜色通道的图像的像素值进行处理,以获取各个颜色通道的目标像素值。通过融合各个颜色通道的目标像素值可以得到彩色的目标图像。For a color target image, the method provided by the present disclosure can be used to process the pixel values of the image of each color channel, so as to obtain the target pixel value of each color channel. A colored target image can be obtained by fusing the target pixel values of each color channel.
图2A示出了根据本公开的实施例的第一响应曲线和第二响应曲线的示例。Figure 2A shows an example of a first response curve and a second response curve according to an embodiment of the disclosure.
如图2A所示,第一响应曲线201指示了第一曝光量下图像像素值与场景中对象的灰阶值之间的映射关系,第二响应曲线202指示了第二曝光量下图像像素值与场景中对象的灰阶值之间的映射关系。As shown in FIG. 2A, the first response curve 201 indicates the mapping relationship between the image pixel value at the first exposure level and the grayscale value of the object in the scene, and the second response curve 202 indicates the image pixel value at the second exposure level. The mapping relationship with the grayscale value of objects in the scene.
饱和分界点203指示了第一图像中过曝区域和非过曝区域的分界点。在一些示例中,对于具有12位数据位宽的图像传感器来说,饱和分界点203的像素值可以是略小于图像传感器的饱和像素值4096的像素阈值。例如,像素阈值可以被确定为4090或任何其他合适的值。The saturation cutoff point 203 indicates the cutoff point between the overexposed area and the non-overexposed area in the first image. In some examples, for an image sensor having a data width of 12 bits, the pixel value of the saturation cutoff point 203 may be a pixel threshold value slightly smaller than the saturation pixel value of 4096 of the image sensor. For example, the pixel threshold may be determined to be 4090 or any other suitable value.
从图2A中可以看出,在不高于饱和分界点203的像素值的范围内,第一响应曲线201可以很好地表示图像像素值和灰阶值之间的映射关系。而在高于饱和分界点203的像素值的范围内,第一响应曲线201开始进入饱和区域,利用第一响应曲线201将无法确定比像素阈值更高的像素值对应的灰阶值,因为任何高于饱和分界点203的灰阶值都被映射为相同的饱和像素值。It can be seen from FIG. 2A that within the range of pixel values not higher than the saturation cut-off point 203 , the first response curve 201 can well represent the mapping relationship between image pixel values and grayscale values. In the range of pixel values higher than the saturation cut-off point 203, the first response curve 201 begins to enter the saturation region, and the gray scale value corresponding to the pixel value higher than the pixel threshold cannot be determined by using the first response curve 201, because any Gray scale values above the saturation cut-off point 203 are all mapped to the same saturated pixel value.
因此,对于第一图像中的过曝区域,可以利用第二响应曲线202确定过曝区域内的像素对应的灰阶值。可以看出,由于第二曝光量小于第一曝光量,第二响应曲线比第一响应曲线更晚进入饱和区域。在第一图像中位于过曝区域内的像素在第二图像中没有过曝。因此可以利用第二图像和用于第二图像的第二响应曲线202确定过曝区域中像素对应的场景中的对象的灰阶值。Therefore, for the overexposed area in the first image, the grayscale value corresponding to the pixel in the overexposed area can be determined by using the second response curve 202 . It can be seen that since the second exposure amount is smaller than the first exposure amount, the second response curve enters the saturation region later than the first response curve. Pixels located within the overexposed region in the first image are not overexposed in the second image. Therefore, the grayscale value of the object in the scene corresponding to the pixel in the overexposed area can be determined using the second image and the second response curve 202 for the second image.
图2B示出了根据本公开的实施例的第一响应曲线和第二响应曲线以及反映射曲线的示例。2B shows an example of first and second response curves and an inverse mapping curve according to an embodiment of the disclosure.
如图2B所示,曲线206和曲线207分别对应于第一曝光量下的第一图像的第一响应曲线和第二曝光量下的第二图像的第二响应曲线。曲线204对应于本公开的实施例的反映射曲线。As shown in FIG. 2B , the curve 206 and the curve 207 correspond to the first response curve of the first image at the first exposure level and the second response curve of the second image at the second exposure level, respectively. Curve 204 corresponds to the inverse mapping curve of an embodiment of the present disclosure.
在利用第一响应曲线206和第二响应曲线207分别确定用于图像区域中各个像素的灰阶值后,可以利用反映射曲线204确定目标图像中各个像素的像素值。其中灰阶值越高,像素的像素值越大。After using the first response curve 206 and the second response curve 207 to determine the grayscale value for each pixel in the image area, the inverse mapping curve 204 can be used to determine the pixel value of each pixel in the target image. The higher the grayscale value, the larger the pixel value of the pixel.
在一些实施例中,如图2B所示,可以基于第一响应曲线206的一部分确定反映射曲线204的至少一部分。在灰阶值小于临界点205的范围内,反映射曲线和第一响应曲线206可以是重合的。利用这种方法,对于灰阶值小于临界点205的对象,通过反映射曲线得到的目标图像中的像素值可以与通过图像传感器实际获取的像素值是相同的,从而能够以接近于真实采集的图像的方式生成目标图像的一部分。对于灰阶值不小于临界点205的对象,可以利用任何数学工具生成反映射曲线的具体形式,只要满足灰阶值越高则像素的像素值越大的约束条件即可。反映射曲线可以被实现为线性函数、多项式函数或任何可能的单调递增的函数。利用这种方式,在目标图像中,环境中具有更高的真实亮度的对象在图像中也相应被体现为具有更高的像素值,从而使得目标图像能够正确体现真实环境中的对象的亮度差异,并由此能够基于第一图像和第二图像生成具有更大动态范围的目标图像。In some embodiments, as shown in FIG. 2B , at least a portion of the inverse mapping curve 204 may be determined based on a portion of the first response curve 206 . In the range where the gray scale value is smaller than the critical point 205, the inverse mapping curve and the first response curve 206 may overlap. Using this method, for an object whose gray scale value is smaller than the critical point 205, the pixel value in the target image obtained by the inverse mapping curve can be the same as the pixel value actually acquired by the image sensor, so that the pixel value close to the real acquisition can be obtained. Image way to generate part of the target image. For objects whose gray scale value is not less than the critical point 205, any mathematical tool can be used to generate the specific form of the inverse mapping curve, as long as the constraint condition that the higher the gray scale value is, the larger the pixel value of the pixel is satisfied. The inverse mapping curve can be implemented as a linear function, a polynomial function, or any possible monotonically increasing function. In this way, in the target image, objects with higher real brightness in the environment are also reflected in the image with higher pixel values, so that the target image can correctly reflect the brightness difference of objects in the real environment , and thus a target image with a larger dynamic range can be generated based on the first image and the second image.
为了得到结合图1、图2A和图2B描述的实施例中涉及的描述图像像素值与环境中对象的灰阶值之间的映射关系的响应曲线,本公开还提供了一种用于标定图像传感器的响应曲线的方法。In order to obtain the response curve describing the mapping relationship between the image pixel value and the gray scale value of the object in the environment involved in the embodiment described in conjunction with FIG. 1 , FIG. 2A and FIG. 2B , the present disclosure also provides a method for calibrating the image The sensor response curve method.
图3示出了根据本公开的实施例的用于标定响应曲线的方法的示例性过程的流程图。FIG. 3 shows a flowchart of an exemplary process of a method for calibrating a response curve according to an embodiment of the present disclosure.
如图3所示,在步骤S302中,可以以第一标定曝光量获取包括第一标定灰阶组中的多个标定灰阶的第一标定图像。As shown in FIG. 3 , in step S302 , a first calibration image including a plurality of calibration grayscales in the first calibration grayscale group may be acquired with a first calibration exposure.
在步骤S304中,可以基于第一标定图像中分别对应于第一标定灰阶组中的多个标定灰阶的多个第一标定位置处的像素值确定第一标定曲线。其中,第一标定曲线可以指示第一标定曝光量下图像传感器采集的像素值与第一标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系。In step S304, a first calibration curve may be determined based on pixel values at multiple first calibration positions in the first calibration image corresponding to multiple calibration grayscales in the first calibration grayscale group. Wherein, the first calibration curve may indicate the mapping relationship between the pixel values collected by the image sensor at the first calibration exposure and the grayscale values of the multiple calibration grayscales in the first calibration grayscale group.
在步骤S306中,可以以不同于第一标定曝光量的第二标定曝光量获取包括第二标定灰阶组中的多个标定灰阶的第二标定图像。In step S306, a second calibration image including a plurality of calibration grayscales in the second calibration grayscale group may be acquired with a second calibration exposure different from the first calibration exposure.
在步骤S308中,可以基于第二标定图像中分别对应于第二标定灰阶组中的多个标定灰阶的多个第二标定位置处的像素值确定第二标定曲线。其中,第二标定曲线可以指示第二标定曝光量下图像传感器采集的像素值与第二标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系。In step S308, a second calibration curve may be determined based on pixel values at multiple second calibration positions respectively corresponding to multiple calibration gray levels in the second calibration gray scale group in the second calibration image. Wherein, the second calibration curve may indicate the mapping relationship between the pixel value collected by the image sensor at the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group.
在步骤S310中,可以基于第一标定曲线和第二标定曲线进行拟合,以得到图像传感器的响应曲线。其中响应曲线可以指示图像传感器采集的像素值与采集图像时使用的曝 光量以及包含多个标定灰阶的灰阶范围内的灰阶值之间的映射关系。其中,上述灰阶范围可以包含第一标定灰阶组和第二标定灰阶组中的至少一个。In step S310, fitting may be performed based on the first calibration curve and the second calibration curve to obtain a response curve of the image sensor. The response curve can indicate the mapping relationship between the pixel value collected by the image sensor, the exposure used when capturing the image, and the grayscale value in the grayscale range including multiple calibrated grayscales. Wherein, the above-mentioned grayscale range may include at least one of the first calibrated grayscale group and the second calibrated grayscale group.
利用本公开的实施例提供的用于标定图像传感器的响应曲线的方法,可以基于不同曝光量下采集的图像确定标定灰阶(即环境中的真实亮度)与所采集的图像中的像素值之间的映射关系,从而能够通过融合不同曝光量下的图像信息的方式确定预定的灰阶范围内环境中的真实亮度与所采集的图像中的像素值之间的映射关系。Using the method for calibrating the response curve of the image sensor provided by the embodiments of the present disclosure, the difference between the calibration gray scale (that is, the real brightness in the environment) and the pixel value in the collected image can be determined based on the images collected under different exposures. The mapping relationship between them, so that the mapping relationship between the real brightness in the environment in the predetermined gray scale range and the pixel value in the collected image can be determined by fusing the image information under different exposures.
以下详细描述方法300的各个步骤。Each step of the method 300 is described in detail below.
在步骤S302中,以第一标定曝光量获取包括第一标定灰阶组中的多个标定灰阶的第一标定图像。其中第一标定图像是由图像传感器获取的原始数据(raw图)。In step S302, a first calibration image including a plurality of calibration grayscales in the first calibration grayscale group is acquired with a first calibration exposure. Wherein the first calibration image is the raw data (raw image) acquired by the image sensor.
在一些实施例中,可以通过以第一标定曝光量获取预定灰阶卡的图像作为第一标定图像。其中,预定灰阶卡可以包括以预定灰阶变化量变化的20阶灰阶。在一些示例中,预定灰阶卡中的灰阶可以是均匀变化的。In some embodiments, an image of a predetermined grayscale card may be acquired at a first calibration exposure as the first calibration image. Wherein, the predetermined gray scale card may include 20 gray scales that change with a predetermined gray scale variation. In some examples, the gray scales in the predetermined gray scale card may vary uniformly.
在步骤S304中,可以基于第一标定图像中分别对应于第一标定灰阶组中的多个标定灰阶的多个第一标定位置处的像素值确定第一标定曲线。In step S304, a first calibration curve may be determined based on pixel values at multiple first calibration positions in the first calibration image corresponding to multiple calibration grayscales in the first calibration grayscale group.
基于步骤S302中获取的第一标定图像,可以针对每个标定灰阶在第一标定图像中的像素值。通过确定第一标定图像中对应于各个标定灰阶的各个第一标定位置并读取各个第一标定位置处的像素值,可以确定每个标定灰阶在第一标定图像中的像素值。可以通过对各个标定灰阶对应的像素值进行拟合得到第一标定曲线,其中第一标定曲线指示第一标定曝光量下图像传感器采集的像素值与第一标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系。Based on the first calibration image acquired in step S302, the pixel value in the first calibration image for each calibration gray scale can be calibrated. By determining each first calibration position corresponding to each calibration gray scale in the first calibration image and reading the pixel value at each first calibration position, the pixel value of each calibration gray scale in the first calibration image can be determined. The first calibration curve can be obtained by fitting the pixel values corresponding to each calibration gray scale, wherein the first calibration curve indicates the pixel value collected by the image sensor under the first calibration exposure and the multiple calibration values in the first calibration gray scale group The mapping relationship between the grayscale values of the grayscale.
在步骤S306中,可以以不同于第一标定曝光量的第二标定曝光量获取包括第二标定灰阶组中的第二标定灰阶组中的多个标定灰阶的第二标定图像。其中第二标定图像是由图像传感器获取的原始数据。In step S306, a second calibration image including a plurality of calibration grayscales in the second calibration grayscale group in the second calibration grayscale group may be acquired with a second calibration exposure different from the first calibration exposure. Wherein the second calibration image is the original data acquired by the image sensor.
在一些实现方式中,步骤S304和步骤S306中使用的第一标定曝光量和第二标定曝光量可以是基于获取图像时使用的曝光时间而确定的。其中,以CMOS图像每秒最多采集30帧图像为例,曝光时间最长可以是33ms。第一标定曝光量可以大于第二标定曝光量,也可以小于第二标定曝光量。在一些示例性的标定过程中,可以将最小标定曝光时间确定为1ms,并且以1ms的增量逐渐增加获取图像时使用的曝光时间。例如,第一标定曝光量的曝光时间可以是1ms,第二标定曝光量的曝光时间可以是2ms。又例如,第一标定曝光量的曝光时间可以是20ms,第二标定曝光量的曝光时间可以是3ms。在此不限 制第一标定曝光量和第二标定曝光量的具体曝光时间,本领域技术人员可以根据实际情况选择合适的曝光时间。In some implementations, the first calibration exposure and the second calibration exposure used in step S304 and step S306 may be determined based on the exposure time used when acquiring the image. Among them, taking a CMOS image at most 30 frames per second as an example, the longest exposure time can be 33ms. The first calibrated exposure amount may be greater than the second calibrated exposure amount, or may be smaller than the second calibrated exposure amount. In some exemplary calibration processes, the minimum calibration exposure time can be determined as 1 ms, and the exposure time used when acquiring images is gradually increased in increments of 1 ms. For example, the exposure time of the first calibration exposure amount may be 1 ms, and the exposure time of the second calibration exposure amount may be 2 ms. For another example, the exposure time of the first calibration exposure amount may be 20 ms, and the exposure time of the second calibration exposure amount may be 3 ms. The specific exposure time of the first calibration exposure amount and the second calibration exposure amount is not limited here, and those skilled in the art can select an appropriate exposure time according to the actual situation.
在另一些实现方式中,步骤S304和步骤S306中使用的第一标定曝光量和第二标定曝光量可以是基于获取图像时使用的曝光时间和曝光增益。例如,第一标定曝光量可以是第一标定曝光时间和第一标定曝光增益的乘积,第二标定曝光量可以是第二标定曝光时间和第二标定曝光增益的乘积。在一些示例性的标定过程中,可以在保持曝光增益为1的情况下,首先通过增加曝光时间来增加获取图像时使用的曝光量。在达到最大曝光时间的情况下,保持曝光时间不变并同时逐渐改变曝光增益至最大曝光增益。In some other implementation manners, the first calibration exposure amount and the second calibration exposure amount used in step S304 and step S306 may be based on the exposure time and exposure gain used when acquiring the image. For example, the first calibrated exposure amount may be the product of the first calibrated exposure time and the first calibrated exposure gain, and the second calibrated exposure amount may be the product of the second calibrated exposure time and the second calibrated exposure gain. In some exemplary calibration processes, under the condition that the exposure gain is kept at 1, the exposure used when acquiring the image can be increased by first increasing the exposure time. In the case of reaching the maximum exposure time, keep the exposure time constant while gradually changing the exposure gain to the maximum exposure gain.
在步骤S308中,可以基于第二标定图像中分别对应于第二标定灰阶组中的多个标定灰阶的多个第二标定位置处的像素值确定第二标定曲线。其中,第二标定曲线可以指示第二标定曝光量下图像传感器采集的像素值与第二标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系。In step S308, a second calibration curve may be determined based on pixel values at multiple second calibration positions respectively corresponding to multiple calibration gray levels in the second calibration gray scale group in the second calibration image. Wherein, the second calibration curve may indicate the mapping relationship between the pixel value collected by the image sensor at the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group.
与步骤S304相似,可以确定第二标定图像中对应于各个标定灰阶的各个第二标定位置并读取各个第二标定位置处的像素值,可以确定每个标定灰阶在第二标定图像中的像素值。可以通过对各个标定灰阶对应的像素值进行拟合得到第二标定曲线,其中第二标定曲线指示第二标定曝光量下图像传感器采集的像素值与第二标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系。Similar to step S304, each second calibration position corresponding to each calibration grayscale in the second calibration image can be determined and the pixel value at each second calibration position can be read, and it can be determined that each calibration grayscale is in the second calibration image pixel value. The second calibration curve can be obtained by fitting the pixel values corresponding to each calibration gray scale, wherein the second calibration curve indicates the pixel value collected by the image sensor under the second calibration exposure and the multiple calibration values in the second calibration gray scale group. The mapping relationship between the grayscale values of the grayscale.
在步骤S310中,可以基于第一标定曲线和第二标定曲线进行拟合,以得到图像传感器的响应曲线。其中响应曲线可以指示图像传感器采集的像素值与采集图像时使用的曝光量以及包含多个标定灰阶的灰阶范围内的灰阶值之间的映射关系。In step S310, fitting may be performed based on the first calibration curve and the second calibration curve to obtain a response curve of the image sensor. The response curve may indicate the mapping relationship between the pixel values collected by the image sensor, the exposure used when capturing the image, and the grayscale values within the grayscale range including multiple calibrated grayscales.
在一些实施例中,第一标定灰阶组中的多个标定灰阶和第二标定灰阶组中的多个标定灰阶可以是相同的。在一些实现方式中,第一标定灰阶组可以包括从基准灰阶值开始以预定灰阶变化量变化的多个标定灰阶,第二标定灰阶组包括从基准灰阶值开始以相同预定灰阶变化量变化的相同数量的多个标定灰阶。由于第一标定图像和第二标定图像中包含的标定灰阶是相同的,因此,利用第一标定曲线和第二标定曲线可以确定针对同一灰阶值在不同曝光量下采集的图像中对应的不同像素值。In some embodiments, the multiple calibration gray scales in the first calibration gray scale group and the multiple calibration gray scales in the second calibration gray scale group may be the same. In some implementations, the first calibration grayscale group may include a plurality of calibration grayscales that start from a reference grayscale value with a predetermined grayscale variation, and the second calibration grayscale group includes a plurality of calibration grayscales that change from a reference grayscale value with the same predetermined Multiple calibrated grayscales with the same amount of grayscale variation. Since the calibration gray scales contained in the first calibration image and the second calibration image are the same, the first calibration curve and the second calibration curve can be used to determine the corresponding different pixel values.
在另一些实施例中,第一标定灰阶组中的多个标定灰阶和第二标定灰阶组中的多个标定灰阶可以是不同的。例如,第一标定灰阶组可以包括从第一基准灰阶值开始以第一预定灰阶变化量变化的第一数量的多个标定灰阶。第二标定灰阶组可以包括从第二基准灰阶值开始以第二预定灰阶变化量变化的第二数量的多个标定灰阶。其中各种第一基准灰阶值和第二基准灰阶值 可以是相同的,也可以是不同的。第一预定灰阶变化量和第二预定灰阶变化量可以是相同的,也可以是不同的。第一数量和第二数量可以是相同的,也可以是不同的。In some other embodiments, the multiple calibration gray scales in the first calibration gray scale group and the multiple calibration gray scales in the second calibration gray scale group may be different. For example, the first calibration grayscale group may include a first number of multiple calibration grayscales that change with a first predetermined grayscale variation from the first reference grayscale value. The second calibration grayscale group may include a second number of multiple calibration grayscales varying by a second predetermined grayscale variation from the second reference grayscale value. The various first reference gray scale values and the second reference gray scale values may be the same or different. The first predetermined gray scale change amount and the second predetermined gray scale change amount may be the same or different. The first quantity and the second quantity may be the same or different.
在一些实施例中,响应曲线对应的灰阶范围可以包括第一标定灰阶组中的多个标定灰阶和/或第二标定灰阶组中的多个标定灰阶。在一些实现方式中,响应曲线对应的灰阶范围可以大于第一标定灰阶组和/或第二标定灰阶组的灰阶范围。也就是说,响应曲线对应的灰阶范围的最大灰阶值可以大于第一标定灰阶组的中最大标定灰阶值和第二标定灰阶组中的最大标定灰阶值。在一些示例中,响应曲线对应的灰阶范围可以包括基于预定灰阶变化量的60阶灰阶。在另一些示例中,响应曲线对应的灰阶范围也包括基于预定灰阶变化量的任何其他数量的灰阶,只要响应曲线对应的灰阶范围不小于第一标定灰阶组和/或第二标定灰阶组的灰阶范围即可。In some embodiments, the grayscale range corresponding to the response curve may include multiple calibration grayscales in the first calibration grayscale group and/or multiple calibration grayscales in the second calibration grayscale group. In some implementation manners, the grayscale range corresponding to the response curve may be greater than the grayscale range of the first calibration grayscale group and/or the second calibration grayscale group. That is to say, the maximum grayscale value of the grayscale range corresponding to the response curve may be greater than the maximum standardized grayscale value in the first calibration grayscale group and the maximum calibration grayscale value in the second calibration grayscale group. In some examples, the gray scale range corresponding to the response curve may include 60 gray scales based on a predetermined gray scale change amount. In some other examples, the grayscale range corresponding to the response curve also includes any other number of grayscales based on the predetermined grayscale variation, as long as the grayscale range corresponding to the response curve is not smaller than the first calibration grayscale group and/or the second Just calibrate the gray scale range of the gray scale group.
在步骤S310中,基于步骤S306和步骤S308中确定的第一标定曲线和第二标定曲线,可以基于图像传感器的物理互易性(reciprocity)的假设,可以通过平移测量得到的标定曲线的方式将标定曲线覆盖的灰阶范围进行延伸,从而在无需实际拍摄更大范围的灰阶值的情况下,能够得到覆盖比预定的标定灰阶组更大的灰阶范围内的标定曲线。In step S310, based on the first calibration curve and the second calibration curve determined in step S306 and step S308, based on the assumption of physical reciprocity (reciprocity) of the image sensor, the calibration curve obtained by translation measurement can be translated into The grayscale range covered by the calibration curve is extended, so that a calibration curve covering a grayscale range larger than the predetermined calibration grayscale group can be obtained without actually photographing a larger range of grayscale values.
图4A示出了根据本公开的实施例的标定曲线的示例。Figure 4A shows an example of a calibration curve according to an embodiment of the present disclosure.
如图4A所示,通过不断改变图像传感器获取图像时使用的曝光量,可以得到一系列指示图像像素值和灰阶值的映射关系的标定曲线。其中,图4A中示出的各条曲线是在不同的曝光量下测得的。对于同一灰阶值,曝光量越高,则图像传感器获取的图像中该灰阶值对应的像素值则越高。在图4A示出的示例中。标定曲线401对应的曝光量大于标定曲线402对应的曝光量,标定曲线402对应的曝光量大于标定曲线403对应的曝光量。As shown in FIG. 4A , by continuously changing the exposure used by the image sensor to acquire images, a series of calibration curves indicating the mapping relationship between image pixel values and gray scale values can be obtained. Wherein, each curve shown in FIG. 4A is measured under different exposure amounts. For the same grayscale value, the higher the exposure, the higher the pixel value corresponding to the grayscale value in the image captured by the image sensor. In the example shown in Figure 4A. The exposure amount corresponding to the calibration curve 401 is greater than the exposure amount corresponding to the calibration curve 402 , and the exposure amount corresponding to the calibration curve 402 is greater than the exposure amount corresponding to the calibration curve 403 .
在图4A示出的示例中,针对标定图像中能够直接获取的20阶灰阶,能够通过图像传感器拍摄的图像直接获得20阶灰阶范围内的各条标定曲线。In the example shown in FIG. 4A , for the 20 gray scales that can be directly acquired in the calibration image, each calibration curve within the range of 20 gray scales can be directly obtained through the image captured by the image sensor.
在一些实施例中,基于图像传感器的物理互易性的假设,可以在图4A中获得的各条标定曲线的基础上,通过平移曲线对标定曲线进行理论延伸,从而获得在更大的灰阶范围内可用的标定曲线。In some embodiments, based on the assumption of the physical reciprocity of the image sensor, on the basis of each calibration curve obtained in FIG. 4A , the calibration curve can be theoretically extended by shifting the curve, so as to obtain a larger gray scale Calibration curves available in the range.
图4B示出了根据本公开的实施例的延伸的标定曲线的示例。Figure 4B shows an example of an extended calibration curve according to an embodiment of the disclosure.
如图4B所示,对于曝光量较低的曲线来说,即使是标定灰阶中最亮的灰阶值为20的情况下,图像中的灰阶20所对应的像素值仍然较低并且距离饱和区域较远。在这种情况下,可以通过将更高曝光量的标定曲线的一部分进行平移并与更低曝光量的标定曲线 进行拼接,可以得到在更低曝光量下标定曲线从灰阶20至更高灰阶(直至饱和区域)的曲线。As shown in Figure 4B, for the low exposure curve, even when the brightest grayscale value in the calibration grayscale is 20, the pixel value corresponding to the grayscale 20 in the image is still low and the distance The saturation region is farther away. In this case, by shifting part of the higher exposure calibration curve and stitching it with the lower exposure calibration curve, you can get the calibration curve from gray scale 20 to higher gray at the lower exposure. order (up to the saturation region) curve.
在一些实施例中,可以利用第一标定曲线对第二标定曲线进行延伸。In some embodiments, the first calibration curve can be used to extend the second calibration curve.
可以基于第二标定曲线确定第二标定曝光量下所述第二标定灰阶组的最大标定灰阶值对应的最大像素值。基于第二标定曲线上对应的最大像素值,将第一标定曲线中高于第二标定曲线的最大像素值的曲线部分与第二标定曲线拼接,以得到经调整的第二标定曲线,其中经调整的第二标定曲线指示灰阶范围中高于最大标定灰阶值的至少一个灰阶值在第二标定曝光量下与图像传感器采集的像素值之间的映射关系。基于第一标定曲线和第二标定曲线确定图像传感器的响应曲线。The maximum pixel value corresponding to the maximum calibrated grayscale value of the second calibrated grayscale group under the second calibrated exposure amount may be determined based on the second calibration curve. Based on the corresponding maximum pixel value on the second calibration curve, the curve portion of the first calibration curve higher than the maximum pixel value of the second calibration curve is spliced with the second calibration curve to obtain an adjusted second calibration curve, wherein the adjusted The second calibration curve indicates the mapping relationship between at least one grayscale value higher than the maximum calibrated grayscale value in the grayscale range and the pixel value collected by the image sensor under the second calibrated exposure. A response curve of the image sensor is determined based on the first calibration curve and the second calibration curve.
如图4B所示,针对标定曲线407,可以确定标定曲线407在灰阶20处的最大像素值,并将将标定曲线404上大于标定曲线407的最大像素值的曲线部分平移到灰阶值20处以形成标定曲线404’,通过将标定曲线404’和标定曲线407在灰阶值20处进行拼接,可以将标定曲线407扩展到灰阶值大于20的灰阶范围内并得到标定曲线407的饱和区域。类似地,可以将标定曲线405平移后得到的标定曲线405’与标定曲线408在灰阶值20处进行拼接,将标定曲线406平移后得到的标定曲线406’与标定曲线409在灰阶值20处进行拼接。根据图像传感器的物理互易性,用于对第二标定曲线进行延伸的第一标定曲线可以是任意的,只要第一标定曲线对应的第一标定曝光量大于第二标定曲线对应的第二标定曝光量即可。在一些情况下,也可以将对应于不同曝光量的多于两条标定曲线进行拼接。As shown in FIG. 4B , for the calibration curve 407, the maximum pixel value of the calibration curve 407 at the gray scale 20 can be determined, and the part of the curve on the calibration curve 404 that is greater than the maximum pixel value of the calibration curve 407 can be translated to the gray scale value 20 To form the calibration curve 404', by splicing the calibration curve 404' and the calibration curve 407 at the gray scale value 20, the calibration curve 407 can be extended to the gray scale range with a gray scale value greater than 20 and the saturation of the calibration curve 407 can be obtained area. Similarly, the calibration curve 405' and the calibration curve 408 obtained after the calibration curve 405 is shifted can be spliced at the gray scale value of 20, and the calibration curve 406' and the calibration curve 409 obtained after the calibration curve 406 is translated at the gray scale value of 20 splicing. According to the physical reciprocity of the image sensor, the first calibration curve used to extend the second calibration curve can be arbitrary, as long as the first calibration exposure corresponding to the first calibration curve is greater than the second calibration corresponding to the second calibration curve Exposure is fine. In some cases, more than two calibration curves corresponding to different exposures can also be spliced.
在确定了对应于包含标定灰阶的灰阶范围内的各条标定曲线后,可以利用灰阶范围内的各条标定曲线进行拟合以得到图像传感器的响应曲线。例如,可以对经调整的第二标定曲线与第一标定曲线进行拟合来得到图像传感器的响应曲线。After each calibration curve corresponding to the gray scale range including the calibration gray scale is determined, each calibration curve within the gray scale range can be used for fitting to obtain a response curve of the image sensor. For example, the adjusted second calibration curve can be fitted with the first calibration curve to obtain the response curve of the image sensor.
在一些实施例中,图像传感器的响应曲线可以被表示为图像像素值关于采集图像时的曝光量以及被采集的对象的灰阶值的函数。可以利用包括第一标定曲线、经调整的第二标定曲线在内的多个标定曲线来拟合响应曲线需要的参数。In some embodiments, the response curve of the image sensor can be expressed as a function of the image pixel value with respect to the exposure when the image was captured and the gray scale value of the captured object. Multiple calibration curves including the first calibration curve and the adjusted second calibration curve can be used to fit the parameters required by the response curve.
可以利用公式(1)表示图像传感器的响应曲线:The response curve of the image sensor can be represented by formula (1):
Figure PCTCN2022123779-appb-000001
Figure PCTCN2022123779-appb-000001
其中I表示图像传感器采集的像素值,S表示灰阶值,E表示曝光量,a、γ、b、δ、w为常数。Among them, I represents the pixel value collected by the image sensor, S represents the grayscale value, E represents the exposure amount, and a, γ, b, δ, and w are constants.
图5A示出了根据本公开的实施例的图像处理过程的示例。FIG. 5A shows an example of an image processing procedure according to an embodiment of the present disclosure.
如图5A所示,在步骤S501中,可以利用图像传感器510以多个标定曝光量采集多个标定图像。根据多个标定图像中标定灰阶和图像像素值之间的预定关系,可以确定标定响应曲线530。其中标定响应曲线530指示图像传感器采集的像素值与采集图像时使用的曝光量以及包含多个标定灰阶的灰阶范围内的灰阶值之间的映射关系。As shown in FIG. 5A , in step S501 , the image sensor 510 may be used to capture multiple calibration images with multiple calibration exposures. A calibration response curve 530 may be determined according to a predetermined relationship between calibration gray scales and image pixel values in a plurality of calibration images. The calibration response curve 530 indicates the mapping relationship between the pixel values captured by the image sensor, the exposure used when capturing the image, and the gray scale values within the gray scale range including multiple calibration gray scales.
在步骤S502中,图像传感器510可以在不同的曝光量下分别采集第一图像520-1、第二图像520-2……以及第n图像502-n,其中n是大于2的整数。In step S502 , the image sensor 510 may capture the first image 520 - 1 , the second image 520 - 2 . . . and the nth image 502 - n under different exposures, where n is an integer greater than 2.
在步骤S503中,可以利用标定响应曲线530对第一图像520-1、第二图像520-2……以及第n图像502-n分别进行处理。根据第一图像520-1、第二图像520-2……以及第n图像520-n对应的曝光量以及图像中各个像素的像素值,可以利用标定响应曲线530确定分别对应于第一图像520-1、第二图像520-2……以及第n图像520-n的第一亮度映射图像540-1、第二亮度映射图像540-2……以及第n亮度映射图像540-n,其中第一亮度映射图像540-1、第二亮度映射图像540-2……以及第n亮度映射图像540-n指示图像区域内每个像素点对应的场景中的对象的灰阶值,即真实亮度。In step S503 , the first image 520 - 1 , the second image 520 - 2 . . . and the nth image 502 - n can be processed respectively by using the calibration response curve 530 . According to the exposure amount corresponding to the first image 520-1, the second image 520-2 ... and the nth image 520-n and the pixel value of each pixel in the image, the calibration response curve 530 can be used to determine the -1, the second image 520-2...and the first brightness-mapped image 540-1 of the nth image 520-n, the second brightness-mapped image 540-2...and the n-th brightness-mapped image 540-n, wherein A luminance mapping image 540-1, a second luminance mapping image 540-2... and an n th luminance mapping image 540-n indicate the grayscale value of the object in the scene corresponding to each pixel in the image area, that is, the real luminance.
图5B示出了根据本公开的实施例的图像传感器采集的图像的示例,可以看出,在图5B中存在过曝区域,通过原始图像无法获取过曝区域中的图像细节。FIG. 5B shows an example of an image captured by an image sensor according to an embodiment of the present disclosure. It can be seen that there is an overexposed area in FIG. 5B , and image details in the overexposed area cannot be obtained through the original image.
在步骤S504中,可以基于第一图像520-1、第二图像520-2……以及第n图像520-n的像素值对第一亮度映射图像540-1、第二亮度映射图像540-2……以及第n亮度映射图像540-n进行融合,以得到融合亮度映射图550。其中,可以从具有最高曝光量的图像开始进行处理。以第一图像具有最高曝光量为例,可以将第一图像520-1中具有不高于像素阈值的至少一个第一像素(即非过曝区域)对应的第一亮度映射图像540-1中的灰阶值确定为融合亮度映射图550中对应像素的灰阶值。对于第一图像520-1中的过曝区域,可以使用具有更小曝光量的图像(如第二图像)对应的亮度映射图像确定过曝区域中至少部分像素的灰阶值。以此类推,直到融合亮度映射图550中的所有像素的灰阶值被确定。In step S504, based on the pixel values of the first image 520-1, the second image 520-2... and the nth image 520-n, the first brightness mapping image 540-1, the second brightness mapping image 540-2 ... and the nth brightness map image 540 - n are fused to obtain a fused brightness map 550 . Among them, the processing can start from the image with the highest exposure. Taking the first image with the highest exposure as an example, the first brightness mapping image 540-1 corresponding to at least one first pixel (that is, the non-overexposed area) in the first image 520-1 that is not higher than the pixel threshold can be The grayscale value of is determined as the grayscale value of the corresponding pixel in the fused brightness map 550 . For the overexposed area in the first image 520-1, grayscale values of at least some of the pixels in the overexposed area may be determined using a brightness mapping image corresponding to an image with a smaller exposure (such as the second image). By analogy, until the grayscale values of all pixels in the fused brightness map 550 are determined.
在步骤S505中,可以利用融合亮度映射图550中指示的像素的灰阶值确定目标图像560。其中,融合亮度映射图550中具有更高灰阶值的像素在目标图像中具有更高的像素值。In step S505 , the target image 560 may be determined by using the grayscale values of the pixels indicated in the fused brightness map 550 . Wherein, pixels with higher grayscale values in the fused brightness map 550 have higher pixel values in the target image.
图5C示出了根据本公开的示例的目标图像的示例。其中,图5C示出的图像是基于图5B中示出的图像确定的高动态范围的目标图像。如图5C所示,通过融合其他图像的 信息,图5B中的过曝区域中的图像细节被恢复。因此图5C相对于图5B具有更好的视觉效果。FIG. 5C illustrates an example of a target image according to an example of the present disclosure. Wherein, the image shown in FIG. 5C is a high dynamic range target image determined based on the image shown in FIG. 5B . As shown in Figure 5C, by fusing information from other images, the image details in the overexposed area in Figure 5B are restored. Therefore, Fig. 5C has a better visual effect than Fig. 5B.
根据本公开的实施例,还提供了一种图像处理装置。图像处理装置可以包括图像获取单元、第一灰阶确定单元、第二灰阶确定单元以及目标图像确定单元,其中,图像获取单元可以配置成获取针对同一场景拍摄的第一图像和第二图像,其中所述第一图像的第一曝光量大于所述第二图像的第二曝光量,所述第一图像和所述第二图像具有相同的图像区域。第一灰阶确定单元可以配置成基于对应于所述第一曝光量的第一响应曲线和所述第一图像中至少一个第一像素的像素值,确定对应于所述第一图像中至少一个第一像素的像素位置的场景中的第一对象的灰阶值。第二灰阶确定单元可以配置成基于对应于所述第二曝光量的第二响应曲线和所述第二图像中至少一个第二像素的像素值,确定对应于所述第二图像中至少一个第二像素的像素位置的场景中的第二对象的灰阶值。目标图像确定单元可以配置成基于所述第一对象的灰阶值和所述第二对象的灰阶值确定目标图像。According to an embodiment of the present disclosure, an image processing device is also provided. The image processing device may include an image acquisition unit, a first grayscale determination unit, a second grayscale determination unit, and a target image determination unit, wherein the image acquisition unit may be configured to acquire the first image and the second image taken for the same scene, Wherein the first exposure amount of the first image is greater than the second exposure amount of the second image, and the first image and the second image have the same image area. The first grayscale determination unit may be configured to determine the pixel value corresponding to at least one first pixel in the first image based on the first response curve corresponding to the first exposure amount and the pixel value of at least one first pixel in the first image. The grayscale value of the first object in the scene at the pixel position of the first pixel. The second grayscale determination unit may be configured to determine the pixel value corresponding to at least one second pixel in the second image based on the second response curve corresponding to the second exposure amount and the pixel value of at least one second pixel in the second image. The grayscale value of the second object in the scene at the pixel position of the second pixel. The target image determining unit may be configured to determine the target image based on the grayscale value of the first object and the grayscale value of the second object.
这里,图像处理装置的上述各个单元的操作分别与前面描述的步骤S102~S108的操作类似,在此不再赘述。Here, the operations of the above units of the image processing device are similar to the operations of steps S102-S108 described above, and will not be repeated here.
根据本公开的实施例,还提供了一种用于标定图像传感器的响应曲线的装置。用于标定图像传感器的响应曲线的装置可以包括第一标定图像获取单元、第一标定曲线确定单元、第二标定图像获取单元、第二标定曲线确定单元以及响应曲线确定单元。其中,第一标定图像获取单元可以配置成以第一标定曝光量获取包括第一标定灰阶组中的多个标定灰阶的第一标定图像。第一标定曲线确定单元可以配置成基于所述第一标定图像中分别对应于所述第一标定灰阶组中的多个标定灰阶的多个第一标定位置处的像素值确定第一标定曲线,所述第一标定曲线指示所述第一标定曝光量下图像传感器采集的像素值与所述第一标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系。第二标定图像获取单元可以配置成以不同于所述第一标定曝光量的第二标定曝光量获取包括第二标定灰阶组中的多个标定灰阶的第二标定图像。第二标定曲线确定单元可以配置成基于所述第二标定图像中分别对应于所述第二标定灰阶组中的多个标定灰阶的多个第二标定位置处的像素值确定第二标定曲线,所述第二标定曲线指示所述第二标定曝光量下图像传感器采集的像素值与所述第二标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系。响应曲线确定单元可以配置成基于所述第一标定曲线和所述第二标定曲线确定所述图像传感器的响应曲线,其中所述响应曲线指示图像传感器采集的像素值与采集图像时使用的曝光量以及包含所述 第一标定灰阶组和所述第二标定灰阶组中的至少一个的多个标定灰阶的灰阶范围内的灰阶值之间的映射关系。According to an embodiment of the present disclosure, a device for calibrating a response curve of an image sensor is also provided. The apparatus for calibrating a response curve of an image sensor may include a first calibration image acquisition unit, a first calibration curve determination unit, a second calibration image acquisition unit, a second calibration curve determination unit, and a response curve determination unit. Wherein, the first calibration image acquiring unit may be configured to acquire a first calibration image including a plurality of calibration grayscales in the first calibration grayscale group with a first calibration exposure. The first calibration curve determining unit may be configured to determine the first calibration based on pixel values at multiple first calibration positions in the first calibration image respectively corresponding to multiple calibration grayscales in the first calibration grayscale group Curve, the first calibration curve indicates the mapping relationship between the pixel value collected by the image sensor under the first calibration exposure and the grayscale values of multiple calibration grayscales in the first calibration grayscale group. The second calibration image acquisition unit may be configured to acquire a second calibration image including a plurality of calibration grayscales in the second calibration grayscale group with a second calibration exposure different from the first calibration exposure. The second calibration curve determination unit may be configured to determine the second calibration based on pixel values at multiple second calibration positions in the second calibration image corresponding to multiple calibration grayscales in the second calibration grayscale group. Curve, the second calibration curve indicates the mapping relationship between the pixel value collected by the image sensor at the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group. The response curve determination unit may be configured to determine the response curve of the image sensor based on the first calibration curve and the second calibration curve, wherein the response curve indicates the pixel values captured by the image sensor and the exposure used when capturing the image and a mapping relationship between grayscale values within a grayscale range of multiple calibrated grayscales including at least one of the first calibrated grayscale group and the second calibrated grayscale group.
这里,用于标定图像传感器的响应曲线的装置的上述各个单元的操作分别与前面描述的步骤S302~S310的操作类似,在此不再赘述。Here, the operations of the above units of the apparatus for calibrating the response curve of the image sensor are similar to the operations of steps S302-S310 described above, and will not be repeated here.
根据本公开的另一方面,还提供一种电子设备,包括:处理器;以及存储程序的存储器,所述程序包括指令,所述指令在由所述处理器执行时使所述处理器执行上述的方法。According to another aspect of the present disclosure, there is also provided an electronic device, including: a processor; and a memory storing a program, the program including instructions, which when executed by the processor cause the processor to perform the above-mentioned Methods.
根据本公开的另一方面,还提供一种存储程序的非暂态计算机可读存储介质,所述程序包括指令,所述指令在由电子设备的处理器执行时,致使所述电子设备执行上述的方法。According to another aspect of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing a program, the program includes instructions, and the instructions, when executed by a processor of an electronic device, cause the electronic device to perform the above-mentioned Methods.
根据本公开的另一方面,还提供一种计算机程序产品,包括计算机程序,所述计算机程序再被处理器执行时实现上述的方法。According to another aspect of the present disclosure, there is also provided a computer program product, including a computer program, and when the computer program is executed by a processor, the above method is implemented.
参见图6,现将描述电子设备600,其是可以应用于本公开的各方面的硬件设备(电子设备)的示例。电子设备600可以是被配置为执行处理和/或计算的任何机器,可以是但不限于工作站、服务器、台式计算机、膝上型计算机、平板计算机、个人数字助理、机器人、智能电话、车载计算机或其任何组合。上述图像处理方法100以及用于标定响应曲线的方法300可以全部或至少部分地由电子设备600或类似设备或系统实现。Referring to FIG. 6 , an electronic device 600 will now be described, which is an example of a hardware device (electronic device) that can be applied to aspects of the present disclosure. Electronic device 600 may be any machine configured to perform processing and/or computation, which may be, but is not limited to, a workstation, server, desktop computer, laptop computer, tablet computer, personal digital assistant, robot, smartphone, vehicle-mounted computer, or any combination thereof. The above-mentioned image processing method 100 and the method 300 for calibrating the response curve may be fully or at least partially implemented by the electronic device 600 or similar devices or systems.
电子设备600可以包括(可能经由一个或多个接口)与总线602连接或与总线602通信的元件。例如,电子设备600可以包括总线602、一个或多个处理器604、一个或多个输入设备606以及一个或多个输出设备608。一个或多个处理器604可以是任何类型的处理器,并且可以包括但不限于一个或多个通用处理器和/或一个或多个专用处理器(例如特殊处理芯片)。输入设备606可以是能向电子设备600输入信息的任何类型的设备,并且可以包括但不限于鼠标、键盘、触摸屏、麦克风和/或遥控器。输出设备608可以是能呈现信息的任何类型的设备,并且可以包括但不限于显示器、扬声器、视频/音频输出终端、振动器和/或打印机。电子设备600还可以包括非暂时性存储设备610,非暂时性存储设备可以是非暂时性的并且可以实现数据存储的任何存储设备,包括但不限于磁盘驱动器、光学存储设备、固态存储器、软盘、柔性盘、硬盘、磁带或任何其他磁介质,光盘或任何其他光学介质、ROM(只读存储器)、RAM(随机存取存储器)、高速缓冲存储器和/或任何其他存储器芯片或盒、和/或计算机可从其读取数据、指令和/或代码的任何其他介质。非暂时性存储设备610可以从接口拆卸。非暂时性存储设备610可以具有用于实现上述方法和步骤的数据/程序(包括指令)/代码。电子设备600还可以包括 通信设备612。通信设备612可以是使得能够与外部设备和/或与网络通信的任何类型的设备或系统,并且可以包括但不限于调制解调器、网卡、红外通信设备、无线通信设备和/或芯片组,例如蓝牙 TM设备、1302.11设备、Wi-Fi设备、Wi-Max设备、蜂窝通信设备和/或类似物。 Electronic device 600 may include elements connected to or in communication with bus 602 (possibly via one or more interfaces). For example, electronic device 600 may include a bus 602 , one or more processors 604 , one or more input devices 606 , and one or more output devices 608 . Processor(s) 604 may be any type of processor and may include, but is not limited to, one or more general purpose processors and/or one or more special purpose processors (eg, special processing chips). The input device 606 may be any type of device capable of inputting information into the electronic device 600, and may include, but is not limited to, a mouse, keyboard, touch screen, microphone, and/or remote control. Output devices 608 may be any type of device capable of presenting information, and may include, but are not limited to, displays, speakers, video/audio output terminals, vibrators, and/or printers. The electronic device 600 may also include a non-transitory storage device 610, which may be any storage device that is non-transitory and that enables data storage, including but not limited to disk drives, optical storage devices, solid-state memory, floppy disks, flexible disk, hard disk, tape or any other magnetic medium, optical disk or any other optical medium, ROM (read only memory), RAM (random access memory), cache memory and/or any other memory chips or cartridges, and/or computer Any other medium from which data, instructions and/or code can be read. The non-transitory storage device 610 is detachable from the interface. The non-transitory storage device 610 may have data/programs (including instructions)/codes for implementing the above methods and steps. The electronic device 600 may also include a communication device 612 . The communication device 612 may be any type of device or system that enables communication with external devices and/or with a network, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication devices, and/or chipsets, such as Bluetooth device, 1302.11 device, Wi-Fi device, Wi-Max device, cellular communication device, and/or the like.
电子设备600还可以包括工作存储器614,其可以是可以存储对处理器604的工作有用的程序(包括指令)和/或数据的任何类型的工作存储器,并且可以包括但不限于随机存取存储器和/或只读存储器设备。 Electronic device 600 may also include working memory 614, which may be any type of working memory that may store programs (including instructions) and/or data useful for the work of processor 604, and may include, but is not limited to, random access memory and and/or read-only memory devices.
软件要素(程序)可以位于工作存储器614中,包括但不限于操作系统616、一个或多个应用程序618、驱动程序和/或其他数据和代码。用于执行上述方法和步骤的指令可以被包括在一个或多个应用程序618中,并且上述图像处理方法100以及用于标定响应曲线的方法300可以通过由处理器604读取和执行一个或多个应用程序618的指令来实现。更具体地,上述图像处理方法100中,步骤S102-S108可以例如通过处理器604执行具有步骤S102-S108的指令的应用程序618而实现。上述用于标定响应曲线的方法300中,步骤S302-S310可以例如通过处理器604执行具有步骤S302-S310的指令的应用程序618而实现。此外,上述图像处理方法100以及用于标定响应曲线的方法300中的其它步骤可以例如通过处理器604执行具有执行相应步骤中的指令的应用程序618而实现。软件要素(程序)的指令的可执行代码或源代码可以存储在非暂时性计算机可读存储介质(例如上述存储设备610)中,并且在执行时可以被存入工作存储器614中(可能被编译和/或安装)。软件要素(程序)的指令的可执行代码或源代码也可以从远程位置下载。Software elements (programs) may be located in working memory 614, including but not limited to operating system 616, one or more application programs 618, drivers, and/or other data and code. Instructions for performing the above methods and steps may be included in one or more application programs 618, and the above image processing method 100 and the method 300 for calibrating response curves may be read and executed by the processor 604 by one or more The instructions of an application program 618 are implemented. More specifically, in the above-mentioned image processing method 100, steps S102-S108 can be implemented, for example, by the processor 604 executing the application program 618 having the instructions of steps S102-S108. In the above-mentioned method 300 for calibrating the response curve, steps S302-S310 can be realized, for example, by the processor 604 executing the application program 618 having the instructions of steps S302-S310. In addition, other steps in the above-mentioned image processing method 100 and the method 300 for calibrating response curves can be realized, for example, by the processor 604 executing the application program 618 having instructions for executing the corresponding steps. The executable code or source code of the instructions of the software elements (programs) may be stored in a non-transitory computer-readable storage medium (such as the above-mentioned storage device 610), and when executed, may be stored in the working memory 614 (possibly compiled and/or install). The executable code or source code of the instructions of the software element (program) may also be downloaded from a remote location.
还应该理解,可以根据具体要求而进行各种变型。例如,也可以使用定制硬件,和/或可以用硬件、软件、固件、中间件、微代码,硬件描述语言或其任何组合来实现特定元件。例如,所公开的方法和设备中的一些或全部可以通过使用根据本公开的逻辑和算法,用汇编语言或硬件编程语言(诸如VERILOG,VHDL,C++)对硬件(例如,包括现场可编程门阵列(FPGA)和/或可编程逻辑阵列(PLA)的可编程逻辑电路)进行编程来实现。It should also be understood that various modifications may be made according to specific requirements. For example, custom hardware could also be used, and/or particular elements could be implemented in hardware, software, firmware, middleware, microcode, hardware description languages, or any combination thereof. For example, some or all of the disclosed methods and devices can be implemented by programming hardware (e.g., including Field Programmable Gate Arrays) in assembly language or hardware programming languages (such as VERILOG, VHDL, C++) using logic and algorithms according to the present disclosure. (FPGA) and/or Programmable Logic Circuits of Programmable Logic Array (PLA)) to implement programming.
还应该理解,前述方法可以通过服务器-客户端模式来实现。例如,客户端可以接收用户输入的数据并将所述数据发送到服务器。客户端也可以接收用户输入的数据,进行前述方法中的一部分处理,并将处理所得到的数据发送到服务器。服务器可以接收来自客户端的数据,并且执行前述方法或前述方法中的另一部分,并将执行结果返回给客户端。客户端可以从服务器接收到方法的执行结果,并例如可以通过输出设备呈现给用户。It should also be understood that the aforementioned methods can be implemented in a server-client mode. For example, a client may receive user-entered data and send the data to a server. The client may also receive the data input by the user, perform part of the processing in the aforementioned method, and send the processed data to the server. The server may receive data from the client, execute the aforementioned method or another part of the aforementioned method, and return the execution result to the client. The client can receive the execution result of the method from the server, and can present it to the user, for example, through an output device.
还应该理解,电子设备600的组件可以分布在网络上。例如,可以使用一个处理器执行一些处理,而同时可以由远离该一个处理器的另一个处理器执行其他处理。计算系统600的其他组件也可以类似地分布。这样,电子设备600可以被解释为在多个位置执行处理的分布式计算系统。It should also be understood that components of electronic device 600 may be distributed across a network. For example, some processing may be performed using one processor while other processing may be performed by another processor remote from the one processor. Other components of computing system 600 may be similarly distributed. As such, electronic device 600 may be interpreted as a distributed computing system that performs processing at multiple locations.
以下描述本公开的一些示例性方面。Some exemplary aspects of the disclosure are described below.
方面1.一种图像处理方法,包括: Aspect 1. An image processing method, comprising:
获取针对同一场景拍摄的第一图像和第二图像,其中所述第一图像的第一曝光量大于所述第二图像的第二曝光量,所述第一图像和所述第二图像具有相同的图像区域;acquiring a first image and a second image taken for the same scene, wherein the first exposure of the first image is greater than the second exposure of the second image, and the first image and the second image have the same image area;
基于对应于所述第一曝光量的第一响应曲线和所述第一图像中至少一个第一像素的像素值,确定对应于所述第一图像中至少一个第一像素的像素位置的场景中的第一对象的灰阶值;Based on the first response curve corresponding to the first exposure and the pixel value of the at least one first pixel in the first image, determine the scene corresponding to the pixel position of the at least one first pixel in the first image The grayscale value of the first object of ;
基于对应于所述第二曝光量的第二响应曲线和所述第二图像中至少一个第二像素的像素值,确定对应于所述第二图像中至少一个第二像素的像素位置的场景中的第二对象的灰阶值;以及Based on the second response curve corresponding to the second exposure and the pixel value of at least one second pixel in the second image, determine the scene corresponding to the pixel position of at least one second pixel in the second image The grayscale value of the second object of ; and
基于所述第一对象的灰阶值和所述第二对象的灰阶值确定目标图像。A target image is determined based on the gray scale value of the first object and the gray scale value of the second object.
方面2.如方面1所述的图像处理方法,其中,所述第一图像中的至少一个第一像素具有不高于像素阈值的像素值,所述第二图像中的至少一个第二像素在所述图像区域中的位置不同于所述至少一个第一像素在所述图像区域中的位置。 Aspect 2. The image processing method according to aspect 1, wherein at least one first pixel in the first image has a pixel value not higher than a pixel threshold, and at least one second pixel in the second image is at The location in the image area is different than the location of the at least one first pixel in the image area.
方面3.如方面2所述的图像处理方法,其中,所述像素阈值小于图像传感器的饱和像素值。Aspect 3. The image processing method according to aspect 2, wherein the pixel threshold is smaller than a saturation pixel value of the image sensor.
方面4.如方面3所述的图像处理方法,其中,所述像素阈值是基于图像传感器的饱和像素值和过曝系数确定的,所述过曝系数是大于0小于1的系数。 Aspect 4. The image processing method according to aspect 3, wherein the pixel threshold is determined based on a saturated pixel value of the image sensor and an overexposure coefficient, and the overexposure coefficient is a coefficient greater than 0 and less than 1.
方面5.如方面1所述的图像处理方法,其中,基于所述第一对象的灰阶值和所述第二对象的灰阶值确定目标图像包括:Aspect 5. The image processing method according to aspect 1, wherein determining the target image based on the grayscale value of the first object and the grayscale value of the second object comprises:
利用反映射曲线对所述第一对象的灰阶值和所述第二对象的灰阶值进行反映射,以得到所述目标图像中所述第一对象的像素位置和所述第二对象的像素位置的目标像素值,其中,所述反映射曲线指示所述目标图像中各个像素位置处的目标像素值与灰阶值之间的映射关系。Using an inverse mapping curve to perform inverse mapping on the grayscale value of the first object and the grayscale value of the second object, so as to obtain the pixel position of the first object and the pixel position of the second object in the target image A target pixel value at a pixel position, wherein the inverse mapping curve indicates a mapping relationship between the target pixel value at each pixel position in the target image and the gray scale value.
方面6.如方面5所述的图像处理方法,所述反映射曲线中,所述灰阶值越大,所述目标像素值越大。 Aspect 6. The image processing method according to aspect 5, in the inverse mapping curve, the larger the gray scale value is, the larger the target pixel value is.
方面7.如方面1所述的图像处理方法,其中,所述第一曝光量是基于获取所述第一图像时使用的第一曝光时间和第一曝光增益而确定的,所述第二曝光量是基于获取所述第二图像时使用的第二曝光时间和第二曝光增益而确定的。Aspect 7. The image processing method according to aspect 1, wherein the first exposure amount is determined based on the first exposure time and the first exposure gain used when acquiring the first image, and the second exposure The amount is determined based on a second exposure time and a second exposure gain used when acquiring the second image.
方面8.如方面1所述的图像处理方法,其中,所述第一响应曲线对应于图像传感器的标定响应曲线指示的在所述第一曝光量下所述第一图像中至少一个第一像素的像素值与对应于所述第一像素的场景中的第一对象的灰阶值之间的第一映射关系,所述第二响应曲线对应于所述标定响应曲线指示的在所述第二曝光量下所述第二图像中至少一个第二像素的像素值与对应于所述第二像素的场景中的第二对象的灰阶值之间的第二映射关系。 Aspect 8. The image processing method according to aspect 1, wherein the first response curve corresponds to at least one first pixel in the first image at the first exposure amount indicated by a calibration response curve of the image sensor The first mapping relationship between the pixel value of the first pixel and the grayscale value of the first object in the scene corresponding to the first pixel, the second response curve corresponds to the second response curve indicated by the calibration response curve in the second A second mapping relationship between the pixel value of at least one second pixel in the second image and the grayscale value of a second object in the scene corresponding to the second pixel under the exposure.
方面9.如方面8所述的图像处理方法,其中所述标定响应曲线是通过以下步骤确定的:Aspect 9. The image processing method according to aspect 8, wherein the calibration response curve is determined by the following steps:
以第一标定曝光量获取包括第一标定灰阶组中的多个标定灰阶的第一标定图像;Acquiring a first calibration image including a plurality of calibration grayscales in the first calibration grayscale group with a first calibration exposure;
基于所述第一标定图像中分别对应于所述第一标定灰阶组中的多个标定灰阶的多个第一标定位置处的像素值确定第一标定曲线,所述第一标定曲线指示所述第一标定曝光量下图像传感器采集的像素值与所述第一标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系;A first calibration curve is determined based on pixel values at multiple first calibration positions in the first calibration image corresponding to multiple calibration grayscales in the first calibration grayscale group, and the first calibration curve indicates The mapping relationship between the pixel values collected by the image sensor under the first calibration exposure and the grayscale values of multiple calibration grayscales in the first calibration grayscale group;
以不同于所述第一标定曝光量的第二标定曝光量获取包括第二标定灰阶组中的多个标定灰阶的第二标定图像;acquiring a second calibration image including a plurality of calibration grayscales in a second calibration grayscale group with a second calibration exposure different from the first calibration exposure;
基于所述第二标定图像中分别对应于所述第二标定灰阶组中的多个标定灰阶的多个第二标定位置处的像素值确定第二标定曲线,所述第二标定曲线指示所述第二标定曝光量下图像传感器采集的像素值与所述第二标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系;以及Determine a second calibration curve based on pixel values at multiple second calibration positions in the second calibration image corresponding to multiple calibration grayscales in the second calibration grayscale group, the second calibration curve indicates A mapping relationship between the pixel values collected by the image sensor under the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group; and
基于所述第一标定曲线和所述第二标定曲线确定所述图像传感器的标定响应曲线,其中所述标定响应曲线指示图像传感器采集的像素值与采集图像时使用的曝光量以及包含所述第一标定灰阶组和所述第二标定灰阶组中的至少一个的多个标定灰阶的灰阶范围内的灰阶值之间的映射关系。Determining a calibration response curve of the image sensor based on the first calibration curve and the second calibration curve, wherein the calibration response curve indicates the pixel value collected by the image sensor and the exposure used when capturing the image and includes the first calibration curve A mapping relationship between grayscale values within a grayscale range of a plurality of calibrated grayscales in a calibrated grayscale group and at least one of the second calibrated grayscale group.
方面10.如方面9所述的图像处理方法,其中,基于所述第一标定曲线和所述第二标定曲线确定所述图像传感器的标定响应曲线包括: Aspect 10. The image processing method according to aspect 9, wherein determining the calibration response curve of the image sensor based on the first calibration curve and the second calibration curve comprises:
基于所述第二标定曲线确定第二标定曝光量下所述第二标定灰阶组中的多个标定灰阶中最大标定灰阶值对应的最大像素值;Based on the second calibration curve, determine the maximum pixel value corresponding to the maximum calibration gray scale value among the multiple calibration gray scales in the second calibration gray scale group under the second calibration exposure;
基于所述最大像素值将所述第一标定曲线中高于所述第二标定曲线的最大像素值的曲线部分与所述第二标定曲线拼接,以得到经调整的第二标定曲线,其中所述经调整的第二标定曲线指示所述灰阶范围中高于所述最大标定灰阶值的至少一个灰阶值在第二标定曝光量下与图像传感器采集的像素值之间的映射关系;以及Based on the maximum pixel value, splicing the curve part of the first calibration curve higher than the maximum pixel value of the second calibration curve with the second calibration curve to obtain an adjusted second calibration curve, wherein the The adjusted second calibration curve indicates a mapping relationship between at least one grayscale value higher than the maximum calibrated grayscale value in the grayscale range and pixel values collected by the image sensor under a second calibrated exposure; and
对所述经调整的第二标定曲线与所述第一标定曲线进行拟合以得到所述标定响应曲线。Fitting the adjusted second calibration curve to the first calibration curve to obtain the calibration response curve.
方面11.如方面9所述的图像处理方法,其中所述第二标定曝光量小于所述第一标定曝光量。Aspect 11. The image processing method according to aspect 9, wherein the second calibrated exposure amount is smaller than the first calibrated exposure amount.
方面12.如方面9所述的图像处理方法,其中所述第一标定灰阶组包括从基准灰阶值开始以预定灰阶变化量变化的多个标定灰阶,所述第二标定灰阶组包括从基准灰阶值开始以相同预定灰阶变化量变化的相同数量的多个标定灰阶。 Aspect 12. The image processing method according to aspect 9, wherein the first calibration grayscale group includes a plurality of calibration grayscales that change with a predetermined grayscale variation from the reference grayscale value, and the second calibration grayscale The group includes the same number of calibration grayscales varying by the same predetermined grayscale variation from the reference grayscale value.
方面13.如方面9-12中任一项所述的图像处理方法,其中,所述标定响应曲线表示为下式:Aspect 13. The image processing method according to any one of aspects 9-12, wherein the calibration response curve is represented by the following formula:
Figure PCTCN2022123779-appb-000002
Figure PCTCN2022123779-appb-000002
其中I表示图像传感器采集的像素值,S表示灰阶值,E表示曝光量,a、γ、b、δ、w为常数。Among them, I represents the pixel value collected by the image sensor, S represents the grayscale value, E represents the exposure amount, and a, γ, b, δ, and w are constants.
方面14.一种用于标定图像传感器的响应曲线的方法,包括: Aspect 14. A method for calibrating a response curve of an image sensor, comprising:
以第一标定曝光量获取包括第一标定灰阶组中的多个标定灰阶的第一标定图像;Acquiring a first calibration image including a plurality of calibration grayscales in the first calibration grayscale group with a first calibration exposure;
基于所述第一标定图像中分别对应于所述第一标定灰阶组中的多个标定灰阶的多个第一标定位置处的像素值确定第一标定曲线,所述第一标定曲线指示所述第一标定曝光量下图像传感器采集的像素值与所述第一标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系;A first calibration curve is determined based on pixel values at multiple first calibration positions in the first calibration image corresponding to multiple calibration grayscales in the first calibration grayscale group, and the first calibration curve indicates The mapping relationship between the pixel values collected by the image sensor under the first calibration exposure and the grayscale values of multiple calibration grayscales in the first calibration grayscale group;
以不同于所述第一标定曝光量的第二标定曝光量获取包括第二标定灰阶组中的多个标定灰阶的第二标定图像;acquiring a second calibration image including a plurality of calibration grayscales in a second calibration grayscale group with a second calibration exposure different from the first calibration exposure;
基于所述第二标定图像中分别对应于所述第二标定灰阶组中的多个标定灰阶的多个第二标定位置处的像素值确定第二标定曲线,所述第二标定曲线指示所述第二标定曝光量下图像传感器采集的像素值与所述第二标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系;以及Determine a second calibration curve based on pixel values at multiple second calibration positions in the second calibration image corresponding to multiple calibration grayscales in the second calibration grayscale group, the second calibration curve indicates A mapping relationship between the pixel values collected by the image sensor under the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group; and
基于所述第一标定曲线和所述第二标定曲线确定所述图像传感器的响应曲线,其中所述响应曲线指示图像传感器采集的像素值与采集图像时使用的曝光量以及包含所述第 一标定灰阶组和所述第二标定灰阶组中的至少一个的多个标定灰阶的灰阶范围内的灰阶值之间的映射关系。Determining a response curve of the image sensor based on the first calibration curve and the second calibration curve, wherein the response curve indicates the pixel values collected by the image sensor and the exposure used when capturing the image and includes the first calibration A mapping relationship between the gray scale group and the gray scale values within the gray scale range of at least one of the multiple calibration gray scales in the second calibration gray scale group.
方面15.如方面14所述的方法,其中,所述曝光量是基于利用所述图像传感器获取图像时使用的曝光时间和曝光增益而确定的。Aspect 15. The method of aspect 14, wherein the exposure amount is determined based on an exposure time and an exposure gain used when acquiring an image with the image sensor.
方面16.如方面14所述的方法,其中所述第二标定曝光量小于所述第一标定曝光量。 Aspect 16. The method of aspect 14, wherein the second nominal exposure level is less than the first nominal exposure level.
方面17.如方面14所述的方法,其中所述第一标定灰阶组包括从基准灰阶值开始以预定灰阶变化量变化的多个标定灰阶,所述第二标定灰阶组包括从基准灰阶值开始以相同预定灰阶变化量变化的相同数量的多个标定灰阶。Aspect 17. The method according to aspect 14, wherein the first set of calibration grayscales includes a plurality of calibration grayscales that change from a reference grayscale value by a predetermined amount of grayscale variation, and the second set of calibration grayscales includes A plurality of calibration gray scales of the same number varying with the same predetermined gray scale variation from the reference gray scale value.
方面18.如方面14所述的方法,其中,所述多个标定灰阶以预定灰阶变化量变化,所述包含所述灰阶范围的最大灰阶值大于所述第一标定灰阶组的最大标定灰阶值和所述第二标定灰阶组的最大标定灰阶值。 Aspect 18. The method according to aspect 14, wherein the plurality of calibrated gray scales change with a predetermined gray scale variation, and the maximum gray scale value including the gray scale range is greater than the first set of calibrated gray scales and the maximum calibrated gray scale value of the second calibrated gray scale group.
方面19.如方面14所述的方法,其中,基于所述第一标定曲线和所述第二标定曲线确定所述图像传感器的响应曲线包括:Aspect 19. The method of aspect 14, wherein determining a response curve of the image sensor based on the first calibration curve and the second calibration curve comprises:
基于所述第二标定曲线确定第二标定曝光量下所述第二标定灰阶组的最大标定灰阶值对应的最大像素值;determining the maximum pixel value corresponding to the maximum calibrated grayscale value of the second calibrated grayscale group under the second calibrated exposure amount based on the second calibration curve;
基于所述最大像素值将所述第一标定曲线中高于所述第二标定曲线的最大像素值的曲线部分与所述第二标定曲线拼接,以得到经调整的第二标定曲线,其中所述经调整的第二标定曲线指示所述灰阶范围中高于所述最大标定灰阶值的至少一个灰阶值在第二标定曝光量下与图像传感器采集的像素值之间的映射关系;以及Based on the maximum pixel value, splicing the curve part of the first calibration curve higher than the maximum pixel value of the second calibration curve with the second calibration curve to obtain an adjusted second calibration curve, wherein the The adjusted second calibration curve indicates a mapping relationship between at least one grayscale value higher than the maximum calibrated grayscale value in the grayscale range and pixel values collected by the image sensor under a second calibrated exposure; and
对所述经调整的第二标定曲线与所述第一标定曲线进行拟合以得到所述响应曲线。Fitting the adjusted second calibration curve to the first calibration curve to obtain the response curve.
方面20.如方面14-19中任一项所述的方法,其中,所述响应曲线表示为下式:Aspect 20. The method of any one of aspects 14-19, wherein the response curve is represented by the following formula:
Figure PCTCN2022123779-appb-000003
Figure PCTCN2022123779-appb-000003
其中I表示图像传感器采集的像素值,S表示灰阶值,E表示曝光量,a、γ、b、δ、w为常数。Among them, I represents the pixel value collected by the image sensor, S represents the grayscale value, E represents the exposure amount, and a, γ, b, δ, and w are constants.
方面21.一种电子设备,包括:Aspect 21. An electronic device comprising:
处理器;以及processor; and
存储程序的存储器,所述程序包括指令,所述指令在由所述处理器执行时使所述处理器执行根据方面1-20中任一项所述的方法。A memory storing a program comprising instructions which, when executed by the processor, cause the processor to perform the method according to any one of aspects 1-20.
方面22.一种存储程序的非暂态计算机可读存储介质,所述程序包括指令,所述指令在由电子设备的处理器执行时,致使所述电子设备执行根据方面1-20中任一项所述的方法。Aspect 22. A non-transitory computer-readable storage medium storing a program comprising instructions which, when executed by a processor of an electronic device, cause the electronic device to perform any of aspects 1-20. method described in the item.
方面23.一种计算机程序产品,包括计算机程序,其中,所述计算机程序在被处理器执行时实现根据方面1-20中任一项所述的方法。Aspect 23. A computer program product comprising a computer program, wherein said computer program, when executed by a processor, implements the method according to any one of aspects 1-20.
虽然已经参照附图描述了本公开的实施例或示例,但应理解,上述的方法、系统和设备仅仅是示例性的实施例或示例,本发明的范围并不由这些实施例或示例限制,而是仅由授权后的权利要求书及其等同范围来限定。实施例或示例中的各种要素可以被省略或者可由其等同要素替代。此外,可以通过不同于本公开中描述的次序来执行各步骤。进一步地,可以以各种方式组合实施例或示例中的各种要素。重要的是随着技术的演进,在此描述的很多要素可以由本公开之后出现的等同要素进行替换。Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but It is limited only by the appended claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by equivalent elements thereof. Also, steps may be performed in an order different from that described in the present disclosure. Further, various elements in the embodiments or examples can be combined in various ways. Importantly, as technology advances, many of the elements described herein may be replaced by equivalent elements appearing after this disclosure.

Claims (23)

  1. 一种图像处理方法,包括:An image processing method, comprising:
    获取针对同一场景拍摄的第一图像和第二图像,其中所述第一图像的第一曝光量大于所述第二图像的第二曝光量,所述第一图像和所述第二图像具有相同的图像区域;acquiring a first image and a second image taken for the same scene, wherein the first exposure of the first image is greater than the second exposure of the second image, and the first image and the second image have the same image area;
    基于对应于所述第一曝光量的第一响应曲线和所述第一图像中至少一个第一像素的像素值,确定对应于所述第一图像中至少一个第一像素的像素位置的场景中的第一对象的灰阶值;Based on the first response curve corresponding to the first exposure and the pixel value of the at least one first pixel in the first image, determine the scene corresponding to the pixel position of the at least one first pixel in the first image The grayscale value of the first object of ;
    基于对应于所述第二曝光量的第二响应曲线和所述第二图像中至少一个第二像素的像素值,确定对应于所述第二图像中至少一个第二像素的像素位置的场景中的第二对象的灰阶值;以及Based on the second response curve corresponding to the second exposure and the pixel value of at least one second pixel in the second image, determine the scene corresponding to the pixel position of at least one second pixel in the second image The grayscale value of the second object of ; and
    基于所述第一对象的灰阶值和所述第二对象的灰阶值确定目标图像。A target image is determined based on the gray scale value of the first object and the gray scale value of the second object.
  2. 如权利要求1所述的图像处理方法,其中,所述第一图像中的至少一个第一像素具有不高于像素阈值的像素值,所述第二图像中的至少一个第二像素在所述图像区域中的位置不同于所述至少一个第一像素在所述图像区域中的位置。The image processing method according to claim 1, wherein at least one first pixel in the first image has a pixel value not higher than a pixel threshold, and at least one second pixel in the second image is in the The position in the image area is different from the position of the at least one first pixel in the image area.
  3. 如权利要求2所述的图像处理方法,其中,所述像素阈值小于图像传感器的饱和像素值。The image processing method according to claim 2, wherein the pixel threshold is smaller than a saturation pixel value of the image sensor.
  4. 如权利要求3所述的图像处理方法,其中,所述像素阈值是基于图像传感器的饱和像素值和过曝系数确定的,所述过曝系数是大于0小于1的系数。The image processing method according to claim 3, wherein the pixel threshold is determined based on a saturated pixel value of the image sensor and an overexposure coefficient, and the overexposure coefficient is a coefficient greater than 0 and less than 1.
  5. 如权利要求1所述的图像处理方法,其中,基于所述第一对象的灰阶值和所述第二对象的灰阶值确定目标图像包括:The image processing method according to claim 1, wherein determining the target image based on the grayscale value of the first object and the grayscale value of the second object comprises:
    利用反映射曲线对所述第一对象的灰阶值和所述第二对象的灰阶值进行反映射,以得到所述目标图像中所述第一对象的像素位置和所述第二对象的像素位置的目标像素值,其中,所述反映射曲线指示所述目标图像中各个像素位置处的目标像素值与灰阶值之间的映射关系。Using an inverse mapping curve to perform inverse mapping on the grayscale value of the first object and the grayscale value of the second object, so as to obtain the pixel position of the first object and the pixel position of the second object in the target image A target pixel value at a pixel position, wherein the inverse mapping curve indicates a mapping relationship between the target pixel value at each pixel position in the target image and the gray scale value.
  6. 如权利要求5所述的图像处理方法,其中,所述反映射曲线中,所述灰阶值越大,所述目标像素值越大。The image processing method according to claim 5, wherein, in the inverse mapping curve, the larger the gray scale value is, the larger the target pixel value is.
  7. 如权利要求1所述的图像处理方法,其中,所述第一曝光量是基于获取所述第一图像时使用的第一曝光时间和第一曝光增益而确定的,所述第二曝光量是基于获取所述第二图像时使用的第二曝光时间和第二曝光增益而确定的。The image processing method according to claim 1, wherein the first exposure amount is determined based on the first exposure time and the first exposure gain used when acquiring the first image, and the second exposure amount is Determined based on the second exposure time and the second exposure gain used when acquiring the second image.
  8. 如权利要求1所述的图像处理方法,其中,所述第一响应曲线对应于图像传感器的标定响应曲线指示的在所述第一曝光量下所述第一图像中至少一个第一像素的像素值与对应于所述第一像素的场景中的第一对象的灰阶值之间的第一映射关系,所述第二响应曲线对应于所述标定响应曲线指示的在所述第二曝光量下所述第二图像中至少一个第二像素的像素值与对应于所述第二像素的场景中的第二对象的灰阶值之间的第二映射关系。The image processing method according to claim 1, wherein the first response curve corresponds to the pixel of at least one first pixel in the first image at the first exposure amount indicated by the calibration response curve of the image sensor value and the grayscale value of the first object in the scene corresponding to the first pixel, the second response curve corresponds to the calibration response curve indicated at the second exposure A second mapping relationship between the pixel value of at least one second pixel in the second image and the gray scale value of the second object in the scene corresponding to the second pixel is described below.
  9. 如权利要求8所述的图像处理方法,其中所述标定响应曲线是通过以下步骤确定的:The image processing method according to claim 8, wherein said calibration response curve is determined by the following steps:
    以第一标定曝光量获取包括第一标定灰阶组中的多个标定灰阶的第一标定图像;Acquiring a first calibration image including a plurality of calibration grayscales in the first calibration grayscale group with a first calibration exposure;
    基于所述第一标定图像中分别对应于所述第一标定灰阶组中的多个标定灰阶的多个第一标定位置处的像素值确定第一标定曲线,所述第一标定曲线指示所述第一标定曝光量下图像传感器采集的像素值与所述第一标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系;A first calibration curve is determined based on pixel values at multiple first calibration positions in the first calibration image corresponding to multiple calibration grayscales in the first calibration grayscale group, and the first calibration curve indicates The mapping relationship between the pixel values collected by the image sensor under the first calibration exposure and the grayscale values of multiple calibration grayscales in the first calibration grayscale group;
    以不同于所述第一标定曝光量的第二标定曝光量获取包括第二标定灰阶组中的多个标定灰阶的第二标定图像;acquiring a second calibration image including a plurality of calibration grayscales in a second calibration grayscale group with a second calibration exposure different from the first calibration exposure;
    基于所述第二标定图像中分别对应于所述第二标定灰阶组中的多个标定灰阶的多个第二标定位置处的像素值确定第二标定曲线,所述第二标定曲线指示所述第二标定曝光量下图像传感器采集的像素值与所述第二标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系;以及Determine a second calibration curve based on pixel values at multiple second calibration positions in the second calibration image corresponding to multiple calibration grayscales in the second calibration grayscale group, the second calibration curve indicates A mapping relationship between the pixel values collected by the image sensor under the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group; and
    基于所述第一标定曲线和所述第二标定曲线确定所述图像传感器的标定响应曲线,其中所述标定响应曲线指示图像传感器采集的像素值与采集图像时使用的曝光量以及包含所述第一标定灰阶组和所述第二标定灰阶组中的至少一个的多个标定灰阶的灰阶范围内的灰阶值之间的映射关系。Determining a calibration response curve of the image sensor based on the first calibration curve and the second calibration curve, wherein the calibration response curve indicates the pixel value collected by the image sensor and the exposure used when capturing the image and includes the first calibration curve A mapping relationship between grayscale values within a grayscale range of a plurality of calibrated grayscales in a calibrated grayscale group and at least one of the second calibrated grayscale group.
  10. 如权利要求9所述的图像处理方法,其中,基于所述第一标定曲线和所述第二标定曲线确定所述图像传感器的标定响应曲线包括:The image processing method according to claim 9, wherein determining the calibration response curve of the image sensor based on the first calibration curve and the second calibration curve comprises:
    基于所述第二标定曲线确定第二标定曝光量下所述第二标定灰阶组中的多个标定灰阶中最大标定灰阶值对应的最大像素值;Based on the second calibration curve, determine the maximum pixel value corresponding to the maximum calibration gray scale value among the multiple calibration gray scales in the second calibration gray scale group under the second calibration exposure;
    基于所述最大像素值将所述第一标定曲线中高于所述第二标定曲线的最大像素值的曲线部分与所述第二标定曲线拼接,以得到经调整的第二标定曲线,其中所述经调整的第二标定曲线指示所述灰阶范围中高于所述最大标定灰阶值的至少一个灰阶值在第二标定曝光量下与图像传感器采集的像素值之间的映射关系;以及Based on the maximum pixel value, splicing the curve part of the first calibration curve higher than the maximum pixel value of the second calibration curve with the second calibration curve to obtain an adjusted second calibration curve, wherein the The adjusted second calibration curve indicates a mapping relationship between at least one grayscale value higher than the maximum calibrated grayscale value in the grayscale range and pixel values collected by the image sensor under a second calibrated exposure; and
    对所述经调整的第二标定曲线与所述第一标定曲线进行拟合以得到所述标定响应曲线。Fitting the adjusted second calibration curve to the first calibration curve to obtain the calibration response curve.
  11. 如权利要求9所述的图像处理方法,其中所述第二标定曝光量小于所述第一标定曝光量。The image processing method according to claim 9, wherein said second calibration exposure is smaller than said first calibration exposure.
  12. 如权利要求9所述的图像处理方法,其中所述第一标定灰阶组包括从基准灰阶值开始以预定灰阶变化量变化的多个标定灰阶,所述第二标定灰阶组包括从基准灰阶值开始以相同预定灰阶变化量变化的相同数量的多个标定灰阶。The image processing method according to claim 9, wherein said first calibration grayscale group includes a plurality of calibration grayscales that change with a predetermined grayscale variation from a reference grayscale value, and said second calibration grayscale group includes A plurality of calibration gray scales of the same number varying with the same predetermined gray scale variation from the reference gray scale value.
  13. 如权利要求9-12中任一项所述的图像处理方法,其中,所述标定响应曲线表示为下式:The image processing method according to any one of claims 9-12, wherein the calibration response curve is represented by the following formula:
    Figure PCTCN2022123779-appb-100001
    Figure PCTCN2022123779-appb-100001
    其中I表示图像传感器采集的像素值,S表示灰阶值,E表示曝光量,a、γ、b、δ、w为常数。Among them, I represents the pixel value collected by the image sensor, S represents the grayscale value, E represents the exposure amount, and a, γ, b, δ, and w are constants.
  14. 一种用于标定图像传感器的响应曲线的方法,包括:A method for calibrating a response curve of an image sensor, comprising:
    以第一标定曝光量获取包括第一标定灰阶组中的多个标定灰阶的第一标定图像;Acquiring a first calibration image including a plurality of calibration grayscales in the first calibration grayscale group with a first calibration exposure;
    基于所述第一标定图像中分别对应于所述第一标定灰阶组中的多个标定灰阶的多个第一标定位置处的像素值确定第一标定曲线,所述第一标定曲线指示所述第一标定曝光量下图像传感器采集的像素值与所述第一标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系;A first calibration curve is determined based on pixel values at multiple first calibration positions in the first calibration image corresponding to multiple calibration grayscales in the first calibration grayscale group, and the first calibration curve indicates The mapping relationship between the pixel values collected by the image sensor under the first calibration exposure and the grayscale values of multiple calibration grayscales in the first calibration grayscale group;
    以不同于所述第一标定曝光量的第二标定曝光量获取包括第二标定灰阶组中的多个标定灰阶的第二标定图像;acquiring a second calibration image including a plurality of calibration grayscales in a second calibration grayscale group with a second calibration exposure different from the first calibration exposure;
    基于所述第二标定图像中分别对应于所述第二标定灰阶组中的多个标定灰阶的多个第二标定位置处的像素值确定第二标定曲线,所述第二标定曲线指示所述第二标定曝光量下图像传感器采集的像素值与所述第二标定灰阶组中的多个标定灰阶的灰阶值之间的映射关系;以及Determine a second calibration curve based on pixel values at multiple second calibration positions in the second calibration image corresponding to multiple calibration grayscales in the second calibration grayscale group, the second calibration curve indicates A mapping relationship between the pixel values collected by the image sensor under the second calibration exposure and the grayscale values of multiple calibration grayscales in the second calibration grayscale group; and
    基于所述第一标定曲线和所述第二标定曲线确定所述图像传感器的响应曲线,其中所述响应曲线指示图像传感器采集的像素值与采集图像时使用的曝光量以及包含所述第一标定灰阶组和所述第二标定灰阶组中的至少一个的多个标定灰阶的灰阶范围内的灰阶值之间的映射关系。Determining a response curve of the image sensor based on the first calibration curve and the second calibration curve, wherein the response curve indicates the pixel values collected by the image sensor and the exposure used when capturing the image and includes the first calibration A mapping relationship between the gray scale group and the gray scale values within the gray scale range of at least one of the multiple calibration gray scales in the second calibration gray scale group.
  15. 如权利要求14所述的方法,其中,所述曝光量是基于利用所述图像传感器获取图像时使用的曝光时间和曝光增益而确定的。14. The method of claim 14, wherein the exposure amount is determined based on an exposure time and an exposure gain used in acquiring an image with the image sensor.
  16. 如权利要求14所述的方法,其中所述第二标定曝光量小于所述第一标定曝光量。The method of claim 14, wherein said second nominal exposure level is less than said first nominal exposure level.
  17. 如权利要求14所述的方法,其中所述第一标定灰阶组包括从基准灰阶值开始以预定灰阶变化量变化的多个标定灰阶,所述第二标定灰阶组包括从基准灰阶值开始以相同预定灰阶变化量变化的相同数量的多个标定灰阶。The method according to claim 14, wherein said first set of calibration gray scales comprises a plurality of calibration gray scales varying by a predetermined gray scale variation from a reference gray scale value, said second calibration gray scale set comprises The same number of nominal grayscales whose grayscale values start to vary by the same predetermined grayscale variation.
  18. 如权利要求14所述的方法,其中,所述多个标定灰阶以预定灰阶变化量变化,所述包含所述灰阶范围的最大灰阶值大于所述第一标定灰阶组的最大标定灰阶值和所述第二标定灰阶组的最大标定灰阶值。The method according to claim 14, wherein the plurality of calibration gray scales change with a predetermined gray scale variation, and the maximum gray scale value including the gray scale range is greater than the maximum value of the first calibration gray scale group The calibrated grayscale value and the maximum calibrated grayscale value of the second calibrated grayscale group.
  19. 如权利要求14所述的方法,其中,基于所述第一标定曲线和所述第二标定曲线确定所述图像传感器的响应曲线包括:The method of claim 14, wherein determining a response curve of the image sensor based on the first calibration curve and the second calibration curve comprises:
    基于所述第二标定曲线确定第二标定曝光量下所述第二标定灰阶组的最大标定灰阶值对应的最大像素值;determining the maximum pixel value corresponding to the maximum calibrated grayscale value of the second calibrated grayscale group under the second calibrated exposure amount based on the second calibration curve;
    基于所述最大像素值将所述第一标定曲线中高于所述第二标定曲线的最大像素值的曲线部分与所述第二标定曲线拼接,以得到经调整的第二标定曲线,其中所述经调整的第二标定曲线指示所述灰阶范围中高于所述最大标定灰阶值的至少一个灰阶值在第二标定曝光量下与图像传感器采集的像素值之间的映射关系;以及Based on the maximum pixel value, splicing the curve part of the first calibration curve higher than the maximum pixel value of the second calibration curve with the second calibration curve to obtain an adjusted second calibration curve, wherein the The adjusted second calibration curve indicates a mapping relationship between at least one grayscale value higher than the maximum calibrated grayscale value in the grayscale range and pixel values collected by the image sensor under a second calibrated exposure; and
    对所述经调整的第二标定曲线与所述第一标定曲线进行拟合以得到所述响应曲线。Fitting the adjusted second calibration curve to the first calibration curve to obtain the response curve.
  20. 如权利要求14-19中任一项所述的方法,其中,所述响应曲线表示为下式:The method according to any one of claims 14-19, wherein the response curve is represented by the following formula:
    Figure PCTCN2022123779-appb-100002
    Figure PCTCN2022123779-appb-100002
    其中I表示图像传感器采集的像素值,S表示灰阶值,E表示曝光量,a、γ、b、δ、w为常数。Among them, I represents the pixel value collected by the image sensor, S represents the grayscale value, E represents the exposure amount, and a, γ, b, δ, and w are constants.
  21. 一种电子设备,包括:An electronic device comprising:
    处理器;以及processor; and
    存储程序的存储器,所述程序包括指令,所述指令在由所述处理器执行时使所述处理器执行根据权利要求1-20中任一项所述的方法。A memory storing a program comprising instructions which when executed by the processor causes the processor to perform the method according to any one of claims 1-20.
  22. 一种存储程序的非暂态计算机可读存储介质,所述程序包括指令,所述指令在由电子设备的处理器执行时,致使所述电子设备执行根据权利要求1-20中任一项所述的方法。A non-transitory computer-readable storage medium storing a program, the program comprising instructions that, when executed by a processor of an electronic device, cause the electronic device to perform the operation described in any one of claims 1-20. described method.
  23. 一种计算机程序产品,包括计算机程序,其中,所述计算机程序在被处理器执行时实现根据权利要求1-20中任一项所述的方法。A computer program product comprising a computer program, wherein said computer program implements the method according to any one of claims 1-20 when executed by a processor.
PCT/CN2022/123779 2021-10-08 2022-10-08 Image processing method, electronic device, and storage medium WO2023056926A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111172854.4 2021-10-08
CN202111172854.4A CN113808222A (en) 2021-10-08 2021-10-08 Image processing method, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2023056926A1 true WO2023056926A1 (en) 2023-04-13

Family

ID=78897373

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/123779 WO2023056926A1 (en) 2021-10-08 2022-10-08 Image processing method, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN113808222A (en)
WO (1) WO2023056926A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113808222A (en) * 2021-10-08 2021-12-17 上海肇观电子科技有限公司 Image processing method, electronic device, and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420944A (en) * 2011-04-25 2012-04-18 展讯通信(上海)有限公司 High dynamic-range image synthesis method and device
CN103841384A (en) * 2012-11-20 2014-06-04 腾讯科技(深圳)有限公司 Image-quality optimization method and device
US20140226903A1 (en) * 2013-02-08 2014-08-14 Canon Kabushiki Kaisha Image processing apparatus and image processing method
CN104050651A (en) * 2014-06-19 2014-09-17 青岛海信电器股份有限公司 Scene image processing method and device
CN107197167A (en) * 2016-03-14 2017-09-22 杭州海康威视数字技术股份有限公司 A kind of method and device for obtaining image
CN112950517A (en) * 2021-02-25 2021-06-11 浙江光珀智能科技有限公司 Method and device for fusing high dynamic range depth map and gray scale map of depth camera
CN113411508A (en) * 2021-05-31 2021-09-17 东南大学 Non-vision field imaging method based on camera brightness measurement
CN113808222A (en) * 2021-10-08 2021-12-17 上海肇观电子科技有限公司 Image processing method, electronic device, and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420944A (en) * 2011-04-25 2012-04-18 展讯通信(上海)有限公司 High dynamic-range image synthesis method and device
CN103841384A (en) * 2012-11-20 2014-06-04 腾讯科技(深圳)有限公司 Image-quality optimization method and device
US20140226903A1 (en) * 2013-02-08 2014-08-14 Canon Kabushiki Kaisha Image processing apparatus and image processing method
CN104050651A (en) * 2014-06-19 2014-09-17 青岛海信电器股份有限公司 Scene image processing method and device
CN107197167A (en) * 2016-03-14 2017-09-22 杭州海康威视数字技术股份有限公司 A kind of method and device for obtaining image
CN112950517A (en) * 2021-02-25 2021-06-11 浙江光珀智能科技有限公司 Method and device for fusing high dynamic range depth map and gray scale map of depth camera
CN113411508A (en) * 2021-05-31 2021-09-17 东南大学 Non-vision field imaging method based on camera brightness measurement
CN113808222A (en) * 2021-10-08 2021-12-17 上海肇观电子科技有限公司 Image processing method, electronic device, and storage medium

Also Published As

Publication number Publication date
CN113808222A (en) 2021-12-17

Similar Documents

Publication Publication Date Title
JP4902562B2 (en) Imaging apparatus, image processing apparatus, control method, and program
WO2018176925A1 (en) Hdr image generation method and apparatus
JP6906947B2 (en) Image processing equipment, imaging equipment, image processing methods and computer programs
JP5906188B2 (en) Brightness adjustment of digital images using range information
US9672414B2 (en) Enhancement of skin, including faces, in photographs
US20210097650A1 (en) Image processing method, storage medium, image processing apparatus, learned model manufacturing method, and image processing system
KR20150026268A (en) Method for stabilizing image and an electronic device thereof
US9332195B2 (en) Image processing apparatus, imaging apparatus, and image processing method
JP6935272B2 (en) Devices, methods, and programs for creating high dynamic range images
WO2023056926A1 (en) Image processing method, electronic device, and storage medium
CN113315956B (en) Image processing apparatus, image capturing apparatus, image processing method, and machine-readable medium
US11069040B2 (en) Empirical exposure normalization
US10715743B2 (en) System and method for photographic effects
JP2010183460A (en) Image capturing apparatus and method of controlling the same
US11972546B2 (en) Image processing apparatus and image processing method
US9413974B2 (en) Information processing apparatus, image sensing apparatus, control method, and recording medium for conversion processing
JP7005215B2 (en) Image processing equipment, image processing method, computer program
JP6786273B2 (en) Image processing equipment, image processing methods, and programs
JP2016127388A (en) Image processing system, control method of the same, program, and storage medium
US20170078585A1 (en) Process and system in which the user can enhance their selfie photos before they are taken
US20200162657A1 (en) Image generation apparatus, image generation method, and storage media
CN112995634B (en) Image white balance processing method and device, electronic equipment and storage medium
WO2022201318A1 (en) Image processing device, image processing method, and image processing program
JP2006279459A (en) Device, method and program for image photography, and recording medium
JP5789330B2 (en) Imaging apparatus and control method thereof

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: 22877942

Country of ref document: EP

Kind code of ref document: A1