klanderfri / klanderfri/CardReaderLibrary

Put configuration values together

Open
#19 0 comments 0 reactions 0 assignees View on GitHub
fix
Dominant language
C++
Stars
10
Forks
3
PR merge metrics
No merged PRs in 30d

Description

The program has literals that are of a configurative nature. Regard the code below:
`do {`
` threshold(workOriginal, binaryImage, binaryThreshold, 255, THRESH_BINARY);`
` binaryThreshold -= 20;`
` } while (!ImageHelper::IsBlackTextWhiteBackground(binaryImage) && binaryThreshold > 0);`

The 255 and the 0 are literals, and should be so. The 20 however might need to be changed in the future since it is a literal that might need to be configured.

- [ ] Compile all configurative values in one single class.

In the future it might be useful to load these values from an external file which the user can edit (if needed).

Contributor guide

Open the contributing guide

Research direction

Search the C++ sources for binaryThreshold, the threshold call, and other configurable literals. Start with the shown ImageHelper::IsBlackTextWhiteBackground flow, then identify where the configuration class should be shared. Done means the configurable values are collected in one class without replacing intentional literals such as 255 and 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, opencv
Domain
computer-vision
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.