mr_indoj
Posts: 42
Joined: Wed Jul 01, 2015 9:28 am

Re: Sight for the Blind for <100$

Sun Jan 24, 2016 9:57 pm

Thanks Peter for helping to test this!
Will have to find a way around that isue.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Mon Jan 25, 2016 12:28 am

Good work guys. That was quick, and will keep a lot of cameras working well.

PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Re: Sight for the Blind for <100$

Tue Jan 26, 2016 10:57 am

Hi Mikey11 and all
1. Does the January 22 image incorporate mr_indoj's code to run teradeep and raspivoice? If yes, how do I get the two of them to work together?
2. I am unable to adjust any of the options like contrast, blinders etc that I could with earlier images when raspivoice is running.
3. I like the new range finder code. It is more visual that is, it makes noise when there is space but just as an object blocks light, the sound decreases as you get closer to an object.
4. I did not have any problems in running with the image because I used my ELP camera module.
5. Can we decrease the reaction time of the vOICe to scene changes? The system lags if I turn my neck rapidly.
6. Is it possible to use the motor to indicate when the unit powers up? I usually use bone conduction headphones with it. These headphones run on batteries and I have no way of knowing if the batteries are charged. A vibration telling me that the unit is powered up will help because if I do not hear a sound after the vibration, I will know to check the headphones.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Tue Jan 26, 2016 6:00 pm

Pranav,

1. Yes it does.

To run both programs, from the main menu the options are 'toggle raspivoice' and 'toggle teradeep' After you launch one, you can still navigate the menu system and just toggle the other program on. I have found they work quite well together.

2. That is correct. In migrating away from raspivoice having menu items and moving towards the items being in the python menu system, some options have temporarily been lost, however the speed changing remains. We can recover the other options in the same way and add them to the 'raspivoice settings' menu. I can do this on my next update.

I found the following list to be the most likely settings we would want in the menu. I took these by running raspivoice --help at the command line. These can be passed as command line arguments the same way the playback speed is. Each time you change one, raspivoice has to restart, and there is a small delay, then normal playback speed resumes.
-n, --negative_image Swap bright and dark.
-f, --flip=[0] 0: no flipping, 1: horizontal, 2: verticel, 3: both
-e --exposure=[0] Camera exposure time setting, 1-100. Use 0 for auto.
-B --brightness=[0] Additional brightness, -255 to 255.
-C --contrast=[1.0] Contrast enhancement factor >= 1.0
-b --blinders=[0] Blinders left and right, pixel size (0-89 for default columns)
-z --zoom=[1.0] Zoom factor (>= 1.0)
-m --foveal_mapping Enable foveal mapping (barrel distortion magnifying center region)
-T, --threshold=[0] Enable threshold for black/white image if > 0. Range 1-255, use 127 as a starting point. 255=auto.
-E, --edge_detection_opacity=[0.0] Enable edge detection if > 0. Opacity of detected edges between 0.0 and 1.0.
-G --edge_detection_threshold=[50] Edge detection threshold value 1-255.
the edge detection settings should likely be combined into one menu item that cycles through complementary values of both.

3. Good, this is the first time not using pulse width modulation, and I think it executes more reliably, and should use less cpu.

4.
5. I'm not sure this will be possible with the current implementation of the algorithm. I have had another coder working on the algorithm away from this forum, and he has indicated that he has some improvements, and more may be possible. If the algorithm can be made to be more efficient, I think this will be the path to what you want. So for this, I think the road is longer than the other items.

6. I shall add a triple vibrate on startup on my next changes.

mr_indoj
Posts: 42
Joined: Wed Jul 01, 2015 9:28 am

Re: Sight for the Blind for <100$

Tue Jan 26, 2016 6:24 pm

After you have started raspivoice, You should be able to just turn the knob to "Toggle Teradeep" and press on it. To turn one of them off again, just press on the one you want to turn off. they work like toggles.
Sometimes the rotary can miss a turn, just turn once more in that case, it shouldn't be silent, like it was in previous images.

The other raspivoice options are not implemented to the menu system yet.

Reaction time is a difficult matter. Do you feel that it has goten worse with this image, with only raspivoice running? We'll have to work on that in any case.

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Tue Jan 26, 2016 6:56 pm

mikey11 wrote:6. I shall add a triple vibrate on startup on my next changes.
I still occasionally find that my Logitech C270 webcam, even with the recent microphone fix, does not turn on after turning the system on. The menu then speaks, but when starting raspivoice or teradeep, nothing happens. Next I notice that the green LED of the C270 is indeed still off where it is normally on when active. Clearly this is not much good if one is blind or the camera lacks an indicator light. It would help if a vibration (or a spoken error message) occurred when frame grabbing fails, obviously at a maximum rate of once per second or so. A shutdown and reboot normally solves the problem, so I suspect there is still some lingering timing issue somewhere. It is not quite clear how often the camera start failure occurs, but my rough estimate is on the order of once every ten boots: not quite reproducible, but frequent enough to be annoying and confusing.

Thanks,

Peter

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Tue Jan 26, 2016 8:52 pm

I have done some things today:

I have reimplemented the blinders, zoom, and foveal mapping functions and added them to the raspivoice settings menu

I determined that when I removed "--speak" as a command line option for raspivoice from raspivoice.py that I could make the bug that causes crashing of raspivoice when the keyboard is used for navigation to go away. Unfortunately, it introduced one more annoyance: I now have to press what I want twice. ie. If I want to advance the menu item once, I have to hit ++ or -- and to engage the option I have to hit enterenter. The rotary encoder appears unaffected.

For the moment I think this is an ok compromise.

I have also added a quick triple vibration as soon as the system has come up which happens just before the introduction speech.

I am going to try to solve my problems with github later tonight, and I will see about uploading my changes there.

PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Re: Sight for the Blind for <100$

Wed Jan 27, 2016 12:35 am

Hi mr_indoj,
<snip Reaction time is a difficult matter. Do you feel that it has goten worse with this image, with only raspivoice running? We'll have to work on that in any case.
PL] It has always been slow. I did not encounter it as much before because I was testing in conditions where it was not a significant issue. I am incorporating the setup in to my everyday activities which is where slow reaction time becomes a challenge. My bases of comparison is the version of the vOICe running on Microsoft windows. Try an experiment.
1. Aim the camera at an object. This is easy with a head mounted setup though you could hold the camera in your hand.
2. Warning: this step involves turning your head so please be careful and do not strain yourself. Turn your head quickly from side-to-side.
3. See how fast the soundscapes reflect the change in scenes.

As regards the menus, once raspivoice has been launched, I do not hear anything when I turn the knob.

PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Re: Sight for the Blind for <100$

Wed Jan 27, 2016 12:44 am

mikey11 wrote:Pranav,

1. Yes it does.

To run both programs, from the main menu the options are 'toggle raspivoice' and 'toggle teradeep' After you launch one, you can still navigate the menu system and just toggle the other program on. I have found they work quite well together.
PL] Hmm I will test this again.
2. That is correct. In migrating away from raspivoice having menu items and moving towards the items being in the python menu system, some options have temporarily been lost, however the speed changing remains. We can recover the other options in the same way and add them to the 'raspivoice settings' menu. I can do this on my next update.

I found the following list to be the most likely settings we would want in the menu. I took these by running raspivoice --help at the command line. These can be passed as command line arguments the same way the playback speed is. Each time you change one, raspivoice has to restart, and there is a small delay, then normal playback speed resumes.
-n, --negative_image Swap bright and dark.
-f, --flip=[0] 0: no flipping, 1: horizontal, 2: verticel, 3: both
-e --exposure=[0] Camera exposure time setting, 1-100. Use 0 for auto.
-B --brightness=[0] Additional brightness, -255 to 255.
-C --contrast=[1.0] Contrast enhancement factor >= 1.0
-b --blinders=[0] Blinders left and right, pixel size (0-89 for default columns)
-z --zoom=[1.0] Zoom factor (>= 1.0)
-m --foveal_mapping Enable foveal mapping (barrel distortion magnifying center region)
-T, --threshold=[0] Enable threshold for black/white image if > 0. Range 1-255, use 127 as a starting point. 255=auto.
-E, --edge_detection_opacity=[0.0] Enable edge detection if > 0. Opacity of detected edges between 0.0 and 1.0.
-G --edge_detection_threshold=[50] Edge detection threshold value 1-255.
the edge detection settings should likely be combined into one menu item that cycles through complementary values of both.
PL] Agreed. The flipping options are also useful to handle situations where a camera has to be oriented in a particular way. I had a non-branded webcam and the only way to mount it was in a manner that its image would appear upside down. The speed option does help.
3. Good, this is the first time not using pulse width modulation, and I think it executes more reliably, and should use less cpu.
PL] Besides, it is quiter.
4.
5. I'm not sure this will be possible with the current implementation of the algorithm. I have had another coder working on the algorithm away from this forum, and he has indicated that he has some improvements, and more may be possible. If the algorithm can be made to be more efficient, I think this will be the path to what you want. So for this, I think the road is longer than the other items.
PL] Understood.
6. I shall add a triple vibrate on startup on my next changes.
PL] Thanks and I like Peter's suggestion as well.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Wed Jan 27, 2016 1:02 am

I will see about obtaining a problematic camera to help solve these issues.

It will no doubt take a few weeks just to get one of the logitech ones via ebay. In the meantime, I'm sure we can have try/catch routines for starting up the camera that can retry with a timeout period. This might be enough to take the 1/10 frequency to less than 1/100. If that was achieved, I would call the problem mostly solved. In cases where getting a camera operating fails, feedback needs to be supplied to the user suggesting a reboot/replug of the camera and trying again.

We simply can't support every camera by every supplier. There are going to be incompatibilities, and one could devote an endless amount of resources to these problems.

In this case though it sounds like the problem is general enough that it deserves to be addressed: UVC cameras that also have a microphone.

With all of this said, I have taken the newer images out for extended real world use, and have found that in general if you aren't constantly changing options, the operation can be reliable for at least an hour or so without crashing. (The time I spend on a typical walkabout).

I have had a few occasions where the camera image freezes, and then I have to reboot, but I think this might have to do with jostling the USB connector. I will probably remove more plastic around the USB connectors on the next case revision to help with this problem.

Upon adding the additional raspivoice settings changes, it has also become apparent that you must make your change, and let raspivoice begin executing again before changing another raspivoice setting. If you do not wait, it can cause raspivoice to crash and require a reboot.

I haven't spent enough time observing these kinds of errors from the console to know how to do the error handling on them yet. Again, I'm sure if we implement a try/catch type of statements for the problem lines of code we will end up in better shape.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Wed Jan 27, 2016 6:10 am

Well, I've got my fingers crossed.

I've tried a different github gui manager than I was using, and it appears to have succeeded. Please let me know if it's junked anything.

If you download copies of menu.py, confmanager.py, aftersight.cfg, raspivoice.py

from

https://github.com/aftersight/After-Sight-Model-1

this should give you the ability to use the keyboard without crashing raspivoice, but you have to double tap your commands (+,-,enter).

You should get a quick triple vibration on startup before other programs execute. This lets you know the device is operating even if your audio is not functioning correctly.

you should be able to use blinders, zoom, and foveal mapping settings from the raspivoice menu. Just make sure you let raspivoice fully restart before changing another setting.

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Wed Jan 27, 2016 7:05 am

mikey11 wrote:I will see about obtaining a problematic camera to help solve these issues.
Thanks! I suggest to not bother about finding a "problematic" camera (reproducing the problem when you want to is a pain here: I failed to do so in a dozen or so reboots last night), and just add some error checking with corresponding user feedback to the frame grabbing code. Then test it by simulating that all frame grabs fail, to ensure that user feedback is still meaningful in such cases (not generating, say, 10 error messages per second).

BTW, I regularly felt a need to stop and restart the webcamvideo loop to try and recover without a reboot, but I do not know of a way to do that with the existing software. Would seem good if the loop was ended (and the camera properly released) when all programs (raspivoice, teradeep) are terminated through a long press, and with each program checking at their respective startup whether the frame grabbing loop is active and healthy, and reinitializing and restarting the loop if not. Something like this should also help in exchanging cameras without requiring a reboot. It will not fix all problems, since one should never hot-unplug a camera with a live video feed, but there one can blame the user for careless action.

Thanks,

Peter

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Thu Jan 28, 2016 3:36 pm

It was requested that I post the latest filesystem image as well.

https://drive.google.com/file/d/0B30mp6 ... sp=sharing

https://drive.google.com/file/d/0B30mp6 ... sp=sharing

In the future, I will look into have an 'upgrade' option located under the settings menu that will check for updates, obtain a script, and then execute it. I have not done anything like that in the past, but it shouldn't be too hard.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Thu Jan 28, 2016 6:34 pm

I have been in contact with Rich Morin who is investigating a different sensory substitution method:

http://wiki.cfcl.com/Projects/Access/Utiles/UE/WebHome

He seeks to recreate something called The Sonic Eye as a portable device. He has mentioned some interest in aspects of the After Sight software/hardware. As everything is open source, I think it is likely that he may take some aspects and adapt them to what he is working on.

He may have some questions regarding hardware/software and I hope he will post them to this forum. That way if someone can help there will probably be more complete answers than I alone can give.

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Thu Jan 28, 2016 7:19 pm

Yes, I recently referred Rich to the After-Sight project when he was inquiring about an ultrasonic emitter. Rather than having yet another open source project for a device for the blind, I suggested joining forces if possible and meaningful. Maybe a Sonic-Eye-like device could be used to offer a crude depth map via small tactor array or something in order to avoid ambiguity and confusion with The vOICe image-to-sound mapping while offering more than a single distance indication.

Peter


Seeing with Sound - The vOICe
http://www.seeingwithsound.com

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Fri Jan 29, 2016 5:24 pm

12622377_992947690763889_3742091983086775545_o_s.jpg
12622377_992947690763889_3742091983086775545_o_s.jpg (62.52 KiB) Viewed 2442 times
Nice to see The vOICe for Raspberry Pi from After-Sight being used in Moscow! Looks like they flashed a newer image https://vk.com/wall-96731906_128 [Google Translate: "Welcome friends of the project «vOICe - sound vision!" January became interesting for us and for our students. We have worked hard to improve technical implementation of the system, we have replaced with a new camera model, and is now firmly fixed on the cap. And most importantly, it was possible to solve the problem of delay in the processing of the image, it becomes a serious problem when moving users in the space and our technicians and programmers coped! January 22 our student Vadim accompanied by Igor Trapeznikova tested a new model of "combat" conditions - Vadim to school where he taught, was a «vOICe». Guided «vOICe» gradually get into the habit Vadim, and today it is practiced, walking in the center of Moscow. Here is a small photo of a practical training on the streets."]

Peter

Image

Seeing with Sound - The vOICe
http://www.seeingwithsound.com

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Sat Jan 30, 2016 12:54 pm

mikey11 wrote:It was requested that I post the latest filesystem image as well.

https://drive.google.com/file/d/0B30mp6 ... sp=sharing
Note that this latest image does not contain mr_indoj's recent fix for cameras that have a built-in microphone: "sudo nano /etc/modprobe.d/alsa-base.conf" and activate the line reading "options snd-usb-audio index=-2" by rmoving the #, as described at viewtopic.php?p=891574#p891574 Lacking this fix, some cameras will appear not to work when launching raspivoice or teradeep.

Peter

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Sat Jan 30, 2016 3:01 pm

I was playing today with the After-Sight device, using the latest image, Technaxx TX-25 glasses and stereo headphones. My impression is that the combination of raspivoice and teradeep has great potential, especially once teradeep's object recognition gets it right more often. A few remarks: 1. Default visual (auditory) contrast with raspivoice appears quite poor (just compare it with The vOICe for Android on curtain folds or whatever), and a menu setting to improve contrast is still missing. 2. A long press in the settings menu makes the device speak that it will turn programs off, but it doesn't (raspivoice and teradeep just continue to sound), and the menu system instead becomes unresponsive. I then have to press the on/off switch twice to restart the device. 3. It might be best to mute distance measurement speech and teradeep speech while in the settings menu, and/or mute these speech sources for a few seconds whenever the rotary knob is being turned, because there is just too much simultaneous speech going on while hearing so-many-meters, object names and the changing menu items.

Thanks,

Peter


The vOICe for Android
http://www.seeingwithsound.com/android.htm
https://play.google.com/store/apps/deta ... OICe.vOICe

PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Re: Sight for the Blind for <100$

Sat Jan 30, 2016 5:10 pm

Hi all,

I ran the battery down as far as it would go. The unit began to reboot. I would get to the main menu and would launch raspivoice. However, the unit would reboot. It ran nicely off my car's power supply. Mikey11, thanks for thye connect and disconnected notification. I think I have a faulty charging cable in my car because the pi kept notifying me about connections and disconnections even though I had not moved the cable all that much.

I agree with Peter that contrast enhancement will help.

By the way, I have flashed the latest image but appear to be making an error because I am not getting any vibration on power up and do not see any options to toggle raspivoice. My usual method of flashing is to use win32 disk imager for the raspberry pi and write the image to the memory card. Do I need to format the card before the write?

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sat Jan 30, 2016 7:08 pm

I will start with Peters:
1. Default visual (auditory) contrast with raspivoice appears quite poor (just compare it with The vOICe for Android on curtain folds or whatever), and a menu setting to improve contrast is still missing. 2. A long press in the settings menu makes the device speak that it will turn programs off, but it doesn't (raspivoice and teradeep just continue to sound), and the menu system instead becomes unresponsive.
1. I believe I can set a default contrast value and add a contrast advancer as has been done with the other raspivoice settings. It just takes a certain amount of programming time to make it happen.
2.That method of shutting down programs predates the shared camera code, and needs to be looked at.

These Items are noted for my next days off from work.

Pranavs observations about the battery are currently an intractable problem. I thought I had a way to monitor the battery/charge management system that I do not. The flashing I observed in the past is an irregular symptom, and can't be used to control.

I am going to lay this out, as it's a hardware problem, and currently I'm the only one who has made hardware contributions. If there are other hardware guru's watching this thread, now is the time to speak up.

I'm using adafruits powerboost 1000c, and a 2000 mah battery that is rectangular, thin, and fits quite well with the current design.

There is a low battery indicator built into the module. However when the battery is under more than normal load it will trigger the low battery LED, but there is still plenty of capacity left. As a result I can't use the low battery LED as a proper signal yet. I do have code to monitor this in menu.py already though. The code is commented out at the moment.

This can probably be solved by getting a better battery, however this means a complete redesign of the case, and very likely a larger case. Right now the battery fits nicely between the rpi and the auxillary electronics board containing the sonar, battery management module, and rotary knob.

A better battery will be capable of more instantaneous current demand. I have already got a few electrolytic capacitors on the board to aid in smoothing out demand spikes, and don't want to add more. These tend to fail over time faster than other components.

More instantaneous current delivery 'should' avoid the false low battery situation, which would allow me to continue using the battery management module currently in use.

The alternative is to stop using someone elses battery management module, and take that design and put in on my board, and add mechanisms to try to analyze and ignore false low battery situations. I could do that, but I'm using a two layer with through hole components currently and that board looks like a four layer with surface mount components. It would in mass production lower costs significantly, but out of mass production it represents a huge headache and higher cost.

For the current time, I propose a solution that I think is a compromise:

When a low battery condition is detected, whether false or real, espeak will let you know on a 5 minute timer basis, but will not automatically shut you down. Running the currently used batteries down will reduce their future capacity, so if you get a low battery condition, it's best to plug in, or carry an auxillary battery to plug in to avoid this issue.

I will obtain a number of different batteries to see about finding a battery that can better meet the instantaneous demand. If this is successful, I can force an automatic shutdown on low battery that better matches the actual discharge of the battery.

I have been planning on evaluating a 6 DOF gyro/accel on the next hardware revision, and a new battery to that revision as well.

I haven't done in depth testing of teradeep/raspivoice running at the same time yet, but qualitatively the unit is running warmer for sure. I imagine the ~3.5 hour battery life has been reduced significantly. A larger battery now is probably the right move anyhow.

We are crunching a lot of numbers now.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sat Jan 30, 2016 7:23 pm

I double checked battery specs.

The battery in use right now has trouble exceeding 500ma discharge continuously. it's $12.50 USD
https://www.adafruit.com/products/2011

An alternative will have no problem and have over double capacity for $19.95 USD
https://www.adafruit.com/products/354

The case will have to be enlarged, but the alternative battery can discharge at over 4A maximum. (I didn't see a continuous discharge rating) one expects though that because it is made of more cells, the continuous discharge rate will likely be double the capacity of the currently used battery.

This should solve battery issues, allow for forced automatic shutdown and though its a significant increase in price, it's probably worth it in the long run.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sat Jan 30, 2016 7:48 pm

as for the SD card issues, I have had no problems personally. I would just suggest trying again with a larger capacity card. Although the image might fit on an 8GB card, not all 8GB cards are created equally. Maybe your download was corrupt?

If you are already doing it on a 16GB then all I can say is try again. I tested the image a few times before I posted it, and it worked for me (sans the camera compatibility update Peter mentions, which I will definitely rectify on my end).

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Tue Feb 02, 2016 4:16 am

I have been working on camera problems and I have some progress to share:

Code: Select all

#Check if Camera exists? If no camera is detected, bug the user to reinit the camera after replugging the USB

signal, text = commands.getstatusoutput('ls /dev') #Check if Camera Detected

if "video0" in text:
        print "Camera Detected on Video 0"
        call (["sudo","espeak","CameraOnVideo0"])
        camera_port=0
        print text
elif "video1" in text:
        print "Camera Detected on Video 1"
        call(["sudo","espeak","CameraOnVideo1"])
        camera_port=1
        print text
else:
        print "No good string returned"
        call(["sudo","espeak","CameraCheckingSubroutineFailedDoYouHaveMoreThanOneCameraPluggedIn?"])
        print text
When I start the device now, the technaxx glasses start as /dev/video0.

If I ssh in and kill everything, unplug the glasses and plug them back in, they always come up as /dev/video1

If I then restart menu.py they are assigned properly and everything works.

This means I can add a camera re-init function. Eventually this will be an automatic thing, but for now I will place camera re-init in the settings menu, and do the re-scan for video devices on /dev/video0 or /dev/video1.

This way if you find you need to unplug the camera and plug it back in, you will be able to recover function without rebooting.

It also means that on bootup it will let you know if your camera has been detected. If it does not detect the camera it will tell you to try replugging the USB connection. Then once bootup is complete you can go to the settings menu and reinitialize the camera.

This should help solve some problems (I hope) with the problematic cameras. As I don't have one to test with, I'm writing the code blind to be general and only look after cameras that exist according to the system.

It's the start of more robust routines to manage these issues.

It also means PLEASE only plug in one camera!

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Tue Feb 02, 2016 5:20 am

Looks like I got a little too excited.

Running into problems with this. Looks like I need to release the camera properly before I can restart it.

I've tried camera.stop()

hoping that the WebCamVideo.py would do a good release. That didn't pan out.

I'm currently investigating WebCamVideo.py to see about modifying the def stop section to do a good release. I'm not getting a lot of console feedback for this. When I pin it down better I will post it.

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Tue Feb 02, 2016 7:04 pm

mikey11 wrote:Running into problems with this. Looks like I need to release the camera properly before I can restart it.

I've tried camera.stop()
Hi Mike,

Indeed I was about to say that just killing an app is not a good idea on most platforms, often leaving the active camera unusable until after a reboot. I have too little experience with Raspberry Pi to generalize, but you should try to quit each app by sending it a signal such as SIGINT that you can catch within the app using a signal handler. See for instance http://stackoverflow.com/questions/1776 ... g-in-linux, http://stackoverflow.com/questions/3018 ... ing-python etc. Then you can let it do a camera.release() before quitting the app. See for instance http://docs.opencv.org/master/dd/d43/tu ... splay.html

This will likely also make the system stick to using /dev/video0 by default. Anyway, I hope that some of these leads will help you in the right direction...

Peter

Return to “Assistive technology and accessibility”