[BlindMath] Scanning braille for sight reading
Łukasz Grabowski
graboluk at gmail.com
Mon Jul 31 22:45:15 UTC 2017
It was pointed out to me that s d f should map to 3 2 1, so here's the
corrected version of the script. I'm trying to attach it as well.
# script start
import sys, tty, termios
def getch():
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
try:
tty.setraw(fd)
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch
last_key=''
last_br = []
tr = {'s':4, 'd':2, 'f':1, 'j':8,'k':16,'l':32}
while not last_key == 'x' and not last_key=='X':
last_key = getch()
if last_key in tr and tr[last_key] in last_br:
last_br =[x for x in last_br if not x == tr[last_key]]
elif last_key in tr:
last_br.append(tr[last_key])
if last_key == " ":
result =10240 + sum(last_br)
with open("test.txt", "a") as myfile:
myfile.write(chr(result))
print(chr(result))
last_br = []
# script end
On Mon, 31 Jul 2017 16:11:27 -0500
"John G. Heim via BlindMath" <blindmath at nfbnet.org> wrote:
> George, that's exactly what I said. I was only saying I wanted such a
> program for linux.
>
>
>
>
> On 07/26/2017 04:27 PM, George Bell wrote:
> > I think you are misunderstanding Perky Duck.
> >
> > You can NOT type in normal letters and numbers.
> >
> > You use the f d s and j k l keys representing dots 3 2 1 and 4 5 6
> > to write a braille file.
> >
> > It is that file which can then be saved in various formats.
> >
> > I'm surprised that Hadley's tutor does not appear to know about
> > Perky Duck. It is virtually a standard world-wide.
> >
> > George
> >
> > -----Original Message-----
> > From: BlindMath [mailto:blindmath-bounces at nfbnet.org] On Behalf Of
> > John G Heim via BlindMath
> > Sent: 26 July 2017 17:17
> > To: Blind Math list for those interested in mathematics
> > Cc: John G Heim
> > Subject: Re: [BlindMath] Scanning braille for sight reading
> >
> > I would be okay with a program that allowed me to type braille via a
> > standard keyboard, like the package someone described from duxbury.
> > But if I am supposed to write the value for pi, it would be
> > cheating to type 3.14 and have the software convert it to Nemeth.
> > I need to make the number symbol, dots 3, 4, 5, and 6. Then the
> > symbol for 3, dots 2 and 4, And so on.
> >
> > I wonder if an editor exists for linux that allows you to press
> > several keys at a time to make a braille symbol. Press the s, j, k,
> > and l keys all at once to make a number symbol.
> > On 07/26/2017 09:56 AM, White, Jason J wrote:
> >> You could just use a good text editor such as Emacs, and set the
> >> fill
> > column to 40 characters (or whatever your preferred line length
> > is). You would need a braille display with a braille keyboard for
> > text entry. BRLTTY supports computer braille text entry under
> > Linux. If you want page breaks, you could introduce form feed
> > characters manually or write a script to automate it.
> >>> -----Original Message-----
> >>> From: BlindMath [mailto:blindmath-bounces at nfbnet.org] On Behalf
> >>> Of John G Heim via BlindMath
> >>> Sent: Wednesday, July 26, 2017 10:50 AM
> >>> To: steve.jacobson at visi.com; Blind Math list for those interested
> >>> in mathematics <blindmath at nfbnet.org>
> >>> Cc: John G Heim <jheim at math.wisc.edu>
> >>> Subject: Re: [BlindMath] Scanning braille for sight reading
> >>>
> >>> I think what somebody else said was right -- the instructor is
> >>> used to
> > people
> >>> taking photos with their phone and submitting that. But the whole
> >>> reason
> > I'm
> >>> doing this is to find the best tools. I think I am going to see
> >>> if I can
> > find a linux
> >>> text editor that allows me to generate brf files. That ducksbury
> >>> tool
> > sounds
> >>> interesting to me but right now, I must have linux.
> >>>
> >>>
> >>>
> >>> On 07/26/2017 08:52 AM, Steve Jacobson via BlindMath wrote:
> >>>> John,
> >>>>
> >>>> I can see where increasing the DPI might help since the braille
> >>>> dot is smaller than most characters. Another thing to
> >>>> experiment with is whether your scanner is getting the image in
> >>>> black and white or color. I frankly don't know which will work
> >>>> the best because such things seem variable. I have had cases,
> >>>> though, where low contrast differences on a page came out better
> >>>> in black and white because of the binary nature, but it seems
> >>>> likely that approach might cause some dots to not show at all
> >>>> falling below a threshold. Obviously, the brightness
> >>>> sensitivity can also matter. I would think that an instructor
> >>>> in such a course would have very specific recommendations,
> >>>> though, or perhaps Hadley itself. This does not seem like it
> >>>> would be an unusual problem.
> >>>>
> >>>> I, for one, would be interested to hear what you find out. I
> >>>> don't remember, are you an Optacon user?
> >>>>
> >>>> Best regards,
> >>>>
> >>>> Steve Jacobson
> >>>>
> >>>> -----Original Message-----
> >>>> From: BlindMath [mailto:blindmath-bounces at nfbnet.org] On Behalf
> >>>> Of John
> >>> G.
> >>>> Heim via BlindMath
> >>>> Sent: Wednesday, July 26, 2017 7:12 AM
> >>>> To: Blind Math list for those interested in mathematics
> >>>> <blindmath at nfbnet.org>
> >>>> Cc: John G. Heim <jheim at math.wisc.edu>
> >>>> Subject: Re: [BlindMath] Scanning braille for sight reading
> >>>>
> >>>> My instructor is sighted. She can sight-read the braille if the
> >>>> dots come up clearly enough in the scanned document. I guess I
> >>>> wouldn't be taking the course if I could see but if I could, all
> >>>> I'd have to do is to keep tweaking the scanner settings until it
> >>>> worked. I think the first thing I am going to do is increase the
> >>>> DPI. There is a lot of info out there that says 300 DPI is best
> >>>> for OCR and my own experiments have confirmed that. But a
> >>>> higher DPI might be better just to get braille dots to show up
> >>>> on a scanner.
> >>>>
> >>>>
> >>>>
> >>>> On 07/26/2017 04:43 AM, George Bell wrote:
> >>>>> Hi John,
> >>>>>
> >>>>> Scanning embossed braille is not an easy task. Indeed there
> >>>>> was once a program called "OBR" (Optical Braille Recognition).
> >>>>> But even that
> >>>> required
> >>>>> that specific makes and models of scanner be used, which allowed
> >>>>> control
> >>>> of
> >>>>> lighting during the scan.
> >>>>>
> >>>>> You instructor should know this.
> >>>>>
> >>>>> Do I get the impression you are using a Perkins type braille
> >>>>> writer as opposed to say 6 key entry into PC braille software
> >>>>> such as Duxbury?
> >>>>>
> >>>>> George
> >>>>>
> >>>>> -----Original Message-----
> >>>>> From: BlindMath [mailto:blindmath-bounces at nfbnet.org] On Behalf
> >>>>> Of John G Heim via BlindMath
> >>>>> Sent: 25 July 2017 15:02
> >>>>> To: Blind Math list for those interested in mathematics
> >>>>> Cc: John G Heim
> >>>>> Subject: [BlindMath] Scanning braille for sight reading
> >>>>>
> >>>>> I'm taking a braille class through Hadley School for the Blind.
> >>>>> I am
> >>>> trying
> >>>>> to submit my homework assignments as scanned images of braille
> >>>>> pages for
> >>>> the
> >>>>> instructor to sight-read. The instructor asked me to scan them
> >>>>> as photos
> >>>> but
> >>>>> I don't know what that means. Does anybody have experience
> >>>>> scanning in braille and can tell me the best format, mode, and
> >>>>> dpi settings? I sent my instructor tif line-art at 300 dpi
> >>>>> which works well for OCR but that
> >>>> didn't
> >>>>> work for sight-reading braille.
> >>>>>
> >>>>>
> >>>>> --
> >>>>> --
> >>>>> John G. Heim; jheim at math.wisc.edu; sip://jheim@sip.linphone.org
> >>>>>
> >>>>> _______________________________________________
> >>>>> BlindMath mailing list
> >>>>> BlindMath at nfbnet.org
> >>>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnfbne
> >>>>>
> >>> t.org%2Fmailman%2Flistinfo%2Fblindmath_nfbnet.org&data=02%7C01%7Cjjwh
> >>> ite%40ets.org%7Cb3463f805174423ab39608d4d435ca8d%7C0ba6e9b760b34fa
> >>> e92
> >>> f37e6ddd9e9b65%7C0%7C0%7C636366774880227294&sdata=aV6zDPJKotROf2
> >>> B%2BK
> >>>>> AGnRYDzJQBJY4kv93fd4VmdQ%2F4%3D&reserved=0
> >>>>> To unsubscribe, change your list options or get your account
> >>>>> info for BlindMath:
> >>>>>
> >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnfbnet
> >>>>
> >>> .org%2Fmailman%2Foptions%2Fblindmath_nfbnet.org%2Fgeorge%2540techno-
> >>> vi
> >>> sio&data=02%7C01%7Cjjwhite%40ets.org%7Cb3463f805174423ab39608d4d435
> >>> ca8
> >>> d%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C6363667748802272
> >>> 94&sdat
> >>>> a=DIVglu4xoiRZUfZz1OGCN9WVjs7JqWtgus6LZ9KwZgY%3D&reserved=0
> >>>>> n.co.uk
> >>>>> BlindMath Gems can be found at
> >>>>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
> >>>>> blindscience.org%2Fblindmath-gems-
> >>> home&data=02%7C01%7Cjjwhite%40ets.o
> >>> rg%7Cb3463f805174423ab39608d4d435ca8d%7C0ba6e9b760b34fae92f37e6dd
> >>> d9e9
> >>> b65%7C0%7C0%7C636366774880237299&sdata=PGstGyxDq8Z%2BbaKL2z4XND
> >>> hMpKRm
> >>>>> MyzikiWtMtrkCSM%3D&reserved=0>
> >>>>>
> >>>>
> >>>> _______________________________________________
> >>>> BlindMath mailing list
> >>>> BlindMath at nfbnet.org
> >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnfbnet
> >>>>
> >>> .org%2Fmailman%2Flistinfo%2Fblindmath_nfbnet.org&data=02%7C01%7Cjjwhit
> >>> e%40ets.org%7Cb3463f805174423ab39608d4d435ca8d%7C0ba6e9b760b34fae
> >>> 92f37
> >>> e6ddd9e9b65%7C0%7C0%7C636366774880237299&sdata=MLvwjqvbHRlsDluDZ
> >>> G2UuVc
> >>>> pfAYtL8IS8CBTyrnI5bY%3D&reserved=0
> >>>> To unsubscribe, change your list options or get your account
> >>>> info for BlindMath:
> >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnfbnet
> >>>>
> >>> .org%2Fmailman%2Foptions%2Fblindmath_nfbnet.org%2Fsteve.jacobson%2540
> >>> v
> >>> isi&data=02%7C01%7Cjjwhite%40ets.org%7Cb3463f805174423ab39608d4d435
> >>> ca8
> >>> d%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C6363667748802372
> >>> 99&sdat
> >>> a=OQ%2B%2FLoHQiK1qp7IkAEw54ypbummBXtuUcBBdtWufk%2B8%3D&reserve
> >>> d=0
> >>>> .com
> >>>> BlindMath Gems can be found at
> >>>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.b
> >>>> lindscience.org%2Fblindmath-gems-
> >>> home&data=02%7C01%7Cjjwhite%40ets.org
> >>> %7Cb3463f805174423ab39608d4d435ca8d%7C0ba6e9b760b34fae92f37e6ddd9
> >>> e9b65
> >>> %7C0%7C0%7C636366774880237299&sdata=PGstGyxDq8Z%2BbaKL2z4XNDhM
> >>> pKRmMyzi
> >>>> kiWtMtrkCSM%3D&reserved=0>
> >>>>
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> BlindMath mailing list
> >>>> BlindMath at nfbnet.org
> >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnfbnet
> >>>>
> >>> .org%2Fmailman%2Flistinfo%2Fblindmath_nfbnet.org&data=02%7C01%7Cjjwhit
> >>> e%40ets.org%7Cb3463f805174423ab39608d4d435ca8d%7C0ba6e9b760b34fae
> >>> 92f37
> >>> e6ddd9e9b65%7C0%7C0%7C636366774880237299&sdata=MLvwjqvbHRlsDluDZ
> >>> G2UuVc
> >>>> pfAYtL8IS8CBTyrnI5bY%3D&reserved=0
> >>>> To unsubscribe, change your list options or get your account
> >>>> info for
> >>> BlindMath:
> >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnfbnet
> >>>>
> >>> .org%2Fmailman%2Foptions%2Fblindmath_nfbnet.org%2Fjheim%2540math.wis
> >>> c.
> >>> edu&data=02%7C01%7Cjjwhite%40ets.org%7Cb3463f805174423ab39608d4d43
> >>> 5ca8
> >>> d%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C6363667748802372
> >>> 99&sdat
> >>>> a=XgeCnHNTZfbEjdOyQaRAv8qsCVDQBVwKi4YHny98HKE%3D&reserved=0
> >>>> BlindMath Gems can be found at
> >>>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.b
> >>>> lindscience.org%2Fblindmath-gems-
> >>> home&data=02%7C01%7Cjjwhite%40ets.org
> >>> %7Cb3463f805174423ab39608d4d435ca8d%7C0ba6e9b760b34fae92f37e6ddd9
> >>> e9b65
> >>> %7C0%7C0%7C636366774880237299&sdata=PGstGyxDq8Z%2BbaKL2z4XNDhM
> >>> pKRmMyzi
> >>>> kiWtMtrkCSM%3D&reserved=0>
> >>>>
> >>> _______________________________________________
> >>> BlindMath mailing list
> >>> BlindMath at nfbnet.org
> >>>
> > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnfbnet.org
> >>> %2Fmailman%2Flistinfo%2Fblindmath_nfbnet.org&data=02%7C01%7Cjjwhite%4
> >>> 0ets.org%7Cb3463f805174423ab39608d4d435ca8d%7C0ba6e9b760b34fae92f3
> >>> 7e6ddd9e9b65%7C0%7C0%7C636366774880237299&sdata=MLvwjqvbHRlsDluD
> >>> ZG2UuVcpfAYtL8IS8CBTyrnI5bY%3D&reserved=0
> >>> To unsubscribe, change your list options or get your account info
> >>> for
> > BlindMath:
> > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnfbnet.org
> >>> %2Fmailman%2Foptions%2Fblindmath_nfbnet.org%2Fjjwhite%2540ets.org&dat
> >>> a=02%7C01%7Cjjwhite%40ets.org%7Cb3463f805174423ab39608d4d435ca8d%7
> >>> C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C636366774880237299&s
> >>> data=nVZxmPFx%2BO1%2Fu%2Fx%2FFyLNbs03hz0zaoUXA3DhVsjeAk4%3D&res
> >>> erved=0
> >>> BlindMath Gems can be found at
> >>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.blin
> >>> dscience.org%2Fblindmath-gems-
> >>> home&data=02%7C01%7Cjjwhite%40ets.org%7Cb3463f805174423ab39608d4d
> >>> 435ca8d%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C6363667748
> >>> 80237299&sdata=PGstGyxDq8Z%2BbaKL2z4XNDhMpKRmMyzikiWtMtrkCSM%3
> >>> D&reserved=0>
> >> ________________________________
> >>
> >> This e-mail and any files transmitted with it may contain
> >> privileged or
> > confidential information. It is solely for use by the individual
> > for whom it is intended, even if addressed incorrectly. If you
> > received this e-mail in error, please notify the sender; do not
> > disclose, copy, distribute, or take any action in reliance on the
> > contents of this information; and delete it from your system. Any
> > other use of this e-mail is prohibited.
> >>
> >> Thank you for your compliance.
> >>
> >> ________________________________
> >>
> > _______________________________________________
> > BlindMath mailing list
> > BlindMath at nfbnet.org
> > http://nfbnet.org/mailman/listinfo/blindmath_nfbnet.org
> > To unsubscribe, change your list options or get your account info
> > for BlindMath:
> > http://nfbnet.org/mailman/options/blindmath_nfbnet.org/george%40techno-visio
> > n.co.uk
> > BlindMath Gems can be found at
> > <http://www.blindscience.org/blindmath-gems-home>
> >
>
>
> _______________________________________________
> BlindMath mailing list
> BlindMath at nfbnet.org
> http://nfbnet.org/mailman/listinfo/blindmath_nfbnet.org
> To unsubscribe, change your list options or get your account info for
> BlindMath:
> http://nfbnet.org/mailman/options/blindmath_nfbnet.org/graboluk%40gmail.com
> BlindMath Gems can be found at
> <http://www.blindscience.org/blindmath-gems-home>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dotbr.py
Type: text/x-python
Size: 806 bytes
Desc: not available
URL: <http://nfbnet.org/pipermail/blindmath_nfbnet.org/attachments/20170731/b60e30f3/attachment.py>
More information about the BlindMath
mailing list