Skip to content

Commit

Permalink
Reduce barcode scan lines to relieve
Browse files Browse the repository at this point in the history
  • Loading branch information
kikuchan committed Jan 10, 2024
1 parent 931b79d commit 98bd1f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/Qrean.js

Large diffs are not rendered by default.

Binary file modified dist/qrean-detect.exe
Binary file not shown.
Binary file modified dist/qrean.exe
Binary file not shown.
5 changes: 3 additions & 2 deletions src/detector.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,13 @@ static int scan_barcode(runlength_t *rl, image_t *img, image_t *src, int x, int

int qrean_detector_scan_barcodes(image_t *src, void (*on_found)(qrean_detector_perspective_t *warp, void *opaque), void *opaque)
{
int step = 10; // XXX: reduce CPU time...
int found = 0;
image_t *img = image_clone(src);
if (!img) return 0;

runlength_t rl = create_runlength();
for (int y = 0; y < (int)img->height; y++) {
for (int y = 0; y < (int)img->height; y += step) {
runlength_init(&rl);
for (int x = 0; x < (int)img->width; x++) {
scan_barcode(&rl, img, src, x, y, 1, 0, on_found, opaque);
Expand All @@ -182,7 +183,7 @@ int qrean_detector_scan_barcodes(image_t *src, void (*on_found)(qrean_detector_p
}
}

for (int x = 0; x < (int)img->width; x++) {
for (int x = 0; x < (int)img->width; x += step) {
runlength_init(&rl);
for (int y = 0; y < (int)img->height; y++) {
scan_barcode(&rl, img, src, x, y, 0, 1, on_found, opaque);
Expand Down

0 comments on commit 98bd1f8

Please sign in to comment.