marvin image color difference plugin error

218 views Asked by At

I am getting a null pointer exception whenever i am trying to process two images for color difference. The code is

MarvinImageIO.saveImage(currentFrame, "check1.jpg");
                MarvinImageIO.saveImage(template, "check2.jpg");

                currentFrame=MarvinImageIO.loadImage("check1.jpg");
                template=MarvinImageIO.loadImage("check2.jpg");
 //                 System.out.println(currentFrame.getWidth()+"        "+currentFrame.getHeight()+"      "+template.getWidth()+"   "+template.getHeight());

                scale(currentFrame, template, template.getWidth(),    template.getHeight());

                MarvinImagePlugin diff =       MarvinPluginLoader.loadImagePlugin("org.marvinproject.image.difference.differenc     eColor.jar");
                MarvinAttributes attr = new MarvinAttributes();
                attr.set("total", 0);


                System.out.println(attr.get("total"));
                diff.process(currentFrame, template,attr);

The error is on the diff.process statement. The images are not null and so is the attr.

Error statement is

Exception in thread "Thread-3" java.lang.NullPointerException
at org.marvinproject.image.difference.differenceColor.DifferenceColor.process(DifferenceColor.java:67)
at marvin.plugin.MarvinAbstractImagePlugin.process(MarvinAbstractImagePlugin.java:65)
at censor_player.player$MyThread.run(player.java:142)
0

There are 0 answers