Mercurial Hosting > traffic-intelligence
comparison python/cvutils.py @ 156:2eef5620c0b3
added key values for opencv
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 08 Sep 2011 19:24:42 -0400 |
parents | 668710d4c773 |
children | 115f7f90286d |
comparison
equal
deleted
inserted
replaced
155:f03fe3d6d0c8 | 156:2eef5620c0b3 |
---|---|
21 cvGreen = (0,255,0) | 21 cvGreen = (0,255,0) |
22 cvBlue = (255,0,0) | 22 cvBlue = (255,0,0) |
23 cvColors = utils.PlottingPropertyValues([cvRed, | 23 cvColors = utils.PlottingPropertyValues([cvRed, |
24 cvGreen, | 24 cvGreen, |
25 cvBlue]) | 25 cvBlue]) |
26 | |
27 cvKeyNumbers = {'a':1048673, | |
28 'n': 1048686, | |
29 'y': 1048697} | |
26 | 30 |
27 def drawLines(filename, origins, destinations, w = 1, resultFilename='image.png'): | 31 def drawLines(filename, origins, destinations, w = 1, resultFilename='image.png'): |
28 '''Draws lines over the image ''' | 32 '''Draws lines over the image ''' |
29 | 33 |
30 img = Image.open(filename) | 34 img = Image.open(filename) |
156 if d < maxTranslation2: | 160 if d < maxTranslation2: |
157 delta.append(dp) | 161 delta.append(dp) |
158 if len(delta) >= minNMatches: | 162 if len(delta) >= minNMatches: |
159 return median(delta, axis=0) | 163 return median(delta, axis=0) |
160 else: | 164 else: |
165 print(dp) | |
161 return None | 166 return None |