(raw_flow,bound)
return flow
this function scale the input pixels to 0-255 with bi-bound

    :param raw_flow: input raw pixel value (not in 0-255)
    :param bound: upper and lower bound (-bound, bound)
    :return: pixel value scale from 0 to 255
this function scale the input pixels to 0-255 with bi-bound
this function scale the input pixels to 0 - 255 with bi - bound
def ToImg(raw_flow,bound):
    '''
    this function scale the input pixels to 0-255 with bi-bound

    :param raw_flow: input raw pixel value (not in 0-255)
    :param bound: upper and lower bound (-bound, bound)
    :return: 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
def ToImg ( raw_flow , bound ) : flow = raw_flow flow [ flow > bound ] = bound flow [ flow < - bound ] = - bound flow -= - bound flow *= ( 255 / float ( 2 * bound ) ) return flow