About three months have passed since the creation of our first working sample passport scanner . Having received good results in terms of quality and speed of recognition, we raised the Olympic motto “Faster! More quality! More compact! ”, Started to create the next model of the PACK. If you are wondering what happened as a result, welcome to cat.
Development in the camera part
The optical system is the heart of our PAK. Having worked in the first versions with a webcam from Microsoft, we were able to formulate a number of camera requirements for future models:
Manual focal length control.
High resolution received frames. As it turned out, the 2 MPix returned by the Microsoft camera is the minimum allowed.
Compact size.
Driver availability for various platforms and operating systems.
Low cost.
As a result, we stopped at the unpackaged small-format USB-camera MI5100 from the well-known Chinese manufacturer of video surveillance systems and USB-cameras ELP . ')
Cheap, compact, offering manual focus, returning images up to 5 MPix, operating under different operating systems, this “ideal” at first glance camera has several drawbacks:
The video stream is encoded using MJPEG with fairly low quality. As a result, the resulting frames contain JPEG-specific artifacts, which are particularly pronounced at the contrast borders. But since the recognition core was sharpened under images of poor quality, this feature of the camera did not introduce serious problems.
Build quality is quite mediocre. For example, in order to fit the lens more closely, I had to resort to FUM tape and PVC electrical tape.
Development in part of the body
As in the first model, we chose chipboard furniture sheets as the material for the cabinet. This solution has several advantages:
It is easy to assemble: it is possible to cut parts of the required size directly in large building stores, in the same place you can buy confirmatics for twisting the box.
It is pleasant to realize that the industrial design is guaranteed to be more compact at least due to the thinning of the device walls.
The use of a wide-angle small-sized camera allowed us to significantly reduce the height of the device: 146 mm against 276 mm for the previous sample. PAK is designed to recognize documents of a size not exceeding A5, which directly determines the length and width of the scanner.
Development in automation
In my opinion this part of the article is the most interesting. If you read our previous post about the software and hardware complex , you probably drew attention to our plans to fill the voids of the box with computing power so that the very recognition of documents was also performed inside the PACK. As you can see from the first picture, we did it and are ready to share our experience.
So, the single-board 8-core mini-computer Odroid-XU4 , made on the ARM architecture, was chosen as the main computing device. A single board computer contains four Cortex-A15 cores with a clock speed of 2.0 GHz and four Cortex-A7 cores with a clock frequency of 1.4 GHz, 2 GB of RAM, a Gigabit Ethernet network controller, two USB 3.0 ports, one USB 2.0 port, and also HDMI to connect the monitor. Lubuntu was chosen as the operating system.
Having collected the recognition core on a micro computer (fortunately, there were no difficulties, we regularly assemble the SDK for Android and iOS mobile platforms), making sure that the documents are recognized, we faced the question of how we would return the recognition result to the client.
The first obvious approach is to bring up a web server on Odroid and access it for recognition results. It is easy to implement, but not what we wanted (and we just wanted a stand-alone device that allows us to reduce the integration process to virtually zero).
The alternative solution came unexpectedly as always. What if we teach our PAK to pretend to be a USB keyboard? Like a barcode scanner. In this form, the integration of our PAK into ready-made information systems essentially consists in connecting the device to an empty USB connector and setting up (on the device) the correct sequence of pressing “virtual” keys.
Inspired by the idea, we bought Odroid Shifter Shield, Arduino Micro, a set of wires, a couple of buttons and a LED. We programmed Arduino (well, a very detailed guide is supplied with Arduino), they “hung up” on the button to start the recognition procedure, on the LED - feedback on the recognition quality.
Being a supporter of the saying “it's better to see once than seven times to hear”, we share with you a video of the work of a completely autonomous scanner.
Conclusion
The experiments carried out smoothly led us to an important scientific and social goal: to create an industrial design that would completely solve the problem of entering passport data at checkpoints, in banks, ticket offices, and also think about import substitution.