Main.py for the highlight extraction example uses the default lower and upper HSV bounds, as specified in highlighting.py. These bounds have been fine-tuned for a standard yellow highlighter. This is why the example works well on this image. However, it may be possible to get the code to work for different colors as well. After installing the package as described in the README:
- Find an image of text highlighted in a color other than the standard yellow (e.g. green). If you own highlighters, do some highlighting and take a picture.
- Place that image in the highlighted_text directory, naming it something like
image_green_highlight.jpg
- Duplicate main.py and call it something like
main_green_highlight.py
- Edit the script to open your new image instead of
image.jpg (relevant line)
- Use the a color picker like this one to find the lower/upper bounds you would like to set to extract your new highlight color.
- Test it out! See if you can fine tune your original lower/upper bound arrays to improve the extraction
It's okay if this doesn't work perfectly! It might not—I've only tested the code with yellow highlighting colors. Nonetheless, you can still create the PR to demonstrate how well the library does/doesn't work for other colors.
Main.py for the highlight extraction example uses the default lower and upper HSV bounds, as specified in highlighting.py. These bounds have been fine-tuned for a standard yellow highlighter. This is why the example works well on this image. However, it may be possible to get the code to work for different colors as well. After installing the package as described in the README:
image_green_highlight.jpgmain_green_highlight.pyimage.jpg(relevant line)lowerbandupperbarguments when creating the HighlightExtractor (arrays of form[H, S, V])It's okay if this doesn't work perfectly! It might not—I've only tested the code with yellow highlighting colors. Nonetheless, you can still create the PR to demonstrate how well the library does/doesn't work for other colors.