APPARATUS AND METHOD FOR PERFORMING COORDINATE TRANSFORMATION EMPLOYING STORED VALUES AND INTERPOLATION

Abstract: A coordinate transformation method and apparatus that uses a lookup table to store a sample of transformed output values and an interpolator for interpolating between samples of the output values to provide an output data value. The samples are stored at varying sample spacings to accomodate varying curvatures of the transformation function so as to minimize interpolation errors.

Description: APPARATUS AND METHOD FOR PERFORMING COORDINATE TRANSFORMATION EMPLOYING STORED VALUES AND INTERPOLATION Field of the Invention The present invention relates to apparatus for performing nonlinear transformations on data values, such as color coordinate transformations on digital images, and more particularly to such apparatus wherein the transformations are performed by storing a sample of transformed values in a lookup table, and interpolating between the samples to produce a transformed value. Background of the Invention In color image processing it is often required to transform color image signals from one color space such as R,G,B to another such as C,M,Y,K. This transformation is frequently performed by employing three or four dimensional lookup tables to transform electronic image data representing color images from one color space to another, and also to transform color data from an input device into a desired color representation t- an output device. These tables consist of sparsely spaced data points regularly populating the three or four dimensional input color space and the output data is derived generally by performing a linear interpolation or signal dependent matrix operations on neighboring values over regularly defined regions within the input space. See for example U.S. patent number 4,275,413, entitled "Linear Interpolation for Color Correction," issued June 23, 1981 to Sakamoto, et al.; U.S. patent number 4,511,989, "Linear Interpolating Method and Color Conversion Apparatus Using This Method," issued April 16, 1985 to Sakamoto; and U.S. patent number 4,346,402 "Image Reproduction Apparatus,: issued August 24, 1982 to Pugsley. Generally speaking, these regions in the input color space are defined by a list of points within a lookup table arranged in a manner to facilitate retrieval. As shown in Figure 2, these points are samples on a three or four dimensional grid. Figure 2 shows an example of the division of a three dimensional volume where the coordinate axis are labeled A, B and C and may represent for example R, G, B color components. This construction is, however, non-optimal because when a linear or matrix approximation technique is used for interpolation, error is introduced by the straight line approximation of the interpolation technique. The magnitude of the error is related to the local curvature on a slope of the transformation function. This error can become extreme near a color gamut boundary, in certain regions of the color space depending on the specific color transformation. Figure 3 is a schematic diagram illustrating this prior art technique for performing transformations on data. As shown in Figure 3, lookup table 10 contains a regular sample of transformed data values f(x). The lookup table 10 and associated control logic is arranged to output a plurality of neighboring transformed values f(n) and f(n+l) where x is between n and n+1, in response to the high order bits of an input data value x. The transformed values f(n) and f(n+l) are supplied to an interpolator 12, along with the low order bits of the input data value. The interpolator 12 employs the low order bits as an interpolation factor F to interpolate a value f(x) between f(n) and f(n+l). Although the example in Figure 3 is shown as a one dimensional interpolator for ease of description, the concept is readily extended to higher dimensions such as three dimensions for color image signals. In an attempt to further reduce the size of the lookup table 10, for multidimensional data, such as color image data, it is known to perform a further transformation on each color component of the input image data prior to performing the color transformation to reduce the number of bits in the component data values. See U.S. patent number 4,346,402 issued August 24, 1982 to P.C. Pugsley. Also, for color image signals, special three dimensional interpolation algorithms have been proposed for increasing the efficiency of the interpolator 12. See for example U.S. patent number 4,275,413 issued to Sakamoto et al., June 23, 1981; U.S. patent number 4,477,833 issued October 16, 1984 to Clark et al,; and U.S. patent number 4,511,989 issued April 16, 1985 to Sakamoto. All of these prior art approaches suffer from the shortcoming that in regions where the multi-dimensional transformation function exhibits a high curvature, the interpolation results in greater error. If this problem is remedied simply by sampling the output values at a higher frequency to reduce the error, the size of the lookup table memory holding the sample of output values is greatly increased, and therefore becomes prohibitively costly. To illustrate the problem, a function f(x) is shown in Figure 4, having a high rate of curvature between the samples at n and n+1. The interpolated value f(x) between n and n+1 contains a large error, whereas the interpolated values Summary of the Invention It is an object of the present invention to provide a coordinate transformation method and apparatus of the type employing a lookup table to store a sample of transformed output values and an interpolator for interpolating between samples of the output values to provide an output data value, that overcomes the shortcomings noted above. The object is achieved according to the present invention by sampling the output values at varying sample spacings, selected to achieve a uniform magnitude of an error due to interpolation (which is related to the degree of curvature and shape of the transformation function) , and storing the sample in a lookup table. When neighboring samples are retrieved from the lookup table for performing interpolation, an interpolation factor is produced that is both a function of the sampling frequency of the neighboring samples, and the relative location of the input data value between the input data values corresponding to the sample output data values. In this way, the interpolation error can be minimized without unnecessarily increasing the storage size of the lookup table. In a preferred mode of practicing the invention, the digital data represents a color digital image, and the-transformation represents a multi-dimensional color coordinate transformation. The principle of operation of the present invention is illustrated in Figure 1, which shows an example for transforming one dimensional data. A nonlinear function f(x) having two regions of high curvature is shown in Figure 5. The function f(x) is sampled at a higher frequency in the regions of high curvature as shown by the sampling location marked on the axes. The sampled values of f(x) are stored in the lookup table 10 (see Fig. 1). Since the sampled output values are not taken on a regular spacing, as in the prior art, there is not a one-to-one correspondence between the high order bits of the input data and the addresses of the output data in the lookup table 10. Furthermore, since the spacing between output values is not fixed, the interpolation factor is not simply the lower order bits of the input data. To generate the correct address for the lookup table 10, and the appropriate interpolation factor for the interpolator 12, an address and interpolation factor generator 14 is provided. The address and interpolation factor generator 14 contains information about the sampling frequency of the function f(x) and the scheme for storing the samples of f(x) in lookup table 10, and generates the address and interpolation coefficient accordingly. Figure 6 shows an example of how this is accomplished. For this example, two sampling rates are employed, coarse and fine, and between any two coarse samples, the function is either sampled at the fine rate or it is not. The address and interpolation factor generator 14 comprises a coarse sample lookup table 16, a fine sample—lookup table 18, and a summer 20. The sampled values of f(x) are addressed in the lookup table 10 according to the scheme shown in Table 1 below: TABLE 1 LOOKUP TABLE VALUE F(X) ADDRESS CONTENTS 1 2 3 coarse sample values n n+1 fine sample values in a first finely sampled region n+m n+m.+1 fine sample values in a second finely sample region n+m The base address and the sampling frequency codes are stored in the coarse sample lookup table 16 as shown in Table 2: n+1 Fine Size m. Coarse nm 1 +l Fine Size m. The input values to the coarse sample lookup table 16 are the high order bits of the input data word. The fine sample lookup table 18 receives the low order bits of the input data word, and upplies an offset address and an interpolation factor . When the coarse sample lookup table 16 indicates that there is no fine sampling in the interval, the address offset is zero, and the interpolation factor is proportional to the input value (i.e. the least significant bits of the input data value) . When fine sampling occurs in the interval, the address offset is proportional to the ratio of the input value n to the sampling rate S in the interval. For example, if the input value could take on 32 possible values in the interval, and the fine sampling occurred at a rate of 8 samples on the interval, the address offset would be the integer portion of n divided by 8. Similarly, the interpolation factor cycles between zero and N/S, S times in the interval. The address for lookup table 10 is produced in summer 20 by adding the base address from the coarse sample lookup table 16 and the address offset from the fine sample lookup table 18. Since the interpolator 12 requires 2 interpolation values to perform the interpolation, means 22 are provided for incrementing the address by one and sending the incremented address value to the lookup table 10. Alternatively, the lookup table 10 can be structured to automatically provide both values at the current address, and the next address. See for example U.S. patent application number 385,242 entitled "System for Performing Linear Interpolation," filed July 25, 1989 by Newman et al. which is incorporated herein by reference. The interpolation factor and the two output values from lookup table 10 are then employed to produce an interpolated value in a known manner, for example according to a well known linear interpolation formula; f(x)=[f(n).F i ]+[f(n+l).(l-F i )], (1) where f(x) is the interpolated value, f(n) and f(n+l) are successive stored values, and F. is the interpolation factor which lies between 0 and 1. In the preferred embodiment of the invention, the transformation apparatus is employed to perform transformations on functions of three or four variables. The technique effectively divides the multidimensional input space into variable sized regions as shown schematically in Figure 7. In regions where the transformation function has a high rate of curvature, such as in the regions labeled 30 and 32, the sampling rate is higher and in regions where the function changes less rapidly, the sampling rate is lower, thereby maximizing the storage efficiency of the transformation function lookup table. Brief Description of the Drawings Figure 1 is a schematic block diagram of transformation apparatus according to the present invention for transforming a function of one variable; Figure 2 is a diagram useful in describing the prior art apparatus for transforming a function of three variables; Figure 3 is a schematic block diagram of prior art apparatus for transforming a function of one variable; Figure 4 is a graph showing a function of one variable having a high degree of curvature useful in describing the operation of the prior art transformation apparatus shown in Figure 3; Figure 5 is a graph of a function of one variable having two regions of high curvature useful in describing the operation of the transformation apparatus shown in Figure 1; Figure 6 is a schematic block diagram of the address and interpolation factor generator shown in Figure 1; Figure 7 is a graph of a three dimensional input space useful in describing the operation of a preferred embodiment of the apparatus according to the present invention; — Figure 8 is a schematic block diagram of a preferred embodiment of the apparatus according to the present invention for performing a transformation on a function of three variables; Figure 9 is a diagram useful in describing the operation of the apparatus in Figure 8; Figure 10 is a schematic diagram showing the address and interpolation factor generator of Figure 8 in further detail; Figure 11 is a schematic diagram showing the address generator of Figure 10 in further detail; Figure 12 is a diagram useful in describing the operation of the address generator of Figure 11; and Figure 13 is a schematic diagram illustrating an alternative embodiment of a portion of the address and interpolation factor generator shown in Figure 10. Modes of Carrying Out the Invention Referring now to Figure 8, apparatus will be described for performing a transformation that is a function of three variables A, B, and C. Three variables represent, for example, three color components such as R, G, and B to produce an output value f(A,B,C) that may for example represent the cyan component of a CMY color space. The other color components M and Y could be produced simultaneously in similar apparatus, or could be produced sequentially from the same apparatus by changing the values stored in the lookup tables. The three input values A, B, and C, represented, for example, by 8-bit digital words are supplied to the address and interpolation factor generator 40. For a three variable transformation function, eight interpolation values f(A.B.C) are required. As shown n Figure 9, these eight values lie at the eight corners of a cube in the three dimensional input data space. To retrieve these eight values from the lookup table 42, eight addresses are generated by the address and interpolation factor generator 40 and sent to the lookup table 42. In response to the eight addresses, the lookup table 42 supplies eight interpolation values f(A.B.C.) where i ■ 0,1 to the interpolator 44. Alternatively, the lookup table 42 can be structured to automatically provide all eight values in response to the input value A 0 B_C 0 as shown in the above referenced U.S. patent number 385,242. The address and interpolation factor generator 40 also supplies three interpolation factors F.,F B ,F C for performing the three dimensional linear interpolation between the eight values. The transformed value samples are stored in the lookup table 42 in the order shown in table 4. TABLE 4 0 1 2 8x8x8 coarse samples 511 512 8x8x4 fine sampled region 767 768 4x8x16 fine sampled region 1023 1024 4x4x4 fine sampled region 1087 For the example shown in table 4, the input data space is coarsely divided into 8x8x8 samples. Three of the regions in the sample space are further subsampled. A first region is subsampled in 8x8x4 fine samples. A second region is subsampled into 4x8x16 subsamples, and a-third region is subsampled with 4x4x4 fine samples. The sample values are outlined in the table by listing the sample along the A axis, incrementing B by one, and listing the samples along the A axis etc. as shown in Figure 7. After a first layer of samples is listed from an AB plane, C's incremented by one and the next layer is listed. The interpolator 44 receives the eight transformed values f(A.B.C.) from the lookup table 42 and the interpolation factors F A. F D_ and F c from the address and interpolation factor generator 40, and generates an interpolated value f(A,B,C) using some form of three dimensional linear interpolation. It should be noted that three dimensional linear interpolation is not a well defined operation , and different approaches will produce slightly different values. The particular method of three dimension interpolation employed with the present invention is not a critical aspect of the present invention. A straight forward trilinear interpolation can be performed as follows: f(A,B,C) - f(A 0 B 0 C 0 ).(l-F A )(l-F B )(l-F c ) + f(A 1 B () C 0 ).F A (l-F B )(l-F c ) f<A 0 B 1 C 0 ).(l-F A ).F B _(l-F c f(A 0 B 0 C 1 ).(l-F A ).(l-F B ).F B + f(A 0 B lCl ).(l-F A ).F B .F c (2) + f(A 1 B 0 C 1 ).F A .(l-F B ).F B + f(A 1 B 1 C () ).F A .F B .(l-F c ) + f(A 1 B 1 C 1 ).F A .F B . F c , where f(A,B,C) is the interpolated value, f(A.B.C.) are the eight-values at the corners of the cube shown in Figure 9 , and F A F β and F c are the interpolation factors in directions A B & C respectively and these factors lie between 0 and 1. Alternatively, improved multidimensional linear interpolation methods requiring fewer multiplications or providing greater interpolation accuracy, such as that disclosed in U.S. patent no. 4,275,413 issued June 23, 1981 to Sakamoto et al. (which is incorporated herein by reference) may be employed. The address and interpolation factor generator 40 will now be described in further detail with reference to Figure 10. The address and interpolation factor generator 40 includes a coarse sample lookup table 46 and fine sample lookup tables 48, 50 and 52, one fine sample lookup table for each component of the input data. The coarse sample lookup table 46 receives the three most significant bits from each of the three components of the input data values A, B, and C, and employs the 9 bits to address a lookup table that contains for each possible 9 bit address location the following information: 1. a base address corresponding to table 42 of the coarse sample located at the corner of a course region nearest the origin in the sample space in which the input data lies. If the course region is not subsampled, the base address is in the coarse sample portion of the lookup table shown in table 4 that is stored in lookup table 42. If the region is subsampled, the base address is the first value in the lookup table that represents the subsampled region of the course region. 2. A value N A representing the number of samples along the A axis^_ If the course region is not subsampled, A is the total number of coarse samples along the axis (e.g. 8). If the course region is subsampled, N. is the total number of fine samples along the A axis in the subsampled region (e.g. 2,4,8 etc.) . 3. A value N..N- representing the product of the number of samples along the A axis times the number of samples along the B axis. If the region is not subsampled, A .N β is the product of the total number of samples along the A axis and the B axis (e.g. 64). If the region is subsampled, N..N_ is the total number of fine samples along the A axis times the number along the B axis (e.g. 4,16,64 etc.) within a course region; and 4. Codes representing the subsampling rates along the A,B, and C axis across the course region. The base address and the values N A. and N . are supplied to the address generator 54, and the sample rate codes are supplied to the fine sample lookup tables 48, 50, and 52. Table 5 shows an example of the data stored in the coarse sample lookup table 46 corresponding to the lookup table data depicted in table 4. TABLE 5 Sample Rate Input Base Code Value Address N, N A' N B B C 64 460 1024 4 16 1 1 1 461 461 8 64 0 0 0 where sample rate code 0 ■= not subsampled 1 m 4 samples 2 ■ 8 samples 3 = 16 samples — As seen in table 5, for the first value in the table, the region is not subsampled, and the base address is the same as the input value. N A is 8 since the overall space is coarse sampled in an 8x8x8 pattern. Similarly N A .N β =64. At input value 60, the region is subsampled in an 8x8x4 pattern. Since this is the first subsampled region, the base address is 512, which is the next address following the coarse sample portion of the lookup table. For the following sample (input value is 61) the region is not subsampled, so again the base address is the same as the input address. The respective fine sample rates are supplied to the fine sampled lookup tables 48, 50, and 52, which produce in response to the least significant bits of the respective data values, an offset value, and an interpolation constant. Table 6 shows an example of the data stored in one of the fine sample lookup tables note that all three tables 48, 50, and 52 are identical. It should also be noted that when the transformation function f(A,B,C) is changed, for example to produce a different color function, the values in tables 48, 50, and 52 are not affected. As shown previously in table 6, when the region is not subsampled (fine sample rate-1) the offset value is zero, and the interpolation factor is directly proportional to the input value. When the fine sample rate is 4 fine samples per coarse sample, the offset is incremented each time the input value increases by eight, and the interpolation factor cycles from 1/8 to 7/8. As the sample rate increases, the offset increments over shorter intervals, and the interpolation factor cycles over shorter intervals as shown for sample rates 8 and 16. The interpolation values or terms 160, 161 and 162 are sent to the interpolation unit. The operation of the address generator 54 will now be described in further detail with reference to Figure 11 and 12. Referring first to Figure 12, there is shown a three dimensional region in A, B, C space similar to that shown in Figure 9. Although the region is shown as a generally cubic region for the sake of example, the sides of the A, B, and C directions will generally be unequal, unless the sample rates in each of these directions are equal and the course region encompassing the fine region is equal on all sides. A sample point N, represents the closest sample point to the origin. The other seven sample points employed in the interpolation are labelled in Figure 12 according to their location in the lookup table 42. The purpose of the address generator 54 is to produce the addresses as shown in Figure 12. Referring now to Figure 11, the address generator 54 includes a first summing circuit 60 that receives the base address and the three offsets from the A, B, and C fine sample lookup tables and produces the lookup table address for the sample N. The bits of the offset values from the fine sample lookup tables are sequentially interleaved to form an addend. That is, if the offset values are four bit values A.A-A-A.; B 1- B2_B_3B4. ; C 1- C2-C3-C4. , the least significant bit of the A offset is the least significant bit of the addend, the least significant bit of the B offset is the next last significant bit, and so on, so that the bit assignment of the offset addend supplied to the summing circuit 60 is C 1 B 1 A 1 C 2 B 2 A 2 C 3 B 3 A 3 C 4 B-A-. This value is added to the base address by the summing circuit 60 to produce the address of the value N located at the corner of an interpolation region. It is to be noted that this addressing scheme is subject to the constraint that there must be equal to or more than the number of subsamples along the A axis than along the B or C axis, and similarly there must be equal to or more than the number of subsamples along the B axis than along the C axis. If this constraint is not respected, the addresses of the lookup table 42 will not all be utilized, thereby wasting memory space. Alternatively, to avoid this constraint, means can be provided for making the offset calculation: offset - N 0 +(C 0 .N A .N B )+(B 0 .N A )+A 0 , (3) where N_ is the base address offset value, C Q is the offset value along the C axis, B_ is the offset value along the B axis, A_ is the offset value along the A axis, N. is the number of subsamples along the A axis, and N_ is the number of subsamples along the B axis. Figure 13 shows an arrangement for generating the offset value according to equation 3. In this arrangement, the product of the C offset value C fi from the C fine sample lookup table 48, and the quantity N..N R from the coarse sample lookup table 46 are taken in a multiplier 62. The product of the B offset value B π from the B fine sample lookup table 50 and the quantity N A from the coarse sample lookup table 46 are taken in a multiplier 64. The products from the multipliers 62 and 64 are added in an adder 66, and the A offset value A_ from the fine sample lookup table 52 is added to the sum in adder 68 to produce the final offset value. The final offset value is then supplied to the summer 60 in the address generator to produce the address value N. As shown in Figure 11, the value N is incremented by one in adder 70 to produce the address value N+l. The address value +N A is produced by adding the value N from summer 60 to the value N. from the coarse sample lookup table 46 in summer 42. Similarly, the address value N+(N A .N„) is produced by • * summer 74 and the address N+NA.+NA..NB„ is produced by summer 76. Each of the values from summers 72, 74, and 76 is likewise incremented by one in adders 78, 80, and 82 respectively to provide the addresses shown in Figure 11. The eight addresses produced by the address generator 54 are applied to the lookup table 42 to produce the interpolation values for interpolator 44 (see Fig. 8) . The invention has been described with reference to preferred embodiments thereof, however it will be appreciated that extensions and modifications can be made within the spirit and scope of the invention. For example, the use of lookup tables to transform each component of the input data prior to the multidimensional transformation performed by the apparatus of the present invention can be provided. Industrial Applicability and Advantages Coordinate transformation apparatus according to the present invention can be employed in color digital imaging processing apparatus and is advantageous in that a more efficient utilization of memory is achieved, and interpolation accuracy in areas where the interpolation error would other wise be large due to curvature of the function.

Claims: WHAT IS CLAIMED IS: 1. Apparatus for transforming input data into output data according to a nonlinear transformation function, characterized by: a. a lookup table containing, at address locations, output data corresponding to a sample of input data values taken at varying sample frequencies based on the rate of curvature of the transformation function; b. means responsive to a specific input data value for producing the address locations of a plurality of output data values corresponding to a plurality of sampled input data values in the neighborhood of said specific input data value, and interpolation factor(s) based on the sample frequency of the data values in the neighborhood and the relative location of said specific input data value with respect to said plurality of input values; c. means for applying the address locations to the lookup table to produce the plurality of output data values; and d. interpolation means coupled to the lookup table and the interpolation factor producing means, and responsive to the plurality of output data values and interpolation factors for producing an interpolated output data value corresponding to the specific input data value. 2. The apparatus claimed in claim 1, wherein the input data represents a point in an N-dimensional space. 3. The apparatus claimed in clair_ 2, wherein the input data represents a color digital image expressed in a three dimensional color space. 4. The apparatus claimed in claim 3, wherein the input color space is R,G,B. 5. The apparatus claimed in claim 1, wherein said input data comprises n-bit digital data values, and wherein said means responsive to a specific input data value is characterized by: a. means responsive to high order bits of said input data value for producing a base address and a code representing the sampling frequency of the input data values in the neighborhood of the input data value; b. means responsive to low order bits of said input data value and a code representing the sampling frequency for producing an offset address and an interpolation factor; and c. means for adding said base address and said offset address to produce said address locations of a plurality of output data values. 6. The apparatus claimed in Claim 5 wherein said address location producing means further includes a first summing circuit and the offsets are A B and C from each of the respective means responsive to low order bits. 7. The apparatus as claimed in Claim 6 wherein the bits of the offset value address are sequentially interleaved to form an addend A. A_ A 3 A-; B B 2 B 3 B 4 ; C χ C 2 C 3 C 4 - 8. The apparatus as claimed in Claim 7 wherein the least significant bit of the A offset is the least significant of the addend and the least significant bit of the B offset is the next least significant bit and the C offset is the least significant bit so that the bit assignment of the offsett addend is C, B. A, C 2 B 2 A 2 B 3 C_ A_ C 4 B 4 A 4 and that -there must be equal to or more than the number of subsamples along the A axis than along th B or C axis. 9. The apparatus as claimed in Claim 8 wherein the offset is equal to NO + ( v C0 • NA • NB n )( v BO • NA. + Ao 10. A method of storing data in a memory according to a nonlinear transformation function so as to provide output data in accordance with said transformation in response to input data comprising the steps of: storing in a lookup table at address locations, output data corresponding to a sample of input data values taken at varying sample frequencies based on the rate of curvature of said transformation function; producing address locations of a plurality of output data values corresponding to a plurality of sampled input data values in the neighborhood of said specific input data value, storing in a lookup table interpolation factor(s) based on the sample frequency of data values in the neighborhood and the relative location of said specific input data value with respect to said plurality of input values; applying the address location to the lookup table to produce the plurality of output data values; and producing an interpolation factor in response to the plurality of output data values and interpolation factors for producing an interpolated output data value corresponding to the specific input data value. 11. The method as set forth in Claim 10 wherein the input data represents a point in N-dimensional space. — 12. The method as set forth in Claim 11 wherein the input data represents a color digital image expressed in a three dimensional color space. 13. The method as set forth in Claim 12 wherein the input color space is R, G, B.

Inventors: MORTON ROGER ROY ADAMS, MORTON, ROGER, ROY, ADAMS
Applicants: EASTMAN KODAK CO, EASTMAN KODAK COMPANY
Application year: 1991
Main classification: G06F15
IPC codes: G06F1, G06F17, G06T1, H04N1