- 703 名前:デフォルトの名無しさん [2020/07/30(木) 21:01:34.87 ID:sKox1nf30.net]
- import numpy as np
import cv2 def norm(v, m, s, t): return np.uint8(0) img = cv2.imread("hoge.jpg") hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) h,s,v = cv2.split(hsv) print("about: h=====================") print(type(h), type(h[0][0]), h, h.shape, sep='\n') f = np.frompyfunc(norm, 4, 1) H = f(h, np.mean(h), np.std(h), img.dtype) print("about: H=====================") print(type(H), type(H[0][0]), H, H.shape, sep='\n') height, width = img.shape[:2] Z = np.zeros((height, width), np.uint8) print("about: Z=====================") print(type(Z), type(Z[0][0]), Z, Z.shape, sep='\n') h_img = cv2.merge((Z, h, h))
|

|