vertices_similarity.py
Go to the documentation of this file.
00001 from __future__ import print_function, division
00002 
00003 from pylab import *
00004 import numpy as np
00005 
00006 from matplotlib.collections import LineCollection
00007 
00008 def plot_edges(edges, **kwargs):
00009     segs = []
00010     for x1, y1, x2, y2 in edges:
00011         segs.append([[x1, y1], [x2, y2]])
00012     col = LineCollection(segs, **kwargs)
00013     ax.add_collection(col)
00014 
00015 
00016 
00017 filt_edges = np.loadtxt('/tmp/filt_edges.dat', delimiter=',')
00018 figure()
00019 ax = gca()
00020 plot_edges(filt_edges)
00021 show()
00022 x = np.hstack((filt_edges[:,0], filt_edges[:,2]))
00023 y = np.hstack((filt_edges[:,1], filt_edges[:,3]))
00024 xy = np.vstack((x, y)).transpose()
00025 for pt in xy:
00026     print(count_nonzero(np.all(pt == xy, axis=1)))
00027 


nj_costmap
Author(s): Gaƫl Ecorchard
autogenerated on Sat Jun 8 2019 20:58:46