我正在尝试使用Catalano-Framework 1.6.1查找RGB图像的MSE和PSNR
但是我得到一个NullPointerException
这是我的代码:
// Code to Find PSNR
BufferedImage OrignalImage = null;
BufferedImage StegoImage = null;
File FileNameOrignal = null;
File FileNameStego = null;
FileNameOrignal = new File("D:\\aexper\\test\\png\\linapng.png");
OrignalImage = ImageIO.read(FileNameOrignal);
FileNameStego = new File("D:\\aexper\\test\\png\\linapngSTEGO.png");
StegoImage = ImageIO.read(FileNameOrignal);
FastBitmap original = new FastBitmap(OrignalImage);
FastBitmap reconstructed = new FastBitmap(StegoImage);
ObjectiveFidelity o;
o = new ObjectiveFidelity(original, reconstructed);
//Error total
int error = o.getTotalError();
//Mean Square Error
double mse = o.getMSE();
//Signal Noise Ratio
double snr = o.getSNR();
//Peak Signal Noise Ratio
double psnr = o.getPSNR();
这是我遇到的错误:
Exception in thread "main" java.lang.NullPointerException at Catalano.Imaging.FastBitmap.getGray(FastBitmap.java:1070)
at Catalano.Imaging.Tools.ObjectiveFidelity.getTotalError(ObjectiveFidelity.java:93)
at findpsnrimage.FindPsnrImage.main(FindPsnrImage.java:46) C:\Users\Ishita\AppData\Local\NetBeans\Cache\8.2\executor- snippets\run.xml:53:
Java returned: 1 BUILD FAILED (total time: 1 second)