Example #1
0
    def test_part1a(self):
        '''part1a on the head'''

        tempdir = tempfile.mkdtemp(prefix='scivis')
        saveas=join(tempdir, 'part1a/')
        cnv.part1a(filename='data/head-16.png', saveas=saveas, aspect=(1,1))
        for op in ['dx', 'dy', 'gm']:
            self.assertArraysSimilar(1, 
                    cnv.png_to_ndarray('data/head-%s.png' % op), 
                    cnv.igreyscale(cnv.png_to_ndarray('%s/%s.png' % (saveas, op)), max=255))
        rmtree(tempdir)
Example #2
0
    def test_convolve_png(self):
        '''convolve phoenix head, x-axis'''

        expected = cnv.png_to_ndarray('data/head-dx.png')
        A = cnv.convolve_png('data/head-16.png', cnv.first_d)
        self.assertArraysSimilar(1, cnv.igreyscale(A, max=255), expected)