Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

How to iterate through recognized symbols (Python)

Help
klo
2013-12-16
2013-12-16
  • klo
    klo
    2013-12-16

    Hi

    First thanks for making this easy to use tool, and allowing others to use it.
    Nevertheless I have a small problem:

    I have an image with 5 EAN13 barcodes and one CODE128 barcode. I read the image through PIL and run scanner as in wiki example. Then I plot the symbol.location points through matplotlib and notice that all barcodes in the image are recognized - i.e. I see left, middle and right boundary points on every barcode.

    However when I iterate symbols (for symbol in image:) I get output only for CODE128 barcode and the first EAN13 barcode, but not the rest four. I thought to iterate over second symbol instance, but it doesn't output anything that way.

    So in short I have two symbols objects from zbar.image instance. First one is single CODE128 barcode and the second one holds five EAN13 barcodes. How can I iterate through second one and extract all five barcodes?

    Thanks in advance
    klo