Skip to content

Commit

Permalink
3,-5 for adaptiveThreshhold on symbols seems better?
Browse files Browse the repository at this point in the history
Part eyeballing, part experimentation -- probably overfit to my sample
data either way, but so were the previous settings 😬

`3` is what we've been using for 8x8, so it does feel reasonable to fall
back to it.
  • Loading branch information
sz3 committed Jun 1, 2023
1 parent 18e5480 commit 6daa947
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/cimb_translator/CimbReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace {
{
// will this need to change for smaller tiles? probably?

int blockSize = 5; // default: no preprocessing
int blockSize = 3; // default: no preprocessing

cv::Mat symbols;
cv::cvtColor(img, symbols, cv::COLOR_RGB2GRAY);
Expand All @@ -38,7 +38,7 @@ namespace {
sharpenSymbolGrid(symbols, symbols);
blockSize = 3;
}
cv::adaptiveThreshold(symbols, symbols, 255, cv::ADAPTIVE_THRESH_MEAN_C, cv::THRESH_BINARY, blockSize, -10);
cv::adaptiveThreshold(symbols, symbols, 255, cv::ADAPTIVE_THRESH_MEAN_C, cv::THRESH_BINARY, blockSize, -5);

bitbuffer bb(std::pow(Config::image_size(), 2) / 8);
bitmatrix::mat_to_bitbuffer(symbols, bb.get_writer());
Expand Down

0 comments on commit 6daa947

Please sign in to comment.