分享

Tensorflow 读取图片,像素强度,归一化,区间转换为[-1,1]

 雪柳花明 2017-05-02


# -*- coding:utf-8 -*-
import tensorflow as tf
import numpy as np
import cv2

#narry
img_r = cv2.imread('img_r.png')

# img_r=img_r*1.0/255*2-1
img_r=np.float32(img_r)
img_r=(img_r-128)/128


print (img_r)

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多