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 methods for identifying intrinsic components of an image, including illumination and material reflectance, and providing analytical information derived from the intrinsic components.
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, determining intrinsic component information as a function of spatio-spectral information for the image, and calculating analytical information, as a function of the intrinsic component information.
In a second 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, determining intrinsic component information as a function of spatio-spectral information for the image, and using the intrinsic component information to generate illumination information for use in a match of illumination characteristics between a first scene and a second scene.
In a third exemplary embodiment of the present invention, a device is provided. The device comprises a computer system arranged and configured to execute a routine to access an image file depicting an image, in a computer memory, determine intrinsic component information as a function of spatia-spectral information for the image, use the intrinsic component information to generate illumination information and output the illumination information for use in a match of illumination characteristics between a first scene and a second scene.
In a fourth exemplary embodiment of the present invention, a computer program product, disposed on a non-transitory computer readable media, is provided. The computer program product includes computer executable process steps operable to control a computer to provide an image file depicting an image, in a computer memory, determine intrinsic component information as a function of spatio-spectral information for the image and use the intrinsic component information to generate illumination information for use in a match of illumination characteristics between a first scene and a second scene.
In fifth 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, determining intrinsic component information as a function of spatio-spectral information for the image, and using the intrinsic component information to control illumination characteristics for a scene.
In a sixth exemplary embodiment of the present invention, a computer program product, disposed on a non-transitory computer readable media, is provided. The computer program product includes computer executable process steps operable to control a computer to provide an image file depicting an image, in a computer memory, determine intrinsic component information as a function of spatio-spectral information for the image and use the intrinsic component information to control illumination characteristics for a scene.
In a seventh exemplary embodiment of the present invention, a device is provided. The device comprises a computer system arranged and configured to execute a routine to access an image file depicting an image, in a computer memory, determine intrinsic component information as a function of spatio-spectral information for the image, and use the intrinsic component information to control illumination characteristics for a scene.
According to a feature of the device of the seventh exemplary embodiment of the present invention, the device includes an output adapted to be coupled to a lighting system to apply the intrinsic component information to control illumination characteristics for a scene.
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, non-transitory 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 programmed to carry out the steps of the methods of the present invention.
a is a flow chart for implementing color analytics for display on the color analytics box, according to a feature of the present invention,
b is a flow chart for analyzing illumination intensity histogram information for an image, according to a feature of the present invention,
a is a flow chart for identifying Type C token regions in the image file of
b is an original image used as an example in the identification of Type C tokens.
c shows Type C token regions in the image of
d shows Type B tokens, generated from the Type C tokens of
a is an illustration of a grid for a spatial hash, according to a feature of the present invention.
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
In an image operation, the CPU 12 operates to analyze the RGB values of the pixels of a stored image file 18 to achieve various objectives, such as, for example, to identify intrinsic components of an image such as, for example, illumination and material reflectance characteristics of an image depicted in the image file 18. A fundamental observation underlying a basic discovery of the inventions disclosed and claimed in the Friedhoff Patents, is that an image comprises two components, material and illumination. All changes in an image are caused by one or the other of these components. Knowledge regarding the illumination and material reflectance characteristics of an image can facilitate improved and more accurate processing in, for example, image processing, image analysis and computer vision applications.
For example, based upon the fundamental observation that an image comprises two components, material and illumination, the computer system 10 can be operated to differentiate between material aspects of the image such as, for example, object edges, and illumination boundaries, through recognition and analysis of spatio-spectral information. Spatio-spectral information is information relevant to contiguous pixels of an image depicted in an image file 18, such as spectral relationships among contiguous pixels, in terms of color bands, for example RGB values of the pixels, and the spatial extent of the pixel spectral characteristics. The spatio-spectral information is processed by the CPU 12 in a manner relevant to an intrinsic characteristic of the image, such as, for example, single material regions depicted in the image or the illumination affecting the image. Pursuant to a teaching of the present invention, spatio-spectral information relevant to, for example, illumination, can be used to derive significant analytical information for use in, for example, scene analysis in broadcast and film production environments.
To that end, one example of spatio-spectral information is information relevant to a spectral shift caused by the interplay between the incident or direct illuminant and the ambient illuminant that together comprise the illumination present at the time an image depicted in an image file 18 is recorded by the digital camera 14. The spectrum for the incident illuminant and the ambient illuminant can be different from one another. According to one of the teachings of the Friedhoff Patents, the spectral shift information for an illumination boundary causing a shadow is expressed by a characteristic spectral ratio formed by the interplay of the incident illuminant and the ambient illuminant.
A spectral shift caused by a shadow, i.e., a decrease of the intensity of the incident illuminant, will be substantially invariant over different materials present in a scene depicted in an image. Thus, a spectral ratio for an illumination boundary defining a shadow, once determined, is characteristic of illumination change across multiple materials depicted in the image being processed, and can be applied to derive analytical information, as will be described below.
A spectral ratio is a ratio based upon a difference in color or intensities between two areas of a scene depicted in an image, which may be caused by different materials, an illumination change or both. The characteristic spectral ratio is a spectral ratio for an illumination boundary and can be used to identify illumination information for an image such as the identification of illumination boundaries throughout the image. Generally, the characteristic spectral ratio provides relative color information between the dark side of an illumination boundary (illuminated by the ambient illumination) and the bright side of the boundary (illuminated by the ambient illumination+the direct illumination). The Friedhoff Patents teach automatic processes for determining a characteristic spectral ratio for an image, as will be described in more detail below.
Moreover, the spatio-spectral information enables techniques that can be used to generate 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). The separation of illumination from material in the intrinsic images provides the CPU 12 with images optimized for more effective and accurate further color and illumination analysis.
According to a feature of the present invention, spatio-spectral information, such as the characteristic spectral ratio, and any resulting information based upon the spatia-spectral information, such as, for example, intrinsic images, determined and generated by the CPU 12, are used to derive analytical information for the image being processed. The image being processed can be a series of images of a video. The analytical information is relevant to aspects of a scene, for example, illumination intensity and relative key light and fill light information for the set of a broadcast studio, as recorded by the digital camera 14. The analytical information is displayed, real time, on a control and display panel of the color analytics box 24 coupled to the CPU 12, for use, for example, by broadcast personnel, for example, in the control of set lighting.
Analytical information, such as illumination intensity and relative key light and fill light information, calculated according to an exemplary embodiment of the present invention, provides many advantages in the control of set lighting. For example, the analytical information can be used to improve continuity. When a particular scene is recorded over multiple days, the lighting in the environment where the scene is being recorded, for example, an outdoor setting, can change from day to day. The analytics can assist a lighting designer such that the lighting for the scene can be modified to have consistent fill light and key light relationships. For example, the lighting designer modifies the lighting based upon the analytics to keep shadows at the same depth and color.
In many productions, an actor performs in front of a green screen, and then composited onto another background. For best results, the illumination on the actor has to match the illumination on the background. Scene analytics can be used by a lighting designer to make certain that the lighting for each of the actor and background are the same. A similar advantageous use of the analytics relates to telepresence. News broadcasters are often in different locations and composited together to appear to be in the same location. The compositing results are optimized by using the analytic information from each location, to match the lighting.
A series of user controls 30 can be mounted on the panel of the color analytics box 24, each coupled to appropriate control circuits (not shown). For example, one of the user controls can be coupled to a toggle switch that changes the display on the intrinsic image screen 28 from the illumination image to the material reflectance image. An output screen 32 displays analytical information derived from processing by the CPU 12 of spatio-spectral information for a current image under analysis. In an exemplary embodiment of the present invention, the analytical information displayed on the output statistics screen 32 includes an illumination intensity histogram, a shadow depth indication and a display of relative fill light color.
a is a flow chart for implementing processes to determine color analytics for display on the color analytics box 24, according to a feature of the present invention. In step 1000, the CPU 12 receives as an input an image file 18 that represents a single image or one of a sequence of images in a video. In step 1002, the CPU 12 optionally uses the input image to generate an illumination image and a material reflectance image. In an exemplary embodiment, the CPU 12 executes log chromaticity clustering and spatio-spectral operator/constraint/solver techniques to generate the intrinsic images.
Pursuant to a feature of the present invention, the intrinsic image processing is performed at a token level. A token is spatio-spectral operator that defines a connected region of an image wherein the pixels of the region are related to one another in a manner relevant to identification of image features and characteristics such as an identification of materials and illumination. The pixels of a token can be related in terms of either homogeneous factors, such as, for example, close correlation of color among the pixels, or inhomogeneous factors, such as, for example, differing color values related geometrically in a color space such as RGB space, commonly referred to as a texture. The present invention utilizes spatio-spectral information relevant to contiguous pixels of an image depicted in an image file 18 to identify token regions. As noted above, the spatio-spectral information includes spectral relationships among contiguous pixels, in terms of color bands, for example the RGB values of the pixels, and the spatial extent of the pixel spectral characteristics relevant to a single material.
According to one exemplary embodiment of the present invention, tokens are each classified as either a Type A token, a Type B token or a Type C token. A Type A token is a connected image region comprising contiguous pixels that represent the largest possible region of the image encompassing a single material in the scene (uniform reflectance). A Type B token is a connected image region comprising contiguous pixels that represent a region of the image encompassing a single material in the scene, though not necessarily the maximal region of uniform reflectance corresponding to that material. A Type B token can also be defined as a collection of one or more image regions or pixels, all of which have the same reflectance (material color) though not necessarily all pixels which correspond to that material color. A Type C token comprises a connected image region of similar image properties among the contiguous pixels of the token, where similarity is defined with respect to a noise model for the imaging system used to record the image.
Referring now to
A 1st order uniform, homogeneous Type C token comprises a single robust color measurement among contiguous pixels of the image. At the start of the identification routine, the CPU 12 sets up a region map in memory. In step 100, the CPU 12 clears the region map and assigns a region ID, which is initially set at 1. An iteration for the routine, corresponding to a pixel number, is set at i=0, and a number for an N×N pixel array, for use as a seed to determine the token, is set an initial value, N=Nstart. Nstart can be any integer>0, for example it can be set at set at 11 or 15 pixels.
At step 102, a seed test is begun. The CPU 12 selects a first pixel, i=1, pixel (1, 1) for example (see
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 a number of pixels in an image ending at pixel (n, m), as shown in
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.
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
While each Type C token comprises a region of the image having a single robust color measurement among contiguous pixels of the image, the token may grow across material boundaries. Typically, different materials connect together in one Type C token via a neck region often located on shadow boundaries or in areas with varying illumination crossing different materials with similar hue but different intensities. A neck pixel can be identified by examining characteristics of adjacent pixels. When a pixel has two contiguous pixels on opposite sides that are not within the corresponding token, and two contiguous pixels on opposite sides that are within the corresponding token, the pixel is defined as a neck pixel.
If no, the CPU 12 exits the routine of
If yes, the CPU 12 proceeds to step 128 and operates to regrow the token from a seed location selected from among the unmarked pixels of the current token, as per the routine of
Subsequent to the regrowth of the token without the previously marked pixels, the CPU 12 returns to step 122 to test the newly regrown token. Neck testing identifies Type C tokens that cross material boundaries, and regrows the identified tokens to provide single material Type C tokens suitable for use in creating Type B tokens.
d shows Type B tokens generated from the Type C tokens of
A method and system for separating illumination and reflectance using a log chromaticity representation 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 color of an image, for example, as represented by Type C tokens. 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, according to the technique disclosed in U.S. Pat. No. 7,596,266, 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
According to the invention disclosed and claimed in related application Ser. No. 12/927,244, filed Nov. 10, 2010, entitled System and Method for Identifying Complex Tokens in an Image (expressly incorporated by reference herein and hereinafter referred to as “related invention”), log chromaticity values are calculated for each color depicted in an image file 18 input to the CPU 12 for identification of regions of the uniform reflectance (Type B tokens). For example, each pixel of a Type C token will be of approximately the same color value, for example, in terms of RGB values, as all the other constituent pixels of the same Type C token, within the noise level of the equipment used to record the image. Thus, an average of the color values for the constituent pixels of each particular Type C token can be used to represent the color value for the respective Type C token in the log chromaticity analysis.
Blend pixels are pixels between two differently colored regions of an image. If the colors between the two regions are plotted in RGB space, there is a linear transition between the colors, with each blend pixel, moving from one region to the next, being a weighted average of the colors of the two regions. Thus, each blend pixel does not represent a true color of the image. If blend pixels are present, relatively small Type C tokens, consisting of blend pixels, can be identified for areas of an image between two differently colored regions. By requiring a size minimum, the CPU 12 can eliminate tokens consisting of blend pixel from the analysis.
In step 204, the CPU 12 can alternatively collect colors at the pixel level, that is, the RGB values of the pixels of the input image file 18, as shown in
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, 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. 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 step 206, the CPU 12 outputs a list or lists of color (after executing one or both of steps 202 and/or 204). According to a feature of the related invention, all of the further processing can be executed using the list from either step 202 or 204, or vary the list used (one or the other of the lists from steps 202 or 204) at each subsequent step.
As taught in U.S. Pat. No. 7,596,266, and as noted above, orientation of the chromaticity plane is represented by N, N being a vector normal to the chromaticity representation, for example, the chromaticity plane of
For example, the CPU 12 can determine estimates based upon entropy minimization, manual selection of lit/shadowed regions of a same material by a user or the use of a characteristic spectral ratio (which corresponds to the orientation N) for an image of an input image file 18, as fully disclosed in U.S. Pat. No. 7,596,266. The characteristic spectral ratio can be automatically determined by the CPU 12 by implementing any one of the different techniques fully disclosed in the Friedhoff Patents, The techniques include identifying an X-junction in the image. An X-junction is an area of an image where a material edge and an illumination boundary cross one another and is an excellent example of spatio-spectral information. According to the technique disclosed in the Friedhoff Parents, a spectral ratio is determined for the illumination boundary in the area of the image defined by the identified X-junction.
For a higher dimensional set of colors, for example, an RYGB space (red, yellow, green, blue), the log chromaticity normal, N, defines a sub-space with one less dimension than the input space. Thus, in the four dimensional RYGB space, the normal N defines a three dimensional log chromaticity space. When the four dimensional RYGB values are projected into the three dimensional log chromaticity space, the projected values within the log chromaticity space are unaffected by illumination variation.
In step 214, the CPU 12 outputs an orientation for the normal N. As illustrated in the example of
In step 224, the CPU 12 operates to calculate a log value for each color in the list of colors and plots the log values in a three dimensional log space at respective (log R, log G, log B) coordinates, as illustrated in
According to a feature of the related invention, the CPU 12 then projects the log values for the colors A, B and C onto the log chromaticity plane to determine a u, v log chromaticity coordinate for each color. Each u, v log chromaticity coordinate can be expressed by the corresponding (log R, log G, log B) coordinate in the three dimensional log space. The CPU 12 outputs a list of the log chromaticity coordinates in step 226. The list cross-references each color to a u, v log chromaticity coordinate and to the pixels (or a Type C tokens) having the respective color (depending upon the list of colors used in the analysis (either step 202(tokens) or 204 (pixels))).
In step 234, the CPU 12 optionally operates to augment each log chromaticity coordinate with a tone mapping intensity for each corresponding pixel (or Type C token). The tone mapping intensity is determined using any known tone mapping technique. An augmentation with tone mapping intensity information provides a basis for clustering pixels or tokens that are grouped according to both similar log chromaticity coordinates and similar tone mapping intensities. This improves the accuracy of a clustering step.
In step 236, the CPU 12 optionally operates to augment each log chromaticity coordinate with x, y coordinates for the corresponding pixel (or an average of the x, y coordinates for the constituent pixels of a Type C token) (see
In each of steps 234 and 236, the augmented information can, in each case, be weighted by a factor w1 and w2, w3 respectively, to specify the relative importance and scale of the different dimensions in the augmented coordinates, The weight factors w1 and w2, w3 are user-specified. Accordingly, the (log R, log G, log B) coordinates for a pixel or Type C token is augmented to (log R, log G, log B, T*w1, x*w2, y*w3) where T, x and y are the tone mapped intensity, the x coordinate and the y coordinate, respectively.
In step 238, the CPU 12 outputs a list of the augmented coordinates. The augmented log chromaticity coordinates provide accurate illumination invariant representations of the pixels, or for a specified regional arrangement of an input image, such as, for example, Type C tokens. According to a feature of the related invention and the present invention, the illumination invariant characteristic of the log chromaticity coordinates is relied upon as a basis to identify regions of an image of a single material or reflectance, such as, for example, Type B tokens.
According to a feature of the present invention, the clustering step 242 is implemented as a function of an index of the type used in database management, for example, a hash index, a spatial hash index, b-trees or any other known index commonly used in a database management system. By implementing the clustering step 242 as a function of an index, the number of comparisons required to identify a cluster group for each pixel or token of an image is minimized. Accordingly, the clustering step can be executed by the CPU 12 in a minimum amount of time, to expedite the entire image process.
a is an illustration of a grid for a spatial hash, according to a feature of an exemplary embodiment of the present invention. As shown in
Each new pixel or token of the image being processed is placed in the grid, in the bucket it would occupy, as if the item (pixel or token) was a new group in the clustering process. The pixel or token is then examined relative to the clusters in, for example, a 3×3 grid of buckets surrounding the bucket occupied by the item being examined. The item is added to the cluster group within the 3×3 gird, for example, if the item is within a threshold for a clusterMean.
The CPU 12 also operates to calculate a center for each group identified in the clustering step. For example, the CPU 12 can determine a center for each group relative to a (log R, log G, log B, log T) space.
In step 244, the CPU 12 outputs a list of the cluster group memberships for the log chromaticity coordinates (cross referenced to either the corresponding pixels or Type C tokens) and/or a list of cluster group centers.
Pursuant to a further feature of the present invention, the list of cluster group memberships can be augmented with a user input of image characteristics. For example, a user can specify pixels or regions of the image that are of the same material reflectance. The CPU 12 operates to overlay the user specified pixels or regions of same reflectance onto the clustering group membership information.
As noted above, in the execution of the clustering method, the CPU 12 can use the list of colors from either the list generated through execution of step 202 of the routine of
In step 252, the list of cluster centers is input to the CPU 12. In step 254, the CPU 12 operates to classify each of the log chromaticity coordinates identified in step 250, according to the nearest cluster group center. In step 256, the CPU 12 outputs a list of the cluster group memberships for the log chromaticity coordinates based upon the new list of colors, with a cross reference to either corresponding pixels or Type C tokens, depending upon the list of colors used in step 250 (the list of colors generated in step 202 or the list of colors generated in step 204).
In step 266, the CPU 12 operates to merge each of the pixels, or specified regions of an input image, such as, for example, Type C tokens, having a same cluster group membership into a single region of the image to represent a region of uniform reflectance (Type B token). The CPU 12 performs such a merge operation for all of the pixels or tokens, as the case may be, for the input image file 18. In step 268, the CPU 12 outputs a list of all regions of uniform reflectance (and also of similar tone mapping intensities and x, y coordinates, if the log chromaticity coordinates were augmented in steps 234 and/or 236). It should be noted that each region of uniform reflectance (Type B token) determined according to the features of the related invention, potentially has significant illumination variation across the region.
U.S. Patent Publication No. US 2010/0142825 teaches a spatio-spectral operator/constraint/solver model for segregating illumination and material in an image, including an optimized solution based upon a same material constraint. A same material constraint, as taught in U.S. Patent Publication No. US 2010/0142825, utilizes Type C tokens as identified through execution of the routine of
Based upon the basic equation I=ML (I=the recorded image value, as stored in an image file 18, M=material reflectance component of the recorded image color, and L=illumination component of the recorded image color), log(I)=log (ML)=log (M)+log(L). This can be restated as i=m+l, wherein i represents log(I), m represents log(M) and l represents log(L). In the constraining relationship of a same material, in an example where three Type C tokens, a, b and c, (as shown in
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
Once the illumination values are known, the material color can be calculated by the CPU 12 using the I=ML equation. Intrinsic illumination and material images can be now be generated for the region defined by tokens a, b and c, by replacing each pixel in the original image by the calculated illumination values and material values, respectively. An example of an illumination image and material image, corresponding to the original image shown in
Implementation of the constraint/solver model according to the techniques and teachings of U.S. Patent Publication No. US 2010/0142825, utilizing the Type C tokens and Type B tokens obtained via a log chromaticity clustering technique according to the present invention, provides a highly effective and efficient method for generating intrinsic images corresponding to an original input image. The intrinsic images can be used to enhance the accuracy and efficiency of image processing, image analysis and computer vision applications.
However, the intrinsic images generated from the performance of the exemplary embodiments of the present invention can include artifacts that distort the appearance of a scene depicted in the image being processed. The artifacts can be introduced through execution of the intrinsic image generations methods of the present invention, or through user modifications such as the user input of image characteristics discussed above. Accordingly, according to a feature of the present invention, various post processing techniques can be implemented to reduce the artifacts.
In step 302, the CPU 12 operates to perform an edge-preserving blur of the illumination in the illumination image by applying an edge preserving smoothing filter. The edge preserving smoothing filter can be any one of the known filters such as, for example, a bilateral filter, a guided filter, a mean-shift filter, a median filter, anisotropic diffusion and so on. The filter can be applied one or more times to the illumination image. In an exemplary embodiment, a bilateral filter is applied to the illumination image twice. In addition, several different types of filters can be applied in succession, for example, a median filter followed by a bilateral filter.
In step 304, the CPU 12 recalculates the intrinsic material reflectance image based upon the I=ML equation, and using the original image of the image file 18 and the illumination image, as modified in step 302. In step 306, the CPU 12 outputs intrinsic material reflectance and illumination images, as modified by the CPU 12 through execution of the routine of
A smoothing filter applied to the illumination image results in several improvements to the appearance of the intrinsic images when used in, for example, such applications as computer graphics. For example, in computer graphics, texture mapping is used to achieve certain special effects. Artists consider it desirable in the performance of texture mapping to have some fine scale texture form the illumination in the material reflectance image. By smoothing the illumination image, in step 302, the fine scale texture is moved to the material reflectance image upon a recalculation of the material image in step 304, as will be described below.
In addition, smoothing the illumination in step 302 places some of the shading illumination (illumination intensity variation due to curvature of a surface) back into the material reflectance image, giving the material image some expression of curvature. That results in an improved material depiction more suitable for artistic rendering in a computer graphics application.
Moreover, small reflectance variation sometimes erroneously ends up in the illumination image. The smoothing in step 302 forces the reflectance variation back into the material image.
In step 402, the CPU 12 operates to calculate derivatives (the differences between adjacent pixels) for the pixels of each of the original image and the material reflectance image. Variations between adjacent pixels, in the horizontal and vertical directions, are caused by varying illumination and different materials in the scene depicted in the original image. When the CPU 12 operates to factor the original image into intrinsic illumination and material reflectance images, some of the variation ends up in the illumination image and some ends up in the material reflectance image. Ideally, all of the variation in the illumination image is attributable to varying illumination, and all of the variation in the material reflectance image is attributable to different materials.
Thus, by removing the illumination variation, variations in the material reflectance image should be strictly less than variations in the original image. However, inaccuracies in the process for generating the intrinsic images can result in new edges appearing in the material reflectance image.
In step 404, the CPU 12 operates to identify the artifacts caused by the newly appearing edges by comparing the derivatives for the material reflectance image with the derivatives for the original image. The CPU 12 modifies the derivatives in the material reflectance image such that, for each derivative of the material reflectance image, the sign is preserved, but the magnitude is set at the minimum of the magnitude of the derivative in the original image and the material reflectance image. The modification can be expressed by the following equation:
derivativeReflectanceNew=min(abs(derivativeReflectanceOld),
abs(derivativeOriginalimage))*sign(derivativeReflectanceOld)
In step 406, the CPU integrates the modified derivatives to calculate a new material reflectance image. The new image is a material reflectance image without the newly appearing, artifact-causing edges. Any known technique can be implemented to perform the integration. For example, the CPU 12 can operate to perform numerical 2D integration by solving the 2D Poisson equation using discrete cosine transforms.
In step 408, the CPU 12 recalculates the intrinsic illumination image based upon the I=ML equation, and using the original image of the image file 18 and the material reflectance image, as modified in steps 404 and 406. In step 408, the CPU 12 outputs intrinsic material reflectance and illumination images, as modified by the CPU 12 through execution of the routine of
As described above, the BIDR model predicts the correct color for a material, in a shadow penumbra, from full shadow to fully lit. As shown in
According to the BIDR model, the illumination values in an image also define a line extending from the color of the ambient illuminant to the color of the combined ambient and direct illuminants. In log color space, the illumination line predicted by the BIDR model corresponds to the normal, N of the log color space chromaticity plane illustrated in
Various inaccuracies in the generation of the illumination and material intrinsic images, as described above, can also result, for example, in illumination values in the generated intrinsic illumination image that diverge from the line for the illumination values predicted by the BIDR model. According to the present invention, the illumination line prediction of the BIDR model is used to correct such inaccuracies by modifying the illumination to be linear in log(RGB) space.
Referring once again to
In the event the illumination and material reflectance images are generated via a method different from the log chromaticity clustering technique of the exemplary embodiment, the orientation N is determined by the CPU 12 in a separate step before the execution of the routine of
Moreover, in step 500, the CPU 12 also receives as input an original image (an image file 18), and the corresponding intrinsic material reflectance and illumination images determined by the CPU 12 through solution of the matrix equation shown in
In step 502, the CPU 12 determines the full illumination color in the illumination image. The full illumination color (ambient+direct) can be the brightest color value depicted in the illumination image. However, the brightest value can be inaccurate due to noise in the image or other outliers. In a preferred exemplary embodiment of the present invention, a more accurate determination is made by finding all illumination color values in a preselected range of percentiles of the intensities, for example, the 87th through 92nd percentiles, and calculating an average of those values. The average is used as the full illumination color value. Such an approach provides a robust estimate of the bright end of the illumination variation in the intrinsic illumination image.
In step 504, the CPU 12 operates to modify all of the pixels of the illumination image by projecting all of the illumination colors depicted by the pixels in the illumination image to the nearest point on a line having the orientation N (input to the CPU 12 in step 500) and passing through the full illumination color determined in step 302. Thus, the color of each pixel of the illumination image is modified to conform to the closest value required by the BIDR model prediction.
A special case exists for the pixels of the illumination image having an intensity that is greater than the full illumination color value, as calculated in step 502. The special case can be handled by the CPU 12 according to a number of different methods. In a first method, the modification is completed as with all the other pixels, by projecting each high intensity pixel to the nearest value on the illumination line. In a second method, each high intensity pixel is replaced by a pixel set at the full illumination color value. According to a third method, each high intensity pixel is kept at the color value as in the original image.
An additional method is implemented by using a weighted average for each high intensity pixel, of values determined according to the first and third methods, or of values determined according to the second and third methods. The weights would favor values calculated according to either the first or second methods when the values are similar to high intensity pixels that are not significantly brighter than the full illumination color value calculated in step 502. Values calculated via the third method are favored when values for high intensity pixels that are significantly brighter than the full illumination color value. Such a weighting scheme is useful when the I=ML equation for image characteristics is inaccurate, for example, in the presence of specular reflections.
Any known technique can be implemented to determine the relative weights for illumination values. In an exemplary embodiment of the present invention, a sigmoid function is constructed such that all the weight is on the value determined either according to the first or second methods, when the intensity of the high intensity pixel is at or near the full illumination color value, with a smooth transition to an equally weighted value, between a value determined either according to the first or second methods and a value determined according to the third method, as the intensity increases. That is followed by a further smooth transition to full weight on a value determined according to the third method, as the intensity increase significantly beyond the full illumination color value.
In step 506, the CPU 12 recalculates the intrinsic material reflectance image based upon the I=ML equation, and using the original image of the image file 18 and the illumination image, as modified in step 504. In step 508, the CPU 12 outputs intrinsic material reflectance and illumination images modified to strictly adhere to the predictions of the BIDR model.
For best results, the above-described post processing techniques can be executed in a log(RGB) space. Also, the various techniques can be executed in the order described above. Once one or more of the post processing techniques have been executed, the final modified intrinsic images can be white balanced and/or scaled, as desired, and output by the CPU 12.
According to another feature of the exemplary embodiment of the present invention, additional processing is implemented by the CPU 12 relative to faces depicted in a scene being recorded by a camera 14. U.S. Patent Publication No. US 2011/0150338 teaches a method for generating an intrinsic image using a single reflectance technique. Images depicted in some image files 18 are dominated by a single material, for example, skin in a human face. In such a case, the invention disclosed in U.S. Patent Publication No. US 2011/0150338 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.
In the exemplary embodiment of the present invention, the CPU 12 executes a known eye detector or other facial landmark locator, to locate faces in the image, then applies the single reflectance techniques taught by U.S. Patent Publication No. US 2011/0150338 relative to each detected face region, to identify single material regions consisting of skin pixels. The CPU 12 can be operated to block out a region of predetermined size, around detected eyes or other facial features, to define a face region and apply the techniques of U.S. Patent Publication No. US 2011/0150338 to the blocked out region. For each region of skin pixels, identified by the CPU 12, the CPU 12 can estimate a material reflectance for the skin of each detected face region, for example, the average of the 94th to 97th percentile brightest skin pixels for a particular face region. Based upon the I=ML equation, the CPU 12 can then estimate the illumination across each face using the recorded values for the skin pixels and the material reflectance estimates.
Referring once again to
In exemplary embodiments of the present invention, the statistics are determined either relative to the intrinsic images, or from the original image. Moreover, the statistics for each face in the image can be based upon the material and illumination estimates for the face, as determined by the CPU 12, implementing the techniques taught by U.S. Patent Publication No. US 2011/0150338. Optionally, the CPU 12 can smoothly interpolate the results for faces to the results for the rest of the image, for an approximate estimate for the entire image.
For example, the relative fill light information can be derived from the original image by determining a characteristic spectral ratio. In a preferred embodiment of the present invention, the characteristic spectral ratio is expressed by the ratio of Dark/(Bright-Dark), wherein Dark is the color on the dark side of an illumination boundary, and Bright is the color on the bright side of the boundary. As noted above, on the dark side, the image is illuminated by the ambient illumination and on the bright side, the image is illuminated by the ambient illumination+the direct illumination. In terms of the I=ML equation, the characteristic spectral ratio S can be expressed by:
S=Ambient*Reflectance/((Ambient+Direct)*Reflectance-Ambient*Reflectance)
S=Ambient/Direct
In broadcast terms, the fill light corresponds to the ambient illumination and the key light corresponds to the direct illumination. Thus, the characteristic spectral ratio provides a representation of relative fill light to key light information.
In the case when the CPU 12 generates the intrinsic images (step 1002), using the log chromaticity clustering technique described above, and/or performs the BIDR enforcement post processing technique, the N value (which corresponds to the characteristic spectral ratio) determined through execution of the routine of
In step 1004, the CPU 12 also operates to calculate the illumination intensity histogram. In an exemplary embodiment of the present invention, the CPU 12 performs the histogram calculation relative to a log color space representation of the illumination image generated in step 1002, and starts the histogram procedure by creating a list of bin counts, each bin count on the list initialized to 0. Each bin count represents a count of the number of pixels in the illumination image at a particular intensity. The number of bins can be set by a user.
In an exemplary embodiment of the present invention, the bin count is set at 100. The 100 bin counts cover a range, in log color space, of from −5.0 to 0.0. In the case of 100 bin counts for the range of from −5.0 to 0.0, the first bin is a count of all pixels in the illumination image having intensities of from −5.0 to −4.95, the second bin from −4.95 to −4.90, and so on to the last bin for the range of from −0.05 to 0.0.
Once the bin counts have been set up, the CPU 12 loops through all of the pixels in the illumination image. In a preferred embodiment of the present invention, certain pixels are not counted. For example, for human faces, a face mask can be used to reference each face depicted in an image under analysis, and only pixels within the face masks are counted in the histogram procedure. Moreover, pixels depicting such facial features as eyes and mouths can be ignored. These features can be determined via such techniques as adaptive shape models or as outlined by pre-defined shapes within each face mask. A separate illumination intensity histogram can be calculated for each detected face, using the estimated illumination and material reflectance for each respective face, as described above.
For each pixel of the illumination image to be counted, the CPU 12 examines the intensity of the pixel and determines the corresponding bin of the histogram to be incremented. Upon completion of the examination of all pixels to be counted, a histogram of integer counts of how many pixels are within each range of intensity represented by the bins of the list is determined.
In step 1006, the CPU 12 operates to generate outputs that represent a display of the statistics calculated in step 1004. For example, the characteristic spectral ratio representing the relative fill light color, when in an RGB space, comprises a three dimensional vector:
V=(Dred/(Bred−Dred), Dgreen/(Bgreen−Dgreen), Dblue/(Bblue−Dblue))
Wherein Bred is the red channel of a color measurement on the bright side color, Dred is the red channel color on the dark side, Bgreen and Bblue represent the green and blue channel colors on the bright side, respectively, and Dgreen and Dblue represent the green and blue colors on the dark side, respectively.
Thus, due to the S=Ambient/Direct relationship, the CPU 12 can use the vector representation of the characteristic spectral ratio to derive RGB values for a color representing relative fill light to key light information. The RGB values can be displayed as a color and/or as a location on a hue/saturation disc. To display the relative color of the fill light without regard to intensity, the vector representation for the characteristic spectral ratio can be normalized to have unit length, or converted to another standard chromaticity representation such as, for example, hue, saturation. Referring to
Moreover, in step 1006, the CPU 12 operates to execute a standard plotting technique to plot the histogram values calculated in step 1004. In the event a separate illumination intensity histogram was calculated for each detected face, a separate plot can be made for each face. As shown in
On the vertical axis, the plot indicates the number of pixels at each particular intensity level plotted along the horizontal axis. The vertical axis is scaled such that the maximum number of pixels in the histogram is covered in the plot.
To continue the execution of step 1006,
Isolation criteria is a technical term in topography that relates to a radius of dominance by a peak and specifies the distance from a peak value to the nearest higher peak value. Once an isolation value is set, the CPU 12 finds the brightest and darkest isolated peaks in the graph depicting the histogram. The location of the brightest isolated peak provides the fully lit illumination intensity and the location of the darkest isolated peak provides the full shadow illumination intensity.
In step 1016, the CPU 12 calculates a shadow depth. The ratio of the two isolated peak intensity values (or the difference in the log values) is a measure of the shadow depth. If there is only one isolated peak in the graph, there is no shadow in the scene, and the shadow depth is set at 1.0. In step 1018, the CPU 12 outputs the shadow depth information to complete execution of step 1006.
Referring once again to
In general, according to the teachings of the present invention, processing is performed to obtain analytical information relevant to color characteristics of a scene, using the multi-band intrinsic component information obtained as a function of spatio-spectral information for intrinsic material and illumination for surfaces depicted in the image, expressed in a spatial extent of the spectral characteristics. In addition to color analytics expressed in the illumination intensity histogram, shadow depth and relative fill light color information, discussed above, other indicia of scene color characteristics can be determined via an analysis of the intrinsic material reflectance and illumination information made available via the image processing techniques provided by the present invention.
As noted above, implementation of the constraint/solver model according to the techniques and teachings of U.S. Patent Publication No. US 2010/0142825 provides a highly effective and efficient method for generating intrinsic illumination images corresponding to original input images, such as a video containing a sequence of image files 18 depicting digital images corresponding to filmed scenes. The intrinsic illumination image for each original digital image is a set of pixels, each representing a vector of values corresponding to the color bands (such as red, green, and blue) of the illumination present at the time the scene was recorded. The color band information provided by the intrinsic illumination image is used to calculate direct and ambient illumination colors that are confounded in the illumination present at the time the scenes were recorded or filmed.
In step 1020, intrinsic illumination images for a sequence of filmed scenes is input to the CPU 12 as an illumination field. In step 1022, the CPU 12 analyzes the color values of the pixels depicted in the illumination field to determine fully lit and fully shadowed illumination colors. The fully lit illumination color can correspond, for example, to the average of the 95th through 97th percentile brightest pixels in the illumination field. The fully shadowed illumination color can correspond to the average of the 8th through 10th percentile brightest pixels.
In step 1024, the CPU 12 uses the fully lit and shadowed illumination colors to compute the direct and ambient illumination colors. The ambient illumination color equals the color value of the fully shadowed color value, and the direct illumination color equals the fully lit illumination color value minus the fully shadowed illumination color value.
In step 1026, the CPU 12 outputs the direct and ambient illumination colors as parameters for use by a user. A user can then proceed to use the direct and ambient color parameters in the rendering engine of a computer graphics application to create computer generated synthetic scenes with illumination color values that match the illumination values of the filmed scenes of the film project, for improved quality of the final film. The ambient and direct illumination color analysis can be performed relative to an entire image, or an analysis can be performed relative to each of several areas of an image to provide local ambient and direct illumination color parameters.
In the exemplary embodiment of the routine of
An analysis of a color pair by the CPU 12, starts with an assumption expressed by the equation L=A+D=(1, 1, 1), where L is the illumination color, A is the ambient illumination color, and D is the direct illumination color. The fully shadowed color (C1) of the selected color pair is expressed by the equation C1=A.*M, where M is the material reflectance and “.*” represents element-wise multiplication (C1red=Ared*Mred, C1green=Agreen*Mgreen, C1blue=Ablue*Mblue). The fully lit color of the selected pair (C2), is expressed by the equation C2=A.*M+D *M.
According to a feature of the preset invention, the above assumption and system of equations for C1 and C2 are utilized to solve for the ambient and direct illumination colors (A and D), for use as parameters in computer generated synthetic scenes. For example, C1./(C2−C1)=A.*M./(A.*M+D.*M-A.*M)=A./D. Therefore, A=D.*C1./(C2−C1) and D.*C1./(C2−C1)+D=(1, 1, 1). This relationship can be used to solve for D=(1, 1,1)./(C1./(C2−C1)+(1, 1, 1)), and then A=(1, 1, 1)−(1, 1,1)./(C1./(C2−C1)+(1, 1, 1)).
Referring once again to
Additionally, the routine of
For example, the concept can be used for illumination matching in a film project that includes a combination of filmed scenes and synthetic scenes, as described above. In the above example, the synthetic scenes are being generated after the filming of the related scenes, and the desire is to match the illumination used in the rendering of the synthetic scenes to the illumination present in the previously recorded scenes. In the example of the control routine of
In step 1100, a user inputs the desired illumination values, such as, for example, desired relative fill light color and desired shadow depth for a scene. In steps 1102 and 1104, the CPU 12 accesses an image file 18 and computes the relative fill light color and shadow depth, as described above. In the decision of step 1106, the CPU 12 compares the calculated fill light color and shadow depth values to the desired illumination values input by the user in step 1100.
According to a feature of the present invention, the comparison determines a match between the values within some preselected threshold. For example, a match can be calculated in terms of a Euclidean distance in RGB space between the calculated values and the desired values, or the squared difference between the values.
In the event that the values match (a difference within the threshold amount), the CPU 12 proceeds to the decision of step 1110. A user can set the routine for continual updating or a one time analysis (step 1110). If a continual updating routine is selected, the CPU 12 returns to step 1102, and continues processing. If a one time analysis was selected by the user, the CPU 12 proceeds to step 1112, to finish the routine. In the event that the values do not match, the CPU 12 proceeds to step 1108, to adust the fill light. After adjustment, the CPU 12 returns the adjusted image to step 1102.
Referring to
In the example of the dynamic control scheme of
For example, as shown in
Pursuant to another feature of the present invention, the control signals are set relative to fill light intensity and fill light color. A step size adjustment, according to a standard active control technique, is set for each of fill light intensity and color, with each step defining an amount of change. When shadow depth error is large, indicating too deep a shadow in the scene, as compared to a desired shadow, the CPU 12 operates to increase fill light brightness by a step size. When the shadow depth error is small, the CPU 12 operates to decreases fill light brightness by a step size. In a similar manner, fill light color is adjusted. For example, when the fill light is too red, the CPU 12 operates to decrease the red channel brightness by a step, and increase the blue and green channels, and so on. In this manner, the scene is recorded under illumination conditions that correspond to the desired illumination characteristics.
Steps 1204A and 1206A are executed by the CPU 12 as in the case of steps 1204 and 1206 in the routine of
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.
This application is a continuation-in-part of application Ser. No. 13/301,129, filed Nov. 21, 2011, entitled: “Color Analytics For A Digital Image,” which is hereby expressly incorporated by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 13301129 | Nov 2011 | US |
Child | 13465644 | US |