Skip to content
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

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

sz3
Copy link
Owner

@sz3 sz3 commented Nov 30, 2023

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.

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);
Copy link
Owner Author

@sz3 sz3 Nov 30, 2023

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)

@sz3 sz3 merged commit faebb87 into master Nov 30, 2023
8 checks passed
@sz3 sz3 deleted the pwa-and-bugfix branch November 30, 2023 03:28
sz3 added a commit to sz3/cfc that referenced this pull request Nov 30, 2023
sz3 added a commit that referenced this pull request Feb 8, 2024
sz3 added a commit that referenced this pull request Mar 13, 2024
faebb87 Merge pull request #81 from sz3/pwa-and-bugfix
5b4b70d Bump version
106809c Change params for symbol decode's adaptiveThreshold operation
d25cd4d Progressive web app stuff

git-subtree-dir: app/src/cpp/libcimbar
git-subtree-split: faebb87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant