Many significant and commercially important uses of modern computer technology relate to images. These include image processing, image analysis and computer vision applications. In computer vision applications, such as, for example, object recognition and optical character recognition, it has been found that a separation of illumination and material aspects of an image can significantly improve the accuracy of computer performance. Significant pioneer inventions related to the illumination and material aspects of an image are disclosed in U.S. Pat. No. 7,873,219 to Richard Mark Friedhoff, entitled Differentiation Of Illumination And Reflection Boundaries and U.S. Pat. No. 7,672,530 to Richard Mark Friedhoff et al., entitled Method And System For Identifying Illumination Flux In An Image (hereinafter the Friedhoff patents).
The present invention provides an improvement and enhancement to the fundamental teachings of the Friedhoff patents, and includes a method and system comprising image techniques that accurately and correctly identify intrinsic images corresponding to an original image of a scene. The intrinsic images include an illumination image and a material reflectance image. According to a further feature of the present invention, a diffuse image is provided to separate desirable diffuse shading aspects of illumination from potentially undesirable cast shadow and strong trend aspects of illumination, for more accurate further processing.
In a first exemplary embodiment of the present invention, an automated, computerized method is provided for processing an image. According to a feature of the present invention, the method comprises the steps of providing an image file depicting an image, in a computer memory, providing a multi-class classifier trained to identify edges in an image relative to computer actions to be taken in respect to the respective edges, determined as a function of illumination effects in the image; and utilizing the multi-class classifier to automatically label edges in the image, for identification of computer actions to be taken in respect to the edges in the image.
According to a feature of the first exemplary embodiment of the present invention, the computer actions include actions that range from no adjustment to the edges, to reduction of edges' contrast, to removal of edges.
In a second exemplary embodiment of the present invention, a computer system is provided. The computer system comprises a CPU and a memory storing an image file containing an image. According to a feature of the present invention, the CPU is arranged and configured to execute a routine to provide a multi-class classifier trained to identify edges in an image relative to computer actions to be taken in respect to the respective edges, determined as a function of illumination effects in the image and utilize the multi-class classifier to automatically label edges in the image, for identification of computer actions to be taken in respect to the edges in the image.
In a third exemplary embodiment of the present invention, a computer program product is provided. According to a feature of the present invention, the computer program product is disposed on a computer readable media, and the product includes computer executable process steps operable to control a computer to: provide an image file depicting an image, in a computer memory, provide a multi-class classifier trained to identify edges in an image relative to computer actions to be taken in respect to the respective edges, determined as a function of illumination effects in the image and utilize the multi-class classifier to automatically label edges in the image, for identification of computer actions to be taken in respect to the edges in the image.
In accordance with yet further embodiments of the present invention, computer systems are provided, which include one or more computers configured (e.g., programmed) to perform the methods described above. In accordance with other embodiments of the present invention, computer readable media are provided which have stored thereon computer executable process steps operable to control a computer(s) to implement the embodiments described above. The present invention contemplates a computer readable media as any product that embodies information usable in a computer to execute the methods of the present invention, including instructions implemented as a hardware circuit, for example, as in an integrated circuit chip. The automated, computerized methods can be performed by a digital computer, analog computer, optical sensor, state machine, sequencer, integrated chip or any device or apparatus that can be designed or programed to carry out the steps of the methods of the present invention. Advantageously, the present invention can be implemented to improve the generation of a diffuse image, or for processing an original image relative to shadow removal or modification.
a is an original image used as an example in the identification of Type C tokens.
b shows Type C token regions in the image of
a is a graph depicting a typical sigmoid fit for an illumination edge, with an illustration of sigmoid parameters used to classify illumination edges in the flow chart routine of
b is a graph depicting a sigmoid fit to red, green, blue bands of pixels of an image edge being classified pursuant to the routine of
Referring now to the drawings, and initially to
Alternatively, the CPU 12 can be implemented as a microprocessor embedded in a device such as, for example, the digital camera 14 or a robot. The CPU 12 can also be equipped with a real time operating system for real time operations related to images, in connection with, for example, a robotic operation or an interactive operation with a user.
As shown in
According to a feature of the present invention, in an image process, the CPU 12 operates to analyze and process information, for example, the RGB values of the pixels of an image stored in an image file 18, to achieve various objectives, such as, for example, a correct and accurate identification of illumination and material aspects of the image. The present invention provides a method and system for generation of intrinsic images. The intrinsic images correspond to an original image, for example, an image depicted in an input image file 18. The intrinsic images include, for example, an illumination image, to capture the intensity and color of light incident upon each point on the surfaces depicted in the image, and a material reflectance image, to capture reflectance properties of surfaces depicted in the image (the percentage of each wavelength of light a surface reflects).
Images depicted in some image files 18 are dominated by a single material, for example, a lawn in a sports playing field, or skin in a human face. In such a case, the present invention utilizes the fact of the dominance of a single reflectance region of an image, to improve computer operations relevant to the generation of intrinsic images. To that end,
In step 1000 a selected image file 18 is input to the CPU 12. In step 1002, the CPU 12 executes a routine to detect a dominant image region of a single reflectance. According to a feature of the present invention, any one of several different methods can be implemented to detect the region of single reflectance. For example, step 1002 can be implemented via alternative methods, such as, for example, a log chromaticity clustering method, a large token analysis, a pixel stability analysis or a spectral analysis, as will appear.
In step 1004, the CPU 12 segregates the image as a function of the detected dominant, single reflectance region of the image depicted in the input image file 18. The segregation can be performed by the CPU 12 through execution of any one of several techniques, for example, a constraint/solver model, or a computation based upon pixels of the detected region of single reflectance. In step 1006, the CPU 12 performs post processing, such as, for example, a factoring of the illumination to provide an image illuminated by diffuse illumination, as will be described in more detail below, then outputs intrinsic images corresponding to the image of the input image file 18 (step 1008).
In the performance of step 1002 using log chromaticity clustering, the CPU 12 computes an illumination-invariant log chromaticity value for each pixel of the input image file 18. Log chromaticity is a technique for developing a two dimensional illumination invariant chromaticity space. A method and system for separating illumination and reflectance using a log chromaticity space is disclosed in U.S. Pat. No. 7,596,266, which is hereby expressly incorporated by reference. The techniques taught in U.S. Pat. No. 7,596,266 can be used to provide illumination invariant log chromaticity representation values for each pixel of an image.
Logarithmic values of the color band values of the image pixels are plotted on a log-color space graph. The logarithmic values are then projected to a log-chromaticity projection plane oriented as a function of a bi-illuminant dichromatic reflection model (BIDR model), to provide a log chromaticity value for each pixel, as taught in U.S. Pat. No. 7,596,266. The BIDR Model predicts that differing color measurement values fall within a cylinder in RGB space, from a dark end (in shadow) to a bright end (lit end), along a positive slope, when the color change is due to an illumination change forming a shadow over a single material of a scene depicted in the image.
Thus, the RGB values of each pixel in an image file 18 can be mapped by the CPU 12 from the image file value p(n, m, R, G, B) to a log value, then, through a projection to the chromaticity plane, to the corresponding u, v value, as shown in
Accordingly, all of the pixels of the input image file 18 representing the dominant region of single reflectance, for example, pixels corresponding to skin in an image depicting a human face, will have a similar log chromaticity value (within the noise level of the device used to record the image, for example, the camera 14), and be within a single cluster. The CPU 12 can implement any known clustering algorithm, to cluster pixel log chromaticity values. Pixels representing regions of the image other than the skin, for example, eyebrows, lips, the iris of the eye, and so on, will fall outside the single cluster corresponding to skin pixels. Thus, all pixels within the single large cluster will be designated as being in the dominant region of single reflectance.
In the performance of step 1002 using the alternative large token analysis, the CPU 12 initially computes Type C tokens. Referring now to
At step 102, a seed test is begun. The CPU 12 selects a first pixel, i=(1, 1) for example (see
If the comparison does not result in approximately equal values (for example, within the noise levels of the recording device for RGB values) for the pixels in the seed, the CPU 12 increments the value of i (step 106), for example, i=(1, 2), for a next N×N seed sample, and then tests to determine if i=imax (decision block 108).
If the pixel value is at imax, a value selected as a threshold for deciding to reduce the seed size for improved results, the seed size, N, is reduced (step 110), for example, from N=15 to N=12. In an exemplary embodiment of the present invention, imax can be set at i=(n, m). In this manner, the routine of
After reduction of the seed size, the routine returns to step 102, and continues to test for token seeds. An Nstop value (for example, N=2) is also checked in step 110 to determine if the analysis is complete. If the value of N is at Nstop, the CPU 12 has completed a survey of the image pixel arrays and exits the routine.
If the value of i is less than imax, and N is greater than Nstop, the routine returns to step 102, and continues to test for token seeds.
When a good seed (an N×N array with approximately equal pixel values) is found (block 104), the token is grown from the seed. In step 112, the CPU 12 pushes the pixels from the seed onto a queue. All of the pixels in the queue are marked with the current region ID in the region map. The CPU 12 then inquires as to whether the queue is empty (decision block 114). If the queue is not empty, the routine proceeds to step 116.
In step 116, the CPU 12 pops the front pixel off the queue and proceeds to step 118. In step 118, the CPU 12 marks “good” neighbors around the subject pixel, that is neighbors approximately equal in color value to the subject pixel, with the current region ID. All of the marked good neighbors are placed in the region map and also pushed onto the queue. The CPU 12 then returns to the decision block 114. The routine of steps 114, 116, 118 is repeated until the queue is empty. At that time, all of the pixels forming a token in the current region will have been identified and marked in the region map as a Type C token. In the event the pixels comprise intensity histogram representations, the token can be marked as Type CT.
When the queue is empty, the CPU 12 proceeds to step 120. At step 120, the CPU 12 increments the region ID for use with identification of a next token. The CPU 12 then returns to step 106 to repeat the routine in respect of the new current token region.
Upon arrival at N=Nstop, step 110 of the flow chart of
In the token size analysis implementation of step 1002, upon the identification of Type C tokens in the selected input image file 18, the CPU 12 performs an analysis of the identified Type C tokens. Type C tokens that include, for example, skin pixels will be large relative to tokens corresponding to pixels representing other features of the face, for example, eyebrows, lips, the iris of the eye, and so on. Thus, a threshold value for a number of pixels in a token can be set so as to be able to identify relatively large tokens, and thereby establish the region of a dominant, single reflectance. For example, the threshold size can be set as a function of the interocular distance (the distance between the eyes), such as: threshold=(interocular distance in pixels)/7.
In the performance of step 1002 using stability analysis, the CPU 12 operates to characterize the stability of pixels in an input image file 18 and defines a dominant region of single reflectance as a function of the pixel stability measurements. For example, the pixels of identified Type C tokens can be analyzed as to stability, the tokens included in the dominant region if the constituent pixels are stable. In a stability analysis, focus is placed upon how similar a subject pixel is to neighboring pixels. Pixels in a dominant region of an image will be similar to a large number of neighboring pixels. Stability can be measured using several different methods.
For example, second derivative energy can be used to indicate the stability of pixels of an image. In this approach, the CPU 12 calculates a second derivative at each pixel, or a subset of pixels disbursed across the image to cover all illumination conditions of the image depicted in an input image file 18, of the image depicted in an input image file 18, using a Difference of Gaussians, Laplacian of Gaussian, or similar filter. The second derivative energy for each pixel examined can then be calculated by the CPU 12 as the average of the absolute value of the second derivative in each color band (or the absolute value of the single value in a grayscale image), the sum of squares of the values of the second derivatives in each color band (or the square of the single value in a grayscale image), the maximum squared second derivative value across the color bands (or the square of the single value in a grayscale image), or any similar method. The sigma of the gaussian (defining the size of the second derivative filter) is adjusted to interocular distance when the subject image depicts a face.
Upon the calculation of the second derivative energy for each of the pixels, the CPU 12 analyzes the energy values of the pixels. There is an inverse relationship between second derivative energy and pixel stability, the higher the energy, the less stable the corresponding pixel. In an image having a dominant region of single reflectance, all of the pixels in the dominant region will have a similar low second derivative energy. The CPU 12 can identify all such pixels and thereby identify the dominant region of the image.
In a second method for measuring pixel stability, the CPU 12 utilizes a second derivative relative to a vertical direction. This is an approach based upon a recognition of the fact that certain features of the geometry of a face, for example, eyes, eyebrows, nostrils and lips, tend to be horizontally aligned features of a face. Thus, an image can be evaluated in the vertical direction by convolving an image horizontally with a 1-d gaussian filter of some sigma, and then vertically by a 1-d laplacian of gaussian filter. The sigma values used in each convolution process can be set based upon the interocular distance. The result provides second derivative energy information in the vertical direction, which can be used to detect horizontal stripes formed by eyes, eyebrows and lips, while ignoring vertical features such as vertical shadow boundaries. The second derivative energy in the vertical direction can be converted to a single value per pixel, for a stability analysis similar to the second derivative energy method described above.
According to a third method, the CPU 12 applies a bilateral filter to the image. A bilateral filter is an edge preserving blurring filter. The filter changes each pixel value to a weighted average of pixels surrounding a subject pixel. The weights in the weighted average correspond to how similar the surrounding pixels are to the subject pixel both in terms of spectral properties and spatial properties. Thus, a nearby pixel of similar color will have a high weight, while a distant pixel of dissimilar color will have a low weight.
While the weighted average is the typically used output of a known bilateral filter, according to a feature of the present invention, the sum of the weights that go into the weighted average is used to measure pixel stability. The higher the weight, the more similar a pixel is to more of nearby neighbors, and thus, the more stable it is. Each pixel in a dominant region of single reflectance will have a sum of weights for the surrounding pixels which is higher than the pixels representing other areas of the image. The size of the bilateral filter and the threshold for the sum of weights can be adjusted according to the interocular distance. As in the previous methods, this factor is evaluated by the CPU 12 to identify the dominant region in the image.
Stability of pixels can also be evaluated relative to local variance in pixel values. The CPU 12 calculates and evaluates the variance in red, green and blue values in a region surrounding each pixel (or variance in the single value for a grayscale image). The size of the region can be based upon interocular distance in an image depicting a face. The higher the variance, the less stable the pixel. Thus, the evaluation can be based upon the inverse relationship between stability and variance to identify a dominant region.
Each of the above methods for detecting pixel stability produces a value corresponding to the stability of each pixel. The stability values can be used to detect a dominant region by placing a threshold on the values at a preselected value determined empirically: for instance, all pixels which have a sufficiently low variance can be considered stable, and is included in the dominant region. The specific threshold used in all image can be set at a conservative level, for example, the 40th percentile local standard deviation. Any pixel more stable than the 40th percentile local standard deviation is classified, for example, as skin in a face image.
Such a conservative threshold value would result in a highly accurate classification of skin pixels. However, there may still be many additional skin pixels in the remaining 60% of the image. On the other hand, assuming 2% of a face image is involved in edges between skin and non-skin, a 98th percentile threshold would encompass all skin pixels. But such a high threshold value would produce results that also include many non-skin pixels. Thus, a single threshold value applied to all images would not necessarily yield the best result for any particular image.
According to a feature of the present invention, an adaptive stability technique is implemented to vary the specific threshold values to be used among different images. For example, the threshold used in any particular image is set as a function of the distribution of stabilities within the particular image. In an exemplary embodiment of the present invention, the CPU 12 is operated to perform an interpolation to determine a threshold value most suitable for a particular image, between the 40th percentile and the 98th percentile.
Empirically, such an interpolation is best performed implementing an exponential function. For example, a determination is made of the log of the 40th percentile and the log of the 98th percentile for a particular image. Then a linear interpolation is performed between the 40th and 98th percentiles and another value, for example the value at the 55th percentile, then exponentiate. For example:
Threshold=exp(55−40)/(98−40)*(log(98)−log(40))+log(40)
In an exemplary embodiment of the present invention, the stability processing is performed as a function of tokens. The stability of each token is determined based upon the stability of the constituent pixels of the token. For example, each token of the image is measured by the mean, median, max, min, 90th percentile, 10th percentile, or any other measure relative to the stability values of the constituent pixels of each respective token. If the chosen measure, for example, the median stability measure, is stable relative to the threshold selected for the respective image, the corresponding token is classified as stable.
The pixel stabilities can be optionally blurred prior to thresholding. Additionally, the resulting region after thresholding can be optionally eroded to remove isolated points and/or dilated to fill in holes.
According to a further exemplary embodiment of the present invention, the performance of step 1002 can be implemented using a spectral analysis. For example, if it is known or expected that the dominant region is a particular color, for example, green for grass in the playing filed of a stadium, then all pixels that are sufficiently similar to the expected color of the dominant region are placed in the region.
Once a dominant region of single reflectance is identified (step 1002), the CPU 12 proceeds to step 1004 to segregate the image into illumination and material aspects of the image. If, for example, the log chromaticity method was implemented to identify the region of single reflectance, the CPU 12 can identify the illumination aspects of the image via the relationship of I=ML, wherein I is the intensity of an image pixel, as recorded and stored in the image file 18, M is the material color and L the illumination value. In the situation of an image with a single dominant region of same reflectance, the CPU 12 can assume any color for all of the pixels within the single large region identified by the CPU 12, for example, a flesh tone, and then solve the I=ML equation for the illumination value of each pixel, using the assumed material color and the recorded value for I, for each pixel of the single dominant region. The result is an illumination map corresponding to the pixels of the dominant region of single reflectance.
Any known in-filling or in-painting technique can be used to expand the illumination filed for the dominant region of single reflectance, to pixels representing other areas of the image, for example, the eyes of an image depicting a human face. For example, a thin plate spline can be fit to the calculated illumination values and used to project the values for the illumination in other areas. For a more detailed description of in-filling or in-painting techniques, reference is made to “Inpainting and the Fundamental Problem of Image Processing” by Jianhong (Jackie) Shen, SIAM News, Volume 36, Number 5, June 2003.
Alternatively, a constraint/solver model can be implemented to segregate the image (step 1004), for example, when, for example, a tokenization was performed to identify the dominant region of single reflectance. The constraint/solver model in an exemplary embodiment of the present invention is implemented according to the teachings disclosed in U.S. Patent Publication No. US 2010/0142825. All of the Type C tokens identified as being in the region of single reflectance are constrained in a matrix equation, to be of a same material. All adjacent Type C tokens of the image of the image file 18 are also constrained in a matrix equation to be in a smooth-illumination constraint.
A smooth-illumination constraint can be used to determine the illumination in regions of the image including regions of the image that are outside the dominant region. In a smooth-illumination constraint, the constraint is based upon the average illumination of the pixels near a shared boundary between adjacent Type C tokens. This constrains the illumination field to be somewhat smooth, as opposed to piecewise constant throughout a token.
Since: ma=ia−la, mb=ib−lb, and mc=ic−lc these mathematical relationships can be expressed, in a same material constraint, as (1)la+(−1)lb+(0)lc=(ia−ib), (1)la+(0)lb+(−1)lc=(ia−ic) and (0)la+(1)lb+(−1)lc=(ib−ic).
Thus, in the matrix equation of
In a standard least squares solver, the matrix equations of
To obtain the illumination image, the la, lb and lc optimized values are substituted for the originally recorded RGB values, for each pixel of the respective tokens. As noted above, the matrix equation is arranged to express a same-material constraint between all of the Type C tokens identified as being in the dominant region of single reflectance, and a smooth-illumination constraint between all adjacent pairs of Type C tokens in the image of the image file 18. The CPU 12 can proceed to also generate a material image by calculating the ma, mb, mc values from the known recorded image values ia, ib, ic, and the determined la, lb and lc values, utilizing the model expressed by i=m+l.
Returning once again to
In the performance of the operations to segregate the image into illumination and material aspects of the image, the resulting material image does not contain any curvature information, and the resulting illumination image contains both curvature information and potentially undesirable illumination effects such as cast shadows and strong trends that can make one side of an image brighter than the other side, for example, when a face is lit from one side.
According to a feature of the present invention, in step 1006, a post processing operation can be performed to factor, for example, the illumination image so as to separate the diffuse shading aspects of the illumination image from the cast shadow and strong trend aspects of the illumination image. To that end, the CPU 12 is operated to perform an edge preserving blurring filter operation. For example, a bilateral filter can be applied to the illumination image to naturally preserve the sharp transitions due to cast shadows and strong trends. If the filter is applied several times in succession, for example, three or four times, the slowly-varying curvature will be removed from the illumination image, while the transitions due to cast shadows and strong trends will be retained in the modified illumination image.
In an exemplary embodiment of the present invention, the CPU 12 applies a bilateral filter to a log illumination image, one or more times in succession. The resulting blurred log illumination image, showing only cast shadows and strong trends, is then subtracted from the original log illumination image to provide a log diffuse shading illumination image. The log diffuse shading illumination image is then added to a log material image to generate a version of the original image as it would appear if originally illuminated by diffuse illumination. The subtraction and addition in log space is equivalent to dividing and multiply images in the original color space, such as RGB space.
In the event that only a diffuse-looking result image is needed for further processing (and not the diffuse illumination field separately), such as a face recognition operation, an edge preserving blurring technique can be applied to the illumination image, as described above, and then the original image is divided by this processed illumination image (or subtracted in log space) to obtain an image that appears like it was taken in diffuse conditions. This is mathematically equivalent to multiplying the diffuse shading by the reflectance image.
As an alternative to the bilateral filter, the CPU 12 can apply a mean shift procedure, anisotropic diffusion, or any other similar method that preserves potentially undesirable illumination effects, to provide a resulting image showing the cast shadow and strong trend aspects of the illumination image. The resulting image can then be manipulated with the original illumination image to generate a diffuse illumination image showing curvature information.
Similarly, a known retinex method can be implemented. A retinex operation removes small gradients, while retaining large gradients. Cast shadows cause large gradients, while curvature shading causes small gradients. Thus, a retinex method can be used as an edge preserving technique to separate the diffuse shading aspects of the illumination image from the cast shadow and strong trend aspects of the illumination image.
In a further exemplary embodiment of the present invention, a diffuse illumination image can be obtained by using an edge masking and reintegration technique. A known edge detection method, such as, for example, a Canny edge detection, is implemented by the CPU 12 to detect edges in an illumination image. The CPU 12 then calculates a gradient field for the illumination image, and sets the gradients for pixels along each detected edge to zero. The gradient field, as modified to zero out edge pixel gradients, is then reintegrated into the original illumination image to provide a diffuse illumination image. The reintegration can be performed utilizing any well known image reintegration technique, for reintegrating a gradient field into an image, such as, for example, a Poisson solver.
In accordance with another exemplary embodiment of the present invention, a multi-class illumination edge classifier is used by the CPU 12 to classify image edges so as to identify edges in the image being processed, for example, that are either not due to illumination (solely due to material reflectance change), due solely to illumination (for example, edges that cause potentially undesirable illumination effects such as cast shadows and strong trends), or due to both illumination and material/reflectance change (thus providing, for example, important curvature information). In this manner, for example, a process to generate a diffuse image is enhanced by providing a more accurate identification of both pure illumination edges that cause the potentially undesirable cast shadows and strong trends, and edges exhibiting partial illumination and material/reflectance change. Moreover, a shadow removal or modification method is also improved by providing a more accurate identification of pure illumination edges. The multiple class classification thus enables a classification of computer actions such as edge removal and edge reduction, relative to the type of edge, that result in a more accurate generation of a diffuse image, or an improved method for a more accurate shadow removal or modification.
In the exemplary embodiment of the present invention, image edge features for training a classifier are based upon a scaled, shifted sigmoid fit. Theoretically, features derived from any model that captures an expected shape of illumination change across an edge (for example, splines, polynomials, etc.), can be implemented to classify image edges.
a shows a graph depicting a typical sigmoid fit model representative of an illumination edge, with an indication of four sigmoid parameters that can be utilized as a basis to classify edges as being, for example, either due solely to illumination, only partially due to illumination or due to material/reflectance change. The parameters include:
For an edge analysis based upon a sigmoid fit, the underlying data are an edge pixel, selected along an image edge to be classified, and profile pixels extending perpendicular to the edge, from the selected edge pixel, on either side of the edge, to represent the illumination profile across the respective image edge. The underlying data are plotted. The plot includes a separate plot for each of the red, green and blue bands (RGB values) of each of the selected edge pixel and the profile pixels (illustrated as dots), and a corresponding sigmoid fit (illustrated as a solid line), as shown in
In
According to the exemplary embodiment of the present invention, a multiple class classifier, for classifying an edge as either solely or partially due to illumination, or a material edge, is trained by the CPU 12 using image features relevant to illumination effects, that are derived from the sigmoid model. The image features include the four basic parameters of the sigmoid fit, as described above, and other features computed as a function of the four basic parameters. The features include:
It should be noted that additional features can be derived from parameters of a different model fit to the residual of the original fit. In this case, the CPU 12 operates to model the intensity profile y with a sigmoid ysigmoid, then proceeds to compute the residual r=y−ysigmoid, fit a model to r and use fit parameters as additional features. For example, after fitting a sigmoid model for an illumination edge identified on skin depicted in a face image, at a location exhibiting significant sub-surface scattering, the CPU 12 can utilize an undershoot/overshoot pattern as a basis to inform a classification decision.
In the exemplary embodiment of the present invention, the coding is a color coding wherein a human operator views each image file of the training set, and assigns a label, using a graphical user interface, to mark off each edge to be used in the training, for example, assigning a different arbitrary color to each marked region, as a function of the type of edge. For example, a distinct color can be assigned as a descriptive label for each of a material edge, shadow edge (pure illumination), contour or geometric edge (partial illumination and material/reflectance), specularity and so on.
In an alternative exemplary embodiment, a system such as Mechanical Turk can be provided to the human operator, as a mechanism for labeling the training set.
After the images of the training set have been labeled and input to the CPU 12, the CPU 12 proceeds to step 1102. In step 1102, the CPU 12 optionally operates to perform the processes described above to generate intrinsic images (illumination and material images) corresponding to the images depicted in the image files 18 of the training set. The training can be performed relative to the original images, the intrinsic images, or a combination of both types of images.
In step 1104, the CPU 12 operates to detect the labeled edges of the images of the training set, for example, as a function of the color codes. In step 1106, the CPU 12 selects a representative edge pixel from each detected edge and, for each selected edge pixel, selects a set of profile pixels extending perpendicular to the edge, from the respective selected edge pixel, on either side of the edge, to represent the illumination profile across each respective image edge. The CPU 12 then operates to fit a sigmoid model to each color band in a respective plot of each illumination profile, as illustrated in
In step 1108, the CPU 12 computes, for each edge point, a set of features, for example, the ten types of features described above, to provide sets of features that correspond to the types of edges specified in the training set, for example, material edge, shadow edge, contour or geometric edge, and so on. All of the features computed for each edge point are concatenated into a feature vector for that edge point, to provide a feature vector for each edge. In this manner, according to a feature of the present invention, feature vectors can be calculated relative to illumination effects in the image, for example, indicative of a shadow edge (pure illumination) as opposed to a contour or geometric edge (partial illumination and material/reflectance change), and so on. The subsequent training, thus, enables a multiple class classification to thereby identify computer actions appropriate, relative to the type of edge, for a more accurate generation of a diffuse image and/or shadow removal or modification.
In step 1110, the CPU 12 utilizes the feature vectors to train a discriminative classifier, for example, according to a known computer learning technique, such as, for example, Support Vector Machines or Boosted Decision Trees. The edge classifier is output in step 1112.
According to a feature of the present invention, the multi-class edge classifier output in step 1112 is utilized by the CPU 12 in a run-time operation. In step 1114, an image file 18 is input to the CPU 12. The images input to the CPU 12 can be an original image, a material image, an illumination image, or a sequence of any combination of image types. Moreover, in step 1116, the CPU 12 optionally operates to perform the processes described above to generate intrinsic images from an original input image.
In step 1118, the CPU 12 executes an edge detection, such as, for example, a Canny edge detector, to identify the pixels that define image edges in the input image, and/or the corresponding intrinsic images. More complex edge detection techniques can be implemented to detect edges based upon multiple cues, such as, for example, color and texture.
In steps 1120 and 1122, the CPU 12 performs the same functions as in steps 1106 and 1108, to generate feature vectors for edge points of the edges of the input image detected in step 1118.
In step 1124, the CPU 12 applies the edge classifier trained in the off-line operation (step 1110) to the feature vectors for the input image, to classify each edge of the image depicted in the input image. The classification can be in the form of a score, for example, of from 0 to 1, with a score of 0 for an edge of the image corresponding to no likelihood that the edge is an edge of a particular type (for example, pure illumination edge or partial illumination and material/reflectance), a 1 corresponding to a high likelihood that the edge is of the respective type. A threshold value can be selected, for example, 0.8, such that each edge with a score that is above 0.8 is considered an edge of the respective type. As noted above, according to a feature of the present invention, the classification is according to a multiple class operation to identify computer actions to be taken, determined as a function of illumination effects observed at the edge in the image.
For example, when the classifier classifies an edge as due entirely to illumination, the classification indicates a CPU action for removal of the edge from the image. When the classifier classifies an edge as due to both illumination and material/reflectance change, the classification indicates a CPU action to reduce the contrast at the edge to eliminate the effect of illumination while preserving the effects that provide an indication of a material/reflectance change in the image at the edge location. When the classification indicates a material edge, the edge is left unaltered.
A multiple class classifier operation, such as provided by the exemplary embodiment of the present invention, can be implemented using a number of different classification methods. For example, the classification can be made relative to the type of edge (shadow, geometric, material, etc.) that is then translated by the CPU 12 to a corresponding action. This can be implemented by translating the edge type to the corresponding action prior to training to provide action classifiers. Alternatively, the CPU 12 is operated to train a set of classifiers, one for each type of edge, and is then operated to translate each classification output to the corresponding action.
Each of these implementations can be achieved via several different training methods. In a first method, the CPU 12 is operated to train a single, multi-class classifier (for example, Random Forest). The single multi-class classifier can directly assign one of the actions or types, as a function of the features. In a second method, the CPU 12 is operated to train a set of binary, one-vs-all classifiers. Each classifier of the set is trained for one of the specific types of edges (shadow, material, etc.). Each edge is classified by each of the set of classifiers, and a final classification for a specific edge is a consensus from the set of classifications, for example, the classification with the highest confidence among the set of classifications, relative to corresponding threshold values.
According to a third method, the CPU 12 is operated to train a cascade classifier. For example, the classifier includes a first level of classification, indicating a pure illumination edge for removal, when the classifier is above a threshold value for pure illumination. When an edge is classified as pure illumination, at the first level, the edge is removed from further classification analysis. If that edge is not classified as pure illumination, the edge continues to a second level of the cascade. At the second level, the classification is relative to a CPU action to reduce the contrast at the edge, and so on.
In an alternative exemplary embodiment, the multi-class classification is implemented as a learned regression model. In the alternative embodiment, the classifier is trained to learn a reduction factor as a function of the feature vectors. Thus, rather than provide a discrete set of classification labels (edge type or computer action), the classification outputs, for example, a real-valued gradient reduction factor. Accordingly, the removal of an edge is executed by setting, as a classification output, a gradient scaling factor to zero, with an edge contrast reduction having a classification output that is a non-zero scaling factor less than 1, with a scaling factor of 1 corresponding to leaving the edge as is.
As a further feature of the present invention, the CPU 12 is operated to propagate the classifications of edge pixels spatially along the edges to which the edge pixel belong. For example, the CPU 12 applies a 1D filter, for example, a 1D median filter, to the classifications of the edge points along each edge.
Upon classification of the edges of an input image in terms of computer actions, any number of known methods can be executed by the CPU 12 to achieve the desired removal/reduction actions. For example, the CPU 12 can perform the edge masking and reintegration technique described above. Moreover, the technique can be executed with respect to the original image and/or the corresponding illumination and material images, regardless of the image used to make the edge classification (original or corresponding intrinsic images).
In the case of execution of the computer actions in the original image, the CPU 12 executes the edge removal/reduction actions, as indicted by the classifications, to remove cast shadows and strong trends, while preserving contour information. In the case of execution of the computer actions in a corresponding illumination image, the result is an estimate of a diffuse illumination for the scene depicted in the image. After processing of the computer actions, the illumination image can be reapplied to the material image, to generate a diffuse image, as described above. The CPU 12 can also be operated to execute the removal/reduction actions in the corresponding material image. Some illumination effects can remain in the material image due to an imperfect separation of the illumination and material aspects in the original image. An execution of the removal/reduction actions by the CPU 12 in both the illumination and material images provides a more accurate generation of a diffuse image.
Returning once again to
In the preceding specification, the invention has been described with reference to specific exemplary embodiments and examples thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention as set forth in the claims that follow. The specification and drawings are accordingly to be regarded in an illustrative manner rather than a restrictive sense.
Number | Name | Date | Kind |
---|---|---|---|
6229578 | Acharya et al. | May 2001 | B1 |
7596266 | Maxwell et al. | Sep 2009 | B2 |
7672530 | Friedhoff et al. | Mar 2010 | B2 |
7873219 | Friedhoff et al. | Jan 2011 | B2 |
7912312 | Hsieh et al. | Mar 2011 | B2 |
20020031268 | Prabhakar et al. | Mar 2002 | A1 |
20080226175 | Suzuki et al. | Sep 2008 | A1 |
20090185050 | Chung et al. | Jul 2009 | A1 |
20100142805 | Maxwell et al. | Jun 2010 | A1 |
20100142825 | Maxwell et al. | Jun 2010 | A1 |
20110150358 | Smith et al. | Jun 2011 | A1 |
20110222742 | Stein et al. | Sep 2011 | A1 |
20120243790 | Campbell et al. | Sep 2012 | A1 |
Entry |
---|
Airie et al. “Fast and stable human detection using multiple classifiers based on subtraction stereo HOG features.” 2011 IEEE International Conference on Robotics and Automation, May 9, 2011. |
Jianhong (Jackie) Shen, “Inpainting and the Fundamental Problem of Image Processing”, SIAM News, vol. 36, No. 5, Jun. 2003. |
Number | Date | Country | |
---|---|---|---|
20130071033 A1 | Mar 2013 | US |