55 for (j = 0; j < img->
h; j++) {
56 for (i = 0; i < img->
w; i++) {
57 oi[j * img->
w + i] = ii[(j * img->
w + i) * 2 + 1];
63 scanner = zbar_image_scanner_create();
71 zbar_image_t *image = zbar_image_create();
72 zbar_image_set_format(image, *(
int *)
"Y800");
73 zbar_image_set_size(image, gray.
w, gray.
h);
74 zbar_image_set_data(image, gray.
buf, gray.
buf_size, zbar_image_free_data);
77 int n = zbar_scan_image(
scanner, image);
80 printf(
"zbar_scan_image returned %d\n", n);
84 const zbar_symbol_t *symbol = zbar_image_first_symbol(image);
85 for (; symbol; symbol = zbar_symbol_next(symbol)) {
87 zbar_symbol_type_t typ = zbar_symbol_get_type(symbol);
88 char *data = (
char *)zbar_symbol_get_data(symbol);
89 printf(
"decoded %s symbol \"%s\"\n",
90 zbar_get_symbol_name(typ), data);
99 zbar_image_destroy(image);
uint32_t buf_size
The buffer size.
Periodic telemetry system header (includes downlink utility and generated code).
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
Computer vision framework for onboard processing.
void * buf
Image buffer (depending on the image_type)
void cv_add(cvFunction func)
bool_t qrscan(struct image_t *img)
#define DefaultChannel
SITL.
Parse video stream to detect and decode QR-codes using the ZBAR library.
zbar_image_scanner_t * scanner
Grayscale image with only the Y part (uint8 per pixel)