This disclosure relates generally to image processing.
The observed color of an image is formed from the spectral energy distributions of the light reflected by the surface reflectance, and the intensity of the image color is determined by the imaging geometry. Diffuse reflection can be assumed to be associated only with the relative angle between the light direction and the surface normal in the imaging geometry regardless of the viewing direction. Specular reflection, on the other hand, is dependent on the viewing direction. This viewing dependency of the specular reflection can lead to problems in many computer vision applications such as stereo matching, segmentation, and/or recognition.
Stereo matching extracts of 3D information from digital images by comparing information about a scene from two vantage points. Because specular reflection changes depending on the view point, if one of the two images under comparison to extract 3D information includes specular reflections and the other does not, large intensity differences may be present. This can lead to miscalculations of 3D information from these two images. Despite this potential for error, it is common to assume that specular reflections do not exist in the images.
Image segmentation is the process of assigning a label to every pixel in an image such that pixels with the same label share certain visual characteristics. A specular reflection within an image shows the reflection rather than the object upon which the reflection occurs. As such the color and/or intensity of pixels representing the specular reflection may not be labeled with the object, which is the object of image segmentation. This can lead to pixels being mislabeled or segmented. Similar problems can occur in image recognition techniques.
Most applications simply consider the observed image as a diffuse reflection model and disregard the specular reflection components because they are considered outliers.
Embodiments of the invention include a method for determining the specular reflectivity within an input image. Embodiments of the invention can include receiving an input image at a computer device that. The input image can include a red channel, a green channel, and a blue channel for each pixel in the input image. A dark channel image can be calculated from the input image. The dark channel image can comprise an image for each pixel value having the lowest pixel value of the corresponding red channel pixel, green channel pixel, and blue channel pixel of the input image. A pseudo specular-free image can be calculated as the difference between the input image and the dark channel image. A specular chromaticity of the input image can be determined from the pseudo specular-free image, which can be returned.
Embodiments of the invention can also receive an input image at a computer device. The input image can include a red channel, a green channel, and a blue channel for each pixel in the input image. A cluster analysis can be performed on the input image that clusters each pixel in the input image into clusters having similar chromaticity. The cluster analysis can determine a chromaticity index for each pixel and a chromaticity vector that indicates the average chromaticity of each cluster represented by the index. An objective function can then be solved to determine the specular reflectivity of the input image. This objective function can have a number of properties. For example, the objective function can include a function that specifies that the specular reflectivity is smooth across edges within the input image. As another example, the objective function can specify that the diffuse reflectivity is relatively constant for the same chromaticity. As another example, the objective function can specify that the diffuse reflectivity is relatively constant within each cluster. As yet another example, the objective function can specify that the diffuse reflectivity changes sharply between clusters. As yet another example, the objective function can specify a combination of any of these or other objective functions. The specular reflectivity of the input image can then be returned.
These illustrative embodiments are mentioned not to limit or define the disclosure, but to provide examples to aid understanding thereof. Additional embodiments are discussed in the Detailed Description, and further description is provided there. Advantages offered by one or more of the various embodiments may be further understood by examining this specification or by practicing one or more embodiments presented.
These and other features, aspects, and advantages of the present disclosure are better understood when the following Detailed Description is read with reference to the accompanying drawings.
Systems and methods are disclosed to separate the specular reflectivity and the diffuse reflectivity from an input image. Images are a representation of light reflected off objects framed within the image. The reflected light captured in an image can either be from a diffuse reflection or a specular reflection. It has proven challenging to accurately distinguish between diffuse reflection and specular reflection. Because diffuse reflections make up the majority of the light in an image and noting that challenges exist in separating the two, most image processing applications assume all the light in an image is diffuse.
In some embodiments of the invention, the chromaticity of an image can be analyzed. The chromaticity of an image represents the color of the image (or even a pixel) regardless of the brightness (or luminance) of the image. Hence, it can be assumed that the diffuse chromaticity of an image can represent the true (or inherent) color of a surface, and the specular chromaticity can represent the true (or inherent) illumination of the surface. Thus, an image can be separated into the diffuse chromaticity and the specular chromaticity.
Embodiments of the invention can be used on any image.
Techniques and systems are disclosed herein for determining or estimating the specular chromaticity, the diffuse chromaticity, or both from an input image. Embodiments of the invention can be used to determine the specular chromaticity by iteratively solving one or more objective functions.
Objective functions are commonly used in optimization problems. An objective function can be defined to represent various conditions or parameters that exist in specular and/or diffuse reflectivities. By setting up an objective function that represents a linear combination of a number of conditions or parameters, the relative contribution of each of these conditions or parameters can be determined. Using any number of optimization techniques, an objective function can be maximized or minimized by systematically choosing input values and then computing the value of the function. The following describes the reasoning behind the selection of an exemplary objective function. An exemplary simplified objective function and initialization parameters are described.
In some embodiments one component of the objective function(s) can be chosen to represent the smooth gradient of the specular chromaticity. As shown in
Moreover, a portion of the objective function can be chosen to take into account the interior chromatic homogeneity of the diffuse chromaticity and/or the sharp changes between chromaticity. This is shown in
Embodiments of the invention can determine the specular chromaticity of an image using a pseudo specular-free image that is calculated from the image and a dark channel image, which is a composite image from the red, green and blue channels of the image and is described in detail below. Typically, each frame is defined as a mix of red, green and blue colors. Each pixel, therefore, can be represented as a linear combination of red, green, and blue values. These different values are often called channels such as the red channel, the blue channel, and the green channel. This pseudo specular-free image can be used to iteratively solve one or more objective functions. Each pixel of the dark channel image can have for each pixel value the lowest pixel value of the corresponding red channel pixel, green channel pixel, and blue channel pixel. In some embodiments, this pseudo specular-free image can preserve color boundaries (chromaticity clusters) and/or can improve results when color channels are ambiguous in saturation values.
An input image I(x) can include red, blue and green channels. As noted above the reflectivity of the input image I(x) can be considered a combination of the diffuse, Id(x), and specular layers, Is(x):
I(x)=Id(x)+Is(x). (1)
This is shown in
In some embodiments the chromaticity of an image can be represented as a normalized color vector. The normalized color vector, for example, can represent each pixel for each channel as the pixel value divided by the sum of all pixel values in the channel:
where Ic(x) is one of the color channels.
The diffuse chromaticity layer can be represented as Λ(x) and the specular chromaticity layer can be represented as Γ(x). The chromaticity can then be rewritten as:
I(x)=md(x)Λ(x)+ms(x)Γ(x), (3)
where md and ms are the diffuse and specular reflection coefficients, respectively, which can depend on the imaging geometry.
In some embodiments of the invention, the specular chromaticity can be assumed to be uniform for a given image. That is, the red, green and blue channels contribute equally to the specular chromaticity:
Γr(x)=Γg(x)=Γb(x)=1/3. (4)
Without loss of generality, this can be achieved, for example, by normalizing the illumination chromaticity estimated from as a preprocessing step.
According to some embodiments of the invention, the specular component Is(x) can be estimated by first estimating the specular reflection coefficient ms(x) from the observed image I(x) and multiplying the specular reflection coefficient ms(x) by the uniform specular chromaticity Γ. That is, the specular layer can be found from:
I
s(x)=ms(x)Γ. (5)
The dichromatic reflection model in the chromaticity space can be represented as:
Ĩ(x)=α(x)Λ(x)+(1−α(x))Γ(x) (6)
where
Using equation (7), the specular reflection coefficient ms(x) can be recovered from
by the denormalization of intensities:
Σc∈{r,g,b}Ic=Σc∈{r,g,b}(mdΛ+msΓ)=md+ms. (8)
From this, the likelihood of the specular layer separation can be written as:
E
D(α, Λ)=Σx(Ĩ(x)−(α(x)Λ(x)+(1−α(x))Γ))2. (9)
This likelihood function can then be used in an iterative optimization problem to solve for α(x). However, embodiments of the invention include linear additions to the likelihood function. These can include, for example, a smoothness component that acts on the specular layer and/or an interior homogeneity component that acts on the diffuse portion.
In some embodiments, the smoothness component can be defined by the gradient of the specular component. The gradient can represent smoothness across edges.
E
s(α)=Σx∥∇(1−α(x)∥2, (10)
where, the gradient,
In some embodiments, the interior homogeneity component of the likelihood function can act on the diffuse component of the input image. As shown in
E
c(Λ, λ)=Σx∥∇Λλ(x))∥1+βλ∥λ(x)∥0, (11)
where λ={1, . . . , N} denotes the index for a set of chromaticities within the input image and Λλ(x) returns the chromaticity which Λ(x) indicates. βλis the weight to control the amount of sparsity on the diffuse chromaticity.
In some embodiments the likelihood functions noted above in equations (9), (10) and (11) can be combined as a linear combination of functions:
E(α, Λ, λ)=ED(α, Λ)+βsEs(α)+BcEc(Λ, λ), (12)
where and βs and βc are the regularization weights. To ease the computational difficulties with this equation, the continuous and discrete variables can be uncoupled with an auxiliary variable, such that:
E
c(Λ, λ, {tilde over (λ)})=Σx∥∇Λλ(x)∥1+βλ∥{tilde over (λ)}(x)∥0. (13)
Now, equation (12) can be rewritten as:
where {tilde over (λ)} is the auxiliary variable for λ of which the similarity is controlled by θ. As θ→0 equation (14) becomes equation (12). Equation (14) can be solved for λ and α, to return the specular reflectivity.
In some embodiments of the invention, a dark channel can be used to determine the diffuse chromaticity and specular chromaticity. This dark channel can be used to solve any optimization process; for example, the optimization processes outlined in
I
dark(x)=minc∈{r,g,b}Ic(x). (15)
The dark channel can be used to calculate a pseudo specular-free image:
I
c
pseudo(x)=Ic(x)−Idark(x). (16)
This pseudo specular-free image, created from the dark channel, can be used to initialize any algorithm used to separate specular reflections from a single image.
Use of a pseudo specular-free image can provide one or more benefits. For example, such an image does not have any ambiguity in the saturation value so that color boundaries can be preserved. This property can allow for accurate separation of the specular reflection in the presence of colors ambiguous in saturation value. As another example, this pseudo specular-free image can directly provide specular reflection in case the diffuse reflection of an object has low value in the saturation component.
At block 415 the pseudo specular-free image can be clustered into regions of similar chromaticity. For example, the pseudo specular-free image can be clustered based on the color of the regions within the image. The image can be clustered using any type of cluster analysis. The clustering can return an image (or matrix having the same dimension as the image) where each pixel indicates an index, λ, representing each clustered chromaticity. A chromaticity vector, Λ, can also be returned that indicates the average chromaticity of each cluster represented by index, λ. If there are five clusters in the image, then each pixel can be represented by index, λ, for example, with a number from 1 to 5. The chromaticity vector, Λ, can then include the five average values of each chromaticity.
Any type of clustering analysis can be performed. For example, clustering can be performed using k-means clustering, hierarchical clustering, centroid-based clustering, distributed-based clustering, Lloyd's algorithm, k-medians clustering, the expectation-maximization algorithm, density based clustering, linkage clustering, the CLARANS algorithm, the BIRCH algorithm, and/or canopy clustering.
In some embodiments the clustering can operate on the input image. In some embodiments this clustering can operate on the pseudo specular-free image.
At block 420 cluster indices and chromaticity values can be initialized. For example, initial index λ0, with the initial cluster indices Λ0 can be found in block 415. Then, the initial α0 can be found by solving:
E
D(α, Λ)=Σx(Ĩ(x)−(α(x)Λ(x)+(1−α(x))Γ))2. (17)
At block 425 these initial values can be used in one or more objective functions. For example, to solve for optimized indices in chromaticity space, {tilde over (λ)}t+1, for fixed αt, λt, and Λt, where initially t=0, the following objective function can be solved for {tilde over (λ)}t+1:
where β{tilde over (λ)}=βcβλ.
And to solve for αt+1 and Λt+1 for fixed λt and {tilde over (λ)}t the following objective function can be solved:
In some embodiments some portions of equation (20) can be left out. For example, the function can be computed without the βcΣx∥∇Λλ(x)∥1 term. As another example, the function can be computed without the βsρx∥∇(1−α(x)∥2 term. Various other combinations of objective functions can be used.
With these values in mind, at block 430 it can be determined whether the difference between consecutive specular layer separation values is less than some parameter. For example, this occurs when the difference between equation (13) and equation (14) is less than some error parameter κ.
E(αt+1, Λt+1, λt+1, {tilde over (λ)}t+1)−E(αt, Λt, {tilde over (λ)}t)<κ. (21)
In the event the difference is greater than error parameter κ, then process 400 returns to block 425 and repeats optimization of the objective function(s) with the new values obtained in the previous iteration.
If the difference is less than error parameter κ, then process 400 proceeds to block 435. Using the chromaticity indices λt and αt, the specular chromaticity, Is(x) can be returned using equations (5), (7) and (8).
Embodiments of the invention can be used, for example, in image processing applications to select and edit specular reflections in images. For example, a user can select a command that initiates selection of specular reflections of the image. The command can call an algorithm that uses process 200 to find the specular reflections in the image. If, for example, the user requests that the image of fruit shown in
Embodiments of the invention can be executed on computational system 1000 as part of any type of image processing application or other another type of application. For instance, embodiments of the invention can be used in stereo matching applications. These applications extract 3D information from digital images by comparing information about a scene from two vantage points. Because specular reflection changes depending on the view point, one of the two images may pick up a specular reflection while the other does not. This can lead to miscalculations of 3D information. Thus, in stereo matching applications, input images can be analyzed for specular reflectivity prior to being used to extract 3D information. Once areas that include specular reflections have been identified, these areas can be corrected or ignored. For example, these areas can be replaced with averages of nearby portions of the image. Various other corrections can be used.
As yet another example, embodiments of the invention can be used in image segmentation applications. Image segmentation is the process of assigning a label to every pixel in an image such that pixels with the same label share certain visual characteristics. A specular reflection within an image can show the reflection rather than the color of the object upon which the reflection occurs. As such the color and/or intensity of pixels representing the specular reflection may not be labeled with the object, which is the object of image segmentation. This can lead to pixels being mislabeled or mis-segmented. Similar problems can occur in image recognition techniques.
Embodiments of the invention can be used to provide improved specular information about an input image. This specular information
The computational system 1000, shown in
The computational system 1000 may further include (and/or be in communication with) one or more storage devices 1025, which can include, without limitation, local and/or network accessible storage and/or can include, without limitation, a disk drive, a drive array, an optical storage device, a solid-state storage device, such as a random access memory (“RAM”) and/or a read-only memory (“ROM”), which can be programmable, flash-updateable and/or the like. The computational system 1000 might also include a communications subsystem 1030, which can include without limitation a modem, a network card (wireless or wired), an infrared communication device, a wireless communication device and/or chipset (such as a Bluetooth device, an 802.6 device, a WiFi device, a WiMax device, cellular communication facilities, etc.), and/or the like. The communications subsystem 1030 may permit data to be exchanged with a network (such as the network described below, to name one example), and/or any other devices described herein. In many embodiments, the computational system 1000 will further include a working memory 1035, which can include a RAM or ROM device, as described above.
The computational system 1000 also can include software elements, shown as being currently located within the working memory 1035, including an operating system 1040 and/or other code, such as one or more application programs 1045, which may include computer programs of the invention, and/or may be designed to implement methods of the invention and/or configure systems of the invention, as described herein. For example, one or more procedures described with respect to the method(s) discussed above might be implemented as code and/or instructions executable by a computer (and/or a processor within a computer). A set of these instructions and/or codes might be stored on a computer-readable storage medium, such as the storage device(s) 1025 described above.
In some cases, the storage medium might be incorporated within the computational system 1000 or in communication with the computational system 1000. In other embodiments, the storage medium might be separate from a computational system 1000 (e.g., a removable medium, such as a compact disc, etc.), and/or provided in an installation package, such that the storage medium can be used to program a general purpose computer with the instructions/code stored thereon. These instructions might take the form of executable code, which is executable by the computational system 1000 and/or might take the form of source and/or installable code, which, upon compilation and/or installation on the computational system 1000 (e.g., using any of a variety of generally available compilers, installation programs, compression/decompression utilities, etc.) then takes the form of executable code.
Numerous specific details are set forth herein to provide a thorough understanding of the claimed subject matter. However, those skilled in the art will understand that the claimed subject matter may be practiced without these specific details. In other instances, methods, apparatuses or systems that would be known by one of ordinary skill have not been described in detail so as not to obscure claimed subject matter.
Some portions are presented in terms of algorithms or symbolic representations of operations on data bits or binary digital signals stored within a computing system memory, such as a computer memory. These algorithmic descriptions or representations are examples of techniques used by those of ordinary skill in the data processing arts to convey the substance of their work to others skilled in the art. An algorithm is a self-consistent sequence of operations or similar processing leading to a desired result. In this context, operations or processing involves physical manipulation of physical quantities. Typically, although not necessarily, such quantities may take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared or otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to such signals as bits, data, values, elements, symbols, characters, terms, numbers, numerals or the like. It should be understood, however, that all of these and similar terms are to be associated with appropriate physical quantities and are merely convenient labels. Unless specifically stated otherwise, it is appreciated that throughout this specification discussions utilizing terms such as “processing,” “computing,” “calculating,” “determining,” and “identifying” or the like refer to actions or processes of a computing device, such as one or more computers or a similar electronic computing device or devices, that manipulate or transform data represented as physical electronic or magnetic quantities within memories, registers, or other information storage devices, transmission devices, or display devices of the computing platform.
The system or systems discussed herein are not limited to any particular hardware architecture or configuration. A computing device can include any suitable arrangement of components that provides a result conditioned on one or more inputs. Suitable computing devices include multipurpose microprocessor-based computer systems accessing stored software that programs or configures the computing system from a general purpose computing apparatus to a specialized computing apparatus implementing one or more embodiments of the present subject matter. Any suitable programming, scripting, or other type of language or combinations of languages may be used to implement the teachings contained herein in software to be used in programming or configuring a computing device.
Embodiments of the methods disclosed herein may be performed in the operation of such computing devices. The order of the blocks presented in the examples above can be varied—for example, blocks can be re-ordered, combined, and/or broken into sub-blocks. Certain blocks or processes can be performed in parallel.
The use of “adapted to” or “configured to” herein is meant as open and inclusive language that does not foreclose devices adapted to or configured to perform additional tasks or steps. Additionally, the use of “based on” is meant to be open and inclusive, in that a process, step, calculation, or other action “based on” one or more recited conditions or values may, in practice, be based on additional conditions or values beyond those recited. Headings, lists, and numbering included herein are for ease of explanation only and are not meant to be limiting.
While the present subject matter has been described in detail with respect to specific embodiments thereof, it will be appreciated that those skilled in the art, upon attaining an understanding of the foregoing, may readily produce alterations to, variations of, and equivalents to such embodiments. Accordingly, it should be understood that the present disclosure has been presented for purposes of example rather than limitation, and does not preclude inclusion of such modifications, variations and/or additions to the present subject matter as would be readily apparent to one of ordinary skill in the art.
The present application claims priority to, and is a divisional application of, U.S. application Ser. No. 13/859,468 for “Single-Image Specular Reflection Separation” filed Apr. 9, 2013, now allowed, which is incorporated by reference herein in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | 13859468 | Apr 2013 | US |
Child | 15208091 | US |