Hello everybody,

I've got a problem using the ColorConvertOp in a Motion Detection
Application :

im getting the image as a raw byte[] out of an MJPEG stream and i only know
that its JPEG, nothing else is known (Compression, Resolution, Progressive
or Interlaced...), since im working with different cameras.

then im using a ByteArrayInputStream and ImageIO Interface (already tried
Swing's ImageIcon too) to get it as an BufferedImage and afterwards i want
to convert it to grayscale, which throws the attached pid in the
java.awt.image.ColorConvertOp.filter() Method.


        ByteArrayInputStream bis = new ByteArrayInputStream( byte[] );
        BufferedImage bg = ImageIO.read(bis);
        background = FilterImage( gray.filter(bg, null).getData() );


gray is the ColorConversion to grayscale, as described in the book, but
declared globally before as:

        gray = new
ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null);

In worst case this happens every 30 Min, "best" case was about a week
without a crash, so its very hard to reproduce the exact case. Though i
think it might be a problem with the different cameratypes or an internal
stack / memory buffer.

I already tried to avoid all BufferedImageOps and used RasterOps instead (
Filterimage uses only RasterOps, as all the Methods after this one operate
only on the Raster ), but i cannot do Colorspace Operations on the Raster
only.

Of course im always open for suggestions especially if you know any other
methods or code running faster or more efficiently

Please help me!!

best regards

Thomas

 <<hs_err_pid3084.log>>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Attachment: hs_err_pid3084.log
Description: Binary data

Reply via email to