Updated for svn revision 2345. Two more tests passing.

This commit is contained in:
jevans 2013-07-14 11:55:29 -04:00
commit 6e0e982ae2
3 changed files with 19 additions and 28 deletions

View file

@ -18,8 +18,8 @@ Glymur works on Python 2.6, 2.7, and 3.3. Python 3.3 is strongly recommended.
OpenJPEG Installation
=====================
The OpenJPEG library version must be 1.3, 1.4, 1.5, or the trunk/development
version of OpenJPEG. Version 2.0.0 or versions earlier than 1.3.0
The OpenJPEG library version should be 1.4, 1.5, or the trunk/development
version of OpenJPEG. The official 2.0.0 release or versions earlier than 1.3.0
are not supported. Furthermore, the 1.4 and 1.5 versions of OpenJPEG are
currently only utilized for read-only purposes. For more information
about OpenJPEG, please consult http://www.openjpeg.org.
@ -55,5 +55,5 @@ You can run the tests from within python as follows::
>>> glymur.runtests()
Many tests are currently skipped; in fact most of them are skipped if you
are relying on OpenJPEG 1.3, 1.4, or 1.5. The important thing, though, is whether or
are relying on OpenJPEG 1.4 or 1.5. The important thing, though, is whether or
not any tests fail.

View file

@ -107,7 +107,6 @@ class TestSuite(unittest.TestCase):
self.assertTrue(peak_tolerance(jpdata[:, :, 2], pgxdata) < 33)
self.assertTrue(mse(jpdata[:, :, 2], pgxdata) < 55.8)
@unittest.skip("Known failure in OPENJPEG test suite.")
def test_ETS_C0P0_p0_05_j2k(self):
jfile = os.path.join(data_root, 'input/conformance/p0_05.j2k')
jp2k = Jp2k(jfile)
@ -119,17 +118,19 @@ class TestSuite(unittest.TestCase):
self.assertTrue(peak_tolerance(jpdata[0], pgxdata) < 54)
self.assertTrue(mse(jpdata[0], pgxdata) < 68)
@unittest.skip("Known failure in OPENJPEG test suite.")
@unittest.skip("8-bit pgx data vs 12-bit j2k data")
def test_ETS_C0P0_p0_06_j2k(self):
jfile = os.path.join(data_root, 'input/conformance/p0_06.j2k')
jp2k = Jp2k(jfile)
jpdata = jp2k.read(rlevel=3)
jpdata = jp2k.read_bands(rlevel=3)
pgxfile = os.path.join(data_root,
'baseline/conformance/c0p0_06.pgx')
pgxdata = read_pgx(pgxfile)
self.assertTrue(peak_tolerance(jpdata[:, :, 0], pgxdata) < 109)
self.assertTrue(mse(jpdata[:, :, 0], pgxdata) < 743)
tol = peak_tolerance(jpdata[0], pgxdata)
self.assertTrue(tol < 109)
m = mse(jpdata[0], pgxdata)
self.assertTrue(m < 743)
@unittest.skip("Known failure in OPENJPEG test suite.")
def test_ETS_C0P0_p0_07_j2k(self):
@ -144,7 +145,7 @@ class TestSuite(unittest.TestCase):
self.assertTrue(peak_tolerance(jpdata[:, :, 0], pgxdata) < 10)
self.assertTrue(mse(jpdata[:, :, 0], pgxdata) < 0.34)
@unittest.skip("Known failure in OPENJPEG test suite.")
@unittest.skip("8-bit pgx data vs 12-bit j2k data")
def test_ETS_C0P0_p0_08_j2k(self):
jfile = os.path.join(data_root, 'input/conformance/p0_08.j2k')
jp2k = Jp2k(jfile)
@ -215,7 +216,7 @@ class TestSuite(unittest.TestCase):
'baseline/conformance/c0p0_13.pgx')
pgxdata = read_pgx(pgxfile)
np.testing.assert_array_equal(jpdata, pgxdata)
np.testing.assert_array_equal(jpdata[:,:,0], pgxdata)
@unittest.skip("Known failure in OPENJPEG test suite.")
def test_ETS_C0P0_p0_14_j2k(self):
@ -284,27 +285,20 @@ class TestSuite(unittest.TestCase):
'baseline/conformance/c0p1_02.pgx')
pgxdata = read_pgx(pgxfile)
print(peak_tolerance(jpdata[:, :, 0], pgxdata))
print(peak_tolerance(jpdata[:, :, 1], pgxdata))
print(peak_tolerance(jpdata[:, :, 2], pgxdata))
self.assertTrue(peak_tolerance(jpdata[:, :, 0], pgxdata) < 35)
self.assertTrue(mse(jpdata[:, :, 0], pgxdata) < 74)
@unittest.skip("Known failure in OPENJPEG test suite operation.")
def test_ETS_C0P1_p1_03_j2k(self):
jfile = os.path.join(data_root, 'input/conformance/p1_03.j2k')
jp2k = Jp2k(jfile)
jpdata = jp2k.read(rlevel=3)
jpdata = jp2k.read_bands(rlevel=3)
pgxfile = os.path.join(data_root,
'baseline/conformance/c0p1_03.pgx')
pgxdata = read_pgx(pgxfile)
print(peak_tolerance(jpdata[:, :, 0], pgxdata))
print(peak_tolerance(jpdata[:, :, 1], pgxdata))
print(peak_tolerance(jpdata[:, :, 2], pgxdata))
self.assertTrue(peak_tolerance(jpdata[:, :, 0], pgxdata) < 28)
self.assertTrue(mse(jpdata[:, :, 0], pgxdata) < 18.8)
self.assertTrue(peak_tolerance(jpdata[0], pgxdata) < 28)
self.assertTrue(mse(jpdata[0], pgxdata) < 18.8)
@unittest.skip("Known failure in OPENJPEG test suite operation.")
def test_ETS_C0P1_p1_04_j2k(self):
@ -364,20 +358,17 @@ class TestSuite(unittest.TestCase):
self.assertTrue(peak_tolerance(jpdata[:, :, 0], pgxdata) < 128)
self.assertTrue(mse(jpdata[:, :, 0], pgxdata) < 16384)
@unittest.skip("Known failure in OPENJPEG test suite operation.")
@unittest.skip("fprintf stderr output in r2345.")
def test_ETS_C0P1_p1_07_j2k(self):
jfile = os.path.join(data_root, 'input/conformance/p1_07.j2k')
jp2k = Jp2k(jfile)
jpdata = jp2k.read(rlevel=0)
jpdata = jp2k.read_bands(rlevel=0)
pgxfile = os.path.join(data_root,
'baseline/conformance/c0p1_07.pgx')
pgxdata = read_pgx(pgxfile)
# This one works.
np.testing.assert_array_equal(jpdata[:, :, 0], pgxdata)
# This one does not.
np.testing.assert_array_equal(jpdata[:, :, 1], pgxdata)
np.testing.assert_array_equal(jpdata[0], pgxdata)
def test_ETS_C1P0_p0_01_j2k(self):
jfile = os.path.join(data_root, 'input/conformance/p0_01.j2k')

View file

@ -9,11 +9,11 @@
| | | | | tests should pass. |
+---------+--------+--------+--------+---------------------------------------+
| Mac | | X | | MacPorts with both OpenJPEG 1.5.1 |
| | | | | and OpenJPEG svn. 370 of 450 tests |
| | | | | and OpenJPEG svn. 372 of 450 tests |
| | | | | should pass. |
+---------+--------+--------+--------+---------------------------------------+
| Mac | | | X | MacPorts with both OpenJPEG 1.5.1 |
| | | | | and OpenJPEG svn. 390 of 450 |
| | | | | and OpenJPEG svn. 392 of 450 |
| | | | | tests should pass. |
+---------+--------+--------+------------------------------------------------+
| Fedora | | | X | Ships with 1.5.1. 390 of 450 tests |