Pi Scan -- Testers Needed

General discussion about software packages and releases, new software you've found, and threads by programmers and script writers.

Moderator: peterZ

duerig
Posts: 388
Joined: 01 Jun 2014, 17:04
Number of books owned: 1000
Country: United States of America

Pi Scan -- Testers Needed

Post by duerig »

Pi Scan is a simple and robust controller for book scanners

Introduction and tutorial video: https://vimeo.com/150385938

The first phase of scanning a book is conceptually very simple. You have cameras you need to trigger and you need to save the resulting images in a way that makes it convenient to copy off onto a computer for post-processing. Previously, I have been recommending Spreads for this task. But Spreads is a large and complicated system with multiple interfaces, running on multiple platforms, supporting many cameras, and fulfilling many roles in book scanning) This complexity meant that it was difficult to make it really robust.

Luckily, Johannes had the foresight to make Spreads open source. And so I was able to take many of the core capture components of Spreads and roll them into a much simpler piece of software called Pi Scan. By limiting the scope of the project and designing it to gracefully handle camera failure from the start, I have been able to create a much more solid piece of capture software. Spreads, Scan Tailor, and other projects can help us deal with the other phases of the book scanning process.

Design Philosophy

Pi Scan runs as a read only appliance. There is no longer any possibility of corrupting the controller software when turning off power unexpectedly. All debug information, configuration, and the images themselves are all saved directly onto external storage in the form of a USB SD Card Reader or USB thumb drive. There is no longer a networking component. You plug a screen and mouse directly into the Pi. A keyboard can optionally be used as a trigger during capture (space bar, 'b', 's', and 'c' all act as triggers).

Configuration and operation is vastly simplified. There are no longer workflows. Images are simply saved to external storage as sequentially named filenames (interleaving the images from the two cameras). When you finish a book, you tap done to unmount the external storage, move the images off of it onto your main computer, then plug it back in to start the next book. Focus is set at the beginning of each session and then locked to prevent blurry shots of partial pages. The only user-settable option is zoom. Everything else is set at good values that are most likely what you want if you are using a scanner. More configuration options may be added as the software becomes more mature.

When there is a crash or failure, Pi Scan will let you know where the error happened and let you quickly get back to scanning. On a simple failure, just tap ok and you are immediately back at the capture screen and ready to capture the page again. If there is a crash, Pi Scan waits until you turn the camera back on, then you can lock focus again and keep scanning. This means that if an error is transient, it won't ruin your day.

For more persistent errors, Pi Scan logs every failure and crash to a log file on the external storage. It includes as much debugging information as possible which you can send along to me to help diagnose the issue. It even helps you capture crash romlogs off the cameras. In the crash recovery page, once you turn the camera back on you will be able to click a button to save the crash log.

Pi Scan is ready for testing

While it is not yet at a stable 1.0 release, Pi Scan is ready for more testers. If you want to test Pi Scan, here is what you need:
  • Your Scanning Rig
  • Raspberry Pi 2 (earlier versions are not supported)
  • 2 Supported Cameras (other cameras may work, but are not supported)
    • Canon PowerShot ELPH 160 (aka IXUS 160)
    • Canon PowerShot A2500
  • SD Card Reader (to write the images) and SD Cards for the Pi and cameras
  • A fast SD card or USB thumb drive for external storage of the captured photos
  • A screen, mouse, and optional keyboard or foot pedal
The Pi Scan project is located at: https://github.com/Tenrec-Builders/pi-scan

There are instructions, links to SD card images for your Raspberry Pi and cameras, and a link to the tutorial video. Give it a try.

Please let me know of any problems (or success) here or at help at tenrec dot builders.

-D
harpmaster
Posts: 8
Joined: 30 Dec 2015, 09:09
Number of books owned: 0
Country: austria

Re: Pi Scan -- Testers Needed

Post by harpmaster »

looks very interesting. i will find time to test it this weekend.
there is one question. if i don't want for the future use a raspberry and an extra sd-card, will you work for a linux-version to use it on a virtual machine to easy use it on a windows-os? would simplify the whole workflow, i think .....

best regards

(btw. it is great to see you on that video)
duerig
Posts: 388
Joined: 01 Jun 2014, 17:04
Number of books owned: 1000
Country: United States of America

Re: Pi Scan -- Testers Needed

Post by duerig »

harpmaster, the code is open source and it will likely be possible for it to run on any Linux distribution. When I release the build scripts I am working on, it should give a good idea of what packages and pre-requisites it needs. So if you or somebody else wanted to package this up as a VM that could run elsewhere, that would be possible.

In the same way, I am sure that many CHDK-capable cameras will work with Pi Scan flawlessly.

However, I am not going to officially support these use cases. One of the hazards of a small project like this is to let the scope grow to beyond the grasp of the developer. The limited time I have to work on Pi Scan will be spent making sure it works well as an appliance on a Raspberry Pi with the cameras that I recommend. I will accept pull requests for fixes on other platforms. And if a member of the community stepped up and wanted to explicitly maintain and support alternate builds or platforms, that would be great.

One other note. TwoCamControl is an excellent script for controlling cameras via Windows. In fact, it was one of the inspirations behind Pi Scan. So for those who want to control their scanner directly from a Windows machine, I'd recommend that as the first thing to try.

-D
harpmaster
Posts: 8
Joined: 30 Dec 2015, 09:09
Number of books owned: 0
Country: austria

Re: Pi Scan -- Testers Needed

Post by harpmaster »

well, i have tried it today. to use it is very simply.
the zoom has to be changed every time i started a new project and to shut down the raspberry after finishing a session i had to switch off the adapter. didn't find any shut down button.
my images are very dark and for me there is no way to change it in the application. will send you an example.
dtic
Posts: 464
Joined: 06 Mar 2010, 18:03

Re: Pi Scan -- Testers Needed

Post by dtic »

This sounds very useful duerig! I don't have a raspberry pi 2 to run it on at the moment but I'll try to test it at a later time.

I like how it (if I understood the video correctly) during capture defaults to not preview all shots in order to maximize speed but still allows the user to manually pause and do a preview now and then to check that positioning, lighting and are still on the right track.
User avatar
dnwst
Posts: 6
Joined: 06 Nov 2015, 12:02
E-book readers owned: Kindle Touch
Number of books owned: 300
Country: Sweden
Location: Sweden
Contact:

Re: Pi Scan -- Testers Needed

Post by dnwst »

I'd be happy to try out Pi Scan Daniel and let you know how it goes.

About mouse vs touch: You only have a download link for the mouse version of Pi Scan at github, but I did manage to download the touch version as well. Is the touch version as stable as the mouse version? If I can get by hands on a Raspberry Pi touch screen any time soon (they're completely sold out everywhere) I'd love to give the touch version a try.

I have two Canon A2600 though and not A2500, any idea if the A2600 work? I might go ahead and buy 2 x IXUS 160 just for Pi Scan.

I'll keep you updated on my progress.
duerig
Posts: 388
Joined: 01 Jun 2014, 17:04
Number of books owned: 1000
Country: United States of America

Re: Pi Scan -- Testers Needed

Post by duerig »

dtic, let me know if you get a chance to test it. Thanks for your feedback. And you are exactly right about not previewing every shot. I like how it turns out, but I was forced into it because I haven't figured out a way to do preview fast enough using a Raspberry Pi and the UI library I chose. I think I will leave it this way even if I figure out how to improve the preview generation speed.

dnwest, thanks for volunteering to be a tester. Though I am Jonathon and not Daniel. :-)

My plan is to release the next version (0.8) as both touch and pi versions officially. The 0.7 touch version you found should work fine as well, though. I put that up so that a few touch screen testers I am in correspondence with could use a touch version before 0.8 is complete. The mouse and touch versions are identical except for some configuration options, so you shouldn't have any stability issues. I'd offer to ship you a Pi screen, but I have a feeling that the shipping cost for it would be almost as much as the device itself.

There is no particular reason why Pi Scan would not work with A2600 cameras. Pi Scan has a good chance of working with any CHDK-enabled device. The reason why the A2500 and ELPH 160 are the supported models is because those are the cameras I have on hand. So if you find a camera problem with a supported model I have a good chance of being able to help diagnose and fix it. If you find a camera problem with a non-supported model, you are mostly on your own.

-D
User avatar
dnwst
Posts: 6
Joined: 06 Nov 2015, 12:02
E-book readers owned: Kindle Touch
Number of books owned: 300
Country: Sweden
Location: Sweden
Contact:

Re: Pi Scan -- Testers Needed

Post by dnwst »

Sorry about that, of course you're Jonathon :)

Sounds great about the touch version, I'll give that a try as a start. I managed to find a local retailer that had the Pi screen in stock, so I'm picking one up this week. I'll give it a try with the A2600 cameras first and see how that works.
User avatar
dnwst
Posts: 6
Joined: 06 Nov 2015, 12:02
E-book readers owned: Kindle Touch
Number of books owned: 300
Country: Sweden
Location: Sweden
Contact:

Re: Pi Scan -- Testers Needed

Post by dnwst »

Hey,

I finally got my Archivist assembled with 2 x Ixus 160, and got my hands on a Pi touch screen. I started it up for the first time now, and get an error message when trying to capture a photo. It happens both when trying to capture a test shot for zoom level and when I try to refocus before starting a scan.

Message:

Failed to prepare camera: Error while switching to record mode

Any idea what's wrong?

I have followed your instructions on Github.

Here's the error log:

Code: Select all

2015-11-21 21:40:03 -- Failed to read config file: [Errno 2] No such file or directory: '/media/pi/KINGSTON/pi-scan.conf': (2, 'No such file or directory')

2015-11-21 21:40:09 -- odd camera: Failed while preparing: ("'NoneType' object is not callable",)
Traceback (most recent call last):
  File "/home/pi/pi-scan/camera.py", line 62, in prepare
    self.prepare_mode()
  File "/home/pi/pi-scan/camera.py", line 82, in prepare_mode
    self.device.switch_mode('record')
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/device.py", line 95, in switch_mode
    if self.mode == mode:
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/device.py", line 87, in mode
    is_record, is_video, _ = self.lua_execute('return get_mode()')
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/device.py", line 186, in lua_execute
    """ % (lua_code, remote_libs)).values()
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/lua.py", line 75, in pexecute
    return self._parse_rval(self._rt.execute(checked_code))
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/lua.py", line 41, in _parse_rval
    self._raise_exception(rval[1])
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/lua.py", line 31, in _raise_exception
    raise PTPError(errval)
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/lua.py", line 14, in __init__
    msg = err_table.get('message')
TypeError: 'NoneType' object is not callable
 -- self.message: Error while switching to record mode
2015-11-21 21:40:09 -- even camera: Failed while preparing: ("'NoneType' object is not callable",)
Traceback (most recent call last):
  File "/home/pi/pi-scan/camera.py", line 62, in prepare
    self.prepare_mode()
  File "/home/pi/pi-scan/camera.py", line 82, in prepare_mode
    self.device.switch_mode('record')
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/device.py", line 95, in switch_mode
    if self.mode == mode:
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/device.py", line 87, in mode
    is_record, is_video, _ = self.lua_execute('return get_mode()')
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/device.py", line 186, in lua_execute
    """ % (lua_code, remote_libs)).values()
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/lua.py", line 75, in pexecute
    return self._parse_rval(self._rt.execute(checked_code))
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/lua.py", line 41, in _parse_rval
    self._raise_exception(rval[1])
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/lua.py", line 31, in _raise_exception
    raise PTPError(errval)
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/lua.py", line 14, in __init__
    msg = err_table.get('message')
TypeError: 'NoneType' object is not callable
 -- self.message: Error while switching to record mode
 
duerig
Posts: 388
Joined: 01 Jun 2014, 17:04
Number of books owned: 1000
Country: United States of America

Re: Pi Scan -- Testers Needed

Post by duerig »

I'm working with dnwest to try to diagnose this problem. If anyone else has this issue, please get in touch.

-D
Post Reply