A method and system for image processing to implement HDR in Bayer data domain
By using a programmable processor chip in the Bayer data domain for HDR image synthesis and tone mapping, the problems of high resource consumption and high latency in the existing technology are solved, low-complexity HDR processing is achieved, and it is adapted to common HDR Sensor and ISP data. Bit width specification.
Patent Information
- Application Number
- CN201810851971.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-07-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2038-07-30
AI Technical Summary
The existing technology has problems in high dynamic range image processing, such as many color space transformation operations, large resource consumption, large delay, and does not support the HDR function, especially during the processing of Bayer data domain.
A method based on a programmable processor chip is used to directly perform HDR image synthesis, tone mapping and bit-width compression in the Bayer data domain. By extracting the brightness component and calculating the fusion weight factor, local tone transformation and bit-width compression are performed to reduce color space transformation steps. and reduce computational complexity.
It achieves low-complexity and efficient HDR image processing, reduces system resource consumption and latency, adapts to common HDR Sensor and ISP data bit width specifications, and supports 10-bit or 12-bit HDR synthesis processing.
Smart Images

Figure CN109345464B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and more specifically, to a method and system for implementing HDR image synthesis and tone mapping in Bayer data domain based on a programmable processor chip. Background Art
[0002] In the daily life of human beings, from dazzling sunlight to extremely dim starlight, the range of environmental brightness changes exceeds 8 orders of magnitude, that is, the dynamic range is greater than 160dB. Due to long-term evolution, the human eye can adapt to 5 to 6 orders of magnitude of brightness changes, that is, the dynamic range reaches 100 to 120dB. Ordinary CMOS Sensors (hereinafter referred to as Sensors) can only provide a dynamic range of about 60dB, which is far from meeting the needs of recording high dynamic scenes in the real world, so they are called LDR (Low Dynamic Range) Sensors. Currently, Sensors that can provide HDR (High Dynamic Range) or high dynamic range can provide a dynamic range of 100 to 120dB, which can better record brightness information in real-world scenes.
[0003] Since common digital image display devices usually only support 256 brightness levels and cannot directly display HDR images, the HDR image needs to be dynamically compressed at a certain stage before the image is displayed to adapt to the capabilities of the display device. Local Tone Mapping is a type of dynamic range compression algorithm with relatively good effects. It has been widely studied and applied. However, the disadvantage is that such algorithms are usually complex, require large amounts of computation, and consume a lot of resources.
[0004] There are many different principles for implementing HDR Sensor. One of the HDR implementation methods is to use a method of staggered long and short exposure within a line, namely, the Line-based Staggered HDR method. The HDR Sensor using this method outputs pixel data in units of lines, usually Bayer format data with a bit width of 10 bits or 12 bits. Two groups of data are output in each line, corresponding to the pixel values collected under long and short exposures respectively.
[0005] Various HDR implementation methods, including the intra-row staggered long and short exposure method, require some form of ISP (Signal Processor), i.e., image signal processor, to be used at the back end of the sensor to complete the synthesis processing of high dynamic range images within the ISP.
[0006] In the prior art, ISPs usually perform HDR synthesis processing on images in a pipeline manner. A typical pipeline is to separate the Bayer format image output by the HDR Sensor into two frames according to different exposure levels and store them separately. After enough data is cached, Bayer2RGB and RGB2YUV conversions are performed to obtain YUV format images. Then, HDR synthesis is performed on the two YUV image frames to obtain a high dynamic image. Finally, YUV2RGB conversion is performed to obtain an RGB format image.
[0007] In the prior art, the disadvantage of the pipeline method is that there are many links in the color space transformation operation. Due to the existence of a large number of floating-point operations, each operation will introduce some precision errors and affect the final HDR processing effect.
[0008] Another shortcoming of the prior art is that due to the large number of operation steps, the system resource overhead (chip area, power consumption, etc.) is very large, which increases the cost of system implementation.
[0009] Another shortcoming of the prior art is that, in order to control the cost of the system, a tone mapping method with relatively simple calculation is often selected, while a tone mapping method with better effect but higher complexity and larger calculation amount is rarely selected.
[0010] Another shortcoming of the existing technology is that the ISP needs to wait until both frames of images are cached in the memory before starting the HDR synthesis process. Therefore, the system delay is large and is not suitable for applications with low latency requirements.
[0011] Another shortcoming of the prior art is that if the ISP does not support the HDR function, it cannot cooperate with the HDR Sensor to obtain an HDR image. Summary of the invention
[0012] In view of the deficiencies in the prior art, an object of the present invention is to provide a method for directly performing HDR synthesis processing in the original Bayer data domain to avoid multiple color space transformations.
[0013] Another objective of the present invention is to provide an HDR synthesis processing method based on the principle of local tone mapping to achieve good HDR effect.
[0014] Another objective of the present invention is to provide an HDR synthesis processing method with low complexity and small computational complexity, thereby reducing the implementation cost of the HDR processing method.
[0015] Another object of the present invention is to provide an HDR synthesis processing method that supports an input image bit width of 10 bits or 12 bits, which is adapted to common HDR Sensor data bit width specifications.
[0016] Another objective of the present invention is to provide an HDR synthesis processing method with an output image bit width of 10 bits or 12 bits, which is adapted to common ISP data bit width specifications.
[0017] In order to achieve the above-mentioned objectives, the present invention proposes an image processing method and system for realizing HDR image synthesis, tone mapping and bit width compression in Bayer data domain based on a programmable processor chip. The image processing method and system can fully or at least partially meet the above-mentioned objectives to solve the problems raised in the above-mentioned background technology.
[0018] To achieve the above object, the present invention provides the following technical solutions:
[0019] An image processing system for realizing HDR image synthesis, tone mapping and bit width compression in Bayer data domain based on a programmable processor chip, comprising: an HDR Sensor unit, an IO interface unit (A and B), a line buffer (FIFO) unit, and an HDR processing unit;
[0020] An HDR Sensor unit, for generating Bayer format data of at least two exposure levels;
[0021] IO interface unit A is used to connect with the HDR Sensor unit and input the image data generated by the Sensor into the system;
[0022] FIFO unit, used to cache Bayer format pixel data generated by HDR Sensor;
[0023] HDR processing unit, used to perform HDR synthesis, tone mapping, bit width compression and other operations on Bayer data, and finally generate high dynamic Bayer data;
[0024] The IO interface unit B is used for external output, and outputs the high dynamic Bayer data generated by the HDR processing unit to the outside. It is usually an ISP chip that does not have the HDR function.
[0025] All or part of the units except the HDR Sensor (at least including the HDR processing unit) are implemented in the form of a programmable processor chip, one of which is to run software on a general-purpose processor chip (CPU, DSP), another is to implement a dedicated image processing pipeline on a large-scale programmable logic device (FPGA), and another is to implement a dedicated image processing pipeline using an application-specific integrated circuit chip (ASIC) or a system on chip (SoC);
[0026] The present invention proposes an image processing method for realizing HDR image synthesis, tone mapping and bit width compression in Bayer data domain based on a programmable processor chip, comprising the following steps:
[0027] Obtain low-bit-width image data with a bit width of 10 bits or 12 bits generated by the HDR Sensor in units of lines;
[0028] Separating the low-bit-width image data according to a predetermined format, separating two rows of low-bit-width data from one row of low-bit-width data, corresponding to pixel values generated under long and short exposures respectively;
[0029] Extract the brightness component from the long-exposure pixels according to a certain algorithm;
[0030] Preferably, a calculation method for extracting brightness components from long exposure pixels is as follows:
[0031] M represents the number of pixels in the horizontal direction of the image, and N represents the number of pixels in the vertical direction of the image;
[0032] Use I L Represents a long exposure image, using I S represents a short exposure image, the I L and I S Both are two-dimensional matrices containing M×N pixel values;
[0033] Preferably, I L and I S All are pixel value matrices arranged in Bayer (2x2) format, that is, odd-numbered rows represent RGRRGG... pixel values, even-numbered rows represent GBGBGB... pixel values, and the R, G, and B represent pixels of red, green, and blue, respectively;
[0034] Use Y L represents the brightness component matrix extracted from the long exposure image, then Y L is a two-dimensional brightness matrix containing M×N grayscale values;
[0035] Let (i,j) represent the I L , I S and Y L The coordinates of any element in ;
[0036] Use I L (i, j) represents the pixel at the current position, and here we only take the case where the current position is the R pixel as an example;
[0037] Use I L (i, j-1) represents the G pixel to the left of the current position;
[0038] Use I L(i, j+1) represents the G pixel to the right of the current position;
[0039] Use I L (i-1, j) represents the G pixel directly above the current position;
[0040] Use I L (i+1,j) represents the G pixel directly below the current position;
[0041] Use I L (i-1, j-1) represents the B pixel to the upper left of the current position;
[0042] Use I L (i-1, j+1) represents the B pixel to the upper right of the current position;
[0043] Use I L (i+1, j-1) represents the B pixel to the lower left of the current position;
[0044] Use I L (i+1,j+1) represents the B pixel to the lower right of the current position;
[0045] Use the R pixel values to construct Y R ,Right now
[0046] Y R (i,j)=I L (i,j)
[0047] Further, the Y G ,Right now
[0048]
[0049] Further, the Y B ,Right now
[0050]
[0051] Further, using each Y R ,Y G ,Y B Construct Y L ,Right now
[0052]
[0053] Further, using the brightness component Y L , and a set of parameters obtained from the system configuration, calculate the fusion weight factor of each target pixel;
[0054] Preferably, a method for calculating the fusion weight factor is as follows:
[0055] Use W in Indicates the bit width of the HDR Sensor output data, usually 10 or 12;
[0056] Use Y m_in Represents Y L The maximum possible value of an element, i.e.
[0057] Get a threshold parameter T and a slope parameter k from the system configuration, and use T, k, Y max and Y L Construct the fusion weight factor α of each target pixel, that is,
[0058]
[0059] Furthermore, a fusion value of each target pixel is calculated according to the fusion weight factor and a set of parameters obtained from the system configuration.
[0060] Preferably, a method for calculating the fusion value of the target pixel is as follows:
[0061] Use I F represents the fused image, the I F is a two-dimensional matrix containing M×N pixel values;
[0062] R represents the ratio of long and short exposures, which is obtained from the system configuration;
[0063] Use I L , I S , α and R calculate the fusion value I of each target pixel F ,Right now
[0064] I F (i,j)=[1-α(i,j)]·I L (i,j)+α(i,j)·I S (i,j)·R
[0065] Furthermore, the fused image is processed by local tone transformation according to a certain algorithm to obtain a local tone transformation image with high bit width and high dynamic range;
[0066] Preferably, a calculation method for the local tone transformation process is as follows:
[0067] Use X max Indicates I F The maximum possible value of an element, i.e.
[0068] Use W out Indicates the bit width of the output data of the HDR processing unit, usually 10 or 12;
[0069] Use Y m_out represents the maximum possible value of the output pixel, that is
[0070] Use I avg (i, j) represents the estimation of the average brightness of the image in a small neighborhood near pixel (i, j);
[0071] Use a binary function f(p,q) to represent the local tone mapping transformation operator;
[0072] Use the I F , I avg , X max and f(p,q) to calculate the local tone transformation image I map ,Right now
[0073]
[0074] Preferably, a method for calculating the I avg The method for (i,j) is as follows:
[0075] Let s represent a control parameter related to the average brightness of the output image, obtained from the system configuration;
[0076] L is used to represent the estimated value of the overall average brightness of the current image;
[0077] use Represents the median value of all pixel values in a small neighborhood around pixel (i, j);
[0078] Using the s, L, And f(p,q) calculates the weighted estimate of the average brightness of the image, that is,
[0079]
[0080] Preferably, a method for calculating the estimated value L of the overall average brightness of the image is as follows:
[0081] According to the natural order of image acquisition time, the image sequence is numbered with an integer n in units of frames;
[0082] use Represents the brightness value of pixel (i, j) in the n-1th frame image;
[0083] Δ is used to represent the sampling interval, usually 8, 16 or 32;
[0084] use Respectively represent the number of sampling times of the image in the column and row directions, where The symbol represents the rounding operation;
[0085] Using the Δ, and Calculate the average brightness statistics of the n-1th frame image Right now
[0086]
[0087] When the calculation of the nth frame begins, since the data of the nth frame image has not yet arrived, the average brightness statistics of the n-1th frame is used as the brightness estimation value of the nth frame, that is,
[0088]
[0089] Preferably, a method for calculating the local tone mapping transformation operator f(p,q) is as follows:
[0090] Select a suitable integer parameter E so that E>0;
[0091] Use the parameters E and p, q to calculate an integer T, that is,
[0092] in The symbol represents the rounding operation;
[0093] Find two integers k, j such that T = k·E+j, where 0≤j <E;
[0094] Use the parameters b, p, q, T to calculate a decimal r, that is
[0095] r=-p / q-(0.6931 / E)·T
[0096] Substitute the parameters k, j, E, and r into the following formula to calculate the function f(p, q):
[0097] f(p,q)=(2 k 2 j / E )(1+r+0.5r 2 )
[0098] Preferably, in the above formula, 2 k Term and 0.5r 2 Items can be quickly calculated using binary shift operations;
[0099] Preferably, since j is an integer and has only E possible values, 2 j / E Items can be quickly calculated using a table lookup method.
[0100] Furthermore, the local tone transformation image is subjected to bit width compression processing to obtain a final output image.
[0101] Preferably, a calculation method for performing bit width compression processing on an image is as follows:
[0102] Use W F Represents the fused image I F The data bit width is usually 16;
[0103] Use W F , W out and Y map Calculate the final output image I out ,Right now
[0104]
[0105] In order to more clearly illustrate the structural features and effects of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0106] Figure 1 The present invention is a flow chart of the HDR image synthesis processing method based on the Bayer data domain.
[0107] Figure 2-5 The figure is a schematic diagram showing the principle of interpolating R, G, and B component values from a Bayer 3x3 pixel window (with the R pixel at the center) according to the HDR image synthesis processing method based on the Bayer data domain of the present invention.
[0108] Figure 6-9 The figure is a schematic diagram showing the principle of interpolating R, G, and B component values from a Bayer 3x3 pixel window (with the G pixel at the center) according to the HDR image synthesis processing method based on the Bayer data domain of the present invention.
[0109] Fig.10 Schematic diagram of the effect of threshold parameter T and slope k in the process of calculating fusion factor α in the HDR image synthesis processing method based on Bayer data domain of the present invention.
[0110] Fig.11 The present invention is a flow chart of calculating a local tone mapping image in the Bayer data domain according to the HDR image synthesis processing method based on the Bayer data domain. DETAILED DESCRIPTION
[0111] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0112] See also Figure 1-Figure 11, a system for implementing HDR image processing in Bayer data domain, comprising: an HDR Sensor unit, an IO interface unit (A and B), a line buffer (FIFO) unit, and an HDR processing unit; the HDR Sensor, the IO interface unit A, the FIFO unit, the HDR processing unit, and the IO interface unit B form a pipeline structure, and according to the data flow order, the HDRSensor generates raw image data in Bayer format, which flows into the FIFO unit through the IO interface unit A in line units, further flows into the HDR processing unit, and finally flows out of the chip through the IO interface unit B; all or part of the units except the HDRSensor (at least including the HDR processing unit) are implemented in the form of a programmable processor chip, one of which is to run software on a general-purpose processor chip (CPU, DSP), another is to implement a dedicated image processing pipeline on a large-scale programmable logic device (FPGA), and another is to implement a dedicated image processing pipeline using an application-specific integrated circuit chip (ASIC) or a system on chip (SoC); the IO interface unit is further divided into two units, A and B, wherein the A unit is used to implement the HDR The communication protocol of the Sensor is used to establish a data transmission channel between the Sensor and the processor chip. The B unit is used to implement the communication protocol with the external processor and establish a data transmission channel between the processor chip and the external processor. The FIFO unit is used to cache the Bayer data generated by the Sensor in units of rows. The HDR processing unit is used to obtain the low-bit-width Bayer data row from the FIFO unit, parse the Bayer data row to separate two low-bit-width Bayer data rows corresponding to long and short exposures, perform HDR synthesis processing on the two low-bit-width Bayer data to obtain high-bit-width data, perform local tone mapping processing on the high-bit-width data row to obtain a high-bit-width high-dynamic data row, perform bit width compression on the high-bit-width high-dynamic data row to obtain the final low-bit-width high-dynamic data row and output it to the outside through the IO interface B unit.
[0113] The method for image processing to realize HDR in the Bayer data domain comprises the following steps:
[0114] Obtain low-bit-width image data with a bit width of 10 bits or 12 bits generated by the HDR Sensor in units of lines;
[0115] Separating the low-bit-width image data according to a predetermined format, separating two rows of low-bit-width data from one row of low-bit-width data, corresponding to pixel values generated under long and short exposures respectively;
[0116] Extract the brightness component from the long-exposure pixels according to a certain algorithm;
[0117] Preferably, a calculation method for extracting brightness components from long exposure pixels is as follows:
[0118] M represents the number of pixels in the horizontal direction of the image, and N represents the number of pixels in the vertical direction of the image;
[0119] Use I L Represents a long exposure image, using I S represents a short exposure image, the I L and I S Both are two-dimensional matrices containing M×N pixel values;
[0120] Preferably, I L and I S All are pixel value matrices arranged in Bayer (2x2) format, that is, odd-numbered rows represent RGRRGG... pixel values, even-numbered rows represent GBGBGB... pixel values, and the R, G, and B represent pixels of red, green, and blue, respectively;
[0121] Use Y L represents the brightness component matrix extracted from the long exposure image, then Y L is a two-dimensional brightness matrix containing M×N grayscale values;
[0122] Let (i,j) represent the I L , I S and Y L The coordinates of any element in ;
[0123] Use I L (i, j) represents the pixel at the current position, and here we only take the case where the current position is the R pixel as an example;
[0124] Use I L (i, j-1) represents the G pixel to the left of the current position;
[0125] Use I L (i, j+1) represents the G pixel to the right of the current position;
[0126] Use I L (i-1, j) represents the G pixel directly above the current position;
[0127] Use I L (i+1,j) represents the G pixel directly below the current position;
[0128] Use I L (i-1, j-1) represents the B pixel to the upper left of the current position;
[0129] Use I L (i-1, j+1) represents the B pixel to the upper right of the current position;
[0130] Use I L (i+1, j-1) represents the B pixel to the lower left of the current position;
[0131] Use I L (i+1,j+1) represents the B pixel to the lower right of the current position;
[0132] Use the R pixel values to construct Y R ,Right now
[0133] Y R (i,j)=I L (i,j)
[0134] Further, the Y G ,Right now
[0135]
[0136] Further, the Y B ,Right now
[0137]
[0138] Further, using each Y R ,Y G ,Y B Construct Y L ,Right now
[0139]
[0140] Further, using the brightness component Y L , and a set of parameters obtained from the system configuration, calculate the fusion weight factor of each target pixel;
[0141] Preferably, a method for calculating the fusion weight factor is as follows:
[0142] Use W in Indicates the bit width of the HDR Sensor output data, usually 10 or 12;
[0143] Use Y m_in Represents Y L The maximum possible value of an element, i.e.
[0144] Get a threshold parameter T and a slope parameter k from the system configuration, and use T, k, Y max and Y L Construct the fusion weight factor α of each target pixel, that is,
[0145] [Claims]
[0146] Furthermore, a fusion value of each target pixel is calculated according to the fusion weight factor and a set of parameters obtained from the system configuration.
[0147] Preferably, a method for calculating the fusion value of the target pixel is as follows:
[0148] Use I F represents the fused image, the I F is a two-dimensional matrix containing M×N pixel values;
[0149] R represents the ratio of long and short exposures, which is obtained from the system configuration;
[0150] Use I L , I S , α and R calculate the fusion value I of each target pixel F ,Right now
[0151] I F (i,j)=[1-α(i,j)]·I L (i,j)+α(i,j)·I S (i,j)·R
claim
[0152] Furthermore, the fused image is processed by local tone transformation according to a certain algorithm to obtain a local tone transformation image with high bit width and high dynamic range;
[0153] Preferably, a calculation method for the local tone transformation process is as follows:
[0154] Use X max Indicates I F The maximum possible value of an element, i.e.
[0155] Use W out Indicates the bit width of the output data of the HDR processing unit, usually 10 or 12;
[0156] Use Y m_out represents the maximum possible value of the output pixel, that is
[0157] Use I avg (i, j) represents the estimation of the average brightness of the image in a small neighborhood near pixel (i, j);
[0158] Use a binary function f(p,q) to represent the local tone mapping transformation operator;
[0159] Use the I F , I avg , X maxand f(p,q) to calculate the local tone transformation image I map ,Right now
[0160] [Claims]
[0161] Preferably, a method for calculating the I avg The method for (i,j) is as follows:
[0162] Let s represent a control parameter related to the average brightness of the output image, obtained from the system configuration;
[0163] L is used to represent the estimated value of the overall average brightness of the current image;
[0164] use Represents the median value of all pixel values in a small neighborhood around pixel (i, j);
[0165] Using the s, L, And f(p,q) calculates the weighted estimate of the average brightness of the image, that is,
[0166]
[0167] Preferably, a method for calculating the estimated value L of the overall average brightness of the image is as follows:
[0168] According to the natural order of image acquisition time, the image sequence is numbered with an integer n in units of frames;
[0169] use Represents the brightness value of pixel (i, j) in the n-1th frame image;
[0170] Δ is used to represent the sampling interval, usually 8, 16 or 32;
[0171] use Respectively represent the number of sampling times of the image in the column and row directions, where The symbol represents the rounding operation;
[0172] Using the Δ, and Calculate the average brightness statistics of the n-1th frame image That is
[0173]
[0174] When the calculation of the nth frame begins, since the data of the nth frame image has not yet arrived, the average brightness statistics of the n-1th frame is used as the brightness estimation value of the nth frame, that is,
[0175] [Claims]
[0176] Preferably, a method for calculating the local tone mapping transformation operator f(p,q) is as follows:
[0177] Select a suitable integer parameter E so that E>0;
[0178] Use the parameters E and p, q to calculate an integer T, that is,
[0179] in The symbol represents the rounding operation;
[0180] Find two integers k, j such that T = k·E+j, where 0≤j <E;
[0181] Use the parameters b, p, q, T to calculate a decimal r, that is
[0182] r=-p / q-(0.6931 / E)·T
[0183] Substitute the parameters k, j, E, and r into the following formula to calculate the function f(p, q):
[0184] f(p,q)=(2 k 2 j / E )(1+r+0.5r 2 )
Claims
[0185] Preferably, in the above formula, 2 k Term and 0.5r 2 Items can be quickly calculated using binary shift operations;
[0186] Preferably, since j is an integer and has only E possible values, 2 j / E The term can be quickly calculated using a table lookup method.
[0187] Furthermore, the local tone transformation image is subjected to bit width compression processing to obtain a final output image.
[0188] Preferably, a calculation method for performing bit width compression processing on an image is as follows:
[0189] Use W F Represents the fused image I F The data bit width is usually 16;
[0190] Use W F , W out and Y map Calculate the final output image I out ,Right now
[0191]
[0192] In the present invention, HDR image generation and tone mapping algorithms can be conveniently implemented in the form of various integrated circuits, including ASIC, FPGA, etc. The entire system has good scalability, is convenient for integrating other image algorithms, and can ensure the real-time processing operations.
[0193] In the embodiment of the present invention, the embodiment based on the integrated circuit IC is implemented by taking FPGA as an example, and those skilled in the art can easily expand it to other ICs for implementation.
[0194] The technical principle of the present invention is described above in combination with the specific embodiments, which are only preferred implementations of the present invention. The protection scope of the present invention is not limited to the above embodiments, and all technical solutions under the idea of the present invention belong to the protection scope of the present invention. Those skilled in the art can think of other specific implementations of the present invention without creative work, and these methods will fall within the protection scope of the present invention.
Claims
1. A method for image processing to implement HDR in the Bayer data domain, characterized in that: The steps include: Obtain low-bit-width image data with a bit width of 10 bits or 12 bits generated by the HDR Sensor in units of lines; Separating the low-bit-width image data according to a predetermined format, separating two rows of low-bit-width data from one row of low-bit-width data, corresponding to pixel values generated under long and short exposures respectively; Extract the brightness component from the long-exposure pixels according to a certain algorithm; Using the brightness component Y L , and a set of parameters obtained from the system configuration, calculate the fusion weight factor of each target pixel; Calculating a fusion value of each target pixel according to the fusion weight factor and a set of parameters obtained from the system configuration; According to a certain algorithm, the fused image is processed with local tone transformation to obtain a local tone transformation image with high bit width and high dynamic range. map ; The local tone transformation image I map Perform bit width compression processing to obtain the final output image; The calculation method for extracting the brightness component from the long exposure pixel is as follows: M represents the number of pixels in the horizontal direction of the image, and N represents the number of pixels in the vertical direction of the image; Use I L Represents a long exposure image, using I S represents a short exposure image, the I L and I S Both are two-dimensional matrices containing M×N pixel values; I L and I S All are pixel value matrices arranged in Bayer (2x2) format, that is, odd-numbered rows represent RGRRGG... pixel values, even-numbered rows represent GBGBGB... pixel values, and the R, G, and B represent pixels of red, green, and blue, respectively; Use Y L represents the brightness component matrix extracted from the long exposure image, then Y L is a two-dimensional brightness matrix containing M×N grayscale values; Let (i,j) represent the I L , I S and Y L The coordinates of any element in ; Use I L (i, j) represents the pixel at the current position, and here we only take the case where the current position is the R pixel as an example; Use I L (i, j-1) represents the G pixel to the left of the current position; Use I L (i, j+1) represents the G pixel to the right of the current position; Use I L (i-1, j) represents the G pixel directly above the current position; Use I L (i+1,j) represents the G pixel directly below the current position; Use I L (i-1, j-1) represents the B pixel to the upper left of the current position; Use I L (i-1, j+1) represents the B pixel to the upper right of the current position; Use I L (i+1, j-1) represents the B pixel to the lower left of the current position; Use I L (i+1,j+1) represents the B pixel to the lower right of the current position; Construct Y using each R pixel value R ,Right now Y R (i,j)=I L (i,j); Use each of the G pixel values to construct Y G ,Right now Use each Y R ,Y G ,Y B Construct Y L ,Right now Using the brightness component Y L , and a set of parameters obtained from the system configuration, calculate the fusion weight factor of each target pixel; The calculation method of the fusion weight factor is as follows: Use W in Indicates the bit width of the HDR Sensor output data, usually 10 or 12; Use Y max Represents Y L The maximum possible value of an element, i.e. Get a threshold parameter T and a slope parameter k from the system configuration, and use T, k, Y max and Y L Construct the fusion weight factor α of each target pixel, that is, The fusion value of each target pixel is calculated according to the fusion weight factor and a set of parameters obtained from the system configuration.
2. The method for image processing to realize HDR in Bayer data domain according to claim 1, characterized in that: A method for calculating the fusion value of the target pixel is as follows: Use I F represents the fused image, the I F is a two-dimensional matrix containing M×N pixel values; R represents the ratio of long and short exposures, which is obtained from the system configuration; Use I L , I S , α and R calculate the fusion value I of each target pixel F ,Right now I F (i,j)=[1-α(i,j)]·I L (i,j)+α(i,j)·I S (i,j)·R。 3. The method for image processing to realize HDR in Bayer data domain according to claim 2, characterized in that: A calculation method for the local tone transformation process is as follows: Use X max I F The maximum possible value of an element, i.e. Use W out Indicates the bit width of the output data of the HDR processing unit, usually 10 or 12; Use Y m_out represents the maximum possible value of the output pixel, that is Use I avg (i, j) represents the estimation of the average brightness of the image in a small neighborhood near pixel (i, j); Use a binary function f(p,q) to represent the local tone mapping transformation operator; Use the I F , I avg , X max and f(p,q) to calculate the local tone transformation image I map ,Right now 4. The method for image processing to realize HDR in Bayer data domain according to claim 3, characterized in that: I avg One way to calculate (i,j) is as follows: Let s represent a control parameter related to the average brightness of the output image, obtained from the system configuration; L is used to represent the estimated value of the overall average brightness of the current image; use Represents the median value of all pixel values in a small neighborhood around pixel (i, j); Using the s, L, And f(p,q) calculation, make a weighted estimate of the average brightness of the image, that is, 5. The method for image processing to realize HDR in Bayer data domain according to claim 4, characterized in that: A method for calculating the estimated value L of the overall average brightness of the image is as follows: According to the natural order of image acquisition time, the image sequence is numbered with an integer n in units of frames; use Represents the brightness value of pixel (i, j) in the n-1th frame image; Δ is used to represent the sampling interval, usually 8, 16 or 32; use Respectively represent the number of sampling times of the image in the column and row directions, where The symbol represents the rounding operation; Use the and Calculate the average brightness statistics of the n-1th frame image Right now When the calculation of the nth frame begins, since the data of the nth frame image has not yet arrived, the average brightness statistics of the n-1th frame is used as the brightness estimation value of the nth frame, that is, 6. The method for image processing to realize HDR in Bayer data domain according to claim 5, characterized in that: A method for calculating the local tone mapping transformation operator f(p,q) is as follows: Select a suitable integer parameter E so that E>0; Use the parameters E and p, q to calculate an integer T, that is, in The symbol represents the rounding operation; Find two integers k, j such that T = k·E+j, where 0≤j <E; Use the parameters p, q, T to calculate a decimal r, that is r=-p / q-(0.6931 / E)·T Substitute the parameters k, j, E, and r into the following formula to calculate the function f(p, q):
7. The method for image processing to realize HDR in Bayer data domain according to claim 6, characterized in that: 2 k Term and 0.5r 2 The term is quickly calculated by binary shift operation; since j is an integer and has only E possible values, the 2 j / E The table lookup method is used to achieve fast calculation.
8. The method for image processing to realize HDR in Bayer data domain according to claim 7, characterized in that: A calculation method for performing bit width compression processing on the image is as follows: Use W F Represents the fused image I F The data bit width is usually 16; Use W F , W out and I map Calculate the final output image I out ,Right now 9. A system for implementing HDR image processing in the Bayer data domain, characterized in that: The system is used to implement the method for image processing of realizing HDR in Bayer data domain as described in any one of claims 1 to 8, comprising: an HDR Sensor unit, an IO interface unit A, an IO interface unit and B, a FIFO unit and an HDR processing unit; An HDR Sensor unit, for generating Bayer format data of at least two exposure levels; IO interface unit A is used to connect with the HDR Sensor unit and input the image data generated by the Sensor into the system; FIFO unit, used to cache Bayer format pixel data generated by HDR Sensor; HDR processing unit, used to perform HDR synthesis, tone mapping, and bit width compression operations on Bayer data, and finally generate high dynamic Bayer data; IO interface unit B is used for external output, and outputs the high dynamic Bayer data generated by the HDR processing unit to the outside. It is an ISP chip without HDR function.
10. The system for implementing HDR image processing in Bayer data domain according to claim 9, characterized in that: The IO interface unit A, IO interface unit and B, FIFO unit, and HDR processing unit are implemented in the form of a programmable processor chip.
Citation Information
Patent Citations
Method and system for achieving HDR image generation and tone mapping based on IC
CN104835131A
Image processing method based on HDR
CN106851138A
