This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2012-077662, filed on Mar. 29, 2012, the entire contents of which are incorporated herein by reference.
Embodiments described herein relate generally to an image processing apparatus and an image processing method.
Conventionally widely known are image processing apparatuses that separate only gloss components from input image data to highlight the gloss components. Specifically, there has been developed a technology for separating diffuse reflection components and gloss components in a pixel to be a target by: using hues of an object in an image to extract the pixel; estimating diffuse reflection components indicating original color components of the surface from the pixel thus extracted; and using the diffuse reflection components thus estimated to separate colors that are changed by illumination.
To extract diffuse reflection components from image data, high processing capacity is required. As a result, hardware providing higher performance is required, thereby making a processor expensive.
In view of the circumstances described above, it is an object of the present invention to provide an image processing apparatus capable of separating diffuse reflection components and gloss components constituting image data efficiently.
A general architecture that implements the various features of the invention will now be described with reference to the drawings. The drawings and the associated descriptions are provided to illustrate embodiments of the invention and not to limit the scope of the invention.
In general, according to one embodiment, an image processing apparatus comprises: a reduction module configured to reduce image data that is input to output reduced data; an extraction module configured to extract a diffuse reflection component from the reduced data; an enlargement module configured to enlarge the diffuse reflection component to a size before reduction of the input image data to output enlarged data; a high-frequency acquisition module configured to acquire a high-frequency component removed by reduction from difference between the input image data and the reduced data; a high-frequency addition module configured to output first data obtained by adding the high-frequency component acquired to the enlarged data; and a gloss component acquisition module configured to acquire a gloss component from difference between the input image data and the first data.
Exemplary embodiments of an image processing apparatus according to the present invention are described below in greater detail with reference to the accompanying drawings. The embodiments are not intended to limit the present invention. The image processing apparatus according to the embodiments, for example, separates gloss components and diffuse reflection components in input image, highlights the gloss components, and outputs an output image obtained by adding the gloss components to the input image. The processing performed on the gloss components is not limited to the processing in the embodiments. The image processing apparatus according to the embodiments is mounted on an optical device, such as a digital camera, and can be used for processing a captured image more efficiently, for example.
An input image signal includes a pixel value for each pixel. A pixel value is an image signal comprising an intensity signal and a color signal based on a standard of the International Telecommunication Union (ITU), for example. A pixel value may be represented by either of a method for using three primary colors of RGB as components or method for converting RGB into an intensity signal and a color signal. In the first embodiment, for example, an explanation will be made of a method for using RGB corresponding to primary colors based on the ITU-RBT. 601 standard as components. Therefore, the pixel value of each pixel in input image is represented by an R channel having intensity of a red component, a G channel having intensity of a green component, and a B channel having intensity of a blue component. The R channel has a discretized pixel value of 0 to r0, the G channel has a discretized pixel value of 0 to g0, and the B channel has a discretized pixel value of 0 to b0.
A diffuse reflection component is generated by scattering of light incident on uneven surface of an object, and produces a unique color on the surface of the object different from a color of a light source. A gloss component is a component reflected by the boundary of the surface of the object.
As illustrated in
O=I+K[I−e (f(s(I)))+H(I)]
where O represents an output image, I represents an input image, f(I) represents a function for calculating a diffuse reflection component, s(I) represents a function for reducing an image, e(I) represents a function for enlarging an image, K[I−f(I)] represents a function for performing predetermined processing on a gloss component, and H(I) represents a function for calculating a high-frequency component. In the first embodiment, processing for calculating a diffuse reflection component is performed on an image s (I) obtained by reducing an input image, and the diffuse reflection component is enlarged. The result is represented by e(f(s(I))). A high-frequency component thus lost is added to difference between the input image and the diffuse reflection component thus enlarged (enlarged data) to output first data. Subsequently, second data obtained by performing predetermined gloss processing on the first data is added to the input image, whereby an output image is obtained. The section that performs the processing will be described below in greater detail.
The reduction module 11 reduces an input image to a predetermined size. An existing method, such as downsampling, can be used for the reduction. In the reduction, because the frequency representable in the image is equal to or lower than the Nyquist frequency (one-half of the sampling frequency), a high-frequency component in the image is lost. For this reason, the high-frequency acquisition module 14 acquires in advance the high-frequency component to be lost. Specifically, the high-frequency acquisition module 14 acquires the high-frequency component from difference between the input image and the image thus reduced. Therefore, the high-frequency component acquired by the high-frequency acquisition module 14 is determined based on a ratio of reduction performed by the reduction module 11. The ratio of reduction performed by the reduction module 11 is determined based on how far a processing capacity required for subsequent processing related to extraction of a diffuse reflection component performed by the extraction module 12 is desired to be suppressed.
The extraction module 12 extracts a diffuse reflection component from the reduced image. To extract a diffuse reflection component, for example, a method using a dichromatic reflection model can be employed. In the dichromatic reflection model, I=Is+Id is satisfied where the intensity of reflected light is I, the intensity of a gloss component is Is, and the intensity of a diffuse reflection component is Id.
Specifically, each pixel of the input image thus acquired is projected onto a color space by values of RGB. The hue, the saturation, and the intensity are calculated by the following Equations using certain elements (Ix, Iy, Iz) projected onto the color space.
A plane is prepared in which classification is performed by the values of the hues with the saturation on the abscissa and the intensity on the ordinate. As illustrated in
A gloss component has the same saturation as that of a diffuse reflection component and different intensity from that of the diffuse reflection component. Therefore, if the intensity of the output image is determined from the saturation for all the pixels based on the following Equation using the slope A thus calculated, the intensity of all the pixels is the same value as the intensity of the diffuse reflection component. As a result, the gloss component is removed.
intensity=A×saturation (5)
The enlargement module 13 enlarges the diffuse reflection component thus obtained. In the first embodiment, the magnification of the enlargement is set such that the diffuse reflection component reaches the size before reduction. Alternatively, the magnification may be changed as appropriate such that the diffuse reflection component reaches a desired size.
The high-frequency addition module 15 adds the high-frequency component acquired by the high-frequency acquisition module 14 to the diffuse reflection component thus enlarged. Subsequently, the gloss component acquisition module 16 acquires a gloss component from difference between the input image and the diffuse reflection component acquired via the high-frequency addition module 15. At this time, no complicated calculation is required. Because the diffuse reflection component has already been acquired, the gloss component can be derived simply by acquiring the difference. Subsequently, the gloss component addition module 17 performs predetermined processing, which is processing for highlighting the gloss component in the first embodiment, on the gloss component thus acquired, and adds the gloss component to the input image. As a result, an output image in which the gloss component is highlighted is obtained.
The process of the image processing in the first embodiment will now be described with reference to
In the image processing apparatus 1 according to the first embodiment, the processing for separating the diffuse reflection component is performed after the input image is reduced. Because the pixels are thinned out in the reduction, it is possible to suppress the processing capacity required for processing related to calculation of the diffuse reflection component that needs to be calculated for each pixel. Furthermore, the high-frequency component lost in the reduction is added to the diffuse reflection component again. As a result, when highlighting the gloss component, it is possible to suppress erroneous highlighting of an edge of the image caused by an increase in difference with the input image if the processing is performed without adding the high-frequency component again.
An image processing apparatus 100 according to a second embodiment will now be described. In the second embodiment, as illustrated in
Specifically, an output value specified in advance is set to be output correspondingly to an input value of a high-frequency component.
A high-frequency component acquired by the high-frequency acquisition module 14 contains a portion serving as a gloss component. Thus, if the high-frequency component is added to a diffuse reflection component, the diffuse reflection component partly contains the gloss component. To address this, the image processing apparatus 100 according to the second embodiment suppresses the portion of the gloss component depending on the magnitude of the high-frequency component thus acquired. Therefore, it is possible to suppress removal of the gloss component contained in the high-frequency component and occurrence of a defect in the gloss component.
An image processing apparatus 200 according to a third embodiment will now be described. In the third embodiment, as illustrated in
Specifically, an input-output relationship in the non-linear processing is determined in advance correspondingly to an input value of the gloss component.
Usually, to perform image processing at high speed, high-speed processing can be achieved by decreasing the gray scale value (number of bits) of the image besides the number of pixels. However, lower bits thus lost are erroneously highlighted as a gloss. To address this, by suppressing the output value in this manner when the gloss component is small, it is possible to suppress erroneous highlighting of the lower bits.
The image processing apparatus 1 according to the first embodiment can be realized by a hardware configuration comprising a control device, such as a CPU, and a storage device, such as a read-only memory (ROM) and a random access memory (RAM), mounted on a chip of a digital camera.
An image processing program of the image processing apparatus 1 according to the first embodiment may be provided as a computer program product in a manner recorded in a computer-readable recording medium, such as a compact disk read-only memory (CD-ROM), a flexible disk (FD), a compact disk recordable (CD-R), and a digital versatile disk (DVD), as a file in an installable or executable format.
The image processing program of the image processing apparatus 1 according to the first embodiment may be provided in a manner stored in a computer connected to a network such as the Internet to be made available for downloads via the network. Furthermore, the image processing program of the image processing apparatus 1 according to the first embodiment may be provided or distributed over a network such as the Internet.
The image processing program of the image processing apparatus 1 according to the first embodiment may be provided in a manner incorporated in a ROM or the like in advance.
The image processing program of the image processing apparatus 1 according to the first embodiment has a module configuration comprising the modules described above. In actual hardware, the CPU (processor) reads and executes the image processing program from the storage medium described above to load the modules on the main memory. Thus, the modules described above are generated on the main memory.
Moreover, the various modules of the systems described herein can be implemented as software applications, hardware and/or software modules, or components on one or more computers, such as servers. While the various modules are illustrated separately, they may share some or all of the same underlying logic or code.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
Number | Date | Country | Kind |
---|---|---|---|
2012-077662 | Mar 2012 | JP | national |