下面是一个简单的 Java 代码示例,它可以使用中值滤波器去除图像中的噪点:
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferByte;
public class MedianFilter {
public static BufferedImage apply(BufferedImage image) {
int width = image.getWidth();
int height = image.getHeight();
BufferedImage filteredImage = new