Export to GitHub

openjpeg - issue #21

conformance: openjpeg fails to decode p0_06.j2k properly


Posted on Mar 24, 2010 by Quick Monkey

I have sent you already two reports concerning the problem that 'j2k_to_image' does not correctly handle a tiled image.

The (sent) image 'p0_06.j2k' contains 4 tiles:

j2k_to_imge -i p0_06.j2k -o p0_06.ppm

creates 4 PPM images.

Reading ISO/IEC FCD15444-1 : 2000(V1.0, 16 March 2000), I am sure that a tiled image is what PNG calls an interlaced image: only if all components are combined, a single image becomes visible.

But the image 'p0_06.j2k' shows that the library does not handle tiling correctly: the fourth PPM image is upside down.

So it seems that

  1. the tiling algorithm of the library must be repaired.

  2. codec/convert.c must be repaired to combine all tiles such that finally one image is created.

The attached file convert_tile.c.7z is a proposal only. It uses 'imagetopnm' to combine the first three (!) tiles of 'p0_06.j2k':

j2k_to_imge -i p0_06.j2k -o p0_06.ppm

The resulting single PPM file is a fairly good approximation.

winfried

Attachments

Comment #1

Posted on Mar 12, 2013 by Massive Wombat

Hi What is the status of this issue with the last version of openjpeg? Best Mickaël

Comment #2

Posted on Mar 13, 2013 by Grumpy Elephant

Unchanged.

Maybe all 4 images are separated from another.

winfried

Comment #3

Posted on Feb 26, 2014 by Helpful Giraffe

I do not agree with OP outputting multiple PPMs should be fine AFAIK. There only one thing that surprises me is that kakadu does not output the same raw output as openjpeg. Hence I am leaving it open for now.

Comment #4

Posted on Feb 27, 2014 by Helpful Giraffe

Ok, openjpeg trunk does not handle them properly:

$ ./bin/opj_decompress -i p0_06.j2k -o opj.pgx

[INFO] Start to read j2k main header (0). [INFO] Main header has been correctly decoded. [INFO] No decoded area parameters, set the decoded area to the whole image [INFO] Header of tile 0 / 0 has been read. [INFO] Tile 1/1 has been decoded. [INFO] Image data has been updated with tile 1.

Generated Outfile opj.pgx $ ls -al opj_?.pgx -rw-r--r-- 1 mathieu mathieu 132373 févr. 27 09:30 opj_0.pgx -rw-r--r-- 1 mathieu mathieu 66325 févr. 27 09:30 opj_1.pgx -rw-r--r-- 1 mathieu mathieu 66708 févr. 27 09:30 opj_2.pgx -rw-r--r-- 1 mathieu mathieu 33428 févr. 27 09:30 opj_3.pgx $ crc32 opj_?.pgx 83403a5d opj_0.pgx 209bd058 opj_1.pgx a7982a19 opj_2.pgx 294eb092 opj_3.pgx

while it should be:

$ ls -al c1p0_06* -rwxr--r-- 1 mathieu mathieu 132371 déc. 26 2001 c1p0_06_0.pgx -rwxr--r-- 1 mathieu mathieu 66323 déc. 26 2001 c1p0_06_1.pgx -rwxr--r-- 1 mathieu mathieu 66706 déc. 26 2001 c1p0_06_2.pgx -rwxr--r-- 1 mathieu mathieu 33426 déc. 26 2001 c1p0_06_3.pgx $ crc32 c1p0_06* 69982899 c1p0_06_0.pgx 10625068 c1p0_06_1.pgx 84501548 c1p0_06_2.pgx f3742ab5 c1p0_06_3.pgx

Comment #5

Posted on Feb 27, 2014 by Helpful Giraffe

(No comment was entered for this change.)

Comment #6

Posted on Mar 3, 2014 by Helpful Giraffe

All tests are now passing nicely:

The following tests passed: ETS-C1P0-p0_06.j2k-decode ETS-C1P0-p0_06.j2k-compare2ref NR-C1P0-p0_06.j2k-compare2base NR-p0_06.j2k-dump NR-p0_06.j2k-compare_dump2base

100% tests passed, 0 tests failed out of 5

Comment #7

Posted on Mar 24, 2014 by Happy Rabbit

(No comment was entered for this change.)

Status: Fixed

Labels:
Type-Defect Priority-High Milestone-Release2.1 Conformance