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

Raw binary data 1D

bronek999
2014-03-11
2014-03-14
  • bronek999
    bronek999
    2014-03-11

    How can I decode raw binary data?
    I need to decode one row data
    How can I tell that it is binary black&white data?

    my example is

    include "zbar.h"

    unsigned char test[] = {0,0,0,0,0,0,0,0,0,0x0F,0x0F,0x0F,0xF0,0,0xF0,0x0F,0x0F,0xFF,0,0xFF,0,0xF0,0x0F,0xF0,0xFF,0x0F,0,0,0xF0,0xf0,0,0xff,0x0f,0x0F,0x0F,0xF0,0x0F,0xF0,0xff,0x0f,0xf0,0x0f,0,0,0xf0,0xf0,0xff,0,0xf0,0x0f,0xff,0x0f0,0x0f,0,0xf0,0,0,0,0,0,0};

    //test contain bars and spaces

    zbar_scanner_t scanner = NULL;
    zbar_decoder_t
    decoder = NULL;
    zbar_symbol_type_t symbol;
    void *data;
    int main()
    {
    decoder = zbar_decoder_create();
    scanner = zbar_scanner_create(decoder);
    symbol = zbar_scanner_reset(scanner);
    data = &test;
    zbar_decoder_set_userdata(decoder,data);
    symbol = zbar_scanner_new_scan(scanner);
    symbol = zbar_scan_y(scanner,1);
    return 0;
    }

     
  • bronek999
    bronek999
    2014-03-14

    It tooks lot of time to get it working :-)

    Now it is modified zbar based algorithm.
    zbar have lot of errors :((
    One of them it cant recognize EAN(UPC) code from
    one dimensional array. (scanned code quality + erorr) It need minimum 3 lines of data.