0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

γ変換に関しての備忘録

Posted at

γ変換で画像の明るさを変化させる。

#ライブラリをインポートする
import cv2 
import numpy as np

今回はLennaの画像を用います。
Lenna.jpg

img = cv2.imread(r'../Lenna.jpg')

γの値を設定し、γ変換を行っていきます。

gannma = 0.5
cvt_gannma = np.zeros([256,1],dtype=uint8)
for i in range(256):
    cvt_gannma[[i],[0]] = 255 * (float(i) / 255) ** (1.0/gannma)

img_gannma = cv2.LUT(img,cvt_gannma)

γ変換の結果
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?