def compareFittingH(houghLine): p0, pl = houghLine linhas = n.walkInLine(p0[0],p0[1],pl[0],pl[1],mag.astype("float"),edges.astype("float")) linhas2 = n.walkInLine2(p0[0],p0[1],pl[0],pl[1],mag.astype("float"),edges.astype("float")) plot(linhas[:,0]-linhas2[:,0]) grid()
lines = skimage.transform.probabilistic_hough(edges,10,50,5) #linha,coluna = nonzero(edges==True) #p0,pl = lines[0] #linhas = n.walkInLine(p0[0],p0[1],pl[0],pl[1],mag.astype("float"),edges.astype("float")) ion() imshow(edges, cm.bone, interpolation='nearest') for p0,pl in lines: linhas = n.walkInLine(p0[0],p0[1],pl[0],pl[1],mag.astype("float"),edges.astype("float")) # linhas2 = n.walkInLine2(p0[0],p0[1],pl[0],pl[1],mag.astype("float"),edges.astype("float")) if len(linhas) != 0: plot(linhas[:,1],linhas[:,0],'-+') # plot(linhas2[:,1],linhas2[:,0],'-d') def compareFittingV(houghLine): p0, pl = houghLine linhas = n.walkInLine(p0[0],p0[1],pl[0],pl[1],mag.astype("float"),edges.astype("float")) linhas2 = n.walkInLine2(p0[0],p0[1],pl[0],pl[1],mag.astype("float"),edges.astype("float")) plot(linhas[:,1]-linhas2[:,1]) grid() def compareFittingH(houghLine): p0, pl = houghLine