Ask Your Question

Revision history [back]

Are you certain that filePath1 is correct? I don't have much experience with android, but it looks like you are trying to access something that either does not exist or you don't have permissions to access. If you are reading your image from an SD card, for example, you need to add READ_EXTERNAL_STORAGE permission to your manifest.

Also, this has nothing to do with your error, but when you load the images:

image1 = Highgui.imread(filePath1, Highgui.IMREAD_GRAYSCALE);
image1 = Highgui.imread(filePath2, Highgui.IMREAD_GRAYSCALE);

I guess you mean:

image1 = Highgui.imread(filePath1, Highgui.IMREAD_GRAYSCALE);
image2 = Highgui.imread(filePath2, Highgui.IMREAD_GRAYSCALE);