Skip to content

Test out other highlighting colors #3

Description

@iRove108

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:

  1. 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
  2. Duplicate main.py and call it something like main_green_highlight.py
  3. Edit the script to open your new image instead of image.jpg (relevant line)
  4. 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.
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions