"Method and System for Translating Between an Image and a 3-Dimensional Relief
TECHNICAL FIELD
This invention relates to computer controlled translation between an image and a three dimensional relief. In particular this invention provides a method, an apparatus, and software for producing an engraving from a colour or monochrome image, and for producing a two dimensional graphic representation of a three dimensional object. Furthermore this invention provides a method of treating an object to colour or otherwise treat a three dimensional relief or two dimensional representation of a two dimensional graphic.
BACKGROUND ART
While computer systems have been employed in engraving applications, these have generally utilised a point to point vector based methodology. Examples of apparatus employing this technique include plotters, and cad-cam milling machines. The use of a vector based methodology has been found to be most efficient in the production of general engineering components which are mostly formed of standard geometric shapes.
By contrast the use of raster methodology in the production of general engineering components is grossly data intensive and inefficient, making it quite uneconomical to use in these computer driven machining operations.
In the production of complex sculptured relief tasks, however, the use of a vector based methodology becomes inefficient and uneconomical due to it being grossly data intensive. Thus, notwithstanding the utility of sophisticated computer numerical controlled (CNC) milling machines which are able to produce complex sculptured relief tasks, it has not been viable to use these
machines to perform such tasks due to their computer control systems being set up to use vector based methodologies.
DISCLOSURE OF INVENTION
It is an object of the present invention to provide for a computer controlled translation methodology between an image and a three dimensional relief which allows for the economical production of complex sculptured forms in three dimensions or the imaging of the same in two dimensions.
Broadly, the invention resides in an apparatus and method for the utilisation of computer graphic files comprising a flat two dimensional graphic having two dimensions (herein referred to as the x axis and the y axis) and a light value for each valid x and y co-ordinate, and producing a third dimension value which co-relates to the light value, for each valid x and y co-ordinate, for treating a material in a predetermined manner and in accordance with the third dimension value.
In accordance with one aspect of the invention there is provided a method for producing a three dimensional relief or material surface treatment from a two dimensional image comprising a two dimensional array of pixels, said method including:-
generating an elevation value from and in proportion with light values for each of said pixels, and performing a forming or surface treatment operation on a stratum of material at an elevation corresponding to each said elevation value, at a respective position corresponding to each pixel position in said two dimensional array.
Preferably said light value is a chrominance or luminance value for each pixel.
Preferably said light value is a grey scale value for each pixel.
Preferably said method includes traversing said stratum of material in a raster sweep while performing said forming operation.
In accordance with a second aspect of the invention, there is provided a method for producing a two dimensional image from a three dimensional relief of a stratum of material, said method including:
scanning the three dimensional relief to measure elevation values at positions across the relief;
generating light values for pixels of the two dimensional image at positions corresponding to said positions across the three dimensional relief, said light values varying in proportion to said elevation values.
Preferably said light value is a chrominance or luminance value for each pixel.
Preferably said light value is a grey scale value for each pixel.
Preferably said scanning includes performing a raster scan on said stratum of material and electronically recording measurement data in respect of said elevation variables.
Preferably said scanning utilises laser measurement of the relief.
In accordance with a third aspect of the invention there is provided a method for reproducing a three dimensional relief of a stratum of material, including:-
scanning the three dimensional relief to measure elevation values at positions across the three dimensional relief;
generating light values for said three dimensional relief, for pixels of the two dimensional image at positions corresponding to said positions across the three
dimensional relief, said light values varying in proportion to said elevation values; and
producing a further three dimensional relief or material surface treatment utilising the method set out in accordance with the first aspect of the invention.
In accordance with a fourth aspect of the invention there is provided an apparatus for interconverting between a two dimensional image and a three dimensional relief or a material surface treatment, to produce a three dimensional surface or a treated surface, respectively, from a two dimensional image, or to reproduce a three dimensional relief or a material surface treatment by producing a two dimensional image from a three dimensional relief; said apparatus including:
data processing means interfaced with material treatment apparatus; and
translation means for translating between an image comprising a two dimensional array of pixels, and a three dimensional relief or material surface treatment;
said translation means being adapted to translate between an elevation or depth values at a position in or on said material in response to and in proportion with a light value values for a pixel in a corresponding position in said image.
In accordance with a fifth aspect, there is provided an apparatus for translating a two dimensional image comprising a two dimensional array of pixels to produce a three dimensional relief or a material surface treatment on a stratum of material including:
data processing means for receiving light value data in respect of each pixel of the two dimensional array of pixels;
material forming or treatment means interfaced with said data processing means for performing a forming or surface treatment operation on a stratum of material;
said data processing means positioning said material forming or treatment means relative to the stratum of material in corresponding position to said pixel being processed; and
translation means to sequentially translate said light value data received by said data processing means proportionally to an elevation value for elevating said material forming or treatment means relative to the stratum of material at said corresponding positions.
Preferably said light value is a chrominance or luminance value for each pixel.
Preferably said light value is a grey scale value for each pixel.
In accordance with a sixth aspect, there is provided an apparatus for producing a two dimensional image from a three dimensional relief of a stratum of material, including:-
scanning means to scan the three dimensional relief and measure elevation values at positions across the relief;
translation means to translate said elevation values to light values to constitute data values for individual pixels of the two dimensional image at positions corresponding to said positions across the relief;
wherein said light values vary in proportion to said elevation values.
Preferably said scanning means performs a raster scan in two dimensions of said three dimensional relief.
In accordance with a seventh aspect of the invention there is provided a computer control system including software for translating between a two dimensional graphic comprising a two dimensional array of pixels, and a three dimensional relief or material surface treatment; said software including a translation algorithm for translating between a light value for each pixel and an elevation value in said three dimensional relief at a position corresponding to the pixel position in said two dimensional array.
Preferably said light value is a chrominance or luminance value for each pixel.
Preferably said light value is a grey scale value for each pixel.
Preferably said software includes a scanning algorithm to raster scan two dimensions of said three dimensional relief, to enable an operation to be performed on or in said three dimensional relief.
In accordance with an eighth aspect of the invention there is provided an apparatus for interconverting between a two dimensional image and a three dimensional relief and/or a material surface treatment to produce a three dimensional surface and/or a treated surface from a two dimensional graphic or to produce a two dimensional graphic from a three dimensional relief or to colour a two or three dimensional representation of a two dimensional graphic, comprising data processing means programmed to form a computer control system in accordance with the seventh aspect of the invention, and interface means to material treatment apparatus.
BRIEF DESCRIPTION OF DRAWINGS
The invention will now be described in the following description of one specific embodiment thereof made with reference to the drawings in which:-
Figure 1 is a flowchart for computer software showing the program start, main program, and program end points;
Figures 2, 3, and 4 are parts making up the flowchart for the TranslatePass Subroutine, callable from the main program;
Figure 5 is a flowchart for the BmWrite Subroutine, callable from the TranslatePass Subroutine;
Figure 6 is a flowchart for the SkipOver Subroutine, callable from the TranslatePass Subroutine;
Figure 7 is a cross section through the x and z axes of an engraved workpiece showing part of the workpiece profile generated using the software according to the invention;
Figure 8 is a cross section through the x and z axes of an engraved workpiece showing part of the workpiece profile generated using the software according to the invention, but invoking a mirror image function embodied in the software;
Figure 9 is a cross section through the x and z axes of an engraved workpiece showing part of the workpiece profile generated using the software according to the invention, but invoking a negative image function embodied in the software;
Figure 10 is a cross section through the x and z axes of an engraved workpiece showing part of the workpiece profile generated using the software according to the invention, but invoking a pierce function embodied in the software;
Figure 11 is a cross section through the x and z axes of an engraved workpiece showing part of the workpiece profile generated using the software according to the invention, but invoking a lift function and a negative function using the software;
Figure 12a is a flowchart showing the first part of the main program dmc_1000 for producing a two dimensional image from a scanned three dimensional relief of a stratum of material in accordance with an alternative method of the embodiment; and
Figure 12b is a flowchart showing the second part of the main program dmc IOOO.
BEST MODE FOR CARRYING OUT THE INVENTION
The embodiment is directed toward conversion software for converting a bitmap file (*.bmp) to a file of a suitable format, and controlling hardware to cut and sculpt an image in 3 dimensions corresponding to the image in the input bitmap file.
The method of the embodiment transposes computer graphic images onto or into the surface of a material work piece via a computer numerically controlled tool. The tool may be a material removal method or material deposition method or alteration of the material chemistry method, producing either a sculptured form or surface colouring via chemical alteration of the material.
Alternatively the method of the embodiment may be used to record the sculptured form of a material subject as a computer graphic image, in this case the tool is a contact or non contact measuring device. In combination, the recording of a sculptured form as a computer graphic image, and the production of a sculptured form therefrom, may be utilised to create a reproduction of an object.
The input computer graphic image may be in any format, but for convenience the software is designed to operate with a 24 bit bitmap (*.bmp) file as the input file. There are a number of software packages which may be used to interconvert between bitmap format and other formats (such as *.tif *.jpg, *.tga, *.gif and
others), and due to the wide availability of these, it is not considered important to provide such functionality within the software of the invention. The bitmap file may have any origin, and may be derived from a colour photograph or a drawing.
The bitmap graphic file is edited and various functions performed upon it depending on the desired final machine controlled result required. For example the graphics file may be edited by altering the colour or shade of the pixel that will correspond to the height or z axis of the matrix, and by increasing or decreasing the number of pixel's that construct the rows or columns of the matrix (y axis width and x axis length). Software for performing such editing is readily available commercially.
The image is then converted into a monochrome image having 256 grey scale levels, with each level from 0 to 255 representing a depth being cut into a work piece. The number of grey scale levels chosen is dependent upon the resolution required in the depth increments. Each individual pixel in the edited bitmap file has a grey scale value which corresponds to a depth value in a work piece, at a position along the work piece which corresponds to the position of the pixel in the bitmap file.
The edited bitmap file is then translated into a three dimensional machine control operating code via translation software which is shown in figures 1 to 6.
The flowchart boxes represented by the reference numerals in figures 1 to 6 have the following functions or names:-
Fiqure 1
11 - Main program OPUS1 c.
13 - Translate?
- 9/2 -
15 - Has a bitmap being selected?
17 - Send error message.
19 - Does the target file exist?
21 - Call Open file ()create OPUSLdmc.
23 - Overwrite file? promt user.
25 - Call Dialog box (settings) for user inputs.
27 - Call Header ():- write header information into file.
29 - Call Translate () to translate the bitmap.
31 - Call TranslatePass () to translate for the current passing cut.
33 - Is another deeper cut required?
35 - End program.
Figure 2 - Translate Pass Subroutine
37 - Is the bitmap 24 bit?
39 - Send error message?
41 - Is the bitmap too large for the buffers?
43 - Send error message.
45 - Set scaling factors X and Y and Z depth.
- 9/3 -
47 - Send Tool to approach height above datam.
49 Set Linier Interpelation Vector speed.
51 - Lower Tool to datam.
Figure 3
53 - Is a spiral path required?
55 - Get the rectangular (X.Y) and polar (R.theta) coordinates of the next pixel.
57 - Mirror the image?
59 - X=bitmap_width - X theta= - theta.
61 - Call B m Write () for current grey value.
63 - End of this spiral (theta=360)?
65 - Mirror? on centre line X - axis.
67 - W=last pixel in scanline,
69 - Call B m Write () for current grey value.
71 - W=W-1.
73 - Start of scanline reached?
75 - W=fιrst pixel in scanline.
77 - Call B m Write () for current grey value?
- 9/4 - 79 - W=w+1.
81 - End of scanline reached?
83 - Lower Tool first Z value.
85 - Call SkipOver () for location of the next nonsimilar pixel.
87 - Are the next three or more pixels similar?
89 - Index Tool to the next pixel location.
Figure 4
91 - Are the pixels white and quick Traverse required?
93 - Is a spiral path required?
95 Lift Tool and quick Traverse to the last similar pixel.
97 - Reset to low speed and lower Tool.
99 - Lift Tool off the work. Index by one pixel. Index Traverse speed.
101 - Quick Traverse to second last similar pixel.
103 - Reset slow speed and lower Tool to last white pixel,
105 - Is a spiral path required.
107 - Index Tool by one pixel of the current line.
109 - Slow traverse to second last similar pixel.
- 9/5 -
111 - Index tool to the last similar pixel.
113 - Index tool to the next location only.
115 - Have we reached machine buffer limits (500 commands) or the end of the scanline?
117 - Send BGS command.
119 - Increment pixel number.
121 - Has the last pixel in the scanline been processed.
123 - Send carriage return commands for the tool.
125 - Round up the bit count to the nearest multiple of 4 for this scanline for use in B m Write ().
127 - Has the last scanline been processed?
Figure 5 - B m Write 0 Subfunction
129 - Is the bit count beyond the end of the first memory segment?
131 - Offset the buffer addresses so as not to read across a segment end.
133 - Call GetArray no Gap () to obtain blue value of pixel.
135 - Request for negative image?
137 - Offset blue value Z=255-B.
139 - Increment bit count.
- 9/6 -
141 - Are red and green and blue values the same?
143 - In form user that bitmap may be colour.
145 - Request for piercing function.
147 - Is red value black?
149 - Return red value.
151 - Return PS depth.
153 - Loop for green then red.
Figure 6 - SkipOver 0 Subfunction
155 - Is the next grey value the same as the current?
157 - Increment pixel.
159 - Were three or more pixels the same?
161 - Return original pixel number.
163 - Return last similar pixel number.
Referring to figure 1 , the main part of the program is shown. For convenience, and in accordance with current practises, a graphical user interface should be utilised. The user would then be presented with a settings box in which the file to translate is entered. Once the "OK" button has been selected, the translation may begin. The program then performs the following:
• a first check 15 to determine if a bitmap file has been selected;
- 10 -
a second check 19 to determine if the target file exists for controlling the hardware which cuts and sculpts the object; and
• a third check 23 to prompt the user to select deletion of the target file, if the target file already exists.
If the second check 23 finds no target file, the OpenFile subroutine 21 is called, and a file named opusl .dmc is opened.
The program then opens a dialog box 25 to allow the operator to select parameters for the resultant machine control code which will be stored in the target file opusl .dmc. The following options are allowed:
• the scale factors for the x ,y , and z axes;
• tool positioning;
• tool traversing speed;
• mirror image;
• negative image;
• pierce depth;
• pierce select;
• skip over; and
• quick traverse.
The program calls the Translate subroutine which is shown in figures 2 to 6. The translation software reads the edited bitmap file in raster, converting each
- 11 - individual pixel described by bytes into the machine control code, which is stored together with header information in the opusl .dmc file. The machine position instruction is prescribed by x and y co-ordinates depending upon the pixel location on the bitmap file matrix, and prescribed by a z co-ordinate representing depth of the tool depending upon the grey scale value for that pixel. Referring to figure 7, a sample profile is shown, showing variation in height of an engraving through an x axis. The high points A represent white in the grey scale bitmap, while the lower points B represent darker shades.
The TranslatePass subroutine is then called, and translation is accomplished by loading one complete line of bits from a 2 bitmap, and this information is written in the machine control code. This procedure is performed iteratively, line by line, until all rows of bit map information have been converted into machine control code. At the end of each line of bit map information a indexing set of machine commands are written into the target file to index the machine to the beginning of the next line. During the translation of each line the user selected settings are taken into account.
Alternatively, if a spiral path is required or preferred for traversing the workpiece, the subroutine branches as shown in figure 3 in order to read pixels and convert into machine control code in a fashion to index the machine from one spiral or circular revolution to the next.
If the tool has been selected to be held a set distance above the work as specified in the settings dialog box 25, the tool will dwell in the selected position until 500 characters or less if so selected, have been sent to the machine buffer. The figure of 500 characters is the number of characters that constitute a line, in the machine used by the inventor, and should be varied for different machines. This function ensures the machine has enough information so as not to be hindered in its execution of commands due to a lack of data.
- 12 -
If mirror image is selected in the settings dialog box 25, the TranslatePass subroutine writes the first bit information from the bit map as the last instruction of machine code in the line of bit map translated information. In addition the TranslatePass subroutine decrements the bit map translated information position W for the value of the next position along the line. In the case of mirror image not being selected, the TranslatePass subroutine writes the first bit information from the bit map as the first instruction of machine code in the line of bit map translated information, and increments the bit map translated information position W for the value of the next position along the line. Figure 8 shows a sample profile, showing variation in height of an engraving through an x axis. This cross section results from the same instructions utilised to produce the image shown in figure 7, except that the mirror image function has been invoked. The mirror function may be used to perform a mirror image operation on a file about a central axis through the x or y axis plane. This enables a non symmetrical form to be sculpted on both sides of an object, and have the identical aspects of each point of the non symmetrical form directly opposite each other. By way of example, an image of a non symmetrical tree was to be sculpted into one side of a coin with holes cut through the material between the leaves and branches (using the pierce function), and the identical procedure was repeated on the other side of the coin with the mirror image, the holes between the leaves on both sides would directly line up as would the form of the branches.
If negative image is selected in the settings dialog box 25 the BmWrite subroutine, shown in figure 5, performs an inversion by subtracting the actual colour value (a value between 0 and 255) from 255 for each pixel in each line, first for the blue values, then the green values, and then the red values. Once the values for red, blue and green have been determined for each pixel, the BmWrite subroutine performs a colour value check for each pixel, comparing the values for red blue and green, and alerts the operator that the bitmap may not be a grey scale bitmap if the values do not match. Figure 9 shows a sample
- 13 - profile, showing variation in height of an engraving through an x axis. This cross section results from the same instructions utilised to produce the image shown in figure 7, except that the negative image function has been invoked.
If pierce function is selected in the settings dialog box 25 then set the z axis value for the position corresponding to the current pixel to the pierce depth value. The pierce depth value should be set to a value which correlates to a depth in excess of the thickness of the material being worked, so that the tool pierces the material. Figure 10 shows a cross section through the x axis of an engraving, using the same instructions utilised to produce the image shown in figure 7, but with the pierce function invoked, which has resulted in apertures C through the work. Alternatively if the pierce depth value is set to a value which corresponds to an altitude above the engraving on the material a sculptured surface may be produced with columns of nominated height protruding therefrom, as shown in figure 11.
If skipover is selected in the settings dialog box 25, the skipover subroutine shown in figure 6 checks to see if three or more pixels in the same row have identical z values and if so the tool is indexed at the same z value from the first to the last pixel having the same value. This function reduces the amount of machine control code used if more than three pixels have the same value.
If quick traverse is selected in the settings dialog box 19, the quick traverse routine shown in figures 3 and 4 checks to determine if the colour value is pure white and if so machine control code is written to lift the tool the specified amount above the work and quick traverse to the next pixel that has a non pure white value in the same row, and lower the cutter the specified amount and commence operation.
Other functions include an x axis revolving function, and z axis offset function.
- 17/1 -
In the alternative method of the embodiment being used to produce the two dimensional graphic representation or bitmap file from a three dimensional relief of an object, an object recorder is used comprising scanning means to scan the three dimensional relief and provide elevation values in digital form to the data processing means. The data processing means includes translation means to translate these elevation values to light values and these light values are sequentially stored as pixel data representing the two dimensional graphic representation of the three dimensional relief. Accordingly, the machine includes a computer control system including software which operates the machine in accordance with the flowchart shown in figures 12a and 12b of the drawings.
The flowchart boxes represented by the reference numerals in figures 12a to 12b have the following functions or names:-
Figure 12a
165 - Main program dmc_1000.
167 - Read the user input values.
169 - Set the scanner traverse speed, acceleration, etc.
171 - Is the orientation of the image landscape or portrait?
173 - Transpose X and Y axis.
175 - Initiate traversing over the template.
177 - Has the end of the scanline been reached?
179 - Has the entire scanning procedure been completed?
181 - Index the scanner to the next line and reverse its direction.
- 17/2 -
183 - End program.
185 - Has the next bitmap "pixie" been reached on the template?
Figure 12b
187 - Read the scanner Z-value.
189 - Is the Z-value out of range?
191 - Read the scanner Z-value and convert it to a grey scale value.
193 - Allocate a grey scale value of 256 for high Z-values and one for low Z- values.
195 - Is a negative image required?
197 - Grey scale_value=256 - grey scale_value.
199 - Update the bitmap with the current bitmap coordinates and grey scale value.
The object recorder utilised for producing the two dimensional graphic representation or bitmap file may be a laser scanner, encoded stylus, video camera, digital camera or any other device used to record images from the real world or printed matter into a computer file, including any of the above mentioned numerically controlled machinery fitted with distance measuring apparatus or other special purpose machinery that guides a measurement recording tool over the object placing the data into a computer file.
From the foregoing discussion, it will be apparent that the invention may be utilised to produce inter alia sculptured surfaces in or on a material surface, in any relief as desired. Such sculptured surfaces may be produced on any
- 17/3 - desired back plane, including fiat back planes or back planes having a circular periphery about a central axis. Envisaged applications include any application where a sunk or raised bar relief form is required, and include the production of moulds for plastic injection, lost wax, and tool production for hobbing, and forming blanking press tools. It will be clear that methods such as electro discharge erosion machining, commonly utilised in tool production, may be utilised.
Direct application may be made of the invention for jewellery manufacture, coin or medallion carving, and sculptures, mould and die manufacture, toolage etc.
- 18 -
Similarly, the invention may be utilised for recording the form of an object, whether the object is fully three dimensional or a sculptural form, in high or low relief, or whether the back plane of the object is flat or cylindrical. Once the form of the object has been recorded in this manner, the object may be reproduced at any scale and in any chosen material.
Other applications include printing on or colouring the surface of refractory metals by instrumentation controlled alteration of the surface oxide, including placing designs on titanium jewellery and medallions.
It should be appreciated that the scope of the invention is not limited to the scope of the specific embodiment disclosed herein.