parameters: (pt,plane,show=False)
docstring: Visualize the RANSAC PLANE (4-tuple) fit to PT (nx3 array).
      Also draws teh normal.
docstring_summary: Visualize the RANSAC PLANE (4-tuple) fit to PT (nx3 array).
      Also draws teh normal.
docstring_tokens: Visualize the RANSAC PLANE ( 4 - tuple ) fit to PT ( nx3 array ) . Also draws teh normal .
function: def visualize_plane(pt,plane,show=False):
      """
      Visualize the RANSAC PLANE (4-tuple) fit to PT (nx3 array).
      Also draws teh normal.
      """
      # # plot the point-cloud:
      if show and mym.gcf():
          mym.clf()
  
      # plot the plane:
      plane_eq = '%f*x+%f*y+%f*z+%f'%tuple(plane.tolist())
      m,M = np.percentile(pt,[10,90],axis=0)
      implicit_plot(plane_eq, (m[0],M[0],m[1],M[1],m[2],M[2]))
  
      # plot surface normal:
      mu = np.percentile(pt,50,axis=0)
      mu_z = -(mu[0]*plane[0]+mu[1]*plane[1]+plane[3])/plane[2]
      mym.quiver3d(mu[0],mu[1],mu_z,plane[0],plane[1],plane[2],scale_factor=0.3)
  
      if show:
          mym.view(180,180)
          mym.orientation_axes()
          mym.show(True)
function_tokens: def visualize_plane ( pt , plane , show = False ) : # # plot the point-cloud: if show and mym . gcf ( ) : mym . clf ( ) # plot the plane: plane_eq = '%f*x+%f*y+%f*z+%f' % tuple ( plane . tolist ( ) ) m , M = np . percentile ( pt , [ 10 , 90 ] , axis = 0 ) implicit_plot ( plane_eq , ( m [ 0 ] , M [ 0 ] , m [ 1 ] , M [ 1 ] , m [ 2 ] , M [ 2 ] ) ) # plot surface normal: mu = np . percentile ( pt , 50 , axis = 0 ) mu_z = - ( mu [ 0 ] * plane [ 0 ] + mu [ 1 ] * plane [ 1 ] + plane [ 3 ] ) / plane [ 2 ] mym . quiver3d ( mu [ 0 ] , mu [ 1 ] , mu_z , plane [ 0 ] , plane [ 1 ] , plane [ 2 ] , scale_factor = 0.3 ) if show : mym . view ( 180 , 180 ) mym . orientation_axes ( ) mym . show ( True )