请问各位大拿,对图象放大缩小的常用算法有那些,小弟谢过了
|
以下网址有许多处理图像的源码:
http://dmoz.org/Computers/Programming/Languages/Java/Class_Libraries/Graphics/
http://dmoz.org/Computers/Programming/Languages/Java/Class_Libraries/Graphics/Data_Formats/
|
Scale an Image
import java.awt.image.*;
import java.awt.*;
import java.net.*;
public class app extends java.applet.Applet {
Image source;
Image resizedImage;
public void init() {
MediaTracker media = new MediaTracker(this);
// java how-to image for example
source = getImage(getDocumentBase(),"jht.gif");
media.addImage(source,0);
try {
media.waitForID(0);
// scale down, half the original size
ImageFilter replicate =
new ReplicateScaleFilter
(source.getWidth(this)/2, source.getHeight(this)/2);
ImageProducer prod =
new FilteredImageSource(source.getSource(),replicate);
resizedImage = createImage(prod);
media.addImage(resizedImage,1);
media.waitForID(1);
}
catch(InterruptedException e) {}
}
public void paint(Graphics g) {
g.drawImage(source, 10,10,this);
g.drawImage(resizedImage,10, 80,this);
}
}
---------------
shmilu@sina.com
|
算法方面,你可以用边缘像素扩大法(我自己给取得名字)、我想你不是搞专业图像处理算法研究的,一般不必要自己写的、也用不着考虑。像我学过图像处理,现在还不忘了,只有用时还有可能再去查资料。