将自动裁剪的图像库

时间:2022-11-14 13:08:45

I'm looking for a .Net library that will accept an image or filename and an aspect ratio, and crop the image to that aspect ratio. That's the easy part: I could do it myself. But I also want it to show a little intelligence in choosing exactly what content gets cropped, even if it's just picking which edge to slice.

我正在寻找一个接受图像或文件名和宽高比的.Net库,并将图像裁剪为该宽高比。这很简单:我可以自己做。但是我也希望它能够在选择确切的内容时显示出一些智能,即使它只是选择要切片的边缘。

This is for a personal project, and the pain isn't high enough to justify spending any money on it, but if you can recommend a for-pay tool go ahead. Maybe someone else will find the suggestion useful.

这是一个个人项目,痛苦不足以证明花费任何金钱,但如果你可以推荐一个付费工具继续。也许别人会发现这个建议很有用。

2 个解决方案

#1


2  

Disclaimer: I work for a .NET Imaging vendor (Atalasoft)

免责声明:我为.NET Imaging供应商(Atalasoft)工作

It depends on what kind of image you are talking about. If you are talking about 1-bit document images (like faxes or scans) we can do this.

这取决于你在谈论什么样的形象。如果您正在谈论1位文档图像(如传真或扫描),我们可以这样做。

If you are talking about photographs, our product doesn't do this, but you might be looking for Seam carving. I wrote this application

如果您正在谈论照片,我们的产品不会这样做,但您可能正在寻找Seam雕刻。我写了这个应用程序

http://www.atalasoft.com/cs/blogs/31appsin31days/archive/2008/05/26/simple-seam-carver.aspx

with our library that could be ported to just using the built-in .NET images with some work.

我们的库可以移植到只使用内置的.NET图像和一些工作。

The idea of seam carving is to find connected paths in the image with the least interesting variation from the surrounding pixels. In the normal implementation, you would pick a continuous (but not necessarily vertical) path and remove it. If you wanted a crop, you could find the area with the least energy and remove it. My code shows how to calculate the energy of a pixel and path (how different it is from it's surrounding pixels)

接缝雕刻的想法是在图像中找到与周围像素最不感兴趣的变化的连接路径。在正常实现中,您将选择一个连续(但不一定是垂直)路径并将其删除。如果你想要一种作物,你可以找到能量最少的区域并将其移除。我的代码展示了如何计算像素和路径的能量(它与周围像素的差异)

If you look up seam carving, you will find some free implementations out there.

如果你查看接缝雕刻,你会发现一些免费的实现。

#2


0  

as in IT should pick the side or YOU will pick the side?

如在IT应该选择侧面或你会选择一方?

#1


2  

Disclaimer: I work for a .NET Imaging vendor (Atalasoft)

免责声明:我为.NET Imaging供应商(Atalasoft)工作

It depends on what kind of image you are talking about. If you are talking about 1-bit document images (like faxes or scans) we can do this.

这取决于你在谈论什么样的形象。如果您正在谈论1位文档图像(如传真或扫描),我们可以这样做。

If you are talking about photographs, our product doesn't do this, but you might be looking for Seam carving. I wrote this application

如果您正在谈论照片,我们的产品不会这样做,但您可能正在寻找Seam雕刻。我写了这个应用程序

http://www.atalasoft.com/cs/blogs/31appsin31days/archive/2008/05/26/simple-seam-carver.aspx

with our library that could be ported to just using the built-in .NET images with some work.

我们的库可以移植到只使用内置的.NET图像和一些工作。

The idea of seam carving is to find connected paths in the image with the least interesting variation from the surrounding pixels. In the normal implementation, you would pick a continuous (but not necessarily vertical) path and remove it. If you wanted a crop, you could find the area with the least energy and remove it. My code shows how to calculate the energy of a pixel and path (how different it is from it's surrounding pixels)

接缝雕刻的想法是在图像中找到与周围像素最不感兴趣的变化的连接路径。在正常实现中,您将选择一个连续(但不一定是垂直)路径并将其删除。如果你想要一种作物,你可以找到能量最少的区域并将其移除。我的代码展示了如何计算像素和路径的能量(它与周围像素的差异)

If you look up seam carving, you will find some free implementations out there.

如果你查看接缝雕刻,你会发现一些免费的实现。

#2


0  

as in IT should pick the side or YOU will pick the side?

如在IT应该选择侧面或你会选择一方?