def ToImg(raw_flow,bound):
    """Scale the input pixels to 0-255 with bi-bound
    
    Args:
        param raw_flow: input raw pixel value (not in 0-255)
        param bound: upper and lower bound (-bound, bound)
    Returns:
        pixel value scale from 0 to 255
    """
    flow=raw_flow
    flow[flow>bound]=bound
    flow[flow<-bound]=-bound
    flow-=-bound
    flow*=(255/float(2*bound))
    return flow