Java - 我需要一个非常快速的图像缩放算法 [英] Java - I need a very fast image scaling algorithm

查看:203
本文介绍了Java - 我需要一个非常快速的图像缩放算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Midlet应用程序。我发现自己需要经常缩放图像。这已经成为一个问题,因为有些手机很慢,缩放时间太长。

I am working on a Midlet application. I am finding myself in the need to scale images very often. This has become a problem because some phones are pretty slow and scaling takes too long.

目前我正在使用Image.createRGBImage(int,int,int,boolean)来缩放图像。

Currently I'm using Image.createRGBImage(int, int, int, boolean) to scale the image.

我想知道你们中是否有人知道一种非常有效和快速的图像缩放方式。

I was wondering if any of you knew of a very efficient and fast way to scale an image.

注意:这是一个Midlet应用程序,因此只有JavaME可用,这意味着我无权访问完整Java版本中可用的其他库。

Note: this is a Midlet application so only JavaME is available, meaning I don't have access to some other libraries available in the full java version.

注2:我的大部分缩放都是从小图像到大图像完成的,虽然我也缩小了图像。

Note2: most of my scaling is done from small to large images, although I also do scale down the image.

推荐答案

请记住,在讨论缩放算法时,总是在速度和图像质量之间进行交易,并且针对您的案例的理想解决方案可能需要一些研究和测试。

Keep in mind that there's always a trade between speed and image quality when discussing scaling algorithms, and the ideal solution for your case might require some research and testing.

最近的neig hbor 是图像缩放的最简单和最快实现。

Coding Horror ,它回顾了几种技术并比较了它们的质量。

There's a nice intro on image scale/resize on Coding Horror which reviews a couple of techniques and compares their quality.

我想你正在使用一个非常小的显示设备,所以图像质量最终并不重要。有些人正在为 J2ME 打电话这个 最快的图像缩放实施。

I imagine you are working with a very small displaying device, so image quality doesn't really matter at the end. Some people are calling this the fastest image scaling implementation for J2ME.

但如果您愿意阅读其他内容,请 this论文提出了一种低成本(意思是非常快)的缩放算法,它可以显着改善最近邻插值。有可用的源代码,它们也提供了该研究的演变此处

But if you are willing to read some other stuff, this paper presents a low cost (meaning "very fast") algorithm for scaling that significantly improves on nearest neighbor interpolation. There's source code available, and they also present an evolution of that research here.

最后但并非最不重要, cvResize() (用于图像处理的开源/跨平台库)。 柳树车库的人们非常善于制作快速的图像/视频处理程序,而且这个功能提供了几种缩放技术,因此可能值得检查它的实现。

At last but not least, cvResize() from OpenCV (open source/cross-platform library for image processing). The folks at willow garage are pretty good at making fast procedures for image/video processing, and this function provides a couple of techniques for scaling, so it might be worth to check it's implementation.

这篇关于Java - 我需要一个非常快速的图像缩放算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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