Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Shih-Yuan Liu committed Jan 7, 2016
2 parents 67a40e8 + aec5690 commit 0e22da0
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ def __checkBounds(self, val, bound):
val = bound-1
return val

def __correctPixelOrdering(self, lines, normals):
for i in range(len(lines)):
x1,y1,x2,y2 = lines[i, :]
dx, dy = normals[i, :]
if (x2-x1)*dy-(y2-y1)*dx<0:
lines[i, :] = [x2,y2,x1,y1]

def __findNormal(self, bw, lines):
normals = []
if len(lines)>0:
Expand All @@ -78,7 +85,9 @@ def __findNormal(self, bw, lines):
if bw[y3,x3]>0 and bw[y4,x4]==0:
normals[cnt,:] = [dx, dy]
else:
normals[cnt,:] = [-dx, -dy]
normals[cnt,:] = [-dx, -dy]

self.__correctPixelOrdering(lines, normals)
return normals

def detectLines(self, bgr, color):
Expand Down

0 comments on commit 0e22da0

Please sign in to comment.