图像旋转算法算法、图像

2023-09-10 23:16:10 作者:缠绵勾画

我在寻找一种算法,通过一些度旋转的图像(输入)。

I'm looking for an algorithm that rotates an image by some degrees (input).

public Image rotateImage(Image image, int degrees)

(图片实例可以替换为int []包含每个像素的RGB值, 我的问题是,我需要实现它的JavaME的MIDP 2.0的项目,所以我必须使用code可运行在JVM之前的1.5版 谁能帮我这个?

(Image instances could be replaced with int[] containing each pixel RGB values, My problem is that i need to implement it for a JavaME MIDP 2.0 project so i must use code runnable on JVM prior to version 1.5 Can anyone help me out with this ?

编辑:我忘了,更不用说我没有可用的SVG api和我需要一种方法,通过任意的程度比其他90旋转 - 180- 270

I forgot to mention that i don't have SVG APIs available and that i need a method to rotate by arbitrary degree other than 90 - 180- 270

此外,没有java.awt中。*包可在MIDP 2.0

Also, no java.awt.* packages are available on MIDP 2.0

推荐答案

一描述的图像旋转算法的最佳页,我在互联网上找到的是依赖于丹彭博的优秀的的leptonica库。虽然leptonica库本身是用C语言编写,并不会帮你,他对图像旋转算法的网页:

One of the best pages describing image rotation algorithms I've found on the internet is tied to Dan Bloomberg's excellent leptonica library. While the leptonica library itself is written in C and won't help you, his page on image rotation algorithms:

http://www.leptonica.com/rotation.html

绝对是值得一读。你很可能要实施类似的旋转通过区域映射算法,他描述了在页面的第二部分。

is definitely worth a read. You will most likely want to implement something like the Rotation by Area Mapping algorithm he describes in the second portion of the page.