Skip to content

Commit

Permalink
draw line connecting points in objects
Browse files Browse the repository at this point in the history
  • Loading branch information
SWiT committed Apr 15, 2012
1 parent 602e506 commit 7020246
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rfcarena.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def displayPts ():
objectIndex += 1
if objectIndex >= len(objectsColorCode):
objectIndex = 0
objectPntIndex = 0
print ""
print "------------------------------"
print "Color: "+objectsColorName[objectIndex]
Expand Down Expand Up @@ -163,11 +164,25 @@ def displayPts ():
#Draw points on output
objIndex = 0
for objPts in objectsPts:
px = 0
py = 0
i = 0
s = objectsPts.shape
li = (s[1]-1) #last index
for x,y in objPts:
x = int(x)
y = int(y)
if x>0 or y>0:
cv2.circle(outputImg, (x,y), 3, objectsColorCode[objIndex], -1, 8, 0)
if px>0 or py>0:
cv2.line(outputImg, (px,py), (x,y), objectsColorCode[objIndex], 1)
elif (objPts[li][0]>0 or objPts[li][1]>0):
px = objPts[li][0]
py = objPts[li][1]
cv2.line(outputImg, (px,py), (x,y), objectsColorCode[objIndex], 1)
px = x
py = y
i += 1
objIndex+=1

if drawing:
Expand Down

0 comments on commit 7020246

Please sign in to comment.