Image processing apparatus and method

Abstract: An image processing apparatus processes image information that includes pixels each of which have X-axis and Y-axis coordinates. The apparatus includes a circuit for processing the image information in an X-axis direction, a circuit for processing the image information in a Y-axis direction and a circuit for adding a predetermined value representing a coordinate in a Z-axis direction to each of the pixels of the image information so that the image information is expressed in three dimensions. In this way information representing a two-dimensional primitive image is transformed into pseudo three-dimensional image information that can be combined with three-dimensional images.

Description: This invention relates to image processing apparatus. WO 88/04804 discloses a method of converting two-dimensional motion pictures for three-dimensional systems. An image scanner converts an input image into digital form. The two-dimensional digital image is stored in a buffer memory. A computer interface allows a computer to read image data from the memory and write image data to the memory. A graphic input tablet and stylus allow a human operator to choose an image element and to specify, inter alia, image depth information. The depth information is applied to a chosen image element. An image element may be given a uniform depth. Alternatively, different portions of an image element may be given different depth designations with the computer interpolating depth coordinates over the whole image element. The computer may calculate depth information automatically. The processed image may be output to an image recorder via an output interface. Referring to Figs. 1 and 2 of the accompanying drawings in another previously proposed system an arbitrary figure PT 10, is represented by image data that consists of two-dimensional coordinates defined with respect to X and Y axes and that has no Z axis coordinate data. Such image data cannot easily be combined with image data defined by three-dimensional coordinates. For example, Fig. 3 of the accompanying drawings schematically illustrates image data PT 12 defined by two-dimensional coordinates and image data PT 13 defined by three-dimensional coordinates. When it is intended to display together images represented both by the data PT 12 and the data PT 13, the data that can accurately be displayed in two dimensions is determined by the order in which the respective image data PT 12 and PT 13 is written in memory. Accordingly, in order to combine image data defined by two-dimensional coordinates with image data defined by three-dimensional coordinates, it is necessary to add Z coordinate data to the image data defined by two-dimensional coordinates. It has been proposed to calculate such Z coordinate data by means of a processor operating under software control and then to add the calculated Z coordinate data to the two-dimensional image data. However, such calculation of Z coordinate data requires an undesirably long period of time. In accordance with one aspect of the invention, there is provided an apparatus for processing image information that includes pixels each having X-axis and Y-axis coordinates, the apparatus comprising: a circuit for processing said image information in an X-axis direction; a circuit for processing said image information in a Y-axis direction; and a Z-axis coordinate data adding circuit for adding a predetermined value representing a coordinate in a Z-axis direction to each said pixel of said image information so that said image information is expressed in three dimensions; the Z-axis coordinate data adding circuit including a first register for storing an initial Z value, a second register for storing an X-axis direction increment for the said Z value, a third register for storing a Y-axis direction increment for the said Z value, a first circuit for outputting the initial Z value for a first set of pixels in the X-axis direction and for outputting the Z value incremented by the Y-axis direction increment for each of a subsequent plurality of sets of pixels in the X-axis direction, and a second circuit for incrementing the Z value produced by the first circuit for a particular said set of pixels by the X-axis direction increment for each pixel of the set. According to an embodiment of the invention, the apparatus comprises an interface block for providing parameter pixel data including the said increments to be used for generating a polygonal primitive; a line block for generating contour pixel data from said parameter pixel data on the basis of a predetermined algorithm, said contour pixel data representing a contour of said primitive; a scan block for scanning the interior of said primitive in an X-axis direction by interpolating said contour pixel data in said X-axis direction to form primitive pixel data comprising two-dimensional coordinate data; said line block and said scan block including the said Z-axis coordinate data adding circuit for adding the Z-axis coordinate data to said primitive pixel data; and an interface block for supplying said primitive pixel data to a next stage circuit; a control block for controlling all of said blocks. The foregoing apparatus provides for rapid calculation of the Z-axis coordinate data required to transform two-dimensional image data into pseudo three-dimensional image data. A preferred embodiment of the invention described below provides an image processing apparatus that can add a Z value to two-dimensional image data and so create a pseudo three-dimensional image with a relatively small amount of calculation and in a relatively short time. Another aspect of the present invention, provides a method of processing image information that includes pixels each having X-axis and Y-axis coordinates, the method comprising: processing said image information in an X-axis direction; processing said image information in a Y-axis direction; and adding a predetermined value representing a coordinate in a Z-axis direction to each said pixel of said image information so that said image information is expressed in three dimensions by the steps of storing in a first register an initial Z value, storing in a second register an X-axis direction increment for the said Z value, storing in a third register a Y-axis direction increment for the said Z value, outputting by a first circuit the initial Z value for a first set of pixels in the X-axis direction and outputting the Z value incremented by the Y-axis direction increment for each of a subsequent plurality of sets of pixels in the X-axis direction, and incrementing the Z value produced by the first circuit for a particular said set of pixels by the X-axis direction increment for each pixel of the set. The invention will now be further described, by way of illustrative and nonlimiting examples, with reference to the accompanying drawings, in which Figs. 1 and 2 are schematic illustrations of image data defined by two-dimensional coordinates; Fig. 3 is a schematic illustration of image data defined by three-dimensional coordinates; Fig. 4 is a block diagram of a processing system in accordance with an embodiment of the invention; Fig. 4A schematically illustrates some details of, and connections among, an interface block, a line block and a scan block that form part of the processing system of Fig. 4; Fig. 5 is a schematic circuit diagram showing portions of a line block, and a scan block that form part of the processing system of Fig. 4; Fig. 6 schematically shows conversion of two-dimensional image data into three-dimensional image data; Fig. 7 schematically shows processing of two-dimensional image data in X-axis and Y-axis directions ; Fig. 8 schematically shows pseudo three-dimensional image data produced by adding Z values to two-dimensional image data; and Fig. 9 schematically shows a combination of an image defined by three-dimensional image data with an image defined by pseudo three-dimensional image data. An embodiment of the invention will now be described with reference to Figs. 4-9. The embodiment uses a line processor to create three-dimensional primitives. As used herein, the term "primitive" refers to a polygonal element that either directly images a polygon such as a triangle, rectangle, etc., or, alternatively, images a figure represented by such polygons. The line processor is capable of rapidly generating a two-dimensional or three-dimensional primitive. More specifically, upon receipt of processing parameters, the line processor outputs corresponding data at a rate of up to 25,000,000 pixels per second. The following are examples of primitives that may be generated by the line processor: two- or three-dimensional lines (i.e. straight lines), two- or three-dimensional triangles, two-or three-dimensional rectangles, other two- or three-dimensional polygons, a two-dimensional bit map, a two-dimensional pixel nap and a three-dimensional scan line pixel. Color data to be output by the line processor may include 24 bits of real color data, 10 bits of index color data, 3 or 4 bits of dither color data and 1 bit of XP color data. Also, the line processor may add attributes to the primitive such as a line pattern (represented by 12 bits), a hatch pattern (represented by 16 x 16 bits), a semi-transparent pattern (represented by 4 x 4 bits) and a line width (represented by 3 or 5 bits). The architecture of the line processor is illustrated in Fig. 4 and generally includes an SP interface block 1, a line block 2, a scan block 3, a line width block 4, a pattern block 5, an XP interface block 6 and a control block 7. The SP interface block 3 receives parameters that define the primitive to be created and also receives incoming address data. The parameters and address information are indicated respectively as inputs DT and ADDR to SP interface block 1. SP interface block 1 also produces data at its outputs for loading into respective registers of other blocks of the line processor. Referring also now to Fig. 4A, SP interface block 1 includes addressable registers X, Y, Z, Zx, Zy, W, H and CMD. The X and Y registers store the X and Y coordinates of the basic location data for the primitive to be generated. The Z register holds a primary Z value. The Zx and Zy registers respectively hold X-axis and Y-axis direction increments for the Z value, as will be discussed below. The W and H registers are for storing respective data indicative of the width and height of the primitive to be generated. The CMD register holds command data as a load signal that causes data to be stored in the other blocks of the line processor. Appropriate data DT received by SP interface block 1 are stored in accordance with address information ADDR in the respective registers. If the succeeding blocks are not occupied with generating a previous primitive when the command data is provided to Sp interface block 1, then a load signal LD is provided to the succeeding blocks for loading of data, as will be described below. Data communication between SP interface block 1 and succeeding blocks is accompanied via a multiline connection labelled DATA in Fig. 4. The SP interface block 1 is inhibited from producing output data when the succeeding blocks are occupied with processing. At such times, SP interface block 1 produces a WAIT signal to a preceding-stage circuit in order to interrupt transmission of data to SP interface block 1 until the production of output data by block 1 is no longer inhibited. At that time, block 1 then produces output data and ceases to generate the WAIT signal. Referring again to Fig. 4, line block 2 creates a line or a polygonal contour on the basis of data received from SP interface block 1 by using algorithms such as Bresenham's algorithm. The interior of the polygon created by the line block 2 is scanned by scan block 3 in the X axis direction for the purpose of generating interpolated pixel data. Scan block 3 includes interpolation circuits for X-coordinate data, Y-coordinate data and R, G and B color data. As will be described in more detail below, line blocks 2 and scan block 3 include circuitry for adding a Z value to two-dimensional coordinate data. Line width block 4 adds a thickness to lines generated by line block 2 by adding appropriate data to pixels encircling X-Y coordinates provided by line block 2. Pattern block 5 adds attributes such as line patterns, hatch patterns, semi-transparent patterns, dither patterns, and so forth, to a primitive generated by the preceding blocks. More specifically, pattern block 5 has stored therein data for generating line patterns, hatch patterns, semitransparent patterns, and dither patterns, and refers to that data in order to generate for each pixel appropriate pixel data so that the desired pattern is created. XP interface block 6 supplies to a succeeding-stage circuit data DT for each pixel of the generated primitive. Control block 7 controls the operation of all of the other blocks of the line processor, and is connected to those blocks by control lines CTL. Circuitry for adding a Z value to two-dimensional coordinate data is shown in Fig. 5 and also in Fig. 4A. In the circuit of Fig. 5, an address generator 51 is made up of an X register 11, and a Y counter 12, both of which are part of line block 2, as well as an X counter 31 that is part of scan block 3. X register 11 stores an initial X coordinate value that is received from SP interface block 1 via a terminal 21. X register 11 loads the initial X coordinate value into X counter 31, which, as each clock cycle occurs, increments the loaded value and outputs an incremented value via a terminal 41 as the X coordinate data for each pixel. Y counter 12 stores either an initial Y coordinate value received from SP interface block 1 via a terminal 22 or an incremented Y coordinate value. Y counter 12 outputs the stored Y coordinate value via a terminal 42. Color register 32 receives, pixel by pixel, color-related R, G and B data (hereinafter called "color data"), which is received through a terminal 23 and is output via a terminal 43. In the circuit of Fig. 5, a Z value computing section 52 is made up of a first Z value computing subsection 13 which is part of line block 2 and a second Z value computing subsection 33 which is part of scan block 3. First Z value computing subsection 11 includes a register 14, an adder 15 and a register 16. Second Z value computing subsection 33 includes a register 35, an adder 36, a selector 17 and a register 38. Register 14 holds a value dZy corresponding to an amount by which the Z value is to be increased as processing proceeds in the Y axis direction. This amount will sometimes be referred to as the "Y-axis direction increment" for the Z value. Register 35 holds a value dZx corresponding to an amount by which the Z value is to be increased as processing proceeds in the X axis direction. This amount will sometimes be referred to as an "X-axis direction increment" for the Z value. Adder 15 is connected to receive the value stored in register 14 and also the value stored in register 16, and adds the two values together, supplying the sum for storage in register 16. Adder 36 is connected to receive the value stored in register 35 and also the value stored in register 38. Selector 37 selectively couples either register 16 or adder 36 to register 38. For each scan in the X axis direction by scan block 3, selector 37 couples register 16 to register 38 upon receipt of data for the first pixel in the scan and thereafter couples adder 36 to register 38 upon receipt of data for each subsequent pixel in the scan. X counter 31, terminal 42, color register 32 and selector 37 are respectively connected to X register 11, Y counter 12, terminal 23 and register 16 via a multi-line terminal A. Control block 7 provides clock signals via a control line CTL to X register 11, X counter 31, Y counter 12, color register 32, and registers 14, 16, 35 and 38. By other control lines (not separately shown) control block 7 provides hold signals to registers 16 and 38 for latching data therein. Count up signals are provided to X counter 31 and Y counter 13 by control block 7 via other control lines (not separately shown). Also, by another control line that is not separately shown control block 7 provides a load data signal to X counter 31. Operation of the system will now be explained with reference to Fig. 7-9. In particular, referring initially to Fig. 7, a Z value will be added to each pixel making up two-dimensional image data PT 1. It will be assumed that the first scan begins with a pixel PX00 located at the bottom left corner of image data PT 1. Thus the value X0 of the X coordinate of pixel PX00 is provided as an initial value by SP interface block 1 to X register 11 via terminal 21. The X coordinate value X0 is provided by register 11 to X counter 31, latched in X counter 31 in response to a signal received from control block 7, and output via terminal 41. SP interface block 1 also supplies Y coordinate value Y0 as an initial value to Y counter 12 via terminal 22. Y coordinate value Y0 is stored in Y counter 12 and output via terminal 42. SP interface block 1 provides color data for storage in color register 32 via terminal 23. Upon storage of the color data, it is output by color register 32 via terminal 43. An initial Z value Za is provided by SP interface block 1 via terminal 24 and loaded in register 16. At the same time, the Y-axis direction increment dZy is loaded in register 14 via terminal 101 and the X-axis direction increment dZx is loaded in register 35 via terminal 100. Also, data indicative of the height and width of the primitive to be generated is respectively loaded in register H of line block 2, and register W of scan block 3. Since, as noted above, register 16 is connected to register 38 via selector 37 for the first pixel in a scan, the initial Z value Za is loaded from register 16 into register 38 and is output via terminal 44. The state of selector 37 is controlled by a signal provided by control block 7. With the output of the color data via terminal 43 as mentioned above, it will be appreciated that an X coordinate value X0, a Y coordinate value Y0, and a Z value Zx (= Za) have respectively been provided to pattern block 5 as data for displaying pixel PX00. Upon application of a clock signal supplied by control block 7, X counter 31 increments the X coordinate value stored therein, and outputs the incremented X coordinate value X1 via terminal 41. At the same time, the Y coordinate value Y0 is output via terminal 42. Upon application of the same clock signal, the color data received from SP interface block 1 via terminal 23 is stored in color register 32 and then output by color register 32 via terminal 43. Also upon application of the clock signal, the state of selector 37 is changed so that adder 36 is coupled to register 38 and adder 36 adds the initial value Za stored in register 38 and the X-axis direction increment dZx stored in register 35 and outputs the resulting sum Zx (= Za + dZx) via selector 37 for storage in register 38. That resulting Z value Zx is accordingly output via terminal 44 and is also available for feedback to adder 36. It will be appreciated, then, that the incremented X coordinate value X1 provided by X counter 31 via terminal 41, the Y coordinate value Y0 provided as an initial value from Y counter 12 via terminal 42, color data via terminal 43, and the Z value Zx provided from register 38 are supplied, respectively, to pattern block 5 as data for displaying pixel 10. In this fashion, with timing controlled by the aforesaid clock signal, an incremented X coordinate value Xi is provided via terminal 41 for each pixel of the first scan line, and the Y coordinate value Y0 is provided via terminal 42. (The value YO is held constant in register 16 during the entire scan by a hold signal provided by control block 7.) In addition, with the same timing, color data is provided via terminal 43 for each pixel, and a Z value Zx generated in the 2 value computing section 52 is provided via terminal 44 for each pixel. All of these are provided to the succeeding-stage pattern block 5, as data for displaying the respective pixel. Referring again to the image data PT1 shown in Fig. 7, when the count value in X counter 31 reaches "N" (which corresponds to the width data stored in register W of scan block 3) and corresponding color data, X and Y coordinate values, and the Z value Zx are provided for pixel PXN0, the line scan in the X axis direction is completed. Pixel PX01 shown in Fig. 7 then becomes the start point for the next line scan. As before, X coordinate value X0 representing the X coordinate of pixel PX01 is provided to X counter 31 by X register 11. That value is latched in X counter 31 and output via terminal 41. At the same time, Y counter 12 increments the Y coordinate value Y0, so that a new Y coordinate value Y1 is output via terminal 42. Color data for the pixel PX01 is provided by SP interface block 1 via terminal 23 for storage in color register 32. Upon storage, the color data is output by color register 32 via terminal 43. Also at this time, in first Z value computing subsection 13, the initial value Za stored in register 16 and the Y-axis direction increment dZy stored in register 14 are added by adder 15 and the resulting sum Zy (= Za + dZy) is then stored in register 16 where it is available for feedback to adder 15 on the next cycle. In addition, the state of selector 37 is controlled so that register 16 is coupled to register 38 with the result that the value Zy, referred to above, is stored in register 38, from where it is output as Z value Zx via terminal 44 and also is available for feedback to adder 36. As was discussed in connection with the previous line scan, for the processing of the next pixel, the state of selector 37 is controlled so that adder 36 will be coupled to provide its output to register 38. Accordingly, the data for displaying pixel PX01 provided to pattern block 5 consists of X coordinate value X0, which is the initial value provided from X counter 31 via terminal 41, incremented Y coordinate value Y1 provided by Y counter 12 via terminal 42, color data provided via terminal 43, and Z value Zx provided by register 38 via terminal 44. Thereafter, color data, X coordinate and Y coordinate values, and a Z value Zx for each pixel PXi1 are provided in the same manner to pattern block 5. In each case the Y coordinate value is Y1. Fig. 6 schematically illustrates conversion of two-dimensional image data into three-dimensional image data, according to the process described above. The coordinate values of pixel PX2 in two-dimensional space are expressed by (X, Y), and the Z value calculated for that pixel is represented by Z. As will be understood from the procedure described above, that Z value is calculated according to the following formula: Z = (dZx) * (X-X0) + (dZy) * (Y-Y0) + Za Accordingly, a resulting 3-dimensional pixel PX3 is generated and may be represented by (X,Y,Z) with Z being calculated as noted above. It should be understood that the color data for pixel PX2 is used as the color data for pixel PX3. Referring again to Fig. 7, the procedure described above for providing color data, X coordinate and Y coordinate values, and a Z value for each pixel PXij is carried out successively from pixel PX00 through pixel PXNM in the image data PT1, where M corresponds to the height data stored in register H of line block 2. Accordingly, a Z value Zx generated by Z value computing section 52 is added to each of the pixels PX00 through PXNM which form the image data PT1. Further, since a Z value Zx is added to each pixel PXij, the image data PT1 which is defined by 2-dimensional coordinates as shown in Fig. 7, can be considered as 3-dimensional image data PT30, for example, as shown in Fig. 8. The image data PT30 shown in Fig. 8 has the same appearance as one to which no Z value has been added. However, when pseudo 3-dimensional image data PT30, and a 3-dimensional image data PT32 are combined, the combined image can be provided as shown in Fig. 9 on the basis of the respective Z values of image data PT30 and image data PT32. For example, the data making up image PT30 can be stored in an image memory (not shown). Then the Z coordinate of each pixel of image data PT32 is compared with the Z coordinate of the corresponding pixel of PT30, and only the pixels of PT32 positioned ahead of the corresponding pixels of PT30 are stored in the image memory in place of the corresponding pixels of PT30. According to the embodiment as described above, Z values generated by Z value computing section 52 can be added to all pixels of an image data that is defined in terms of 2-dimensional coordinates. Thus, any such image data can also be defined with pseudo 3-dimensional coordinates, which makes it possible to combine such an image data with three dimensional image data. It will appreciated that Z value computing section 52 is rather simple in design and can easily add a Z value Zx to image data defined in 2 dimensions, with less computation, and in less time, than is required for calculation of such data by a software-controlled processor. Further, the processing system described above generates Z values that have predetermined inclinations in the X axis and Y axis directions in an area defined in two dimensions, and that data is added by a Z axis coordinate value adding circuit to provide pseudo 3-dimensional image data on the basis of 2-dimensional image data. This is accomplished rapidly, and with a relatively small amount of computation.

Claims: An apparatus for processing image information that includes pixels each having X-axis and Y-axis coordinates, the apparatus comprising: a circuit (2, 11, 31) for processing said image information in an X-axis direction; a circuit (2, 12) for processing said image information in a Y-axis direction; and a Z-axis (2, 13-16, 33-38) coordinate data adding circuit for adding a predetermined value representing a coordinate in a Z-axis direction to each said pixel of said image information so that said image information is expressed in three dimensions; the Z-axis coordinate data adding circuit including a first register (16) for storing an initial Z value, a second register (35) for storing an X-axis direction increment (dZx) for the said Z value, a third register (14) for storing a Y-axis direction increment (dZy) for the said Z value, a first circuit (13, 15) for outputting the initial Z value for a first set of pixels in the X-axis direction and for outputting the Z value incremented by the Y-axis direction increment (dZy) for each of a subsequent plurality of sets of pixels in the X-axis direction, and a second circuit (33, 35, 36) for incrementing the Z value produced by the first circuit for a particular said set of pixels by the X-axis direction increment (dZx) for each pixel of the set. An apparatus according to claim 1, the apparatus comprising an interface block (1) for providing parameter pixel data including the said increments (dZx and dZy) to be used for generating a polygonal primitive; a line block (2) for generating contour pixel data from said parameter pixel data on the basis of a predetermined algorithm, said contour pixel data representing a contour of said primitive; a scan block (3) for scanning the interior of said primitive in an X-axis direction by interpolating said contour pixel data in said X-axis direction to form primitive pixel data comprising two-dimensional (X, Y) coordinate data; said line block and said scan block including the said Z-axis coordinate data adding circuit for adding the Z-axis coordinate data to said primitive pixel data; and an interface block (6) for supplying said primitive pixel data to a next stage circuit; a control block (7) for controlling all of said blocks. An apparatus according to claim 2, further comprising a pattern block (5) for adding an attribute to said primitive. An apparatus according to claim 2 or 3, wherein said primitive pixel data comprises pseudo three-dimensional image data. An apparatus according to claim 1, 2, 3 or 4, comprising mean (32) for providing colour data for each of the said pixels. A method of processing image information that includes pixels each having X-axis and Y-axis coordinates, the method comprising: processing (2, 11, 31) said image information in an X-axis direction; processing (2, 12) said image information in a Y-axis direction; and adding (2, 13-16, 33-38) a predetermined value representing a coordinate in a Z-axis direction to each said pixel of said image information so that said image information is expressed in three dimensions by the steps of storing in a first register (16) an initial Z value, storing in a second register (35) an X-axis direction increment (dZx) for the said Z value, storing in a third register (14) a Y-axis direction increment (dZy) for the said Z value, outputting by a first circuit (13,15) the initial Z value for a first set of pixels in the X-axis direction and outputting the Z value incremented by the Y-axis direction increment (dZy) for each of a subsequent plurality of sets of pixels in the X-axis direction, and incrementing (33, 35, 36) the Z value produced by the first circuit for a particular said set of pixels by the X-axis direction increment (dZx) for each pixel of the set. A method according to claim 6, comprising providing (1) parameter pixel data including the said increments (dZx and dZy) to be used for generating a polygonal primitive; generating (2) contour pixel data from said parameter pixel data on the basis of a predetermined algorithm, said contour pixel data representing a contour of said primitive; and scanning (3) the interior of said primitive in an X-axis direction by interpolating said contour pixel data in said X-axis direction to form primitive pixel data comprising two-dimensional (X, Y) coordinate data; the said Z-axis coordinate values being added to the primitive pixel data. An method according to claim 7, further comprising adding (5) an attribute to said primitive. An method according to claim 7 or 8, wherein said primitive pixel data comprises pseudo three-dimensional image data. A method according to claim 6, 7, 8 or 9, comprising providing (32) colour data for each of the said pixels.

Inventors: FUJITA JUNICHI, ITO KAZUMASA, KATO HIROSHI, FUJITA, JUNICHI, ITO, KAZUMASA, KATO, HIROSHI, Fujita, Junichi, c/o Patents Div., Sony Corp., Ito, Kazumasa, c/o Patents Div., Sony Corporation, Kato, Hiroshi, c/o Patents Div., Sony Corporation
Applicants: SONY CORP, SONY CORPORATION
Application year: 1992
Main classification: G06T15
IPC codes: G06T15, G06F3