他の使用tf.image.adjust_brightness

tensorflow TF ASインポート
インポートnumpyのAS NP
インポートCV2 AS CV
インポートAS PLT matplotlib.pyplot
セッション数= tf.Session()
NAME = '.. /メイン/ 0.jpg'の相対位置#
とIMG = tf.read_file(名)位TFは、画像の読み取り
文字の画像の読み取りが復号化するためのimg = tf.image.decode_image(IMG)#を
img_shape = sess.run(IMG)#だけでは画像データを取得することができますコマンドを実行します
img_shape = img_shape.shape#GET画像形状を
img_sha = tf.reshape(IMG、[1 、img_shape [0]、img_shape [1]、img_shape [2])#のコントラスト関数tf.image.adjust_brightnessバルクバルク処理液TFため
new_img = tf.image.adjust_brightness(img_sha、0.5) #0.5 〜0.5倍のときにコントラスト低下-0.5 0.5倍のコントラスト強調
new_img = sess.run(new_img)
new_img new_img.reshape =((img_shape [0]、img_shape [ 1]、img_shape [2]))
new_img = np.array(new_img、np.uint8)


cv.imshow( 'DD'、new_img)
cv.waitKey()

おすすめ

転載: www.cnblogs.com/tangjunjun/p/11817095.html