decoding, joining and encoding j2k images

77 views
Skip to first unread message

jkimble

unread,
May 29, 2012, 11:11:56 AM5/29/12
to OpenJPEG
I'm trying to create a 1080p mj2 video from a series of images that
are broken up as Y and CrCb frames of 1920x540. So I must first merge
the Y and CrCb frames to get color top and bottom 1920x540 frames.
Then I must join the top and bottom merged frames to get the final
1920x1080 HD image. Finally combining them all into an mj2 video.

I've been able to do this with Kakadu but I haven't purchased the libs
(using the command line tools from a script). I prefer to stay open
source and keeping this all in memory instead of reading and writing
to the file system will give me a lot more speed.

I'm able to merge the original Y and CrCb color frames (without
decoding) to get full color j2k frames. I then decode each frame into
3 pgm files of Y, Cr and Cb (kakadu). I get three files for the top
frame and three for the bottom. I then join each of these (Y, Cr, Cb)
into three full frame images (still pgm). I then re-encode them
(Kakadu again) into a single full frame color j2k image. These can
then be turned into an mj2 video easily.

What I need to know is how I can do the decode and encode operations
with OpenJPEG.

I've been trying to do the decode with j2k_to_image as in:

j2k_to_image -i test.j2k -o new.pgm

This gives me a single pgm with only the first component decoded. I
see that I can use the pgx format and get the three components I need,
but I don't know how to work with pgx (to join top and bottom). I can
figure that out but if there's a way to get a pgm file out for each
component that would be ideal.

The next issue is re-encoding. There's certainly more than one way to
do this but I don't know how to get image_to_j2k to do any of them so
here's the next thing I need help with:

1) Recombine all 6 pgx's (Y, Cr, Cb for top and bottom frames) with
the top 3 and bottom 3 frames combined for color and then joined top
to bottom in a single color HD j2k image.

OR

2) I'll join the Y, Cr and Cb frames top to bottom so that I have 3,
full scale (1920x1080) images (pgm or pgx) that then need to be
combined for color and encoded into a single j2k.

OR

3) Some combination of things I'm not aware of... Any suggestions
welcome.

My real goal is to do this totally open source from beginning to end.

Thanks for any help or suggestions!

Mathieu Malaterre

unread,
Jun 7, 2012, 11:07:24 AM6/7/12
to open...@googlegroups.com
Hi,

Have you made any progress on this ?

Thanks
> --
> You are subscribed to the mailing-list of the OpenJPEG project (www.openjpeg.org)
> To post: email to open...@googlegroups.com
> To unsubscribe: email to openjpeg+u...@googlegroups.com
> For more options: visit http://groups.google.com/group/openjpeg
> For more info about OpenJPEG main partners : visit  www.tele.ucl.ac.be (UCL) and www.intopix.com



--
Mathieu

jkimble

unread,
Jun 7, 2012, 12:23:27 PM6/7/12
to OpenJPEG

I went in a different direction. I'm purchasing the Kakadu libs and
will be able to do what I need in that way. I'd prefer an open
solution but I have a time constraint that's not flexible.

I'll continue to work on an open solution and hope to share my
results.

On Jun 7, 11:07 am, Mathieu Malaterre <mathieu.malate...@gmail.com>
wrote:
> > For more options: visithttp://groups.google.com/group/openjpeg
Reply all
Reply to author
Forward
0 new messages