Your buffered image seems to be of a type unsupported by Processing.
Relevant code in the PImage source:
Code:
pixels = new int[width * height];
WritableRaster raster = bi.getRaster();
raster.getDataElements(0, 0, width, height, pixels);
As you can see, it calls getDataElements with an array of ints (color information on 24/32 bits).
The error message says Java can't cast this array of ints (the [I part) to an array of bytes (the [B).
If I look at
WritableRaster reference, I see getDataElements actually just expect an Object, which makes quite some room for interpretation for the sub-classes... The one you provide (your library provides...) is ByteInterleavedRaster which implies, well, it is based on an array of bytes!
It might be because you feed the BufferedImage with indexed colors, gray levels, or because that's just how it is implemented (eg. using 3 bytes per pixel (I doubt the scanner provides transparency information...)).
So I think you need to convert your BufferedImage to a compatible one, eg. by creating a new compatible one and drawing the old one in it.