Method for calculating and displaying luminance in a computer graphics system

Abstract: A method for displaying an object on a screen (1) for use in computer grpahics and CAD, in which a nonlinear transformation treatment is applied to the luminance value of the surface of an object calculated in accordance with an illumination model expression with only ambient light and diffusedly reflected light taken into consideration to display an image (2) in which lighter and darker portions of the surface of the object are emphasized, whereby the object is expressed with glossiness on the surface thereof in a simulated manner. The color of the image can be designated by selecting a point in a cross-sectional chart having a fixed value of lightness of a color cube, of which coordinate axes represent hue, lightness, and saturation of color.

Description: BACKGROUND OF THE INVENTION A. Field of the Invention The present invention relates to an image displaying method for use in computer graphics and, more particularly, to a method for calculating and displaying luminance to obtain an image expressing glossiness of the surface of an object. B. Prior Art In the technical field of computer graphics, a shading treatment is generally applied to an image of an object to be displayed so that texture of the surface of the object may be expressed by the image. Except for the case where part or whole of the light incident on an object is transmitted through the object, namely, except for the case where the object is lucent or transparent, expressing of texture of the surface of the object depends on the diffusedly reflected light and specularly reflected light. Further, in practice, the method for calculating the luminance at a point on the surface of the object taking ambient light into consideration greatly contributes to the expressing of texture. Generally, when a shading process is performed, the calculation of the luminance at a point on the surface of an object is performed according to an illumination model expression. So far, as an illumination model expression simple in form and calculable in a short time, there is widely known the following expression (1) formed of a model expression of diffusedly reflected light according to Lambert's cosine law and a term having ambient light taken into consideration added thereto. where I: luminance at a point on the surface of an object k a : reflection coefficient of ambient light, (0 ≦ k a ≦ 1) I a : luminance of ambient light k d : diffuse reflection coefficient I j : luminance of the j th light source, (0 ≦ j ≦ m, 0 ≦ I j ≦ 1)  j : the angle formed between the direction vector Lj of the j th light source and the normal vector N at the point (refer to FIG. 11). However, since the glossiness of an object is produced by specularly reflected light, the texture of a glossy surface of an object cannot be expressed by the adoption of the luminance calculating method using the above mentioned expression (1). As a typical illumination model expression for expressing the texture of a glossy surface of an object, there is known the following expression (2), which is obtained by adding to the expression (1) an experimental model expression for specularly reflected light by Bui-Tuong-Phong. where K s : specular reflection coefficient (K s = 1 - K d , 0 ≦ k ≦ 1) n: index representing expanse of specularly reflected light (1 ≦ n, the larger the value of n is, the more spotlight-like the specularly reflected light becomes) α j : the angle formed between the j th specularly reflected light vector (the j th light-source direction vector and the regular-reflection direction vector with respect to the normal vector N at the point) L j ' and the visual-point direction vector E (refer to FIG. 12). In computer graphics, designation of color of a displayed image is made by representing the color of the surface of an object by a combination of three numerical elements. As three elements of color, there are known such as RGB (Red, Green, Blue), HSV (Hue, Saturation, Value), and HLS (Hue, Lightness, Saturation). By representing a color by a combination of three numerical elements as described above, color designation of a displayed image can be made by introducing a concept of a three-dimensional body (color cube) with the three elements taken along its coordinate axes. For example, a color cube of RGB representation becomes a cube having RGB as the axes as shown in FIG. 13, in which neutral colors (white - gray - black) exist in the diagonal connecting the point of black and the point of white. When a hexagonal pyramid is developed having the diagonal of the color cube of the above described RGB representation, where neutral colors exist, used as the axis of the value, a hexagonal-pyramid color cube of HSV representation as shown in FIG. 14 is obtained. When the above described color cube of HSV representation having the point of black as its vertex is further developed into a bicone having the points of black and white as its vertexes, a color cube of HLS representation as shown in FIG. 15 is obtained. Color designation of an image to be displayed has conventionally been made by designating the above three elements individually. For example, as shown in FIG. 16, by having the circular display area AR 1 provided for displaying H (hue), the strip area AR 2 horizontally elongated below the hue display area AR 1 provided for displaying S (saturation), and the strip area AR 3 horizontally elongated at the bottom provided for displaying L (lightness), the color designation of an image to be displayed has been made by individually designating H (hue), S(saturation), and L (lightness) by designating sections of the display areas AR 1 , AR 2 , and AR 3 . Further, a hue display for fine adjustment of H (hue) has been provided in the strip area AR 4 vertically elongated on the right-hand side of the hue display area AR 1 so that a fine adjustment of H (hue) can be achieved by designating a section of the display area AR 4 . Further, in applying a shading treatment to a displayed object in computer graphics, such a process as to change only the lightness (luminance) of the color designated by the HSV representation or HLS representation is practiced. When applying a shading treatment to an image of an object to be displayed to thereby express texture of the surface of the object as described above, if the calculation of luminance on the surface of the object is performed in accordance with an illumination model expression with only ambient light and diffusedly reflected light taken into consideration, it cannot be achieved to express glossiness of the surface of the object to be produced by specularly reflected light. Further, if an illumination model expression with all of the ambient light, diffusedly reflected light, and specularly reflected light taken into consideration is employed to express the glossiness of the surface of the object, a difficulty arises that it takes a very long time to perform the calculation. Besides, when applying a shading treatment to the image of an object to be displayed in computer graphics,, such a process to have only the lightness (luminance) of the surface of the object changed with the color existing thereon taken as the basis is performed. In other words, although only V or L is changed with H and S kept unchanged when color designation is made by HSV representation or HLS representation, color designation of the displayed image has nevertheless been made by individually designating the three elements as described above, and therefore vast amounts of labor and time have been taken for designating a desired color. In view of the above described points of problem involved in the prior art, an object of the present invention is to provide a method for displaying an image employing an illumination model expression with only ambient light and diffusedly reflected light taken into consideration and being capable of expressing an object having glossiness on the surface thereof. In view of the points of problem involved in the prior art as described above, a preferred embodiment of the present invention additionally provides a for simply and quickly achieving the color designation for the image. SUMMARY OF THE INVENTION A method for calculating and displaying the luminance of an image in accordance with the present invention is set forth in claim 1. According to said method, a non-linear transformation is applied to the luminance value of the surface of an object calculated in terms of an illumination model expression with only ambient light and diffusedly reflected light taken into consideration to display an image in which lighter and darker portions of the surface of the object are emphasized. In this way it is made possible to express an object with glossiness on the surface thereof in a simulated manner and, in addition, to calculate the luminance value on the surface of the object effectively in a short time. According to a preferred embodiment of the present invention which forms the subject matter of dependent claims 6 to 9, hue and saturation can be selected by a single operation of selecting a point in a cross-section, having a fixed value of lightness, of a color cube whose coordinate axes represent hue, lightness, and saturation of color, and therefore any color can be designated simply and effectively. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a flow chart showing steps of procedure for calculating and displaying luminance values according to a method of the present invention; FIG. 2 is a diagram useful for explaining nonlinear transformation in the method of the present invention; FIG. 3 is a flow chart showing steps of procedure for color designation for an image to be displayed according to a preferred embodiment of the invention; FIG. 4 is a diagram showing displayed contents on a display screen when color designation for an image is performed according to the procedure shown in the flow chart of FIG. 3; FIG. 5 is a flow chart showing steps of procedure for producing a display area for the above described color designation; FIG. 6 is a diagram showing a state of ID numbers distributed over the display area for color designation; FIG. 7 is a diagram showing a state of elements of hue distributed over the display area for color designation; FIG. 8 is a diagram showing a state of elements of saturation distributed over the display area for color designation; FIG. 9 and FIG. 10 are diagrams showing states of a cursor operated in the display area for designating a color; FIG. 11 and FIG. 12 are diagrams useful for explaining diffusedly reflected color model; FIG. 13 is a perspective view showing a color cube of RGB representation; FIG. 14 is a perspective view showing a hexagonal-pyramid color cube of HSV representation; FIG. 15 is a perspective view showing a hexagonal-pyramid color cube of HLS representation; FIG. 16 is a diagram showing a prior art display example of display areas for color designation; and FIG. 17a and FIG. 17b are diagrams showing luminance on the surface of an object displayed by the method of the present invention. DESCRIPTION OF THE PREFERRED EMBODIMENTS In the method for displaying an image according to the present invention, display of an image expressing an object having glossiness on the surface thereof is performed according to the procedure shown in the flow chart of FIG. 1. The flow chart of FIG. 1 shows a procedure in which the light source is arranged to be a parallel light source, the luminance value on the surface of the object is calculated according to the above mentioned illumination model expression (1), and a nonlinear transformation is performed according to Bezier curve of third order. In the procedure shown in the flow chart of FIG. 1, the color designation for the surface of the object is performed by HLS (Hue, Lightness, Saturation) representation, while H (hue) and S (saturation) on the surface of the object are supposed to be kept constant. The aforesaid color designation for the surface of the object is performed according to the procedure of the later described flow chart of FIG. 3. First, in the step 1, H (hue) and S (saturation) of the surface of the object to be displayed are designated, and the light-source direction vector L j , light-source luminance I j (1 ≦ j ≦ m), ambient light luminance I a , ambient light reflection coefficient k a , and the diffuse reflection coefficient k d are designated. In the next step 2, Bezier curve setting the relationship between the luminance value I on the surface of the object calculated by the above described illumination expression (1) and the luminance value I' after a nonlinear transformation process is performed, i.e., nonlinear transformation characteristic, is defined by controlling four control points thereof. Thereby, a nonlinear transformation characteristic as shown in FIG. 2, in which the luminance value I on the surface of the object calculated by the above described illumination model expression (1) is taken along the axis of abscissas and the luminance value I' after a nonlinear transformation process is made is taken along the axis of ordinates, and the minimum value of each of the luminance values I and I' is set to 0 and the maximum value thereof is set to 1, is provided. In the next step 3, the normal vector N at a point on the surface of the object to be displayed is calculated. In the next step 4, the angle  j formed between the light-source direction vector L j and the normal vector N calculated in the above step 3 is calculated and thereafter the luminance I* is calculated by the above mentioned expression (1). In the next step 5, the intersection (I*, I*') of the Bezier curve defined in the above step 2 and the straight line I = I* is obtained. In the next step 6, I*', which is the value obtained in the above step 5, is set for I' and L = I' is set for L (lightness). In the next step 7, color is displayed for the point with the color represented by H, L, and S. The procedure from the step 3 to the step 7 is followed for all points on the surface of the object to be displayed. In the step 8, it is decided whether or not the textile of the surface of the displayed image of the object is good. When the result of the decision is NO, the routine returns to the step 2, where the nonlinear transformation characteristic is changed by controlling the four control points of the Bezier curve and, then, the nonlinear transformation process is performed once again. When the decision of YES is reached, the procedure is ended. When the color on the surface of the object is designated and a shading treatment is applied to the same, the change from the luminance I obtained by calculation according to the expression (1) with no specularly reflected light taken into consideration to the luminance I' after the nonlinear transformation is performed can be said to be a transformation from L to L' because I = L is considered to hold. Further, since H and S are fixed in the shading process, the colors given to each point on the surface of the object in the course of the shading process are those present on the heavy line of the color cube A of FIG. 2, and the colors C 1 , C 2 , and C 3 of the color cube A corresponding to the luminance I calculated by the expression (1) are transformed into the colors C 1 ', C 2 ', and C 3 ' present on the heavy line of the color cube B. That is, the color C 1 at the lighter portion of the surface of the object is transformed into still lighter color C 1 ' and the color C 3 at the darker portion of the surface of the object is transformed into still darker color C 3 '. Thereby, an object having glossiness on its surface can be expressed in a simulated manner. Besides, as to the Bezier curve of the third order providing the aforesaid nonlinear transformation characteristic, the form of the curve, i.e., the nonlinear transformation characteristic, can be changed simply by controlling the four control points thereof. Therefore, the textile on the surface of the object can be controlled simply by controlling such four control points. FIG. 17a and FIG. 17b are representations of display data of an object, which is supposed to be of a spherical form, by contour lines for luminance, in which the luminance values on the surface are obtained on the assumption that the light source is located above the north pole (N) of the sphere, i.e., at the top of the drawing. In FIG. 17a, the light of the light source was subjected to a linear transformation in order to obtain the luminance values on the surface of the object. As a result, the luminance value on the surface of the sphere is gradually changed according as the angle formed between the light source and the surface changes, and hence, the display is provided with such natural glossiness as would be obtained when the light source were at infinity. On the other hand, in FIG. 17b, the light of the light source was subjected to a nonlinear transformation in order to obtain the luminance values on the surface of the object. As a result, the portion with high luminance are widely expanded around the north pole and the luminance is displayed to be sharply lowering around medium latitudes. Because of this, it is sensed by vision as if the light source were a spot light source, the light source were located just above the north pole, or the sphere were formed of a glossy surface. In a preferred embodiment of the invention, color designation for the surface of the body is performed according to the procedure shown in the flow chart of FIG. 3. In the step 1 of the flow chart of FIG. 3, display data is made up and an image 2 of the object is displayed on the display screen 1 in a line drawing as shown in FIG. 4. In the display screen 1, there is provided a display area (COLOR MAP) 3 requesting for color tone designation, and when the request for color designation is accepted (step 2), the routine advances to the step 3. In the step 3, a color chart, i.e., a cross-section at a preset value of lightness (for example 50%) of a color cube of HLS (Hue, Lightness, Saturation) representation, for example, which has three elements of color of hue, lightness, and saturation along its coordinate axes, is displayed in a circular display area 4 for color designation and also a QUIT area 5 for ending the color designation is displayed. The circular display area 4 is divided into microareas AR 0 , AR 1 , AR 2 , ... , AR m obtained by dividing the circular area, for example, into 11 divisions in the radial direction and into 72 divisions in the circumferential direction. All colors with the lightness of 50%, with saturation changing from 0% to 100% in the radial direction from the center of the circle to the circumference, and with hue changing from 0° to 360° in the circumferential direction are allocated to the microareas AR 0 , AR 1 , AR 2 , ... , AR m one after another. The display of the circular display area 4 in the step 3 is performed, for example, according to the procedure shown in the flow chart of FIG. 5. That is, in step 1, various settings are made. In step 2, the circular display area 4 is secured. In step 3, the circular display area 4 secured in the step 2 is made invisible. In step 4, the number of divisions of the circular display area 4 in its circumferential direction, i.e., the number of divisions of hue [dhue] is set to 72 and the number of divisions of the same in its radial direction, i.e., the number of divisions of saturation [dsat] is set to 11. In step 5, the circular display area 4 is divided according to the number of divisions [dhue] and [dsat] set up in the step 4 into microareas AR 0 , AR 1 , AR 2 , ... , AR m and each microarea is given its ID number. In step 6, each value in the arrays of hue and saturation is calculated. In step 7, the microareas AR 0 , AR 1 , AR 2 , ... , AR m are colored according to preset rules. Now, the rules for coloring the microareas AR 0 , AR 1 , AR 2 , ... , AR m will be described taking the case where the number of divisions of hue [dhue] is set to 10 and the number of divisions of saturation [dsat] is set to 11 as an example. In this case, the circular display area 4 is divided into 101 microareas AR 0 , AR 1 , AR 2 , ... , AR 100 as shown in FIG. 6. The area within the circle of the smallest radius is designated as microarea AR 0 and given ID No.[0]. In the area on the interior of the circle of the second smallest radius, they are designated as microareas AR 1 , AR 2 , ... , AR 10 and given ID Nos.[1], [2], ... , [10] in the circumferential direction. In the area on the interior of the circle of the third smallest radius, they are designated as microareas AR 11 , AR 12 , ... , AR 20 and given ID Nos.[11], [12], ... , [20]. ID numbers are given to the following microareas in like manner, and in the area on the interior of the circle of the largest radius, they are designated as microareas AR 91 , AR 92 , ... , AR 100 and given ID Nos.[91], [92], ... , [100] in the circumferential direction. For the array of elements of hue, i.e., Hue(h) [Hue(1), Hue(2), ... , Hue(10)], allocated to the divisions in the circumferential direction of the circular display area 4 as shown in FIG. 7, the values of hue are defined in increments of 360° /No. of divisions [dhue = 10], i.e., 36° , as shown in Table 1. Array of Hue Array of Elements Hue(h) Values of Hue (Unit: degree) Hue(1) 0 (360) Hue(2) 36 Hue(3) 72 Hue(4) 108 Hue(5) 144 Hue(6) 180 Hue(7) 216 Hue(8) 252 Hue(9) 288 Hue(10) 324 Further, as for the array of elements of saturation, i.e., Sat.(s) [Sat.(1), Sat.(2), ... , Sat.(11)], allocated to the divisions in the direction from the center to the circumference of the circular display area 4 as shown in FIG. 8, value 0% is defined for Sat.(1) and the values of saturation in increments of 100%/{No. of divisions [dsat = 11] - 1}, i.e., 10%, are defined for Sat.(2), Sat.(3), ... , Sat(11) as shown in Table 2. Array of Saturation Array of Elements Sat.(s) Values of Saturation (Unit: %) Sat.(1) 0 Sat.(2) 10 Sat.(3) 20 Sat.(4) 30 Sat.(5) 40 Sat.(6) 50 Sat.(7) 60 Sat.(8) 70 Sat.(9) 80 Sat.(10) 90 Sat.(11) 100 According to such rules, hue and saturation of the colors allocated to the microareas AR 0 , AR 1 , AR 2 , ... , AR m can be determined first by obtaining the No. s and No. h in the arrays of elements by calculating where integer ( ): a function obtaining the integer part by omitting fraction, and modular ( ): a function obtaining remainder in the division, and then taking up the value corresponding to the above mentioned array of elements Hue(h) and the array of elements Sat.(s). Incidentally, when n = 0, the value of saturation is obtained as the value of the array of elements Sat.(1), i.e., 0%, and the value of hue is insignificant. In the next step 4, an enlarged chart around the current color tone (initially, default data) is displayed in the preset square display area 6. In the next step 5, a cross-hair cursor 7 is moved with a mouse so that an arbitrary point (microarea AR n ) in the circular display area 4 or the square display area 6 is picked up. Thereby, hue and saturation are selected at the same time. In the next step 6, it is decided whether or not the ID No. [n] of the point (microarea AR n ) picked up in the step 5 is the same as the ID No. in the QUIT area 5, and if the result of decision is NO, the routine advances to the step 7. In the step 7, the color tone of the color of the point (microarea AR n ) picked up in the step 5 is determined according to the ID No. n. In the next step 8, the color tone determined in the step 7 is registered as the color tone of the surface of the object. In the next step 9, the shading treatment described above according to the procedure shown in the flow chart of FIG. 1 is applied to the displayed image of the object using the color tone registered in the step 7 and then the routine returns to the above described step 4. When the result of the decision in the step 6 is YES, the procedure moves to step 10, wherein the display areas 4, 5, and 6 are made invisible and the procedure is ended. In the computer graphics, the color of the surface of an object to be displayed is determined by the relationship between the normal vector N at the point of the object and the light source vector L, and it is expressed, in practice, as the inner product of the vectors N·L =| N| ·| L| cos where : the angle formed between the normal vector N and the light source vector L. The shading process in the above described step 9 is performed according to the following procedure of step 1 to step 3. Step 1: A color table in which various colors are stored is prepared in advance and it is prescribed which number of color out of the color table is used as the color of a point when what numerical value the product N·L takes. As to the contents of the color table, the color tone and lightness must have been given to each color. As to the lightness, it may be arranged to change in accordance with either linear or nonlinear transformation. Step 2: A collection of micro triangular or square planes approximating the surface of the object is produced. The normal vector N of each facet is calculated and the value of N·L is obtained, and then the color corresponding to the value of the product N·L is assigned to the facet as its color. Step 3: Since the boundary line of facets becomes noticeable when the colors of adjoining facets are different with each other, a dithering treatment is applied to gradate the color of the boundary.

Claims: A method of calculating and displaying the luminance of an image (2) on a screen (1), suitable for use in CAD and a computer graphics generating apparatus, said method comprising the steps of inputting display conditions of an object to be displayed, said display conditions comprising at least light parameters of ambient light (Ia, Ka) and diffusely reflected light (Kd) of said object; and calculating luminance values (I*) for each point of the surface of said object from said display conditions using an illumination model, characterized by further comprising the steps of defining a nonlinear transformation and applying said nonlinear transformation to said calculated luminance values (I*) for each point of said surface of said object to obtain a new set of luminance values (I'), said nonlinear transformation enhancing the contrast between lighter and darker areas of said surface of said object; and displaying said surface of said object using said new set of luminance values (I'). A method according to claim 1, characterized in that said display conditions further include at least color data (H, S) of said surface of said object, direction data (L j ) of a light source and luminance data of said light source (I j ). A method according to claim 2, characterized in that said color data comprise hue and saturation data (H, S). A method according to any one of claims 1 to 3, characterized in that said nonlinear transformation is represented by a Bezier curve defined by four control points on said screen (1) and said nonlinear transformation is performed according to said Bezier curve. A method according to claim 4, characterized in that said Bezier curve is generated in a normalized rectangular coordinate system (L, L') and exhibits a nonlinear characteristic defined by its two control points preset at the coordinates (0, 0) and (1, 1) and two other control points to be designated. A method according to any one of claims 1 to 5, characterized by further comprising the steps of displaying, on said screen (1), a circular color chart (4) for designating the color of said surface of said object, wherein said color chart (4) is divided into a plurality of areas (AR 0 , AR 1 , ... AR m ), each area (AR 0 , AR 1 , ... AR m ) representing specific color data; selecting a specific area (AR 0 , AR 1 , ... AR m ) in said color chart (4) with a cursor (7); registering the color data corresponding to said selected area (AR 0 , AR 1 , ... AR m ) of said color chart (4); coloring said surface of said object in accordance with said selected and registered color data; and displaying said colored surface of said object on said screen (1) on the basis of said new set of luminance values (I'). A method according to claim 6, characterized in that said circular color chart (4) is formed of a plurality of color charts adapted to be alternately selected, each color chart corresponding to one predetermined value of lightness (L) of color. A method according to claim 6 or 7, characterized in that in said circular color chart (4) a value of saturation (S) of said specific color data corresponding to each area (AR 0 , AR 1 , ... AR m ) changes from the center of the circle to the circumference of the circle. A method according to any one of claims 6 to 8, characterized in that in said circular color chart (4) a value of hue (H) of said specific color data corresponding to each area (AR 0 , AR 1 , ... AR m ) changes along the circumferential direction of the circle.

Inventors: FUMIE SAGA, TETSUZO KURAGANO, FUMIE, SAGA, TETSUZO, KURAGANO, Fumie, Saga, c/o SONY CORPORATION, Tetsuzo, Kuragano, c/o SONY CORPORATION
Applicants: SONY CORP, SONY CORPORATION
Application year: 1991
Main classification: G06T15
IPC codes: G06T11, G06T15