[Blindmath] Fw: [Nfb-science] grayscale braille
Michael Whapples
mwhapples at aim.com
Mon Mar 19 21:28:48 UTC 2012
Hello,
Just had this on the NFB-science list, may be interesting to some here
(Richard Baldwin, you are probably the main one I think of but there are
others as well).
Michael Whapples
-----Original Message-----
From: John Miller
Sent: Monday, March 19, 2012 9:16 PM
To: blindmath at nfbnet.org ; nfb-science at nfbnet.org
Subject: [Nfb-science] grayscale braille
Hello,I hope you enjoy the following article about grayscale braille.I would
appreciate any feedback or ideas for improving grayscale braille to
johnmillerphd at hotmail.com. Grayscale Braille
by John MillerViewing grayscale plots is helpful in algebra, multi-variable
calculus, electrical engineering, image processing, and other fields of
STEM.
What follows is a brief discussion of how to make grayscale plots using a
refreshable braille display or a braille embosser.
These grayscale braille plots are meant as a supplement to other analytical
methods and methods of displaying braille graphics.
Note that today braille embossers only display binary data, each dot
represents a location in the image that contains energy and each blank
location indicates a location that does not. The grayscale braille method
described in this article provides 26 levels of grayscale in the braille
output.
Section 1 describes the grayscale braille display method.
Section 2 describes some advantages and disadvantages of the method.
Section 3 provides some examples.
Section 4 provides a matlab script that generates grayscale braille output
in a file suitable for embossing or viewing with a refreshable braille
display.Section 1
The general idea of the grayscale braille method is to represent each
braille pixel with a braille symbol taken from the symbols "a" through "z".
The "z" symbol is mapped to a pixel of high energy whereas the "a" symbol is
mapped to a pixel of low energy.
In this way, when viewing pixels from smallest energy to highest energy in
the tactile graphic, one would encounter the letters of the English alphabet
in ascending order.Perform the grayscale braille display method as follows.
Define the input variables num_rows and num_cols corresponding to the number
of rows and columns in the braille output.
Define an input function f for the grayscale plot.
Set display_levels, the number of display levels, to 26.
Step 1. Compute the minimum value of the function box_min.
Step 2. Compute the maximum value of the function box_max.
Step 3. Compute delta = (box_max - box_min) / display_levels.
Step 4. Print the maximum value, minimum value, and delta value to file.
Step 5. Repeat steps 6 through 9 for each row and each column index.
Step 6. float_offset = (f(i, j) - box_min ) / delta
Step 7. int_offset = floor(float_offset + 0.5)
Step 8. Limit int_offset to the range 0 through display_levels - 1.
Step 9. For the current row and column, generate a grayscale "a" symbol if
int_offset is 0.
Similarly, generate a grayscale "b" symbol if int_offset is 1, and so-on.
Generate a grayscale "z" symbol if int_offset is 25. Output the grayscale
symbol to file.Section 2
Grayscale braille output provides several advantages over other braille
graphic methods.
Grayscale braille output provides an analog for braille viewing that is
similar to viewing a print grayscale image.
The grayscale braille output provides a compact 2 dimensional tactile image
that is superior to a collection of 1 dimentional images.
The grayscale output can easily be viewed with a 40-cell refreshable braille
display.
The refreshable braille display may be available when a braille embosser
supporting braille graphics is not.The grayscale braille output has several
disadvantages when compared with print or other tactile graphics.
The resolution of the grayscale braille image is significantly lower than
that of typical print images. For example, an 11 inch by 11 inch braille
page contains 3.63 horizontal grayscale symbols per inch and 0.44 vertical
grayscale symbols per inch. For comparison, laser printers offer 300 to
1200 DPI. The different horizontal and vertical braille grayscale symbol
spacings can lead to some difficulty in correctly forming a mental image of
the true shape of the function. For example, a circle might seem more like
an oval when viewed with grayscale braille output.
Print grayscale plots typically display 256 levels.
The grayscale braille output contains a smaller number of 26 display levels.
The grayscale braille output does not capture all of the variation of the
print grayscale as a result of its fewer grayscale levelss.Section 3
In the following examples, use the definition of num_rows and num_cols as
described in Section 1.
Set num_rows to a value of 20 and num_cols to a value of 30.
Label the top row as row 1 and the left column as column 1.In the following
2 examples, search for the string "Display output:" to view the beginning of
the grayscale braille for that example. Search for the string "Analysis:" in
order to find a description of the grayscale braille after the grayscale
exerpt.
Example 1:
Create a grayscale plot for the function
f1 = 255 * exp(-0.5 * (x^2 + y^2)).
Display output:
display_gray_scale:
The minimum value = 0.000000
The maximum value = 255.000000
The delta value = 9.807692
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaacecaaaaaaaaaaaaaa
aaaaaaaaaaaackqkcaaaaaaaaaaaaa
aaaaaaaaaaaaeqzqeaaaaaaaaaaaaa
aaaaaaaaaaaackqkcaaaaaaaaaaaaa
aaaaaaaaaaaaacecaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAnalysis:
Observe that rows 8 through 12 are the only rows containing symbols other
than the "a" symbol.
It follows that the display reaches a minimum value at the top, bottom,
left, and right.
Note that row 10 is the only row that contains a "z" symbol.
In fact, the "z" symbol appears at (row 10, column 15).
It follows that the peak of the function appears at (row 10, column 15).
Examine rows 8 through 12 and columns 13 through 17.
Skipping the "a" symbols, read column 15 from top to bottom.
This generates the sequence "eqzqe".
Skipping the "a" symbols, read row 10 from left to right.
This also generates the sequence "eqzqe".
Performing a similar operation, both the main diagonal and off diagonal are
the sequence "eqzqe".
It follows that the function falls off symmetrically in both the horizontal
and vertical directions.
The function falls off sharply in both the horizontal and vertical
directions.Example 2:
Create a grayscale plot for the function
f2 = 255 * exp(-0.025 * x^2 - 0.05 * y^2).Display output:
display_gray_scale:
The minimum value = 0.006197
The maximum value = 255.000000
The delta value = 9.807454
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaabbbbbbbbbbbaaaaaaaaaa
aaaaaaabbbcccccccccbbbaaaaaaaa
aaaaabbbccddeeeeeddccbbbaaaaaa
aaaabbccdefghhhhhgfedccbbaaaaa
aaabbccdfgijllmlljigfdccbbaaaa
aaabbcdfhjlnpqrqpnljhfdcbbaaaa
aabbcdegjlortvvvtroljgedcbbaaa
aabbcdfhknruwyzywurnkhfdcbbaaa
aabbcdfilorvyzzzyvrolifdcbbaaa
aabbcdfhknruwyzywurnkhfdcbbaaa
aabbcdegjlortvvvtroljgedcbbaaa
aaabbcdfhjlnpqrqpnljhfdcbbaaaa
aaabbccdfgijllmlljigfdccbbaaaa
aaaabbccdefghhhhhgfedccbbaaaaa
aaaaabbbccddeeeeeddccbbbaaaaaa
aaaaaaabbbcccccccccbbbaaaaaaaa
aaaaaaaaabbbbbbbbbbbaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAnalysis:
The example displays bright energy centered at (row10, column15).
The energy falls off symmetrically.
This is true both for each row and each column.
The displayed energy is at a minimum value at the top, bottom, left, and
right.
The positions (row10, column11) and (row10,column19) contain a "r" symbol.
The positions (row6, column15) and (row14, column15) contain a "m" symbol.
It follows that the function falls off with a higher slope in the vertical
direction than it does in the horizontal direction.
Note that (row10, column15) contains a "z".
Note that the middle of row10 contains 3 consecutive "z" symbols.
Note that row9 and row11 contain a single "z" symbol at column15.
It follows that the function obtains a peak value at (row 10, column 15).
Example 2 displays values that fall off more slowly than example 1.Section 4
This section contains a matlab script that will generate grayscale braille
output.
The script "gray_to_ascii.m" requires that you have matlab installed on your
computer.
It requires that you set num_rows and num_cols to their desired values at
the matlab command prompt.
It also requires that you define a variable mag_img at the matlab command
prompt that is a 2-dimensional matrix with num_rows rows and num_cols
columns.
The script makes grayscale braille output from the evaluated function
mag_img.
It writes the grayscale braille output to the file "gray_ascii.txt".Matlab
script gray_to_ascii.m
% John Miller
% Email questions or comments to johnmillerphd at hotmail.com.
% Prior to calling this script, define the following inputs:
% num_rows - number of rows to display
% num_cols - number of columns to display
% mag_img - the num_rows by num_cols 2 dimensional function to display a_val
= 97;
2 display_alphabet_size = 26;
3 box_min = min(min(mag_img));
4 box_max = max(max(mag_img));
5 fid = fopen('gray_ascii.txt', 'w');
6 offset = 0;
7 display_val = a_val + offset;
8 delta = (box_max - box_min) / display_alphabet_size;
9 fprintf(fid, '%s\n', 'display_gray_scale:');
10 fprintf(fid, 'The minimum value = %.6f\n', box_min);
11 fprintf(fid, 'The maximum value = %.6f\n', box_max);
12 fprintf(fid, 'The delta value = %.6f\n', delta);
13 for i=1:num_rows
14 for j=1:num_cols
15 float_offset = (mag_img(i,j) - box_min) / delta;
16 int_offset = int16(float_offset);
17 if (int_offset > display_alphabet_size - 1),
18 int_offset = display_alphabet_size - 1;
19 end
20 if int_offset < 0,
21 int_offset = 0;
22 end
23 braille_symbol = a_val + int_offset;
24 fprintf(fid, '%c', braille_symbol);
25 end
26 fprintf(fid, '\n');
27 end
28 fclose(fid);
Best regards,John Miller
_______________________________________________
Nfb-science mailing list
Nfb-science at nfbnet.org
http://nfbnet.org/mailman/listinfo/nfb-science_nfbnet.org
To unsubscribe, change your list options or get your account info for
Nfb-science:
http://nfbnet.org/mailman/options/nfb-science_nfbnet.org/mwhapples%40aim.com
More information about the BlindMath
mailing list