File: ticket_6.py

package info (click to toggle)
opencv 2.1.0-3%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 68,800 kB
  • ctags: 52,010
  • sloc: cpp: 554,793; xml: 475,942; ansic: 153,396; python: 18,622; sh: 428; makefile: 111
file content (16 lines) | stat: -rw-r--r-- 476 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import urllib
import cv
import Image
import unittest

class TestLoadImage(unittest.TestCase):
    def setUp(self):
        open("large.jpg", "w").write(urllib.urlopen("http://www.cs.ubc.ca/labs/lci/curious_george/img/ROS_bug_imgs/IMG_3560.jpg").read())

    def test_load(self):
        pilim = Image.open("large.jpg")
        cvim = cv.LoadImage("large.jpg")
        self.assert_(len(pilim.tostring()) == len(cvim.tostring()))

if __name__ == '__main__':
    unittest.main()