image makeovers with autodesk® raster design 2006 ......image makeovers with autodesk raster design...
TRANSCRIPT
Walt Disney World Swan and Dolphin ResortOrlando, Florida
11/30/2005 - 10:00 am - 11:30 am Room:N. Hemispheres (Salon A2) (Dolphin)
Image Makeovers with Autodesk® Raster Design 2006: Going Beyond the Basics
You've put Autodesk Raster Design to use and it's proven its value in your business. Now it's time to hone your imaging skills and explore the less obvious features of Raster Design 2006. Turn those impressive presentations into truly memorable ones. Make productive use of that data you thought you'd never use. And increase your image throughput and effectiveness.
GD32-3
About the Speaker:
Gary Stephenson - Autodesk
Gary has been active in the imaging industry for 20+ years in a variety of roles. His application experience ranges from medical imaging to document imaging and from AEC to GIS. His AutoCAD experience began with Image Systems Technology, Inc. as product manager for the pioneering CAD Overlay GSX. For Softdesk, Inc., Gary continued to focus on imaging solutions for AEC, developing datasets and tutorials, training resellers, customers, and Softdesk personnel in imaging applications. He now works as a program manager for imaging products including Autodesk Raster Design. Gary holds M.B.A. and B.S.E.E. degrees from Rensselaer Polytechnic Institute in Troy, New [email protected]
Image Makeovers with Autodesk Raster Design 2006
2
Working with that Impossible scanned document Most of the time, the original of a scanned document is in good enough shape that a workable bitonal scan can be acquired. However, there’s always those few documents that produce headaches and seem destined for a time consuming total redraw. You’ll see some of the tools in Raster Design 2005 that will allow you to rescue drawings like this and at the same time give you some insight into some of the lesser known tools and techniques that not only apply in this, but other vexing situations as well.
The key process in this instance is to combine two separate scans of the same document. One a bitonal scan and the other a grayscale scan. Between the two we’ll be able to obtain a cleaned up, readable bitonal document. The example I’ll use here is a blueprint of a plot plan that was rolled up but unfortunately exposed to direct sunlight. The result is a faded swath through an otherwise quite usable document. The bitonal scan clearly shows this, and it’s not possible to get a clean bitonal scan that can capture all of the information. The steps we’ll use to come up with a usable image are outlined below:
Step 1: Use File ⇒ Open and navigate to: C:\datasets\GD32-3\Impossible. Select the drawing: Plot Plan.dwg and open it. The drawing will be blank.
Step 2: Make sure the Bitonal layer is the current layer. Use Image ⇒ Insert and navigate to: C:\datasets\GD32-3\Impossible. Select the image: Bitonal Plot Plan.tif and insert it using default correlation.
Note the missing linework through the center region.
Step 3: Change the current layer to Grayscale. Step 4: Use Image ⇒ Insert to insert a grayscale scan of the same drawing:
Grayscale Plot Plan.tif, from the same directory also using default correlation.
Notice that the missing linework is somewhat visible in this scan.
Step 5: Use Image ⇒ Manage to invoke the Image Manager Toolspace. Select the Images tab.
Step 6: In the Image Manager Toolspace, select Image Insertions from the drop down list box to activate the Image Insertions pane. Click on the Expand Tree icon.
Step 7: Note that the current display order is reflected in the listing of the two insertions. Drag Bitonal Plot Plan up above Grayscale Plot Plan.
Alternatively, we could have used the Image Manage right-click shortcut menu off Bitonal Plot Plan to put it on top.
Step 8: Close or minimize the Image Manager Toolspace. Step 9: Restore the named view Washout. From this zoomed in view we can get a
better idea what is missing from the bitonal scan.
Image Makeovers with Autodesk Raster Design 2006
3
Step 10: Shift-left-click on the image, select Grayscale Plot Plan from the list and click OK. Use Image ⇒ Image Processing ⇒ Histogram. Choose the Window option and select a window encompassing the driveway and two porches.
Step 11: Click on the Tonal Adjustment tab and select: Apply changes to: “Entire image”.
What we’ve done here is effectively zoomed into a representative part of the image and will use
it to adjust the whole image.
Step 12: Select the Gamma contrast curve option. Using the sliders below the curve set the Black threshold near 165, the White near 245 and the Gamma value near .27. The illustration below shows how the curve should look.
Step 13: Click Apply, and then click Close to exit the dialog. The grayscale image is made much more readable.
Now, depending on the situation, we’ll use a combination of REM primitives, VTools, and plain
AutoCAD vectors to re-create the missing geometry in the bitonal image
Step 14: Restore the named view REM. Step 15: Use Image ⇒ Raster Entity Manipulation ⇒ Create Primitive ⇒ Line to
operate on one of the two horizontal raster lines by first picking to create a REM line, then by grip editing the REM line across the missing space. Press
Image Makeovers with Autodesk Raster Design 2006
4
Enter to repeat the REM Line command and similarly edit the second line. The result should be as below:
.
Step 16: Select the two REM lines with a crossing window, right-click, and select Merge To Raster Image off the shortcut menu. When the Image Select dialog is presented, select the Bitonal Plot Plan image for each of the REM merges.
If you find it inconvenient to be prompted for the image to merge into for each entity, you can
alternatively temporarily turn off the other image(s) so you won’t be prompted. This will be
especially beneficial if you are merging several REM entities at once.
Step 17: Restore the named view Vtools. Step 18: Change the current layer to be Text. Step 19: Use Image ⇒ Vectorization Tools ⇒ Text. Use the command line H option
and pick two points to set the height of the numeric text. The height should end up being around .0015. Select the insertion point for one of the raster numeric fields and enter the correct number as determined from the grayscale image (315.88 or 316.48) into the VText Edit dialog. Click OK to confirm the entered text, and window around the bitonal remains of the old raster number. Press Enter to erase the highlighted raster.
Step 20: Continue using the VText command in the same manner for the other numeric field.
Step 21: Use the command line H option again to pick two points to set the height for the CURB label. The height should end up being around .0022. Proceed to convert the word CURB erasing its old raster text as well. End the VText command when finished.
Step 22: Change the current layer to Linework. Step 23: Notice from the grayscale scan that there are actually two lines making up
the curb geometry. Now using Image ⇒ Vectorization Tools ⇒ Line, select the 2P option and draw in the two curb lines. If you get a dialog asking which image to use, select the Bitonal Plot Plan image. Note that you can use the Break option to end the first line and start the second line without having to re-enter the VLine command. When you are done with the VTool commands your result should look similar to the following:
Image Makeovers with Autodesk Raster Design 2006
5
.
Note that the text and linework should each use different width raster. The RPens table is
where we can set the width for different color vector entities to merge into the image. The
default three pixel width is fine for the green text entities but the cyan line entities need to
be about 5 pixels wide to be consistent with the existing lines in the image.
Step 24: Use Image ⇒ Merge ⇒ Configure Raster Pens. In the resulting Raster Pen Settings dialog, select the Magenta entry. Set the pen width in pixels to 5 and click Apply. The dialog should appear as below:
Step 25: Click OK to finalize the Raster Pen Settings. Step 26: Use a crossing window to select the new text and linework. Right-click and
select Merge To Raster Image off the shortcut menu. Respond Yes to deleting the existing vector.
Image Makeovers with Autodesk Raster Design 2006
6
In each of the foregoing cases there was raster in the bitonal image that we had to deal with
which is why we used the REM and VTool commands. For the next set of geometry, there is
essentially no raster in the bitonal image at all, so we’ll just use plain AutoCAD drawing tools to
reconstruct the geometry.
Step 27: Restore the named view: House. Step 28: Draw in the missing outline of the house using AutoCAD linework. When
you’re done, select the lines and merge them to the bitonal plot plan image as you did before. The result should be as below:
Step 29: Now restore the named view Overall, and turn off the Grayscale layer. You should have results similar to that shown below:
Note that there is more work to be done here, but by using the tools outlined in this lesson, the
drawing can be just about fully recovered.
Image Makeovers with Autodesk Raster Design 2006
7
Image Convolution Filters Raster Design has a full complement of convolution filters available under the Image Processing menu. What are these filters good for, and when might they be useful? The answer is that predominately they are useful for very specialized cases most of which would be of interest to few of us. However, there are some filters that can be handy indeed when the need arises.
I’ll cover three cases here where the convolution filters can be used to great advantage. First, is to increase the quality of scans made from printed material. Second, is to remove noise from images. And third, is to edge enhance imagery.
Scanned images from printed materials
Step 1: Use File ⇒ Open and navigate to: C:\datasets\GD32-3\Convolution. Select the drawing Convolution.dwg and open it. In the drawing you will see a scanned image of the space shuttle in the view Book scan. Notice how the image seems a bit coarse.
Step 2: Restore the named view Shuttle detail. Note the interference pattern created in the image due to the interaction between the halftoning dots on the printed page and the scanning density.
When you are scanning images from printed sources, higher resolution is not necessarily better.
If the interference pattern is especially pronounced, try cutting down the scan resolution by
say a third or so. For example, if you originally scanned at 300 dpi, try 200 dpi instead.
Step 3: Shift-left-click the image to select it, and select Image ⇒ Image Processing ⇒ Convolve.
Step 4: Expand the Smoothing Filters category, and then expand the Lowpass Filtering category. Select the Blurring filter, and then click Run Filter. Notice the instant improvement in the quality of the image.
Image Makeovers with Autodesk Raster Design 2006
8
.
Step 5: Restore the named view: Book scan to see the effect the convolution filter had on the overall image.
Image Noise
Step 1: Restore the named view Image noise. Note the band of noise running across the image.
Step 2: Shift-left-click the image to select it, and select Image ⇒ Image Processing ⇒ Convolve.
Step 3: Expand the Smoothing Filters category and then expand the Lowpass Filtering category. Select the Median Filter and then click Run Filter.
Step 4: Enter 5 for the filter size and click OK. Notice how the noise is processed out.
Image Makeovers with Autodesk Raster Design 2006
9
Edge Enhancement Step 1: Restore the named view Grayscale Topo. The image will appear as below:
This is a scanned USGS Topo map that we’d like to overlay on another image. We’ll be converting
the image to bitonal in order to do that, but unfortunately the solid buildings are going to be a
problem as they will wipe out what’s under them. With some judicious image processing we’ll be
able to take care of the problem and sharpen up the other linework for further REM or
vectorization operations to boot.
Step 2: Shift-left-click the image to select it, and select Image ⇒ Image Processing ⇒ Convolve.
Step 3: Expand the Sharpening Filters category, then expand the Edge Enhancements category, and finally expand the Laplace Edge Enhancements category. Select the Laplace #1 filter and click Run Filter. Note that the filter has effectively outlined the buildings for us.
This is still a grayscale image and we’ll need to convert it to bitonal in order to use it as an
overlay.
Step 4: Select Image ⇒ Image Processing ⇒ Histogram. Shift-left-click the image to select it. Yes, you can use shift-left-click after a command is invoked. Press Enter to process the entire image. When the Histogram dialog is presented, select the Threshold tab. Set the threshold level around 14 and click Apply and Close. The result is the bitonal image below that we can now use as an overlay:
Image Makeovers with Autodesk Raster Design 2006
10
Rubbersheeting Rubbersheeting is an extremely useful tool for correcting imagery. In many cases it allows one to use less expensive or readily available imagery where ortho accuracy is not required. The confusing thing about rubbersheeting is that there is more than one processing method to use, and each method has its own unique set of idiosyncrasies.
The two basic rubbersheeting methods are Polynomial and Triangular. Fundamentally, the Polynomial method takes the user specified control points and from them, derives one equation to apply to the whole image. The net effect is that usually the points are only going to end up only close to where you wanted them, not exactly. In addition, areas outside the control point cluster can often become very distorted. With the Triangular method, control points in the image move exactly to where you specified. Any adjustments are taken up between the points. The downside of the Triangular method is that through the rubbersheet you loose any part of the image that was outside the control point cluster i.e parts of the image that are not between control points.
To illustrate these concepts, exercises involving both forms of rubbersheeting follow.
Polynomial Rubbersheet
Step 1: Use File ⇒ Open and navigate to: C:\datasets\GD32-3\Rubbersheet. Select the drawing Rubbersheet.dwg and open it. A scanned image of an underground mine is shown in relation to a section grid. Note how points in the image do not line up exactly with the section corners and no amount of linear operations such as Match will make it fit.
Step 2: Select Image ⇒ Correlate ⇒ Rubbersheet. On the Rubbersheet – Set Control Points dialog, Select the Polynomial option.
Step 3: Import a set of pre-existing control points by clicking on Import, and opening the Rsheet.txt file in the directory C:\datasets\GD32-3\Rubbersheet.
Step 4: To see how rubbersheet control points are represented on the screen, select the entry for point #6 and click Zoom To. Note the cyan line starting with the + and ending in the o. This is indicating the chosen From and To control point pair. The red + indicates where the From point will end up after the rubbersheet and the radius of the circle gives a visual representation of the error at that point. Shown below is how control point 6 is represented:
.
Image Makeovers with Autodesk Raster Design 2006
11
Step 5: Press Enter to exit the preview.
Step 6: Now, it is known that there was an error in establishing control point #4. To correct this, select point #4 in the list, and click Repick. Choose the new from point according to the screenshot below but use the same to point as before:
Step 7: Back at the Rubbersheet dialog, click Export to save out this new control point set. Export it under the name Rsheet Corrected in the same directory as the original set.
In the Rubbersheet dialog note the error column for the individual points (corresponding to the
radii of their respective circles in the display) and the entry for Total RMS error at the bottom
of the dialog. The total RMS error is a measure of the overall accuracy of the rubbersheet at
the control points.
Step 8: Experiment with turning various control points on and off as well as changing the Polynomial degree to 2 from 1 and see the effect on the various errors. In general, a higher degree will result in less error but will introduce more distortion into the image where there are no control points. The more control points the higher degree you can use.
If you were to have only three or six (with degree 2) control points enabled for this image, note
that the errors all go to 0. This is because the Polynomial equation used to rubbersheet the
image has an exact solution at these numbers of control points. In fact, there are many “magic
numbers”. Beyond 3 and 6 are 10, 15, 21, 28 and so on, each requiring an increase in degree.
Now, using these numbers of control points doesn’t guarantee that the image is going to
rubbersheet any better in areas away from the control points. It only insures that the control
points in the image will rubbersheet exactly to the points you specified.
Step 9: Set the polynomial degree to 2 and enable all the control points. Click OK to execute the Rubbersheet.
Step 10: Check the results of the rubbersheet. Note that maybe only some points moved exactly where to you wanted them; but overall, the result was a significant and useful improvement.
Image Makeovers with Autodesk Raster Design 2006
12
Triangular Rubbersheet
Step 1: Having done the Polynomial rubbersheet in the previous section, make sure to undo your work before proceeding. Use the UNDO command and the Back option to undo everything.
Step 2: Select Image ⇒ Correlate ⇒ Rubbersheet again. This time, select the Triangular option in the Rubbersheet – Set Control Points dialog.
Step 3: Select Import and choose the corrected control point list, Rsheet Corrected. Note right off the bat that the errors are all zero.
The errors are zero because Triangular rubbersheet operates on the principal of breaking the
image into triangular segments and performing a three point polynomial rubbersheet on each
segment independently. As we learned earlier, a three point rubbersheet will be exact, hence
the zero error.
Step 4: Click on Preview. Note that the cyan boundary shows the image in its present position and the red boundary shows the extents of the image after the rubbersheet. The cross-hatched area shows the part of the original image that will be lost in the process. The preview is shown below:
The areas outside the red line in the preview are missing because they are outside the cluster
of control points. Essentially, there is not a third point out there to make a new triangular
section from, and hence it can’t be rubbersheeted.
Step 5: Exit the preview by pressing Enter.
Image Makeovers with Autodesk Raster Design 2006
13
Step 6: Given that we want to preserve the image in some of those areas outside the red line, we’ll need to add additional control points. A good choice in this case, would be to add the right-hand corner points to the control point list. To do this, select Add Points and add the two right-hand image corners as Anchor points. Return to the Rubbersheet dialog when you’re done.
Step 7: Select Preview again to see the change. It should look like the following:
Step 8: Exit the preview by pressing Enter. Then click OK in the Rubbersheet dialog to perform the rubbersheet.
Step 9: Now check your section corners. They’re right on as expected!
A quick note about the Grid option for Rubbersheeting. This is really a quick assist for setting
up the control points. It’s applicable when you have a regular grid to work from such as found in
a scanned map. In this case, the section lines are not regular and the grid would not have
helped us.
Palettes
Index color images use a palette to translate between the index, (the data value of a pixel in the image file), and the color in which that pixel is represented on the screen (in true color). The Palette Manager gives visibility into this palette and offers tools for exporting and importing palettes, changing individual palette entries, and even some for consolidating image index values.
Grayscale images also have a palette, albeit a fixed one. The Palette Manager allows Grayscale images to be “promoted” to index color and thereby have their palettes modified too.
Image Makeovers with Autodesk Raster Design 2006
14
Import/export palettes
Step 1: Use File ⇒ Open and navigate to: C:\datasets\GD32-3\Palettes. Select the drawing Palettes.dwg and Open it. A scanned USGS map is automatically inserted with the drawing.
Step 2: Select Image ⇒ Image Processing ⇒ Palette Manager. Shift-Left-Click the USGS map when prompted to Select image. The Palette Manager dialog is displayed. Note that a relatively few colors are contained in the image palette reflecting the standard colors used for USGS topo maps.
Because the palette is standardized, it’s possible to use the Palette Manager to essentially
remove classes of features from the image display. A simplified display can greatly help the
process of creating a bitonal image for the purpose of vectorizing contours for instance.
Step 3: We’ll want to export this palette so we can use it on other images. To do this, use the Palette drop down menu at the left side of the Palette Manager toolbar, and select Export. Save the palette as USGS Topo.pf with a Title of the same name. The capture below shows the Palette Manager dialog and the Palette drop-down menu.
.=
Step 4: Close (Cancel) the Palette Manager dialog.
Step 5: Restore the named view Troy Topo.
Step 6: Use Image ⇒ Insert and navigate to C:\datasets\GD32-3\Palettes. Select the image Troy USGS Topo.tif, and insert it using World File correlation.
Step 7: Use Image ⇒ Image Processing ⇒ Palette Manager and select the Troy USGS Topo image using Shift-Left-Click. Note that the Palette Manager dialog shows that this image uses an entirely different palette, one that uses up all 256 entries.
Step 8: Activate the Palette pull-down again but this time select Import. Note the selections at the bottom of the dialog for Palette Application. Select the
Image Makeovers with Autodesk Raster Design 2006
15
option for Match. Choose the USGS Topo.pf palette file and click Open. A capture of the Palette Import dialog is shown below for reference.
Step 9: Click OK to apply the palette to the image, and close the Palette Manager dialog.
Our standard USGS palette has been applied to this image by taking each original color in the
image and assigning it to the closest matching color in the standard palette.
For this exercise we exported our own “standard” USGS palette. In reality there is already a
palette file for USGS maps that comes with Raster Design: it’s called USGS_DRG.pf.
Combine & Change Using Palette Manager Combine and Change are the workhorse functions of Palette Manager. With these functions, images can be altered to suit many purposes. There are fundamental differences between Change and Combine that the user needs to be aware of. Change, is essentially an edit to the image palette only, where a new display color is set for a given image data value (index). Combine, on the other hand, changes data values in the image (an image edit) so that the affected pixels, with their new index values, display in a different color than before.
Step 1: Restore the named view Topo.
Step 2: Use Image ⇒ Image Processing ⇒ Palette Manager and select the USGS_Topo image using Shift-Left-Click.
Step 3: Note in the resulting Palette Manager dialog that white (index 1) with the cross in the color icon is designated as the transparency color.
Having White as the Transparency color is not good, as white has meaning in the image as a data
color. If we were to perform an edit such as a Remove operation, the part removed would be
Image Makeovers with Autodesk Raster Design 2006
16
the same color as the white portion of the image and all would render transparent if
transparency was turned on.
We’ll remedy this situation by taking one of the unused entries in the palette and turning it
white so it can be set as the transparency color instead of our current used entry. Then we’ll
change our data color to be slightly off white to distinguish it from the transparency color. The
reason we have to do this is that Raster Design uses the display color, not the index value, to
display transparency on the screen.
Step 4: Select the icon in the color table for index 255 and then click Change as shown below:
Step 5: In the resulting Target Color dialog, choose Index 1 (white) for the new color as shown below. Click OK.
Image Makeovers with Autodesk Raster Design 2006
17
Back in the Palette Manager dialog notice that now both indices, 0 and 255 show as the
transparent color because they are both the same white value.
Step 6: Click Apply in the Palette Manager dialog to see that we indeed loose the original data to transparency.
We’ll now use the Change operation to alter the white in the image (Index 0) to something very
close to white but just enough different to still use the pure white of index 255 as the
transparency color.
Step 7: Select the Index 0 white color icon in the color table. Click the Change button. The Target Color dialog is presented as before.
Step 8: Since we’re not likely to find the color we want in this, or another standard palette, we’ll use a custom color. Click the Custom Color button. The Select Color dialog is now invoked. Select the True Color tab in the dialog. In the Color model drop-down, insure that RGB is selected. The dialog will appear as below.
Step 9: Change the color from 255,255,255 to 254,254,254 and click OK.
Step 10: Click OK on the Target Color dialog.
Step 11: Back in the Palette Manager dialog, note that Index 0 (our white data) is no longer shown as the transparency color. Click Apply to see the result of this reassignment in the image.
Step 12: Click OK to finish.
We’ll now combine colors in an image. Remember that unlike the Change just performed, the
Combine operation will alter the original image data.
Step 13: Restore the named view San Fran. Note that the water in the bay is shown in various colors. For our purposes it would look much nicer to show the water as one homogenous blue color.
Image Makeovers with Autodesk Raster Design 2006
18
Step 14: Restore the named view SFO Bay to see the water colors in detail.
Step 15: Use Image ⇒ Image Processing ⇒ Palette Manager and select the SanFran.tif image using Shift-Left-Click.
Step 16: In the Palette Manager dialog click on the Select Color button at the right side of the menu bar. Choose the Window option, and window a selection of water colors. Your window should cover about the same area as that shown below:
Step 17: With several colors now selected in the color table, click on the Combine button.
Step 18: In the Target Color dialog, select index 121. To help find this index, note that as the cursor is moved over the color table that the index under the cursor is reported to the right and just above the table. With index 121 selected, Click OK to return to the Palette Manager dialog.
Step 19: Click OK in the Palette Manager dialog.
Step 20: The water has all changed to a single color. Restore the named view San Fran to see the entire effect.