DiegoCatalano / Catalano-Framework

Framework
GNU Lesser General Public License v3.0
295 stars 99 forks source link

Getting Null pointer Exception on image's getGray while calculating difference between two images #27

Closed deepsidhu1313 closed 8 years ago

deepsidhu1313 commented 8 years ago

Hi,

I am newbie to image processing and i am using this framework for first time.

I am getting null pointer exception when your code try to access gray of the image Exception in thread "main" java.lang.NullPointerException at Catalano.Imaging.FastBitmap.getGray(FastBitmap.java:942) at Catalano.Imaging.Tools.ObjectiveFidelity.getMSE(ObjectiveFidelity.java:122) at qualityanalysis.QualityAnalysis.calculate(QualityAnalysis.java:44) at qualityanalysis.QualityAnalysis.main(QualityAnalysis.java:105)

I am using simple code mentioned here in the answer.

deepsidhu1313 commented 8 years ago

Sorry got the answer in the comment below. Thanks :). BTW isn't there anything which converts the image automatically while comparing, like

if(!isGrayscale() || getGraydata==null){ this.toGrayscale() }

because you are comparing gray to compute the error.