<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <title>Instructions for using the program named SVGDraw01</title>
  <meta name="generator" content="Amaya, see http://www.w3.org/Amaya/" />
        </head>
<body style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt"
bgcolor="#FEFFF0" link="#0000ff" vlink="#cc00cc" alink="#ff0000">


<h1>Instructions for using the program named ShapeExtractor02</h1>
<p>Version 0.0.1 2012.02.13<br />
</p>


        <h2>Table of contents</h2>

<ul>
        <li><a href="#Introduction">Introduction</a><ul>
                <li><a href="#Accessibility">Accessibility</a></li>
                <li><a href="#An_image_processing_algorithm">An image processing algorithm</a></li>
                <li><a href="#Output_file_format">Output file format</a></li>
                <li><a href="#Semi-theoretical_background">Semi-theoretical background</a><ul>
                        <li><a href="#Loss_of_color_information">Loss of color 
                                information</a><ul>
                                <li><a href="#The_billboard_example">The billboard example</a></li>
                        </ul>
                        </li>
                        <li><a href="#The_solution">One solution to the color loss problem</a><ul>
                                <li><a href="#Outlines">Outlines</a></li>
                                <li><a href="#Horse_images">Horse images</a></li>
                                <li><a href="#A_written_description_is_necessary">A written 
                                description is necessary</a></li>
                                <li><a href="#Color_differences_are_paramount">Color differences are paramount</a></li>
                                <li><a href="#Camouflage">Camouflage</a></li>
                                <li><a href="#Emphasizing_outlines">Emphasizing outlines</a></li>
                                <li><a href="#Color_changes">Color changes</a></li>
                                <li><a href="#An_audio_speed_sensor">An audio speed sensor</a></li>
                                <li><a href="#Getting_back_to_outlines">Getting back to outlines</a></li>
                                <li><a href="#A_mathematical_description">A mathematical description</a></li>
                        </ul>
                        </li>
                </ul>
                </li>
        </ul>
        </li>
        <li><a href="#Operating_instructions">Operating instructions</a><ul>
                <li><a href="#GUI_components">GUI components</a></li>
                <li><a href="#CheckToDisplayGrayPixels">Check to display gray pixels</a></li>
                <li><a href="#Select_file">Select file</a><ul>
                        <li><a href="#Allowable_file_types">Allowable file types</a></li>
                        <li><a href="#Processing_begins">Processing begins</a></li>
                </ul>
                </li>
                <li><a href="#Slide_to_adjust_threshold">Slide to adjust threshold</a></li>
                <li><a href="#Sliding_scale_value_display">Sliding scale value display</a></li>
                <li><a href="#Write_the_output_file">Write output file</a></li>
                <li><a href="#Exit_the_program">Exit the program</a></li>
        </ul>
        </li>

</ul>
<h2><a name="Introduction">Introduction</a></h2>
<p>You may have discovered that your attempts to emboss bitmap images have been 
met with less than outstanding success. If so, you may want to try using this 
program to enhance your bitmap images for embossing prior to the application of 
your chosen embossing method.</p>
<p>This program is designed to make it easier for sighted 
teachers and others who assist blind people to enhance bitmap images for 
improved embossing. The program is not tied to any particular embossing method. 
It should work equally well with embossers with variable dot height, embossers 
without variable dot height, and other embossing methods such as the use of 
"swell paper".</p>
<h3><a name="Accessibility">Accessibility</a></h3>
<p>Unfortunately, the program is not completely accessible for blind users 
because it requires the use of a mouse, a slider, and an onscreen display to 
adjust a threshold in the enhancement algorithm for best results on an image by 
image basis.</p>
<p><a name="However,_the_graphical_user_interface">However, the graphical user 
interface</a> was written using SWT and should be fully accessible. If you are 
blind, you should be able to run the program to produce and emboss output files 
using the default level for the threshold. While you won't be able to use the 
slider to optimize the threshold on an image by image basis, you may find that 
embossed versions based on the default threshold value are more useful than 
embossing the raw image for some images.</p>
<h3><a name="An_image_processing_algorithm">An image processing algorithm</a></h3>
<p>The program applies a sophisticated image processing algorithm to the 
full-color bitmap image for the purpose of identifying and
retaining the 
salient features of the image prior to discarding the color information and converting to black and white or 
black, gray, and white format.</p>
<h3><a name="Output_file_format">Output file format</a></h3>
<p>The enhanced output image is written into a jpg file. The name of the output 
file is the same as the name of the input file but with "-Enhanced" inserted in 
the file name.</p>
<p>The dimensions of the image in the output file are the same as or possibly 
smaller than the dimensions of the input image. After the image is enhanced, it 
is trimmed to eliminate any blank areas around the borders of the enhanced 
image. This can lead to smaller dimensions in the output image.</p>
<h3><a name="Semi-theoretical_background">Semi-theoretical background</a></h3>
<p>You may have discovered that it can be very difficult to produce good results 
when embossing full-color bitmap images. The reasons for the poor results  
are fairly easy to understand. The solution to the problem is somewhat more 
difficult.</p>
<p>The reasons for the difficulty are twofold:</p>
<ul>
        <li>loss of color information</li>
        <li>loss of spatial detail due to very sparse spatial sampling</li>
</ul>
<p>This program deals with the first reason: loss of color information.</p>
<h4><a name="Loss_of_color_information">Loss of color information</a></h4>
<p>In many cases, a digital image consists of an array of colored pixels where 
any one pixel can take on more than 16 million colors. It is the combination of 
these widely varying colors in the array of pixels that imparts information to a 
sighted viewer.</p>
<p>An embossed output is often analogous to a digital image 
containing only two colors -- black and white. The situation is somewhat better 
with embossing methods that provide variable dot height. Those methods can represent black, white, and 
possibly three 
shades of gray. (Some might claim that a blind user of a variable dot height 
embosser can recognize more than three shades of gray.)</p>
<h5><a name="Map_16_million_colors_into_black,_white,_and_three_shades_of_gray">
Map 16 million colors into black, white, and three shades of gray</a></h5>
<p>In order to emboss a digital image and produce a meaningful tactile image, we 
must map 16 million colors into black, white, and possibly three shades of gray and cause those 
resulting two to five colors to convey the information content of the original image. 
That is a tall order.</p>
<h5><a name="Five_sets_of_3_million_colors_each">Five sets of 3.2 million colors 
each</a></h5>
<p>Assume, for example, that you were to divide the colors into five sets of 
about 3.2 million colors each. Then assume that in order to emboss a bitmap image, 
you were to </p>
<ul>
        <li>convert every pixel whose color falls in one set to black,</li>
        <li>convert every pixel whose color falls in another set to dark gray,</li>
        <li>convert every pixel whose color falls in still another set to gray,</li>
        <li>convert every pixel whose color falls in still another set to light 
        gray,</li>
        <li>convert the remaining pixels to white.</li>
</ul>
<p>The results that you get will depend entirely on chance and the chances for 
success aren't very good. About twenty-percent of the pixels will be will be 
indistinguishable from their neighbors in the final version of the image even if 
those pixels were clearly distinguishable from their neighbors in the original 
image.</p>
<h5><a name="The_billboard_example">The billboard example</a></h5>
<p>Assume, for example, that red and green are two of the colors that are 
assigned to black while blue, is assigned to white. Now 
assume that you emboss an image of a green rectangular billboard containing red 
letters in front of a blue sky. The result will be a black rectangle on a white 
background. The message being conveyed by the red letters will be completely 
lost because they also will be converted to black and will be 
indistinguishable from the billboard.</p>
<p>We need a better way to convert those 16 million colors to black, gray, and 
white. I will explain a better way in the next section.</p>
<h4><a name="The_solution">One solution to the color loss problem</a></h4>
<p>Let me begin by saying that there is no single best solution to the problem 
of color loss. 
Different solutions may provide better results for different images. The 
solution provided by this program is only one of several possible solutions.</p>
<h5><a name="Outlines">Outlines</a></h5>

<p>Coloring books used by small sighted children contain images consisting 
almost entirely of the outlines of objects. Once a student progresses 
beyond childhood coloring books and enrolls in an art class, she learns that there are very few outlines 
in nature. Consequently, there are usually very few outlines in digital images. 
However, you probably will want to return to outlines for the purpose of 
embossing shapes. Outlines are probably more easily recognized than broad areas 
of raised dots when exploring an image with the fingers.</p>
<p>This is illustrated in the following four images.</p>
<!--``1Fig001-->
<table border="1" width="0"><thead><tr><th>
        <a name="Figure_1">Figure 1</a>. Full-color rendition.</th></tr></thead><tbody><tr><td>
                        <img alt="Missing image" src="horse.jpg" width="480" height="640" />
</td></tr></tbody></table>
<!--``2-->
<p>-</p>
<!--``1Fig002-->
<table border="1" width="0"><thead><tr><th>
        <a name="Figure_2">Figure 2</a>. Five-level gray scale rendition.</th></tr></thead><tbody><tr><td>
                        <img alt="Missing image" src="horseFiveLevelGrayScale.jpg" width="475" height="635" />
</td></tr></tbody></table>
<!--``2-->
<p>-</p>
<!--``1Fig003-->
<table border="1" width="0"><thead><tr><th>
        <a name="Figure_3">Figure 3</a>. Enhanced image with 5-level gray scale.</th></tr></thead><tbody><tr><td>
                        <img alt="Missing image" src="horse-Enhanced01.jpg" width="481" height="641" />
</td></tr></tbody></table>
<!--``2-->
<p>-</p>
<!--``1Fig004-->
<table border="1" width="0"><thead><tr><th>
        <a name="Figure_4">Figure 4</a>. Enhanced image with black and white only.</th></tr></thead><tbody><tr><td>
                        <img alt="Missing image" src="horse-Enhanced02.jpg" width="481" height="641" />
</td></tr></tbody></table>
<!--``2-->
<h5><a name="Horse_images">Horse images</a></h5>
<p><a href="#Figure_1">Figure 1</a> shows a full-color image of a horse.
Note the similarities of the colors in the image.</p>
<p><a href="#Figure_2">Figure 2</a> shows a five-level gray scale rendition of the 
same horse image. If you were to simply copy the original image to a 5-level embosser, 
this is probably close to what you would get where each different shade of gray  
is represented by dots of a given height. Thus, you would end up with large 
areas of dots all at the same height with small differences in dot height 
between the areas in some cases.</p>
<p><a href="#Figure_3">Figure 3</a> shows a five-level rendition of an enhanced 
version of the original image. In this rendition, the salient features of the 
original image are outlined in black and the gray levels simply add accent to 
the image. This version would be suitable for printing on an embosser that 
supports variable dot height.</p>
<p>I believe that the outlines shown in <a href="#Figure_3">Figure 3</a> would be much 
easier to interpret with the fingers than the large areas of constant dot height 
shown in <a href="#Figure_2">Figure 2</a>. I will admit, however, that never 
having developed the ability to see with my fingers, even <a href="#Figure_3">
Figure 3</a> would be nearly impossible for me to interpret blindfolded.</p>
<p><a href="#Figure_4">Figure 4 </a>shows an enhanced black and white rendition 
that would be suitable for printing on an embosser that doesn't support variable 
dot height. Depending on the number of dots per inch that the embosser produces, 
this version should work well with such an embosser. I don't know what you would 
get if you were to print the rendition in <a href="#Figure_2">Figure 2</a> on 
such an embosser, but I doubt that it would be very usable.</p>
<h5><a name="A_written_description_is_necessary">A written description is 
necessary</a></h5>
<p>In all cases, a good written description of the embossed image would be 
needed to help the student interpret what she feels with her fingers.</p>
<h5><a name="Color_differences_are_paramount">Color differences are paramount</a></h5>
<p>In general, the only 
thing that distinguishes one object from another in a full color digital image is 
the fact that the two objects are colored differently. (The horse's hair in
<a href="#Figure_1">Figure 1</a> is a different color than the wooden planks 
that were used to construct the stall.) As mentioned above, if 
the scheme for converting the color image to black, gray, and white depends on 
subdividing the colors into five groups, and simply mapping the colors into black, 
dark gray, gray, light gray, 
and white (as in <a href="#Figure_2">Figure 2</a>), much of the information will be lost in 
the transformation from color to black, gray, and white.</p>
<h5><a name="Camouflage">Camouflage</a></h5>
<p>Animals and military combat troops use camouflage to avoid being seen by 
predators or by the enemy. The purpose of camouflage is to eliminate outlines 
and to prevent the recognition of common shapes.</p>
<p>For example, the colors of the feathers on a quail cause it to blend into its 
surroundings and eliminate or reduce its visual outline. The chameleon and 
certain undersea creatures can change their color to match that of their 
surroundings to eliminate or reduce their visual outline.</p>
<p>For purposes of embossing a digital image  we need a 
way to un-camouflage the objects in the image. In other words, we need a way to 
retain and even emphasize the shapes of objects in the process of converting from color to black, 
gray, and white.</p>
<h5><a name="Emphasizing_outlines">Emphasizing outlines</a></h5>
<p>The image processing algorithm used by this 
program is designed to emphasize outlines. The primary objective is to cause each object 
in an image to be described by a black outline against a white background. A 
secondary objective, if elected by the user, is to fill in the outlines with 
three shades of gray plus white.</p>
<h5><a name="Color_changes">Color changes</a></h5>
<p>The distinguishing characteristic among objects in a full-color digital image 
is usually not the absolute colors themselves. Instead, the distinguishing characteristic is the 
change in color from one object to the next. For example, I can invert the 
colors in a color image so that every unique color is changed to a different 
unique color and a sighted person will probably still be able to distinguish 
among the different objects in the image.</p>
<p>Therefore, the primary characteristic of the algorithm used by this program 
is not based on the translation of absolute colors into black, gray, and white. Instead, it 
is based on detecting the changes in color and reflecting those changes in black, 
gray, 
and white.</p>
<h5><a name="An_audio_speed_sensor">An audio speed sensor</a></h5>
<p>This is somewhat analogous to installing a buzzer in your car that sounds off when 
your rate of change of position (speed) exceeds a preset limit. The buzzer 
doesn't care about your absolute position, it cares only about the rate of 
change in position.</p>
<p>The algorithm used in this program doesn't care about absolute color, it 
cares only about the rate of change of color.</p>
<h5><a name="Getting_back_to_outlines">Getting back to outlines</a></h5>
<p>The net effect of the algorithm is to convert the image back to the "coloring book" format of 
black outlines on a white background. This is a format that seems to work well 
for embossing images with a two-level embosser. The algorithm can also fill in 
the outlines with three levels of gray, if elected by the user, to add accent to 
the image when used with a multi-level embosser.</p>
<h5><a name="A_mathematical_description">A mathematical description</a></h5>
<p>For the mathematicians in the group, the enhancement algorithm simulates the 
computation of the first derivative of a five-dimensional surface (X, Y, red, 
green, and blue) and the creation of a three-dimensional surface where the height of the 
surface at a particular X-Y coordinate position represents the rate of change of color at 
that position in the original image.</p>
<p>A slider is used to manually apply a level detector to the surface, producing 
black pixels where the rate of change exceeds the threshold and producing white 
pixels where the rate of change is less than the threshold. Thus, peaks in the 
surface are represented as black islands in a sea of white.</p>
<p>Alternatively, if elected by the user, four separate  but related thresholds can be applied 
producing black, dark gray, gray, light gray, and white pixels in the output 
image.</p>
<h2><a name="Operating_instructions">Operating instructions</a></h2>
<p><strong>ShapeExtractor02</strong> is a GUI application designed for use by sighted instructors 
and others who assist blind people. It is not designed to be fully accessible for 
unassisted use by the blind. (See
<a href="#However,_the_graphical_user_interface">earlier comments</a> regarding 
use of the program with the default threshold value.) I will publish a different version of the program 
later that is designed for unassisted use by the blind. The user interface consists 
of labels, a checkbox, a sliding scale, a small display window, two 
buttons, and a large onscreen visual display.</p>
<h3><a name="GUI_components">GUI components</a></h3>
<p>When the program starts running, focus is on a component that I refer to as 
home base. It reads "Start here and tab down." As you tab down, you will 
encounter the following components in order, which are labeled as shown. I will explain 
the purpose of each component in later sections of this document.</p>
<ul>

        <li>Checkbox - <a href="#CheckToDisplayGrayPixels">Check to display gray 
        pixels</a></li>
        <li>Button - <a href="#Select_file">Select file</a></li>
        <li>Sliding scale - <a href="#Slide_to_adjust_threshold">Slide to adjust threshold</a></li>
        <li>Display (unlabeled) - <a href="#Sliding_scale_value_display">Sliding scale value display</a></li>
        <li>Button - <a href="#Write_the_output_file">Write output file</a></li>
</ul>
<h3><a name="CheckToDisplayGrayPixels">Check to display gray pixels</a></h3>
<p>This checkbox is checked by default, meaning that the output file will 
contain gray pixels by default. If you don't want gray pixels in the output, 
clear the checkbox.</p>
<h3><a name="Select_file">Select file</a></h3>
<p>Press the button 
labeled "Select file." to open a bitmap image file for processing. When you press that button, a 
standard file selection dialog will appear allowing you to select 
a bitmap image file.</p>
<h4><a name="Allowable_file_types">Allowable file types</a></h4>
<p>The image processing portion of this program was written using a multimedia 
library provided by Georgia Tech University. I'm unsure as to all of the 
different image file types that it will support. I know that the program will 
support image files of <a name="types_jpg">types jpg</a>, bmp, and png, so the program is written to 
allow you to easily select image files of those types. (The program will also allow you 
to select a file of any type, but a little extra effort is required.)</p>
<p>If you are interested in 
routinely processing image files of types other than those <a href="#types_jpg">
listed above</a>, contact me by email and provide a sample image file. I will 
test the file, and if it can be supported, I will update the program to include 
image files of that type.</p>
<h4><a name="Processing_begins">Processing begins</a></h4>
<p>Processing begins when you select the file and close the 
dialog. At this point, you can begin moving the slider to adjust the image in 
the onscreen display. </p>
<p>Also, at this point, the value of the checkbox labeled "Check to display 
gray pixels" has been set. Clearing or setting that checkbox will have no effect until you select another file for processing.</p>
<h3><a name="Slide_to_adjust_threshold">Slide to adjust threshold</a></h3>
<p>When you select an image file for processing, the program will begin running 
the image enhancement algorithm described <a href="#The_solution">earlier</a> The slider 
on the scale will move to the center position with a value of 50 and a black and 
white version of the selected image will appear in an onscreen display. (If the 
checkbox is checked, a black, gray, and white version of the selected image will 
appear in the onscreen display.)</p>
<p>You use the slider to adjust a threshold value that is used by the enhancement algorithm 
to determine how much detail is included in the enhanced image. Detail 
decreases you move the slider to the left and increases as you move the slider 
to the right. </p>
<p>Only you can decide what works best for any particular 
image and embossing method, and you can use the slider to adjust the level of detail accordingly.</p>
<p>Depending on the speed of your computer, you may find that the slider is 
sluggish and difficult to move. Just be patient. One approach to moving the 
slider is to press the 
slider with the mouse and then move the mouse pointer to the location where you 
want the slider to go. As soon as the computer 
finishes the current task, an updated image will appear in the onscreen display 
and the slider will move to the location of the mouse pointer.</p>
<p>Another way to move the slider is to click the mouse in the track to the left 
or the right of the slider. This will cause the slider to move in very small increments. 
This is useful in the final stages of adjusting the threshold to cause the 
algorithm to 
produce the desired output.</p>
<h3><a name="Sliding_scale_value_display">Sliding scale value display</a></h3>
<p>The sliding scale is calibrated from 0 on the left to 100 on the right. As 
you move the slider, you should see the current position of the slider reflected 
in a small read-only display immediately below the sliding scale.</p>
<p>Note, however, that depending on the speed of your computer, you 
may also find that updates to the display are somewhat sluggish.</p>
<h3><a name="Write_the_output_file">Write output file</a></h3>
<p>When you are satisfied with the image showing in the onscreen display, press 
the button labeled "Write output file. This will cause the output jpg file to be written into the same folder as the input file that you
<a href="#Select_file">selected</a> 
for processing earlier.</p>
<p>When the output jpg file has been written, you can use it to produce an 
embossed version of the enhanced image using the embossing method of your 
choice. </p>
<p>At that point, you can either select another file for processing, or exit the 
program.</p>
<p>As mentioned earlier, the name of the jpg file will be based on the name of the image file 
with "-Enhanced" inserted into the file name to distinguish it from the original 
image file</p>
<h3><a name="Exit_the_program">Exit the program</a></h3>
<p>You can exit the program by selecting the X in the 
upper-right corner of the graphical user interface.</p>
<p>Dick Baldwin<br/>
baldwin@dickbaldwin.comp</p>




<p>-end-</p>