Commit graph

113 commits

Author SHA1 Message Date
YAMAMOTO Takashi
ea9b6ee5ef otsu: Use unsigned for the pixel numbers
Because singed numbers don't make sense here.
2021-04-08 13:38:30 +09:00
YAMAMOTO Takashi
de68db7b69 otsu: Use double for weighted sums
My phone camera produces 12M-pixel images.
They can easily overflow an int.
2021-04-08 13:38:30 +09:00
Alexandre Perrin
9c0f555acb
Merge pull request #94 from yamt/demo-opencv
quirc-demo-opencv: Add OpenCV version of the demo
2021-03-28 21:00:08 +02:00
Alexandre Perrin
7ef51ee6e7
Merge pull request #97 from yamt/readme-demo
README.md: mention requirements of each test/demo
2021-03-28 20:59:30 +02:00
YAMAMOTO Takashi
f10e7dc39a README.md: mention requirements of each test/demo 2021-03-23 09:08:51 +09:00
YAMAMOTO Takashi
679e43f144 quirc-demo-opencv: Add OpenCV version of the demo
My motivation is to experiment quirc on macOS, where
neither of SDL1 or V4L2 work.

```
% brew install opencv
% brew install pkg-config
% brew install bsdmake
% bsdmake quirc-demo-opencv
% ./quirc-demo-opencv
```

Note: the macOS version of GNU make (/usr/bin/make) is a bit old
for quirc's Makefile.
2021-03-22 10:13:33 +09:00
Alexandre Perrin
7e7ab596e4
Merge pull request #89 from claudiofelber/master
Support horizontally flipped QR-codes according to ISO 18004:2015
2020-09-23 22:09:39 +02:00
Claudio Felber
8e8a638a5f Update README.md with how to use quirc_flip() 2020-09-22 12:23:17 +02:00
Claudio Felber
2fd06df8de Add support for flipped QR-codes in inspect and qrtest tools 2020-09-22 12:18:23 +02:00
Claudio Felber
4bc17cf8c6 Optimize quirc_flip() 2020-09-22 12:14:09 +02:00
Claudio Felber
5beb59e3b4 Support horizontally flipped QR-codes according to ISO 18004:2015 2020-09-21 16:54:55 +02:00
Daniel Beer
92026d26bd
Merge pull request #87 from claudiofelber/master
Fix stack corruption and bus errors while scanning oversized QR codes
2020-09-21 11:13:11 +12:00
Claudio Felber
963d6ed126 Fix stack corruption and bus errors while scanning oversized QR codes 2020-09-15 00:51:41 +02:00
Alexandre Perrin
744372e551
Merge pull request #77 from JaapHaitsma/warning-fix
Fix compiler warning
2020-05-20 09:02:14 +02:00
Jaap Haitsma
013a8922bb Fix compiler warning 2020-05-19 19:01:38 -04:00
Alexandre Perrin
cbf911edf0
Merge pull request #69 from dlbeer/fix/c99
Refactored some c99 features
2020-03-13 21:51:35 +01:00
Alexandre Perrin
a0b41121e4 Refactored some c99 features
Fixes #68
2020-02-27 20:40:23 +01:00
Alexandre Perrin
2e8c4ce7bc Add a README note about building with DQUIRC_MAX_REGIONS
Question about decoding large images has come up several times, let's
document it better.
2019-10-23 09:37:24 +02:00
Alexandre Perrin
026485bdc6 missing <limits.h> header 2019-09-25 11:10:43 +02:00
Alexandre Perrin
b77da026c9 README.md formatting tweaks 2019-09-25 11:07:20 +02:00
Alexandre Perrin
db4046f997
Merge pull request #61 from roger-wetzel/patch-1
Rename README to README.md
2019-09-25 10:59:47 +02:00
Alexandre Perrin
bf397f0794
Merge pull request #57 from kAworu/cosmetic
define a QUIRC_PIXEL_ALIAS_IMAGE constant to explicit conditional path
2019-09-25 10:59:08 +02:00
Alexandre Perrin
74459b9f59 Don't assume that sizeof(int) == sizeof(int32_t)
See https://github.com/dlbeer/quirc/pull/59#discussion_r320307589
2019-09-25 10:57:38 +02:00
Daniel Beer
f27a7c2c75
Merge pull request #62 from sushshring/master
Fixes issue #60
2019-09-10 15:33:52 +12:00
Sushrut Shringarputale
26d2402655
Fixes issue #60 2019-09-09 23:09:20 -04:00
Roger Wetzel
3046f4c710
Rename README to README.md
So this Readme gets rendered nicely.
2019-09-03 19:41:56 +02:00
Daniel Beer
c89d949371
Merge pull request #59 from sushshring/master
Fix some compile-time issues for better production usability
2019-08-22 11:43:05 +12:00
Sushrut Shringarputale
ed833132d5 Fix some compile-time issues for better production usability
Fixed up some type coercion and uninitialized variable instances for
better production code usability.
2019-08-20 09:50:39 -07:00
Alexandre Perrin
f700e456b4 define a QUIRC_PIXEL_ALIAS_IMAGE constant to explicit conditional path
Before this patch, the "sizeof dance" was confusing, fix #54.
2019-07-02 09:22:25 +02:00
Daniel Beer
5d71b1853e identify: make otsu() static. 2019-05-02 15:56:35 +12:00
Daniel Beer
0e2dbec426
Merge pull request #55 from claudiofelber/master
Replaced existing threshold function with Otsu threshold algorithm
2019-05-02 15:55:22 +12:00
Claudio Felber
766f79ce7c Use const struct quirc parameter in otsu() function and fix tabs 2019-04-30 18:44:59 +02:00
Claudio Felber
96a5a380fb Remove quirc.row_average and associated code
quirc.row_average was used by the former threshold function and has
become obsolete with the introduction of the Otsu threshold function.
2019-04-30 18:43:57 +02:00
Claudio Felber
97ffaabfb5 Replace existing threshold function with Otsu threshold algorithm 2019-04-30 13:02:11 +02:00
Daniel Beer
307473dbca
Merge pull request #42 from kAworu/master
fix mjpeg_decode_rgb32().
2018-02-01 12:04:11 +13:00
Alexandre Perrin
d283137a60 fix mjpeg_decode_rgb32().
Before this patch the `rgb` pointer was incremented by the "inner" for
loop but never reset to the start of the buffer by the "outer" while
loop.

This bug was introduced by the refactoring in
6158aeb30a.
2018-01-31 15:29:01 +01:00
Daniel Beer
eca042a787 Merge pull request #40 from kAworu/vla-cleanup
Refactoring to remove the use of c99 VLA
2017-06-11 22:30:33 +12:00
Alexandre Perrin
d3780f3e6f Warning comment improvement. 2017-06-11 10:19:31 +02:00
Alexandre Perrin
6158aeb30a mjpeg_decode_rgb32() refactoring.
Use calloc(3) & free(3) instead of c99 VLA.
2017-06-11 10:08:58 +02:00
Alexandre Perrin
90371f36a0 threshold() uses now the row_average member of struct quirc. 2017-06-11 10:08:58 +02:00
Alexandre Perrin
21f6863577 Added a row_average member to struct quirc.
Prep to remove the VLA from threshold()
2017-06-11 10:08:58 +02:00
Daniel Beer
7b26f6e193 Merge pull request #39 from kAworu/quirc_resize.fix
Fix a potential use-after-free on quirc_resize failure.
2017-06-10 14:02:40 +12:00
Alexandre Perrin
971c9d4e8c refactor quirc_resize
So that the given quirc struct is never invalid once we return to the
caller.
2017-06-09 22:12:06 +02:00
Daniel Beer
90e12be081 Merge pull request #38 from kAworu/Wold-style-declaration
Fixes warnings emitted by gcc -Wold-style-declaration
2017-06-08 19:30:05 +12:00
Alexandre Perrin
1f9edb0b84 Fix a potential use-after-free on quirc_resize failure.
Before this patch, in the event of `q->image` reallocation success but
`q->pixels` failure, `q->image` would point to a freed memory.

After this patch, once quirc_resize() returns, `q->image` consistently
point to a memory address that can be freed.

There is still an inconsistency left in the example codepath: `q->{h,w}`
would hold the "old" values, while `q->image` allocated size would be
based in the requested width/height; hence the comment update about the
state of the QR-code recognizer (it should only be passed to
quirc_destroy()).
2017-06-07 19:37:14 +02:00
Alexandre Perrin
a858ec4896 Fixes warnings emitted by gcc -Wold-style-declaration 2017-06-07 10:24:43 +02:00
Daniel Beer
fce4b94bb2 mjpeg: remember to set dinfo.err. 2017-05-31 17:52:55 +12:00
Daniel Beer
ffc2f9b68a dbgutil: fix double-free on error in jpeg_finish_decompress. 2017-05-31 17:52:26 +12:00
Daniel Beer
5174ba77f8 Merge pull request #34 from kAworu/decode_kanji.fix
Fix Kanji decoding.
2017-05-31 08:23:33 +12:00
Alexandre Perrin
2528ea3955 Comment fix
Bad copy-pasta from
http://www.thonky.com/qr-code-tutorial/kanji-mode-encoding
2017-05-30 19:23:42 +02:00