The majority of what I need to track are printed pages.
They start as a stack of cut sheet paper with a preprinted
backgroup. The printer has multiple trays.
For example:
A typical production run will have a cover page pulled
from one bin, with name address, city, state, zip printed
on it, along with some personalized letter text.
The bottom 1/3 of the coversheet has a certificate with
a barcode (3 of 9) on it. We might be dealing with other
codes later.
Then, additional secondary pages are pulled. They contain up to
3 certificates, with 3 bar codes, spread throughout the page.
There is no external visibility during printing.
There are always the same number of pages - each print run
is segmented into pages since the folding machine needs to
know how many pieces go together.
So now we have a stack of pages that is fed into the folding
machine. We set the number of pages per group, and it feeds
them in. They go about 3 pages per second.
The machine folds them together and spits it out the other
side.
For a 3 page grouping, on the feed side:
Page 1 goes from feeder to pre-fold area. - Single bar code
Page 2 goes from feeder to pre-fold area. - 3 bar codes
Page 3 goes from feeder to pre-fold area. - 2 bar codes
Folder grabs 3 pages, folds, spits them
out the other side. - single bar code.
When pages are accumulating, there is about 1/4
second where they sit, waiting for the next page
to show up. But then the last page arrives, the
folder grabs them and pulls them through very
quickly.
On the other side, I have anywhere from 1/2 a second
any 2 seconds between pieces, but they fly by
about 3 feet per second. If we set an area to watch
of about 1 foot, then we have 1/3 of a second to grab
the image and pull the code.
\t
I'd like to correlate what comes in with what goes out,
making sure the correct number of pages comes through,
that only the cover bar code comes out, and possibly
triggering an equipment stop on a fault.
I would also need to pull the valid bar codes from a
database, but I doubt I would be doing this on a per
piece basis.
I'd most likely be front loading a job into memory and
doing QC by matching as they fly by.
Based on tech specs and lit (all bullshit until I
get equipment) a typicaly monochrome USB or firewire
cameras ($500 - $750) can feed from 20 - 50 pictures
a second to the computer.
So, even at the slow rate, if I have 2 foot page move
by at 3 feet per second, and I am looking at a 1
foot area, I should get several pictures of every
bar code on the page at least a few times.
Based on me reading the Linux firewire development
how-to, I should be able to setup a ring-buffer for
these images to arrive into, and I should be able to
loop around, grabbing the images, and then sending
them to a 3rd party software library which claims to
be able to parse out about 60 pages per second (of course,
they have their caveats).
I would get the returned codes, throw away dupes, do
a hashed memory lookup to validate, and react as necessary.
As a first step, I wouldn't mind merely writing the
discovered bar codes to a file for later processing.