The present technology relates to image processing apparatus and method, and a program, particularly, image processing apparatus and method and a program that make it possible to achieve a sufficient smoothing effect by suppressing deterioration of the image quality of an image.
An edge preserving smoothing process is one of the image processing techniques. The edge preserving smoothing is a nonlinear filter process that smoothes gradation while maintaining an outstanding luminance, such as object boundary in an image. The process has been used for a noise reduction process in the related art, because the process removes a fine luminance change while preserving an object outline that influences visibility (For example, see A. Lev, S. W. Zucker, A. Rosenfeld, “Iterative enhancement of noise images”, IEEE Trans. Systems, Man, and Cybernetics, Vol. SMC-7, 1977, D. C. C. Wang, A. H. Vagnucci, C. C. Li, “Gradient inverse weighted smoothing scheme and the evaluation of its performance”, CVGIP, Vol. 15, pp. 167-181, 1981 and M. Nagao, T. Matsuyama, “Edge preserving smoothing”, CGIP, Vol. 9, pp. 394-407, 1978).
The edge preserving smoothing process is also used for a gradation correction process that compresses the luminance difference of other components without changing detailed components represented as a texture, using the property that can separate a fine luminance change of a texture in an object and an outstanding luminance step of an object outline (for example, see F. Durand, J. Dorsey, “Fast bilateral filtering for the display of high-dynamic-range images”, Proc. of ACM SIGGRAPH 2002, 2002 and S. N. Pattanaik, H. Yee, “Adaptive gain control for high dynamic range image display”, Proc. of Spring Conference in Computer Graphics 2002, 2002).
A technique called a bilateral filter in the edge preserving smoothing process is frequently used in recent years. In general, a bilateral filter BLF(p) of an image I(p), as expressed in the following Formula (1), performs a calculation of adding a pixel value I(q) around a pixel position p weighted with both a space direction weighting function of ω(q−p) and a luminance value direction weighting function φ(I(q)−(I(p)).
                              BLF          ⁡                      (                          p              c                        )                          =                                            ∑                              p                ∈                Ω                                      ⁢                                                  ⁢                                          ω                ⁡                                  (                                      p                    -                                          p                      c                                                        )                                            ⁢                              ϕ                ⁡                                  (                                                            I                      ⁡                                              (                        p                        )                                                              -                                          I                      ⁡                                              (                                                  p                          c                                                )                                                                              )                                            ⁢                              I                ⁡                                  (                  p                  )                                                                                        ∑                              p                ∈                Ω                                      ⁢                                                  ⁢                                          ω                ⁡                                  (                                      p                    -                                          p                      c                                                        )                                            ⁢                              ϕ                ⁡                                  (                                                            I                      ⁡                                              (                        p                        )                                                              -                                          I                      ⁡                                              (                                                  p                          c                                                )                                                                              )                                                                                        (        1        )            
The denominator at the right side expresses a normalizing coefficient of a weighted value in Formula (1).
For example, a technique of a gradation correcting process using a bilateral filter is disclosed in “F. Durand, J. Dorsey, “Fast bilateral filtering for the display of high-dynamic-range images”, Proc. of ACM SIGGRAPH 2002, 2002”. The weighting functional shapes of space direction and luminance direction are optional in the bilateral filter, but a rectangular box function or a bell-shaped normal distribution function are commonly used for image processing.
There is a technique called a ε filter in the edge preserving smoothing process, similar to the bilateral filter, and this is also commonly used. The ε filter may be said as a filter in which the space direction weighting function of the bilateral filter is a box function, that is, as a bilateral filter without weighting that depends on the pixel position. The following Formula (2) is a mathematical expression of the ε filter.
                              ɛ          ⁢                                          ⁢                      F            ⁡                          (                              p                c                            )                                      =                                            ∑                              p                ∈                Ω                                      ⁢                          ϕ              ⁢                              (                                                      I                    ⁡                                          (                      p                      )                                                        -                                      I                    ⁡                                          (                                              p                        c                                            )                                                                      )                            ⁢                              I                ⁡                                  (                  p                  )                                                                                        ∑                              p                ∈                Ω                                      ⁢                          ϕ              ⁡                              (                                                      I                    ⁡                                          (                      p                      )                                                        -                                      I                    ⁡                                          (                                              p                        c                                            )                                                                      )                                                                        (        2        )            
Both the bilateral filter and the ε filter are techniques of calculating a weighted expectation value based on the difference between the luminance value of a pixel to be smoothed and the luminance value of the pixels around the same, which shows an effect of improving separation of a large step, such as an edge, and an infinitesimal amplitude, such as noise.