Go package to detect interesting portions of images (salient region detection).
One method "Crop" is provided which crops the supplied image to the width and height provided, ensuring the most interesting portion of the image is contained within the cropped area.
Crop works by moving a sliding window over the input image and selecting the one with the highest entropy.
Inspired by some of the ideas submitted here: http://codebrawl.com/contests/content-aware-image-cropping-with-chunkypng
Run the sample command line app like this:
go run /path/to/bin/cropper.go /path/to/input.img /path/to/output.img 200 120
go get github.com/iand/salience
Documentation is at https://pkg.go.dev/github.com/iand/salience
- Do submit your changes as a pull request
- Do your best to adhere to the existing coding conventions and idioms.
- Do run
go fmton the code before committing
- Do feel free to add yourself to the
CREDITSfile and the corresponding Contributors list in the
README.md. Alphabetical order applies.
- Don't touch the
AUTHORSfile. An existing author will add you if your contributions are significant enough.
- Do note that in order for any non-trivial changes to be merged (as a rule
of thumb, additions larger than about 15 lines of code), an explicit
Public Domain Dedication needs to be on record from you. Please include
a copy of the statement found in the
WAIVERfile with your pull request