-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add progressive web app config, and minor bugfix for symbol decoding #81
Conversation
The negative constant (-5) with blockSize=3 is an overfit for 8x8 cimbar based on my current (371 frame) trial set. blockSize=3 or 5 or 7 aren't *too* different if the subtraction constant is set to 0 (and intuitively maybe it *should* be). 7 seems slighly worse than the other two, and 5 (marginally) the best. When the sharpen kernel is enabled, 7 and 5 are more or less identical (3 is worse), but 7 seems best
blockSize = 7; | ||
sharpenSymbolGrid(symbols, symbols); | ||
} | ||
cv::adaptiveThreshold(symbols, symbols, 255, cv::ADAPTIVE_THRESH_MEAN_C, cv::THRESH_BINARY, blockSize, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear the best way to calculate it (do you include good and bad images? borderline ones? etc etc), but the most sensible way I have of evaluating the error rate introduced by that -5
is to check how many of the sample images fit into certain error cutoffs.
Before and after, using blockSize=3 and different constant values (top=-5, bottom=0):
<50 tile errors | < 100 | < 200 | < 400 | < 500 | <700 | < 1000 | total |
---|---|---|---|---|---|---|---|
28 | 62 | 98 | 149 | 168 | 190 | 223 | 371 |
107 | 141 | 177 | 208 | 226 | 251 | 266 | 371 |
Higher numbers are better (we could also express it as a %, e.g. 141/371 == 38%
), and includes all numbers to the left.
For very low error rates the difference between before and after is deceptive and mostly irrelevant (the ECC will correct 1 error or 60 with similar ease), but on the whole this means that the previous change was a significant regression under certain lighting conditions -- the 371 image dataset includes various lighting scenarios -- and fine under others.
(misc note: "tile errors" nor "bit errors" is exactly the metric we care about -- ideally we'd want to chart byte errors, since that's what reedsolomon corrects for. But tile errors is convenient to calculate, and operates as a proxy for byte errors. tile == 6 bits)
In trying to improve the color decode, I've gathered a larger dataset of real-world sample images -- and it turns out that the decoder change introduced here was overfit. Incremental learning...
The other change here is to add a
pwa.json
file to enable installing cimbar.org as a webapp. There are some drawbacks (I've seen some brutal performance in airplane mode on android that simply I don't understand), but in general it seems like a reasonable thing to have, even if it's imperfect.