def plot_features(im, locs, circle=False):
 def draw_circle(c, r):
  t = ((arange(0, 1.01, 0.01) * 2) * pi)
  x = ((r * cos(t)) + c[0])
  y = ((r * sin(t)) + c[1])
  plot(x, y, 'b', linewidth=2)
 imshow(im)
 if circle:
  for p in locs:
   draw_circle(p[:2], p[2])
 else:
  plot(locs[:, 0], locs[:, 1], 'ob')
 axis('off')

def plot_features ( im , locs , circle = False ) : def draw_circle ( c , r ) : t = ( ( arange ( 0 , 1.01 , 0.01 ) * 2 ) * pi ) x = ( ( r * cos ( t ) ) + c [ 0 ] ) y = ( ( r * sin ( t ) ) + c [ 1 ] ) plot ( x , y , 'b' , linewidth = 2 ) imshow ( im ) if circle : for p in locs : draw_circle ( p [ : 2 ] , p [ 2 ] ) else : plot ( locs [ : , 0 ] , locs [ : , 1 ] , 'ob' ) axis ( 'off' )
show image with features .