Infopost | 2019.05.23

Thumbnail selection algorithm areas of interest motorcycles

On a whim I decided to update my thumbnail algorithm. In short, the previous iteration would look for areas of sharp contrast from a few preconfigured areas of the image. Intuitively, this had the twofold benefit of finding high contrast areas (sometimes where the important stuff is) and finding sharp areas (as out-of-focus parts won't have sharp contrast). I decided to iterate on this and preserve the sharp contrast element of the equation, but added parameters to try to resolve some of the issues with the original algorithm.

Image histogram

Both new ingredients are based on creating a histogram of brightness values using luminance (greyscale that treats R/G/B as the human eye does).
Rather than use preconfigured sample locations, I wrote the interface to let the user define a number of circlular sampling areas spaced evenly across the image. Running the algorithm would give me:

( x,   y): [score] [values...]
(88,  76): [265]   midtone: 96 contrast: 96   sharpness: 73
(88, 152): [104]   midtone: 40 contrast: 40   sharpness: 24
(88, 228):  [88]   midtone: 48 contrast: 24   sharpness: 16
(88, 304): [102]   midtone: 64 contrast: 24   sharpness: 14
(88, 380):  [79]   midtone: 48 contrast: 24   sharpness:  7
(88, 456):  [86]   midtone: 48 contrast: 24   sharpness: 14


Taking the combined midtone/contrast/sharpness values, I normalized them using them to give the percentage thumbnailability compared to the rest of the image.

Thumbnail selection algorithm areas of interest dog weimaraner

It gets a little clearer and more aligned when I draw on the sampling circles.

Thumbnail selection algorithm areas of interest volleyball

Generating a thumbnail is fairly trivial from here, but still heuristic. I could take the point of highest interest and expand out if necessary, but that could fall into an adversarial case fairly easily. Rather, iterating over the entire grid is pretty straightforward, and I can take the maximum grouping that meets provided size constraints.

Thumbnail selection algorithm areas of interest Dying Light screenshot

And beyond the thumbnail application, the high/low interest region labeling could be used for cropping or culling datasets for other algorithms.

Thumbnail selection algorithm areas of interest Risk of Rain 2 screenshot

Video games break the heuristic, but not as easily as the last one. Text provides the sharp contrast that the code likes to hone in on. Creating a center left/right bias would help with this, but then I need to provide manual or automatic recognition that it's a screencap.

Thumbnail selection algorithm areas of interest rafting

Even photos don't always get the intended result.



Related - internal

Some posts from this site with similar content.

Post
2020.05.09

Raster

I've done a little more work with my graphics library, following a few threads:
Post
2020.05.31

Perrrrrsona!

No, I'm not nerding out about newest Persona game, I'm nerding out about site meta! (There's the thin connection that it's about people and in the video game when a character attacks they sometimes shout "persona" because it's a jrpg). Anyway, I wante...
Post
2019.06.02

Parallelism

A short story from graphics to parallelism to lambda to mapreduce to hadoop to Spliterator to ParallelStream.

Related - external

Risky click advisory: these links are produced algorithmically from a crawl of the subsurface web (and some select mainstream web). I haven't personally looked at them or checked them for quality, decency, or sanity. None of these links are promoted, sponsored, or affiliated with this site. For more information, see this post.

www.jeremykun.com

Bezier Curves and Picasso || Math - Programming

Pablo Picasso Simplicity and the Artist Some of my favorite of Pablo Picassos works are his line drawings. He did a number of them about animals: an owl, a camel, a butterfly, etc. This piece called Dog is on my wall: Dachshund-Picasso-Sketch (Jump to interactive demo where we recreate Dog using the math in this post) These paintings are extremely simple but somehow strike the viewer as deeply profound. They give the impression of being quite simple to design and draw.
machinethink.net

One-stage object detection

An in-depth look at how fast object detection models are trained
builtin.com

What Is Software Engineering? Definition and Job Outlook | Built In

What is software engineering? It is a field directly related to computer science, where engineers apply systematic and disciplined methods to the development, operation and maintenance of software.

Created 2024.07 from an index of 306,147 pages.