(flows,image,save_dir,num,bound)
return 0
To save the optical flow images and raw images
    :param flows: contains flow_x and flow_y
    :param image: raw image
    :param save_dir: save_dir name (always equal to the video id)
    :param num: the save id, which belongs one of the extracted frames
    :param bound: set the bi-bound to flow images
    :return: return 0
To save the optical flow images and raw images
    :param flows: contains flow_x and flow_y
    :param image: raw image
    :param save_dir: save_dir name (always equal to the video id)
    :param num: the save id, which belongs one of the extracted frames
    :param bound: set the bi-bound to flow images
    :return: return 0
To save the optical flow images and raw images : param flows : contains flow_x and flow_y : param image : raw image : param save_dir : save_dir name ( always equal to the video id ) : param num : the save id which belongs one of the extracted frames : param bound : set the bi - bound to flow images : return : return 0
def save_flows(flows,image,save_dir,num,bound):
    '''
    To save the optical flow images and raw images
    :param flows: contains flow_x and flow_y
    :param image: raw image
    :param save_dir: save_dir name (always equal to the video id)
    :param num: the save id, which belongs one of the extracted frames
    :param bound: set the bi-bound to flow images
    :return: return 0
    '''
    #rescale to 0~255 with the bound setting
    flow_x=ToImg(flows[...,0],bound)
    flow_y=ToImg(flows[...,1],bound)
    if not os.path.exists(os.path.join(data_root,new_dir,save_dir)):
        os.makedirs(os.path.join(data_root,new_dir,save_dir))

    #save the image
    save_img=os.path.join(data_root,new_dir,save_dir,'img_{:05d}.jpg'.format(num))
    scipy.misc.imsave(save_img,image)

    #save the flows
    save_x=os.path.join(data_root,new_dir,save_dir,'flow_x_{:05d}.jpg'.format(num))
    save_y=os.path.join(data_root,new_dir,save_dir,'flow_y_{:05d}.jpg'.format(num))
    flow_x_img=Image.fromarray(flow_x)
    flow_y_img=Image.fromarray(flow_y)
    scipy.misc.imsave(save_x,flow_x_img)
    scipy.misc.imsave(save_y,flow_y_img)
    return 0
def save_flows ( flows , image , save_dir , num , bound ) : #rescale to 0~255 with the bound setting flow_x = ToImg ( flows [ ... , 0 ] , bound ) flow_y = ToImg ( flows [ ... , 1 ] , bound ) if not os . path . exists ( os . path . join ( data_root , new_dir , save_dir ) ) : os . makedirs ( os . path . join ( data_root , new_dir , save_dir ) ) #save the image save_img = os . path . join ( data_root , new_dir , save_dir , 'img_{:05d}.jpg' . format ( num ) ) scipy . misc . imsave ( save_img , image ) #save the flows save_x = os . path . join ( data_root , new_dir , save_dir , 'flow_x_{:05d}.jpg' . format ( num ) ) save_y = os . path . join ( data_root , new_dir , save_dir , 'flow_y_{:05d}.jpg' . format ( num ) ) flow_x_img = Image . fromarray ( flow_x ) flow_y_img = Image . fromarray ( flow_y ) scipy . misc . imsave ( save_x , flow_x_img ) scipy . misc . imsave ( save_y , flow_y_img ) return 0