java.awt.color.CMMException: General CMM error528

339 Views Asked by At

I'm developing a neural network to recognize certain images. The code was working fine until I started adding more images from different sources to create data sets. I get the following error:

Exception in thread "main" java.awt.color.CMMException: General CMM error528
at sun.java2d.cmm.kcms.CMM.checkStatus(Unknown Source)
at sun.java2d.cmm.kcms.ICC_Transform.colorConvert(Unknown Source)
at java.awt.image.ColorConvertOp.ICCBIFilter(Unknown Source)
at java.awt.image.ColorConvertOp.filter(Unknown Source)
at com.NeuralNetwork.catRecognition.Data.convertToGrayScale(Data.java:96)

The error occurs in the method responsible for converting an image from RGB to gray scale:

public BufferedImage convertToGrayScale(BufferedImage source) {
    BufferedImageOp op = new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null);
    return op.filter(source, null); // This is line 96 causing the issue
}

I can't seem to find any information about the error. It's obviously something to do with the images, since removing a lot of the images resolves the issue, but I can't do a trial and error procedure to find the pictures I can use when I'm working with thousands of images.

Anyone seen this error or knows what causes it?

1

There are 1 best solutions below

0
On BEST ANSWER

I actually got this to work now. I did two things so I'm not sure which one helped resolve the issue.

  1. I noticed that I was using the 32-bit JRE (under program files (x86) in Windows), so I configured Eclipse to point to the 64-bit JRE path (under program files).
  2. I applied the latest update for Java 7 so now I'm using java 1.7.0_67-b01

After these two changes, I ran the program again reading the exact same images that caused the issue and the application worked fine.