このコードでは、画像を入力として取り込み、同じ画像を出力しています。私が知る限り、2つの画像が同じであれば、PSNRの値はinfになります。ですから、私はMATLABを使ってPSNR値を計算しますが、48.05はその画像が同じでないことを示しています。しかし、私は同じイメージを読み書きしています。なぜこれが起こっているのですか?どうすれば修正できますか?Javaでの画像入力出力
public class ImageProcessing {
BufferedImage image = null;
int width;
int height;
public ImageProcessing() {
// Input the image
try {
File input = new File("image0.jpg");
image = ImageIO.read(input);
width = image.getWidth();
height = image.getHeight();
/*int count = 0;
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
count++;
Color c = new Color(image.getRGB(j, i));
System.out.println("S.No: " + count + " Red: " + c.getRed() + " Green: " + c.getGreen() + " Blue: " + c.getBlue());
}
}*/
} catch (Exception e) {
System.out.println("Error: " + e);
}
// Output the image
try {
File input = new File("image1.jpg");
ImageIO.write(image, "jpg", input);
System.out.println("Writing complete.");
} catch (Exception e) {
System.out.println("Error: " + e);
}
}
public static void main(String[] args) {
// TODO code application logic here
System.out.println("System Start");
ImageProcessing obj = new ImageProcessing();
}
}
は、それが –
おかげで、PNG形式でその作業 –
はクールな形式をPNG形式のために同じことをしている場合、私に知らせて、あなたは緑のチェックマークを打つ気に? –