PC-based software toolkit helps process pictures precisely

Oct. 1, 1996
Portrait photoprocessing is a high-volume business involving millions of photographs per year. Companies often use hundreds of industrial portrait cameras, with each camera capable of taking up to 300 pictures on a single roll of film.

PC-based software toolkit helps process pictures precisely

By Dennis Flanagan

Portrait photoprocessing is a high-volume business involving millions of photographs per year. Companies often use hundreds of industrial portrait cameras, with each camera capable of taking up to 300 pictures on a single roll of film.

When a photograph is taken, the camera burns small variable-length low-contrast identification (ID) numbers into the space between images (see Fig. 1). These ID numbers contain information about the subject, sitting, and pose and are referenced in the customer`s database record. When a customer orders reprints or packages of a particular proof, an order is filled specifying the picture`s ID number and the order.

Traditionally, rolls of negative film are loaded onto printing machines that hold 575 ft of photographic paper. ID numbers of each negative on the rolls are then manually read to locate the exact negative to be reprinted. Human intervention not only slows the process, but it can lead to the reproduction of incorrect prints.

Automating the process

To solve this problem, Zyco Manufacturing (Paoli, PA) built an optical character recognition (OCR) system using an Optimas Sentinal software toolkit. This system allows all the ID numbers to be read from a roll of film at once. In building the system, the challenge was to maximize the contrast of ID numbers against the film background.

Zyco`s system is divided into upper and lower cabinets. The upper cabinet contains the 575-ft roll of unexposed photographic paper, a platen for pressing the paper flat during exposure of the image, an LED unit to write the film negative ID number onto the paper for identification purposes, and a large stepper motor for advancing the paper after exposure. A lens deck is located directly below the upper cabinet, which contains extremely high-quality, hand-ground lenses for printing various paper sizes. Lenses are isolated from cabinet vibrations, dust, and humidity and are controlled by air cylinders that prevent mechanical vibrations. Below the lower cabinet sits a lamphouse that automatically adjusts light colors (RGB), depending on the density of each negative. Film sensors read this information and control the RGB lighting using a PC-based printer controller.

The lower cabinet contains the rest of the system. Rolls of film of various widths (35, 70, or 120 mm) can be loaded onto two reeler motors attached to a dc servo switch. The dc servo motors maintain the tension of the film as a stepper motor controlled by an I/O board from Keithly Metrabyte (Taunton, MA) advances the film (see Fig. 2).

Distance is measured by an encoder that records in 0.001-in. increments. The film is advanced across an 18-in. fluorescent light that allows multiple frames to be back lit. Therefore the operator and the camera can simultaneously view frames of the film as they pass over the light. The cool white fluorescent light backlighting the film produces an even diffused light that maximizes the contrast of the ID numbers.

An XC-75 black and white camera from Sony (Park Ridge, NJ) and a mirror are positioned directly over the film and light. Based on the distance traveled by the film, the servo switch triggers the camera to capture an image of every frame on the film. A color camera is not necessary for this system because the characters in the image are monochrome. Images are digitized by connecting the camera to a Data Raptor PCI frame-grabber board from BitFlow (Woburn, MA). This digitizes the image directly into a Pentium 166-MHz computer with 64 Mbytes RAM for software analysis.

Optimas Sentinel software performs low-contrast OCR, reading the ID numbers of every frame of the roll. Running on the PC, Sentinel`s OCR function reads the ID string at a rate of 0.25 ms per character (4000 characters per second). Once the ID numbers have been read, Sentinel passes them to the photoprocessor`s Fox Pro 2.5-based customer database, a software package from Microsoft (Redmond, WA). A print/no-print decision is made based on the order information. In the event of a print decision, the printer controller instructs the package printing machine to create a print.

Strings with blanks

For the printing process to operate correctly, the software must identify the ID string of unknown character length with an unknown number of various sized blanks. Because each image can contain a different number of characters, a simple measurement of string length is not sufficient to determine if all of the characters have been read.

In operation, Sentinel locates the string, reads characters until a blank is encountered, and steps across the blank space. While stepping across blanks, the software checks the search distance to ensure the system is still in range to find characters. When it becomes out of range, the OCR string is reported to other software modules.

Sentinel software-based machine OCR can find a single character and read an entire string, adjust for irregular character spacing, read irregularly placed text, skip spaces and blanks, train and read any font, and limit reading operations to a maximum string length. This software can also be used to read labels, lot codes on packages, serial numbers on manufactured goods, and pharmaceutical packages.

Designers can benefit from the ease of maintenance and level of portability enabled by software-based machine vision tools. For systems integrators, applications that were previously too difficult or expensive to be solved using software techniques can only benefit as the horsepower of CPUs increases.

Click here to enlarge image

Figure 1. In portrait photography, the camera exposes photo ID numbers into the film, which are used to identify the customer and number and/or size of reprints they require.

Click here to enlarge image

Figure 2. As rolls of film are moved through the photoprocessor, they are illuminated by a fluorescent backlight. IDs are then reflected from a mirror, digitized and correlated with database information on a PC to control photoprocessing operations.

Building OCR systems with off-the-shelf software

Using the Sentinel graphical user interface from Optimas Corp. (Bothell, WA), systems integrators can build search and optical-character-recognition (OCR) routines to find patterns or read text at any angle of orientation and extract a correlation coefficient from which pattern quality can be graded. This is accomplished in three stages. First, the pattern or font is taught to the system. Then, a module is built to encapsulate the inspection tasks within the system. Finally, the module is embedded in the application so that it can be controlled with simple commands (see figure at left).

Sentinel software allows system integrators to train any pattern or font. For noisy or low-contrast images, Sentinel allows the developer to provide more than one example of each character. This technique permits Sentinel to overcome low-contrast and noise problems, resulting in more consistent results and faster execution time.

Sentinel includes a computer-aided software engineering (CASE) program, which lets developers build an application`s control structure by dragging and dropping vision tools (see below). While building the application, the module can be executed or stepped through to test each tool`s behavior. Once finished, the module can be saved as a single file that encapsulates the inspection.

A CASE module can be embedded in applications written with Visual Basic, C++, Delphi, or other Windows-compatible development environments. The application program must provide only the user interface and the interface to process or motion-control systems. Vision tasks are fully contained in the module and performed when the module is run. Modules also can control the flow of output results. An I/O tool allows results to be saved to files. A DLL tool allows the module to load and execute DLL functions to operate process control equipment.

Click here to enlarge image

Sentinel`s Teach program performs font training by selecting instances of each character by drawing a feature window around the character image and supplying the ASCII that it describes.

Click here to enlarge image

Sentinel`s CASE program allows complicated pattern searching or optical-character-recognition (OCR) control structure to be graphically constructed. Each icon represents a specific OCR task. The inspection process is built by dragging and dropping icons into the control structure and drawing control flow arrows to incorporate logic.

Voice Your Opinion

To join the conversation, and become an exclusive member of Vision Systems Design, create an account today!