Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i in range (0, edges.height):
- for j in range (0, edges.width):
- # perpendicular = math.atan2(dx[i][j], dy[i][j])
- perpendicular = float (math.atan2(cv.Get2D(dx, i, j)[0], cv.Get2D(dy, i, j)[0]))
- slope = math.tan(math.pi/2.0 + perpendicular)
- for cy in range (0, edges.height):
- cx = int ((i-cy)*-1*slope / math.pow(a, 2) + j)
- ry = int (math.sqrt(a*a*math.pow(j-cx, 2) + math.pow(i-cy, 2)))
- if cx >= 0 and cx < edges.width and cy >= 0 and cy < edges.height and ry <= edges.height/2 :
- votes[cx][cy][ry] += 1
- if votes[cx][cy][ry] > maxVote:
- maxVote = votes[cx][cy][ry]
- maxCx = cx
- maxCy = cy
- maxRy = ry
Add Comment
Please, Sign In to add comment