code: def bilateral2(data, fSize, sigma_p, sigma_x = 10.):
      
      
      dtype = data.dtype.type
      dtypes_kernels = {np.float32:"bilat2_float",
                          np.uint16:"bilat2_short"}
  
      if not dtype in dtypes_kernels:
          logger.info("data type %s not supported yet (%s), casting to float:"%(dtype,list(dtypes_kernels.keys())))
          data = data.astype(np.float32)
          dtype = data.dtype.type
  
  
      img = OCLImage.from_array(data)
      res = OCLArray.empty_like(data)
  
      
      prog = OCLProgram(abspath("kernels/bilateral2.cl"))
  
  
      prog.run_kernel(dtypes_kernels[dtype],
                      img.shape,None,
                      img,res.data,
                      np.int32(img.shape[0]),np.int32(img.shape[1]),
                      np.int32(fSize),np.float32(sigma_x),np.float32(sigma_p))
  
  
      return res.get()
docs: bilateral filter