December 2-5, 2003 MGM Grand Hotel Las Vegas From Raster to Vector: Make That Scanner Earn Its Keep! Felicia Provencal GD31-2 This class is an in-depth introduction to Autodesk Raster Design, formerly known as CAD Overlay, the raster editing, processing, and conversion tool from Autodesk. You'll learn the concepts behind raster information and how that information can be used within the AutoCAD environment. We'll cover all aspects of working with raster images, including the sources of raster data, inserting, and correlating images. You'll see how to process images with tools to change the resolution, brightness, contrast, and color depth. You'll learn how edit raster images by moving, copying, stretching, and rotating portions of a scanned image. You'll also learn the basics of converting scanning plans into true AutoCAD vector drawings. About the Speaker: Felicia is an Independent Consultant based in Hawaii with more than 17 years of experience working with AutoCAD, AutoCAD Map, Autodesk Land Desktop, Autodesk Civil Design, Autodesk Survey, Autodesk Field Survey, and Autodesk Raster Design software. She writes the monthly tutorial on civil software products for Point A Toplines. A popular Autodesk University instructor, Felicia conducts workshops and seminars and provides consulting and training services throughout the United States and the Pacific Basin. felicia.provencal@k-teksolutions.com
In this class, we will focus on working with raster images using Raster Design. Raster images are generally scanned pictures (such as aerial photographs and existing sites), rendered images (such as architectural modeling and rendering), digital photographs (such as site or structure pictures), or images downloaded from the Internet (such as satellite data). Raster Design will run with any flavor of AutoCAD except AutoCAD LT. These include AutoCAD, AutoCAD MAP, Mechanical Desktop, Architectural Desktop, and Land Desktop. You can insert and perform basic manipulation of raster images in AutoCAD, but for full control, editing, and conversion tools, you will need a plug-in such as Raster Design. Acquiring Images The most common way to acquire a raster image is to scan an existing printed plan, map, or photograph. When scanning raster images, there are a few things to keep in mind. The first term encountered when working with raster images is resolution. The resolution is typically listed in dots per inch (or dpi). The higher the resolution, the better looking the end results. However, the higher the resolution, the larger the file sizes. You have to compromise between file size and image quality when choosing a resolution. The first factor that can help determine the optimal resolution is what the image will be used for. If you will be displaying the image over the Internet or on a large format projector, you do not have to use a very high resolution as even high quality monitors do not display much more than 100 dpi. If you will be printing your images, most ink-jet style printers do not use more than 600 dpi. Older printers can generally handle about 300 dpi. For example, this handout is printed on a 300 dpi printer. If you will be scaling your image, you may need to scan at a higher resolution. The next thing you have to consider is the color depth. Again, the higher the color depth, the more realistic the image, but the larger the file size. This simplest type is called a binary image. This is also known as black and white, and is typically used to scan in blueprints or printed plans. The next level is 8-bit grayscale or palette color. Above that are several levels of full-color. Again, which color depth you choose will depend on the purpose for the scan. The last thing you should consider is the file type. For full editing capabilities within AutoCAD, TIFF images work the best. You can scan to a compressed TIFF file for better storage, although image processing may take a little longer. If you do not need to edit the image much and plan to use it across the Internet, the JPEG file format is much more compact and efficient and transfers quicker. JPEG s are typically used with HTML files. Once you have acquired the image, you have to insert it. This can be done by going to the Image pull-down menu and picking the Insert command. 2
Once you have chosen the image, the command will either insert the image, display a wizard to aid in inserting the image, or display a dialogue box for insertion point, rotation angle, scale, etc. This is controlled by the Insert Options shown at the bottom of the dialog. The following shows an example of the Correlation dialog. Correlation information can be taken from the image header, a separate world file, or by entering the information in the correlation dialog. If you are using Raster Design with AutoCAD MAP or Land Desktop, you can have transformations applied to the image automatically as you insert it. Correlating and Adjusting the Image Once the image has been inserted, it can be moved, scaled, and rotated using the standard AutoCAD editing commands. Since this image was scanned, there may be some distortion due to the mechanics of scanning. Images can also be cleaned up for presentation purposes. To process the image, go to the Image pull-down menu and pick the Cleanup submenu. In addition to being cleaned up, there are several ways an image can be adjusted to match the vector portion of your drawing. The simplest is to go to the Image pull-down menu, pick the Correlate sub-menu, then the Match command. This will prompt for two points both on the raster and vector to align the image. For a more thorough match, use the Rubbersheet command from the same menu. This will do a multiple point alignment on the image. This is the best tool for correlating aerial photos with vector geometry. Once the image to be rubbersheeted has been selected, you can choose the correlation points. All rubbersheeting information is shown as follows. 3
Once the image has been adjusted, it can be plotted and saved with the drawing. Images are attached to drawings much the way Xref s are. The raster file is not physically inserted into the drawing, but simply attached to it. Any changes made to the image can be saved back out to the raster file. To view all of the raster insertions, go to the Image pull-down menu and choose the Manage command. Editing Images There are two ways you can edit images in Raster Design, by processing the image, and by using Raster Entity Manipulation. The most common edit made to a true-color image is to adjust the contrast, brightness, and color balance. Go to the Image pull-down menu, then pick the Image Processing sub-menu, and then pick the Histogram command. A histogram is a graph showing the distribution of pixels in an image across the color map. The range of shades depends on the image type selected. The darker shades are shown on the left, and the lighter shades on the right of the graph. This Histogram command allows you to edit this distribution to change the appearance of an image. You can now process a portion of the image, or the entire image. Once the image area has been specified, you can choose the type of processing using the following dialog box. 4
You can use the various tabs to adjust different elements of the image. If there are several images tiled together, all images can be adjusted at one time by selecting all of the appropriate images. A new option is the Tonal Adjustment tab. This is used to perform non-linear adjustments to the histogram. If you are working with grayscale images, you can use the Convolve tool to adjust the masking in the image. For black and white images, there are the bitonal filters, used to thicken or thin out the raster linework. 5
The Palette Manager is a tool added with the latest version of Raster Design allows you to edit the color palette for 8-bit color or grayscale images. Use the Palette Manager to combine, change, and set transparency for individual colors within the palette. Palettes can also be exported and imported for color matching and web-safe images. If you are working with 8-bit grayscale images, you can use the Palette Manager to add spot color to the image. Once the image has been adjusted properly, you may need to edit it to remove portions of the image, or move, copy, or rotate image elements. These can be done using the Raster Entity Manipulation tools. Before you can make the edit, you must select a portion of the image. There are three ways to select the portion of the image to edit: by region, by enhanced bitonal region, or by primitive. A region can be used to select any window, polygon, or other shape of any type of image. These regions can then be moved, copied, rotated, or stretched like any AutoCAD entity. An enhanced bitonal region can only be used with binary (or bitonal) images. These regions can be selected using window or crossing areas similar to AutoCAD object selection methods. A primitive can only be created for binary images as well. These are used to select raster linework such as lines, arcs, and circles by picking the linework to change with a single click. To select the information, go to the Image pull-down menu, choose Raster Entity Manipulation, then the appropriate selection type. 6
Once the information has been selected, you can change it using any standard AutoCAD editing command (such as move or rotate). Once the changes have been made, you should save the changes back to the original image file. Go to the Image pull-down menu, choose Raster Entity Manipulation, then Merge To Raster Image. Alternatively, you can save the changed bits of raster image to separate files (similar to cropping an image). Merging Raster and Vector Raster Design provides tools you can use to merge two images together (tiled images) or to burn in vector information back to the underlying raster. This can be very useful when the final product needed is a TIFF file. Before merging vector information back into a raster file, you should set the Raster Pens. These are similar to plot style tables in that the settings made here control the width of the resulting raster linework based on the object s color. Go to the Image pull-down menu, choose Merge, then Configure Raster Pens. Pen sizes can be set in pixel values, or in AutoCAD units. Once the pens have been set, go to the Image pull-down menu, choose Merge, then Vector into Raster. If color images are used, the software will determine the best color usage based on the existing palette. If gradyscale or binary images are used, the raster pen widths will be respected, and the colors converted appropriately. 7
Raster to Vector Conversion Another task you will use Raster Design for is to convert a scanned line drawing into an AutoCAD vector drawing. This is widely used for contour maps, parcel maps, existing floor plans, electrical schematics, mechanical diagrams, and other linework. The image must be a binary image (i.e. black and white). You can use the Histogram command shown previously to convert a grayscale image into black and white. Before converting the linework, you should set the Options from Raster Design to get the most accurate results. Go to the Image pull-down menu and choose the Options command. This will access the following dialog box. There are three tabs from this dialog box that affect how the conversions are applied: Raster Entity Detection, VTools General, and VTools Follower. These settings affect how linework is created, what happens to the underlying raster, and the assigning of layers to the new linework. 8
A new group of settings is called Vector Separation. This allows you to set how layers will be assigned to the new linework as it is created. The Vector Separation options are available from the VTools General tab of the Options dialog. There are two sets of Vector Separation controls, one for Contours, and one for all other types of linework. These settings are respected by all commands from the Vectorization Tools menu. Once you have set the options, you are ready to begin converting. For the first example, we will go to the Image pulldown menu, then pick the Vectorization Tools sub-menu, then pick the Line command. Note that when you choose a line to convert, the command will display information about the line. You can use the command line (or right-click context menu) verification tools to make sure the new line is drawn accurately. Vectorization tools are available to 9
convert lines, arcs, circles, rectangles, text, and to follow polylines and contours and to create 3D polylines from 2D information. Note that the text conversion will require you to manually re-type the text. The follower tools replace the old LFX tools from previous versions of CAD Overlay. In addition to being faster and more accurate, the new followers will recognize broken linetypes, jump gaps, and can use the vector separation tables. New with Raster Design 3 were the Text Recognition tools. This is often referred to as Optical Character Recognition. The new text recognition tools allow you to extract text information as AutoCAD text objects for use within the current drawing. The text recognition tools can also be used to export scanned text to an external text file, or tables and schedules to external spreadsheet files. There are two types of text that can be converted: text (sometimes referred to as standard text), and table text. Text that represents labels, sentences, or paragraphs are treated as standard text and can be converted to AutoCAD Text or Mtext entities. Items such as construction notes, call-outs, or specifications are considered to be standard text. Text of this type can also be exported to an external text file. Standard text is converted using the Recognize Text command. Text organized into a schedule or chart is treated as table text and can only be converted into individual AutoCAD Text entities. Items such as door schedules and curve tables are considered to be table text. Text of this type can also be exported to an external spreadsheet file. Table text is converted using the Recognize Table command. To convert either type of text, go to the Image pull-down menu, choose Text Recognition, then the appropriate text type. You will then be prompted to select the text and a rotation angle. Once the text has been selected, a verification screen will appear. 10
Edits can be made in the lower pane of this dialog box. You can use search and replace tools, as well as custom dictionaries to look for spelling or conversion errors. At the bottom of this dialog, there are tools you can use to format the resulting text, as well as to export the text to word processing or spreadsheet programs. This command is continuous, so you will have to press Esc to exit the command line. 11