Hacker News new | more | comments | ask | show | jobs | submit login

This is called "salient region detection" and some current approaches (there are many) include detecting the contrast between each pixel and the global or regional average color or luminosity. Areas of high contrast are likely to be regions which are considered interesting. Once you have those regions, you would have to have a separate algorithm which maximizes the placement of a rectangle (the crop) to get the greatest coverage of "interestingness".

You could also combine this with face detection, so that a picture of someone in a bikini doesn't end up cropping just to their midsection, since going by surface area, the torso could have more high-contrast pixels than the face.

Here's one approach which has open source C++ code: http://mmcheng.net/effisalobj/

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact