Patent Description:
A popular technique for image processing is to apply a bilateral (BL) filter to an image. A BL filter is a filter that computes new values for pixels in an image based on the spatial closeness and the photometric similarity of neighboring pixels in the image.

BL filtering is becoming the de-facto noise filtering for computer vision systems, such as for Advanced Driver Assistance Systems (ADAS), due to its edge-preserving property. ADAS is implemented by an automotive vision control system which processes digital information from imaging sources including digital cameras, lasers, radar and other sensors to perform tasks such as lane departure warning, drowsiness sensors, and parking assistance. In such a vision control system, a vision sensor may be embodied as a system-on-a-chip (SoC) that includes a BL filter for noise filtering that is coupled to a processor, such as a digital signal processor (DSP) or other processor.

Conventional BL filtering uses a direct formula implementation in essentially real-time (on-the-fly) using the known standard BL filter equation shown hereinbelow, where p is the center pixel and q are the neighboring pixels. <MAT> <MAT> where BF[I]p is the filtered output, <NUM>/Wp is the normalization factor, Gσs (∥p-q∥ is the space (i.e., distance) weight, Gσr (|Ip-Iq|) is the range (i.e., intensity) weight, and Iq is the input pixel being filtered. The respective weights are each calculated as a product of two Gaussian functions. In <NUM>-dimensions (x,y), an isotropic (i.e. circularly symmetric) Gaussian function has the following form: <MAT> where σ is the standard deviation (or variance) of the distribution.

To support multiple ranges and distances, a sigma (σ) calculation is performed, per the above direct formula, where σ is the variance that defines the amount of blurring. To employ adaptive BL filtering, a complex content adaption using local σ is generally used.

The conventional bilateral filter is well-known to the person skilled in the art. It is is a non-linear, edge-preserving, and noise-reducing smoothing filter for images. It is detailed in the paper by <NPL>".

In described examples, a method for filtering noise for imaging includes receiving an image frame comprising image data from multiple pixels having a position and a range (intensity) value including multiple window pixels. Based on a selected filter window size that divides the frame into multiple filter windows including a center pixel, and multiple other pixels (neighborhood pixels) including first pixel and at least a second pixel, the plurality of filter windows are processed. For the first pixel, a space being its distance to the center pixel and a range difference between the first pixel and the center pixel are determined. The space/range difference are used for choosing a combined 2D weight from pre-computed combined 2D weights stored in a 2D weight lookup table (LUT) including weighting for both space and a range difference. The 2D weight LUT is quantized in at least one of the space and the range, and non-linear interpolation is used to quantize the range by using a non-linear LUT for the 2D weight LUT including a finer step size at lower values for the range as compared to a larger step size at higher values for the range. A filtered range value is calculated by applying the selected combined 2D weight to the first pixel, and then the range, filtered range value and selected 2D weight are summed to determine the first pixel's contribution.

The determining, choosing, calculating and summing are then repeated for the second pixel, usually to complete these steps for all of the other (neighborhood) pixels in the filter window. A total sum of contributions from the first and the second pixel (and usually all of the other pixels in the filter widow) are divided by the sum of selected combined 2D weights from these pixels to generate a final filtered range value for the center pixel as a filtered output pixel. The method is generally repeated for all filter windows in the image frame to generate a noise filtered image that can be used for an Advanced Driver Assistance System (ADAS).

In the drawings, like reference numerals are used to designate similar or equivalent elements. Some illustrated acts or events may occur in different order and/or concurrently with other acts or events. Furthermore, some illustrated acts or events may not be required to implement a methodology in accordance with this description.

Also, the terms "coupled to" or "couples with" (and the like), as used herein without further qualification, describe either an indirect or direct electrical connection. Thus, if a first device "couples" to a second device, that connection can be through a direct electrical connection where only parasitics are in the pathway, or through an indirect electrical connection via intervening items including other devices and connections. For indirect coupling, the intervening item generally does not modify the information of a signal, but may adjust its current level, voltage level and/or power level.

Known bilateral (BL) filtering implementations have a high computation complexity resulting in the need for a large semiconductor (e.g., silicon) area for circuit hardware (HW) filter implementations or a high central processing (CPU) loading for software (algorithm) filter implementations. This inefficiency is the result of a complex equation for generating the respective weights on-the-fly because as described hereinabove the weight generating equation requires a computation involving the product of two Gaussian functions.

Algorithm or hardware configuration details are described herein for BL filters that use at least one combined 2D weight LUT (2D weight LUTs). In the direct BF filter equation (copied again hereinbelow): <MAT> <MAT>.

BF stands for BL filter, so that BF[I] is the BF filtered image output by the BL filter. Space refers to distance to the center pixel, and range refers to the amplitude/intensity of the light, p is center pixel, and q are the neighboring pixels. The first term in front of the summation <NUM>/Wp is a normalization (or weighting) factor. The terms summed include a space (i.e., distance) weight (Gσr (|Ip-Iq|) term) multiplied by a range (i.e., intensity) weight (Gσr (|Ip-Iq|)) multiplied by Iq which is the input pixel being filtered. The space weight includes Gσr which is the spatial extent of the kernel being the size of the considered pixel neighborhood defined by the filter window, and the range weight includes Gσs which is the "minimum" amplitude of an edge.

Described embodiments combine the space weight and range weight together to provide pre-computed combined 2D weights (W(i,j) (i corresponding to space and j corresponding to range) that are stored in one or more 2D weight LUT(s). As described in more detail hereinbelow, the 2D weight values in the 2D weight LUT(s) can be optionally quantized to reduce the size (number of entries) of the LUT. Regarding generating combined 2D weights for described 2D weight LUTs, combined 2D weights can be computed using the example equation hereinbelow for each center pixel in the image based on an input (guide) image:
<IMG>
where i is the center pixel index, j is a neighborhood pixel index, Ii is the center pixel input image range, and Ij is the neighbor pixel input image range.

Example implementation details are shown hereinbelow: (i-j) is <NUM>-bit for a 5x5 (pixel neighborhood for a 5x5 filter); (Ii - Ij) is <NUM>-bits quantized to <NUM> bits; each 2D weight Wi,j is pre-computed as <NUM>-bit values including normalization to put in a combined 2D weight LUT; LUT[i][j]: i is a 3bit pixel index, and j is an 8bit image range difference. The lookup value can be <NUM> bits and the total 2D LUT storage <NUM> x <NUM> x <NUM> bits = <NUM>,<NUM> bytes that can be stored, such as in a flip-flop based design. As described hereinbelow, the 2D LUT size can be reduced further based on the symmetrical nature of the space and/or the range data. Although this example uses a pixel neighborhood of size 5x5, described embodiments can be extended to any filter window size, such as 4x4, 7x7, 9x9, 11x11, etc..

For the <NUM>/Ki division in the equation hereinabove, the LUT described hereinbelow as a <NUM>/x LUT <NUM> in <FIG> can be used, where the <NUM>/Ki calculation can be performed using a reciprocal table. The following are specific example details for a reciprocal table. The reciprocal table can be located in a read only memory (ROM) (i.e. all values hardwired), and <NUM> bits can exist per entry. The first <NUM> entries may not be quantized, with the remaining entries quantized by <NUM> with bilinear interpolation during lookup of two neighboring values, and a total of <NUM> LUT entries can exist.

<FIG> is a block diagram representation of a pipeline for an example BL filter <NUM> shown including one or more described 2D weight LUT(s) <NUM> having combined 2D weights(W(i,j), according to an example embodiment. As described hereinabove, the BL filter <NUM> can be implemented as a hardware (HW) filter block or by a processor (e.g., central processing (CPU)) implementing described software. The BL filter <NUM> reads image data originating from a scene (an input image (or frame) having multiple pixels) provided generally from a memory (e.g. double data rate synchronous dynamic random-access memory (DDR SDRAM or on-chip) to a shared memory (SL2) and performs described bilateral (2D) filtering on each filter window (size N X M), such as <NUM> x <NUM>) to generate a final filtered range value for each center pixel in the filter widows as a BL filter output pixel having reduced noise.

N x M window pixels defined by a selected filter window size are shown received by a pixel fetch block <NUM>. The N x M window pixels received define a center pixel and N x M -<NUM> or other pixels (or neighborhood pixels) that are around the center pixel shown as center pixel <NUM> in <FIG>. In the specific example shown in <FIG>, the filter window size is <NUM> x <NUM> so that the other (neighborhood) pixels besides the center pixel <NUM> total <NUM>.

The block shown as block <NUM> is a pixel contribution calculation block that generally calculates a pixel contribution for each pixel in the N X M filter window by using the respective pixel's space (position) and range (intensity) data to select a combined 2D weight from the combined 2D weight LUT(s) <NUM>. The weight lookup block <NUM> receives the N x M pixels. The 2D weight lookup indexing strategy employed by weight lookup block <NUM> is dependent on the space (position) of the respective pixel in the filter window relative to the center pixel, and the range difference of that pixel compared to the range of the center pixel.

The size of the 2D LUT <NUM> is dependent on the strategy to use a space lookup, and the amount of optional quantization (if any) of the pixel bit width. When the 2D weight LUT <NUM> comprises multiple sub-LUT tables, two different mutually exclusive sub-table selection techniques are described as shown in <FIG>. Each sub-LUT table has values derived from combining the range σ and space σ into a single (not separable) table. Even if one only varies the range σ (instead of both the range and space σ) when generating each sub-LUT table, the table still contains a space σ for each sub-table. As a result, each parameter in the sub-table includes both a space and a range σ.

A first sub-table select technique termed herein adaptive mode control is shown controlled by the "mode" signal which is generally provided by a processor (not shown) applied to the weight lookup block <NUM> for selecting a particular sub-LUT table on a per-pixel basis. In this embodiment, the weight lookup block <NUM> averages the range of other pixels in each filter window to calculate a local average range for choosing the index for the selecting a particular sub-LUT.

A second sub-table select technique termed direct mapping to table ID is shown controlled by the "sub-table select" signal shown which is generally provided by a processor applied to the weight lookup block <NUM> for selecting a particular sub-LUT for pixel processing across an entire frame. In this embodiment, the weight lookup block <NUM> indexes into the sub-LUT specified by the "sub-table-select" signal. This embodiment allows for multiple sub-LUTs to be configured to different planes (i.e. luminance vs. chrominance) or different video streams (different camera sources) to be loaded into memory at once and selected using the sub-table-select signal on a per frame basis without the need to reload the LUT for each frame.

The sub-table-select corresponds to which sub-table the user wants to use for that particular frame that is being processed. This feature is described by the following specific example situations.

The multiply/accumulate block <NUM> performs digital filtering by multiplying each pixel in the neighborhood by a corresponding 2D filter weight selected by the weight lookup block <NUM>, and adding all the results together. The accumulate block <NUM> calculates the sum of the selected 2D weights to be used as the index of the reciprocal lookup table shown as <NUM>/x LUT <NUM> for efficient LUT based division for normalization.

The division block <NUM> is shown having inputs coupled to an output of the multiply accumulate block <NUM>, an output of the accumulate block <NUM>, and to the <NUM>/x LUT <NUM>. The division block <NUM> is shown including a <NUM>/x LUT lookup block <NUM> and a multiply block <NUM> which is shown generating the filtered output pixel <NUM> which reflects a normalized noise filtered range value for the center pixel value. The <NUM>/x LUT lookup block <NUM> is a reciprocal value lookup, with the lookup based on a total sum of all weights as an index that selects a value from the <NUM>/x LUT <NUM> for division to implement normalization. The multiply block <NUM> then implements an efficient way to (Filter Output)/(sum of weights) division after the <NUM>/x LUT lookup block <NUM> multiplies the output of the filter by the <NUM>/x LUT <NUM>'s result selected by the <NUM>/x LUT lookup block <NUM>.

<FIG> and <FIG> depict example weight computation details using quantization that reduces the number of LUT entries and thus the needed 2D weight LUT size. <FIG> shows example space (i.e. distance) quantization by a factor of <NUM>. Although a <NUM> x <NUM> filter window is being used and thus <NUM> other (neighboring) pixels, only <NUM> different pixel positions (distances) are shown relative to the center pixel <NUM>. In this example, the number of pixels at distance <NUM> = <NUM>, the number of pixels at distance <NUM> = <NUM>, the number of pixels at distance <NUM> = <NUM>, the number of pixels at distance <NUM> = <NUM>, and the number of pixels at distance <NUM> = <NUM>.

In an example not covered by the invention, linear interpolation can be used to quantize the range (i.e. intensity) values analogous to the space quantization described relative to <FIG>. For example, in this example <NUM> bit pixel range (intensity) values (<NUM> to <NUM>,<NUM>) can be reduced to <NUM> (<NUM> bits), thus by a factor of 16X, such as by linear interpolation. Non-linear interpolation is used to quantize the range by using a non-linear (NL) LUT. The NL LUT has a finer step size at lower range/intensities compared to a step size at higher range/intensities. A finer step size corresponds to more closely spaced data in the LUT at lower intensities compared to a step size (corresponding to closer spaced data in the LUT) at higher intensities. For example, a NL LUT can maintain higher precision (e.g., step size = <NUM>) in the generally more important lower intensity interval and a higher step size, say <NUM>, in the higher (less sensitive) intensity interval.

<FIG> shows the dimensions of an example quantized 2D weight LUT defined within the intersection of the dashed lines shown compared to the size of the outer full resolution 2D LUT, where i is for space (distance) and j is for the range (intensity). (i-j) is <NUM>-bits for an example 5x <NUM> filter window. (Ii - Ij) is <NUM>-bits, which is quantized to <NUM> bits. Wi,j (combined 2D weights) are pre-computed as <NUM>-bit values including normalization that are stored in at least one 2D LUT, such as 2D LUT <NUM> shown in <FIG>. LUT[i][j]: i is <NUM> bit pixel index, j is 8bit image range (intensity) diff lookup value is 8bits. The total storage is 5x <NUM> x 8bits = <NUM>,<NUM> Bytes, such as using flip flops as the memory elements. Provided in this example is thus about a 80X reduction in 2D weight LUT size (versus full resolution being <NUM> x <NUM>,<NUM>=<NUM>,<NUM> Bytes) while enabling similar filtered image quality evidenced in image quality evaluated from simulation images generated.

Noise and thus sigma (σ) are an essentially linear function of the range (i.e. intensity) and the space (distance from central pixel). To address this challenge, multiple sub-tables each covering different levels of at least the range (intensity) within a given table are provided, and a given 2D LUT sub-table is dynamically selected based on the average range.

<FIG> show workings of described sub-tables by describing an example using <NUM> described 2D weight LUT sub-tables, where the respective LUT sub-tables each cover different levels of range (and thus different σ values). <FIG> shows compression of separate 2D LUTs for parameters <NUM>, <NUM>, <NUM> and <NUM> using quantization into the compressed 2D LUT sub-tables shown. Quantization in this example replaces one table of size x, with four tables with size x/<NUM>. This means picking every 4th value from the larger table of size x for a given sigma (σ) value. Each parameter as used here as shown in <FIG> reflects a range σ and a space σ. The separate 2D LUTs for parameters <NUM>, <NUM>, <NUM> and <NUM> after quantization are shown hereinbelow compressed into a single 2D weight LUT that includes 2D LUT sub-tables shown as 2D-LUT1, 2D-LUT2, 2D-LUT3 and 2D-LUT4 in <FIG>.

<FIG> shows bilateral mode, num_sub-table=<NUM> and bilateral mode, num_sub-table=<NUM> each having multiple space (i.e., distance) entries shown as distance <NUM> to <NUM> corresponding to different offset address ranges. <FIG> essentially shows multiple sub-table division for various σ values (e.g. <NUM> sub-table configuration on the left side of figures, and <NUM> sub-table configuration on right side of figure). This example shows that each row takes <NUM> entries, and the sub-tables are indexed in an interleaved fashion (e.g. table0 [<NUM>], table1[<NUM>], table0[<NUM>], table1[<NUM>], etc.).

<FIG> shows adaption using local 4x4 averaging that can be used for LUT sub-table selection. As an example, <FIG> shows the top left 4x4 pixels from the 5x5 pixel neighborhood surrounding the center pixel. Using a pixel neighborhood which is within the size of the bilateral filter pixel neighborhood has the benefit of already being available within the local memory. Also, choosing a number of pixels to be a power of <NUM> means that the average can be obtained simply by computing the sum of the pixels, and right shifting instead of dividing (e.g. average of <NUM> pixels can be given by right shifting the sum by <NUM>). The number of neighborhood pixels chosen, and their distance from the center pixel, are not limited to the example given (i.e. the neighborhood pixels can be the full 5x5 filter window, or a size smaller or larger).

<FIG> is a flow chart that shows steps in an example method <NUM> for BL filtering an image using a processor implementing a BL filter algorithm stored in a memory accessible by the processor or using BL filter hardware configured to perform the method using at least one described combined 2D weight LUT, according to an example embodiment. Step <NUM> comprises receiving an image frame comprising image data from multiple pixels including a position and a range.

Step <NUM> comprises based on a selected filter window size, dividing the frame into filter windows, each including a center pixel and multiple other pixels (or neighborhood pixels) including a first pixel and a second pixel. Step <NUM> to <NUM> comprises processing each of the plurality of filter windows including step <NUM>-<NUM> for the first pixel, with step <NUM> determining a space being the first pixel distance relative to the center pixel and the range difference between its range and the range of the center pixel.

Step <NUM> comprises using the space and range difference, choosing a selected combined 2D weight (selected 2D weight) from multiple combined 2D weights which each include weighting for both the space and range difference from at least one combined pre-computed 2D weight lookup table (2D weight LUT <NUM>), thus being exclusive of any run time weight calculation. Step <NUM> comprises calculating a filtered range value by applying the selected 2D weight to the first pixel. Step <NUM> comprises summing the range, filtered range value and selected 2D weight to determine a contribution of the first pixel. Step <NUM> comprises repeating the determining, choosing, calculating, and summing for at least the second pixel. Step <NUM> comprises dividing (such as using division block <NUM> in <FIG>) a total sum of the contributions from the first pixel and at least the second pixel by a sum of the selected 2D weights from the first pixel and at least the second pixel to generate a final filtered range value for the center pixel as an output pixel <NUM> from the BL filter. The output pixels from repeating the processing for all of plurality filter windows window can be used to generate a noise filtered image for an ADAS.

For the 2D weight sub-LUT embodiment where the 2D weights provide different sigma (σ) values for range, as described hereinabove, before choosing the 2D weight, the method can further adaptive mode control controlled by a mode signal applied to the weight lookup block <NUM> for selecting a particular sub-LUT table on a per-pixel basis. In this embodiment, the weight lookup block <NUM> averages the range of other pixels in each filter window to calculate a local average range for choosing the index for the selecting a sub-LUT. Alternatively, direct mapping to table ID can be controlled by a "sub-table select" signal applied to the weight lookup block <NUM> for selecting a particular sub-LUT for pixel processing across an entire frame. In this embodiment, the weight lookup block <NUM> indexes into the sub-LUT specified by the "sub-table-select" signal.

Claim 1:
A method (<NUM>) of filtering noise for imaging, comprising:
using a processor implementing a bilateral, BL, filter algorithm stored in a memory accessible by the processor or using BL filter hardware configured to perform the method on an image frame comprising image data including a position and a range from a plurality of pixels, the frame including a plurality of filter windows each including a center pixel and a plurality of other pixels including a first pixel and a second pixel, processing each of the plurality of filter windows including:
for the first pixel, determining (<NUM>) a space being its distance relative to the center pixel and a range difference between its range and the range of the center pixel, using (<NUM>) the space and the range difference, choosing a selected combined 2D weight from a plurality of combined 2D weights which each include weighting for both the space and the range difference from at least one combined pre-computed 2D weight lookup table, 2D weight LUT, calculating (<NUM>) a filtered range value by applying the selected combined 2D weight to the first pixel range, and summing (<NUM>) the filtered range value to determine a contribution of the first pixel,
repeating (<NUM>) the determining, the choosing, the calculating, and the summing for at least the second pixel, and
dividing (<NUM>) a total sum of the contributions from the first pixel and at least the second pixel by a sum of the selected combined 2D weights from the first pixel and the second pixel to generate a final filtered range value for the center pixel as an output pixel;
wherein the 2D weight LUT is quantized in at least one of the space and the range, and
wherein non-linear interpolation is used to quantize the range by using a non-linear, NL, LUT for the 2D weight LUT including a finer step size at lower values for the range as compared to a larger step size at higher values for the range.