From 5670b821b8c14983ed635f40f4c9ae36c3fa5343 Mon Sep 17 00:00:00 2001 From: Rusty Striker Date: Fri, 19 Jan 2024 13:37:22 +0200 Subject: [PATCH] readme and stuff --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e45fe55 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# The ALGORITHM!!! + +The general idea is to make a filter/mask of each of the corresponding fonts, +and attempt to match them to the given letter. + +## Scoring system + +The score each font will have will be based on the average color(`acolor`) +underneath each font mask(might be different `acolor` for each mask). + +After obtaining the `acolor` for a mask, the score will be calculated +as the sum of the different pixel scores. + +For a given pixel(`po` for the original image and `pm` for the mask, same position) +its score will be calculated as follows: + +``` +S_p = | po - acolor | x (0.5 - pm) +``` + +it is assumed that the font mask is of values between `0..1` and made as a +'white on black' text(so `1` is where the font is). + +The given score calculation will take into consideration color +variations of where the letter should be, while also taking into +consideration the fact that the background should be of different +color. + +## Potential improvements + +Some potential improvements would be: + +- Only consider pixels in the font and their outline. + This might be helpful, as it would mean we dont care + about pixels that are too far away, but assuming a good bounding boxes, + it probably wont give much better results(or at all). + Additionally, it poses some questions of which pixels should be considered, + as both the text and mask are anti-aliased(thus having "weak" pixels) +- Increase the area around the font. + This idea can make sure we are not looking too inwards, + although it shouldn't matter since we are looking to classify from + a predefined set and not search them randomly, thus the potentially + good information missed shouldn't matter that much + (i.e. all scores will be 0.1 lower but the correct font shall still be picked) + + + + + + +