OpenJPEG2000 Java OpenJPEGJavaDecoder (seeking ANY(!!) example)

496 views
Skip to first unread message

jkimble

unread,
Aug 16, 2012, 4:31:31 PM8/16/12
to open...@googlegroups.com

I'm trying to convert some j2k (or jp2) JPEG 2000 images to BMP bitmaps (or any more accepted format) for conversion to video using a Java. I'm parsing a datastream from camera source that I need to convert to real time video. I've already done this a couple of different ways using Kakadu and other command line tools. Now I want to the parsing and conversion from a JPEG2000 format to a BMP.

I've been playing with the OpenJPEG utilities and the j2k_to_image program handles the conversion nicely. Within the OpenJPEG sources there's the OpenJPEGJavaDecoder.java and OpenJPEGJavaEncoder.java but no examples and no real guide to using these classes.

What I'm looking for is any example of using this code (or the JAI utilities, or whatever) to convert or manipulate JP2 or J2K images. I've played around but I could do a hundred things and not find the right sequence of steps. If anyone is using this I would be VERY grateful to see some simple decode and image conversion examples.

Thanks!!

Noe Bjn

unread,
Jan 24, 2017, 12:59:56 PM1/24/17
to OpenJPEG, hjki...@gmail.com
Hello,

I am trying to do the same thing but I think I miss Something. If someone can help me it will be great.

my code :
  String openJPEGFilename = "D:\\lib\\openjp2.dll";
        File openJPEGFile = new File( openJPEGFilename );
        if( !openJPEGFile.exists() ) {
            throw new IOException( "The open jpeg file " + openJPEGFilename + " does not exist." );
        } // if
        LoggerDecoder logg = new LoggerDecoder();
        OpenJPEGJavaDecoder decoder = new OpenJPEGJavaDecoder( openJPEGFilename, logg );
         String[] argumentsForTheDecoder = new String[4];
         argumentsForTheDecoder[0] = new String( "-i" );//
         argumentsForTheDecoder[1] = new String( "D:\\Users\\VP-jp2\\fullmoon.jp2" );// -i input
         argumentsForTheDecoder[2] = new String( "-o" );//
         argumentsForTheDecoder[3] = new String( "D:\\Users\\VP-jp2\\fullmoontest.png" );// -o output
        decoder.setDecoderArguments( argumentsForTheDecoder );
        int res = decoder.decodeJ2KtoImage();
        System.out.println( "resultat : " + res );

When I execute this code I have an error :
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.openJpeg.OpenJPEGJavaDecoder.internalDecodeJ2KtoImage([Ljava/lang/String;)I
 at org.openJpeg.OpenJPEGJavaDecoder.internalDecodeJ2KtoImage(Native Method)


Thanks.
Noe
Reply all
Reply to author
Forward
0 new messages