什么是用于裁剪图像以避免空白区域或空白区域的好算法或库? [英] What is a good algorithm or library for cropping images to avoid whitespace or empty areas?

查看:256
本文介绍了什么是用于裁剪图像以避免空白区域或空白区域的好算法或库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一大堆插图图片,我想裁剪到较小的预览尺寸。

I have a whole bunch of images of illustrations that I would like to crop to a smaller preview size.

问题在于我想裁剪它们以显示插图的有趣部分(即避开空白区域)。

The problem is that I want to crop them to show an "interesting" part of the illustration (ie avoid areas of whitespace).

图像通常具有平面颜色或背景的细微渐变。它们大多是矢量风格的艺术品,形状各异。

The images typically have a flat color or a subtle gradient for the background. They are mostly vector style artwork with fairly distinct shapes.

以下是一些例子:链接; - )

Here are some examples: link ;-)

我一直在考虑使用某种图像特征检测算法有一个滑动窗口,可以找到功能最多的区域。

I've been thinking about using some sort of image feature detection algorithm with a sliding window to find the area with the greatest number of features.

我在PHP中实现这个,但我不介意自己实现它,如果有的话没有图书馆或分机。

I'm implementing this in PHP, but I don't mind implementing it myself if there isn't a library or extension available.

想法?

推荐答案

ImageMagick 修剪操作。它可以作为库使用,但我不知道从PHP使用有多难。有一些 PHP界面

ImageMagick has a trim operation. It's available as a library but I don't know how hard it is to use from PHP. There are some PHP interfaces.

这篇关于什么是用于裁剪图像以避免空白区域或空白区域的好算法或库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆