original_docstring:  Takes an object and a projection matrix (P) and projects the 3d
          object orientation vector into the image plane.
          Returns:
              orientation_2d: (2,2) array in left image coord.
              orientation_3d: (2,3) array in in rect camera coord.
      
docstring: Takes an object and a projection matrix (P) and projects the 3d
  object orientation vector into the image plane.
docstring_tokens: Takes an object and a projection matrix ( P ) and projects the 3d object orientation vector into the image plane .
code: def compute_orientation_3d(obj, P=None):
      ''' Takes an object and a projection matrix (P) and projects the 3d
          object orientation vector into the image plane.
          Returns:
              orientation_2d: (2,2) array in left image coord.
              orientation_3d: (2,3) array in in rect camera coord.
      '''
      # compute rotational matrix around yaw axis
      R = roty(obj.ry)
      # orientation in object coordinate system
      orientation_3d = np.array([[0.0, obj.l], [0, 0], [0, 0]])
      # rotate and translate in camera coordinate system, project in image
      orientation_3d = np.dot(R, orientation_3d)
      orientation_3d[0, :] = orientation_3d[0, :] + obj.t[0]
      orientation_3d[1, :] = orientation_3d[1, :] + obj.t[1]
      orientation_3d[2, :] = orientation_3d[2, :] + obj.t[2]
  
      if P is None:
          orientation_2d = None
          orientation_3d = np.transpose(orientation_3d)
          orientation_3d[:, 1] = orientation_3d[:, 1] - obj.h
          return orientation_2d, orientation_3d
  
      # vector behind image plane?
      if np.any(orientation_3d[2, :] < 0.1):
          orientation_2d = None
          return orientation_2d, np.transpose(orientation_3d)
      # project orientation into the image plane
  
      orientation_2d = project_to_image(np.transpose(orientation_3d), P)
      return orientation_2d, np.transpose(orientation_3d)
code_tokens: def compute_orientation_3d ( obj , P = None ) : R = roty ( obj . ry ) orientation_3d = np . array ( [ [ 0.0 , obj . l ] , [ 0 , 0 ] , [ 0 , 0 ] ] ) orientation_3d = np . dot ( R , orientation_3d ) orientation_3d [ 0 , : ] = orientation_3d [ 0 , : ] + obj . t [ 0 ] orientation_3d [ 1 , : ] = orientation_3d [ 1 , : ] + obj . t [ 1 ] orientation_3d [ 2 , : ] = orientation_3d [ 2 , : ] + obj . t [ 2 ] if P is None : orientation_2d = None orientation_3d = np . transpose ( orientation_3d ) orientation_3d [ : , 1 ] = orientation_3d [ : , 1 ] - obj . h return orientation_2d , orientation_3d if np . any ( orientation_3d [ 2 , : ] < 0.1 ) : orientation_2d = None return orientation_2d , np . transpose ( orientation_3d ) orientation_2d = project_to_image ( np . transpose ( orientation_3d ) , P ) return orientation_2d , np . transpose ( orientation_3d )
short_docstring: Takes an object and a projection matrix (P) and projects the 3d
  object orientation vector into the image plane.
short_docstring_tokens: Takes an object and a projection matrix ( P ) and projects the 3d object orientation vector into the image plane .
comment: ''' Takes an object and a projection matrix (P) and projects the 3d
          object orientation vector into the image plane.
          Returns:
              orientation_2d: (2,2) array in left image coord.
              orientation_3d: (2,3) array in in rect camera coord.
      '''$SEP$# compute rotational matrix around yaw axis$SEP$# orientation in object coordinate system$SEP$# rotate and translate in camera coordinate system, project in image$SEP$# vector behind image plane?$SEP$# project orientation into the image plane