At work, we had a requirement to digitize certain physical forms, the time-consuming part is to separate the attached photograph , scan it , upload to the digitized data, it was taking upwards of 1 minute for each photograph.

After regular discussion/brainstorming, one solution was seen viable.

Use web camera to take the photograph at a fixed position and associate to the data, however the following challenges are faced

the application in context is a webapplication the digitization person uses a webbrowser(obviously) to enter data the prefered way is associate the photograph at the time of digitization and not one more action of association also the digitization person will have to be satisfied with the photograph to upload

a solution was devised

a webcam attached to a system, where a daemon will take pictures on request and send it BOTH to the client browser and server the server will store the picture in temp directory flushed periodically, and the browser will get a unique uploaded id to be submitted with the form the server will then associate the picture

however, this required multiple image captures when the digitization person is not satisfied, so the solution has to be tweaked to stream the webcamera output and to capture.

One easy solution, use FLASH, but NO

DBus

one advantage we had is, the digitization is in-house and we run Linux 🙂

so i started to look around for a solution, i remembered dbus as a new generation ipc, so how would it be if using dbus, the daemon

would launch an application in client side streaming the video, and once the application captures an image, the daemon(which is watching the filesystem) will pick up the latest image, serve to the webpage also upload to the server.

so in less than 30minutes a working solution was implemented, and now it takes about 5-12 seconds for every picture, so its about 6 times faster

So the application is built as

1. Daemon : a webserver in python, with dbus and pyinotifier

2. Application Cheese 🙂

a picture to summarize

