def mp_icon(filename):
 try:
  import pkg_resources
  name = __name__
  if (name == '__main__'):
   name = 'MAVProxy.modules.mavproxy_map.mp_tile'
  stream = pkg_resources.resource_stream(name, ('data/%s' % filename)).read()
  raw = np.fromstring(stream, dtype=np.uint8)
 except Exception:
  stream = open(os.path.join(__file__, 'data', filename)).read()
  raw = np.fromstring(stream, dtype=np.uint8)
 img = cv2.imdecode(raw, cv2.IMREAD_COLOR)
 return img

def mp_icon ( filename ) : try : import pkg_resources name = __name__ if ( name == '__main__' ) : name = 'MAVProxy.modules.mavproxy_map.mp_tile' stream = pkg_resources . resource_stream ( name , ( 'data/%s' % filename ) ) . read ( ) raw = np . fromstring ( stream , dtype = np . uint8 ) except Exception : stream = open ( os . path . join ( __file__ , 'data' , filename ) ) . read ( ) raw = np . fromstring ( stream , dtype = np . uint8 ) img = cv2 . imdecode ( raw , cv2 . IMREAD_COLOR ) return img
load an icon from the data directory .