Tracing Tools

If we do not wish to use freehand tracing , Manifold provides tools to make tracing easier by creating points, lines and areas for us in a semi-automatic way. The tracing tools are found in the Tracing toolbar. The Tracing toolbar works within maps to create objects in drawings by using pixels in an image layer to guide the creation of objects in a drawing layer. This function is called vectorizing in older GIS packages.

 

Tracing tools work with all image types except compressed images - to trace compressed images, use freehand tracing.

 

images\tbar_tracing.gif

 

images\btn_trace_auto.gif

Trace Auto

Autoselect between creating areas or points depending on Tool Properties when clicking on a region of pixels of a similar color within the given tolerance.

images\btn_trace_area.gif

Trace Area

Create an area when clicked on a region of pixels of a similar color within the given tolerance. A Shift click will create areas within all such regions that qualify as areas throughout the image. Potentially slow in large images or complex shapes.

images\btn_trace_line.gif

Trace Line

Create line when clicked on a region of pixels of a similar color within the given tolerance. A Shift click will create lines within all such regions that qualify as lines throughout the image. Potentially slow in large images or complex shapes.

images\btn_trace_point.gif

Trace Point

Create a point when clicked on a region of pixels of a similar color within the given tolerance. A Shift click will create points within all such regions that qualify as points throughout the image.

 

(CTRL click)

CTRL clicking with a trace tool tells the tool to build objects only in regions where pixels are the same color as the tracing color well. If the tracing tool is clicked on pixels of any other color no tracing will occur.

 

(SHIFT click)

SHIFT clicking is an "open" command. It tells the trace tool to build objects in all regions throughout the image where pixels are colored like the place clicked. Caution: in a large image this can take a very long while.

images\btn_pick_color.gif

Pick Color

(Not on the tracing toolbar) This tool is on the editing toolbars for both drawings and images. It is listed here because it is frequently used with the tracing tools. Sample the color in the clicked pixel and use it as the foreground color. A Shift click chooses the background color.

 

Tracing toolbar buttons are enabled when a drawing layer in a map is clicked. Tracing commands require both an image and a drawing layer in the map. The pixels in any visible images layers are used as a guide to create objects in the active drawing layer. Normally we will use several different drawing layers and switch between them so different objects may be created in different drawing layers.

 

Tool Properties Controls when Tracing

 

All images consist of a sea of pixels. The only thing that differentiates one pixel from another is its color. Tracing tools all work by examine the colors of pixels at the place they are clicked and will continue to search from that initial click point to see how far the clicked color (within the tolerance specified in Tool Properties) extends into surrounding pixels. Tracing tools use the parameters specified within Tool Properties to decide how they should deal with the pixels they find that are contiguous with the pixel clicked.

 

Snap Tolerance

When a snap mode is on, the distance in pixels or physical units within which the cursor must be to a given snap item (such as a line when snapping to lines) before the cursor snaps to that item.

Value Tolerance

Color tolerance to use to reckon that pixels are the same color as the pixel originally clicked.

Point size

A distance parameter given in native drawing measurement units that is used to distinguish a point from an area. Pixel regions smaller than this distance will be created as points, while those larger than this distance will be created as areas.

Match neighbors

When automatically creating areas, fill in the area to align exactly to the edge of any neighboring areas that already exist.

Trim size

A distance parameter given in native drawing measurement units that is used to trim unwanted side lines when automatically creating areas.

 

Pick Color

 

images\btn_pick_color.gif The color picker sets foreground color by sampling a color in an image. Clicking into the foreground color well and drilling down into the color dialogs will show the RGB value of the color chosen with the color picker tool.

 

Color picker action:

 

·      Clicking anywhere in an image with Pick Color chooses the color of the clicked pixel for the foreground color.

·      Shift clicking anywhere in an image with Pick Color chooses the color of the clicked pixel for the background color.

·      When the Layers pane is used to turn channels off Pick Color will only pick those color values represented by the channels that are visible.

·      When only the Alpha channel is turned on in the Layers pane, clicking Pick Color into the image will pick a grayscale color value representing the value of the Alpha Channel.

·      Clicking Pick Color on invisible pixels results in no change.

·       When used in a map Pick Color chooses color from the highest visible image in the map layer stack.

 

Restricting Tool Action by Color

 

Tracing tools can be set to use the color shown. Tracing tools normally create objects based on whatever color exists at the point they are clicked. If desired, we can force the tool to use only the specified color by CTRL clicking with the tool. This is useful when clicking onto small portions of the image. Set the desired color and then CTRL click with a tracing tool to be sure we are clicking only on that color. CTRL clicking on other colors will have no effect.

 

Tracing Many Objects at Once

 

Normally, tracing tools will trace just the region of pixels on which the tracing tool is clicked. SHIFT clicking on a spot in an image with a tracing tool will cause all regions of pixels of the color clicked to be traced. In Manifold, a SHIFT is usually an "open" command. For example, in Select Touch a click will select all contiguous pixels like the one touched while a SHIFT click with Select Touch will select all pixels like the one touched throughout the entire image even if they are not contiguous.

 

The SHIFT click tracing command applies only to that tool used. Using it with Trace Line will trace only lines within all pixel regions like the one touched. Trace Auto will automatically trace areas, lines and points throughout the image when used with SHIFT click.

 

Point size and Trim Size

 

The Trace Auto tool needs to know if it has been clicked on a region of pixels that qualifies as a point or an area. It does this using the Point size parameter in the Tool Properties pane.

 

images\img_tracing_area_ratio.gif

 

For example, in the illustration above we would want the Trace Auto tool to trace the larger purple rectangles as areas and not as points. To make this determination, the tool sees how far the clicked pixel color extends into neighboring pixels and compares it to the Point size parameter. If the clicked color extends in all directions no more than the point size parameter, the trace tool knows it has been clicked on a point. If the clicked color extends further than the point width parameter, the trace tool knows it has been clicked on an area.

 

When autotracing lines the Trim size parameter helps the system avoid following a pixel fog into unreasonably complicated lines. If lines are growing undesired side branches, the Trim size parameter may be modified.

 

Note that the Point size and Trim size parameters are given in the native measurement units of the target drawing. Fractional values are allowed. For projected drawings, the native measurement unit is normally meters or feet. By definition, this means that for sensible use of the Trace Auto tracing tool the image and drawing should be in a projection, most likely a meter-based projection.

 

Example

 

images\sc_trace_tools_eg02.gif

Suppose we wish to trace over some elements of a scanned paper map.

 

images\btn_trace_area.gif We begin by choosing the Trace Area tool and clicking onto the large purple rectangle.

 

images\sc_trace_tools_eg02a.gif

The point where the Trace Area tool cursor is first clicked choose the color used to find the area. In this case the tool finds all contiguous purple pixels from the central point. If the tolerance factor was set very high the tool would use the lighter purple pixels as well.

 

images\sc_trace_tools_eg02b.gif

The area is created in the region of purple pixels.

 

images\sc_trace_tools_eg03.gif

We can click on other of the purple rectangles with the Trace Area tool to trace them into areas as well.

 

images\sc_trace_tools_eg04.gif

If we Shift click on one of the purple rectangles, the Trace Area tool will create areas for all such regions of clicked color.

 

images\btn_trace_line.gif To create a line we choose the Trace Line tool and then click on the brown contour line just below the two large rectangles we traced into areas.

 

images\sc_trace_tools_eg04a.gif

When we click onto a brown pixel in the line the tracing engine follows contiguous brown pixels up and down to see where the line object should be created.

 

images\sc_trace_tools_eg04b.gif

We show the approximate region where the line is created in magenta pixels, with the line object that was created drawn in black.

 

images\sc_trace_tools_eg05.gif

On zooming out we can see on the line has been created. It is shown as a thick magenta line so it is more easily visible. Note that the new line has been created from the point where the brown pixels ended at the "200" number in the lower left up to the point where the brown pixels ended at the "P" in the "Alpine" letters. While text within the image may be very helpful to readers when it gets in the way of tracing lines it is simply clutter.

 

We can create points with the tracing tools as well.

 

images\btn_trace_point.gif To create a point, we choose the Trace Point tool and then click on regions of pixels that we want interpreted as points. In the above case, we can click on the two black dots near the line that was just traced.

 

images\sc_trace_tools_eg05a.gif

The trace tool will follow the black color of the point from the place clicked as shown in the illustration above, which is zoomed far into the image. If our Point Size tool property setting is wider than the geographic distance covered by the pixels that make up the dots they will be interpreted as points and will have a point object created at the center of each.

 

images\sc_trace_tools_eg06.gif

 

Because points are often represented by small regions of pixels it is often most convenient to zoom into the point before clicking on it. This avoids accidentally creating a point if we click on some pixel junk near the region on which we intended to click.

 

Tracing with Multiple Images Visible

 

We may wish to trace using maps where several images are visible at the same time. The tracing tools auto-select which image is used for tracing by choosing the highest visible image at the location where the tool is clicked. That image is then used to guide tracing. This is similar to the action of the Pick Color tool, which picks color from the highest visible image in the map layer stack.

 

images\sc_trace_tools_eg07.gif

The illustration above shows the scanned paper map image used as an example earlier in this topic. Above it in the map layer stack is a drawing and then above the drawing is an RGBa image that contains several semi-transparent rectangles with invisible pixels between the rectangles.

 

images\sc_trace_tools_eg07a.gif

The illustration above depicts the two image layers as we looked at them in a perspective view. The drawing layer (not shown) is between them. The rectangles in the upper image have been made semi-transparent so we can see what happens underneath them.

 

images\sc_trace_tools_eg08.gif

If we use the Trace Area and Trace Line tools and click on the points indicated we will be clicking onto the scanned paper map image. In those locations the uppermost image has no visible pixels. Thus, the first visible image layer under the point being clicked is the scanned paper map image's layer.

 

images\sc_trace_tools_eg09.gif

The result is that the tracing tools create objects in the drawing layer by following pixels in the scanned paper map image. The tracing process follows the pixels in the scanned paper map layer even when those pixels lead "underneath" visible pixels in overlying layers. Note how the traced line object goes underneath the overlying semi-transparent rectangle, for example.

 

If we would like pixels from several images to guide the action of tracing tools we should first merge those image layers into one image layer (by showing the layers to be combined in one map and then using Tools - Make Image to create a single image) and then use that one image layer to guide tracing.

 

Example

 

In this example we show how to use tracing tools with surfaces to create areas from a surface. This is an atypical usage of tracing tools that uses an image as an intermediary step.

 

images\eg_surf_area_01.gif

 

Let's begin with the Montara Mountain example surface from the Manifold CD. Our objective is to create areas in a drawing that exactly overlay a region of interest in the surface. This is a common task when creating drawings from surfaces, for example, to create vector maps of islands or other features in regions where we have terrain elevation data but no other detail.

 

We copy the surface and work with the copy of the surface so that any changes made are not permanent.

 

images\eg_surf_area_02.gif

 

We begin by selecting the region of interest. We can use whatever selection tools we like, for example, touch selection using add and subtract selection modes.

 

images\eg_surf_area_03.gif

 

We press Edit - Delete to delete the selected pixels.

 

images\eg_surf_area_04.gif

 

We use Tools - Make Image to make an image of the surface, we create a map based on that image and then we open the map.

 

images\eg_surf_area_05.gif

 

We zoom into the image to a region that shows the "deleted" part of the surface. Note that when seen in the surface the deleted region shows the default checkerboard background. In the image, which is a literal snapshot of the screen, this part of the image is not transparent pixels but rather consists of light gray and white pixels that render the checkerboard background as it was seen.

 

We select the region of darker gray boxes by using SHIFT - Select Touch.

 

images\eg_surf_area_06.gif

 

Next, with selection mode set to Add to Selection we select the region of white boxes by again using SHIFT - Select Touch.

 

images\eg_surf_area_07.gif

 

Finally we select the grid between the boxes with one more SHIFT - Select Touch click.

 

images\eg_surf_area_08.gif

 

With three quick clicks we have selected the entire region of pixels in the image that represent the region selected and then deleted in the surface.

 

images\eg_surf_area_09.gif

 

To make this region stand out we launch the Image - Adjust - Hue / Saturation command and adjust Lightness all the way to -100. Press OK.

 

images\eg_surf_area_10.gif

 

This makes all pixels in that region black. This is a color that does not otherwise occur in the image so it is a useful way to mark the desired region with easily discernable pixels.

 

images\eg_surf_area_11.gif

 

images\btn_trace_area.gif We add a new drawing to the map and with the drawing being the active layer click on Trace Area and then we click on one of the black pixel regions.

 

images\eg_surf_area_12.gif

 

This creates an area in the drawing that overlays the region of black pixels. We click the Trace Area tool cursor into the other black region.

 

images\eg_surf_area_13.gif

 

This creates another area overlaying the other region of black pixels.

 

images\eg_surf_area_14.gif

 

If we turn off from display the image layer we can see that we have created a drawing with two area objects that precisely overlay the region of pixels that were selected in the original surface.