티스토리 뷰
'''
qhy
2018.12.3
'''
import os
import numpy as np
import cv2
ims_path = './photo/sorted_by_data/2022-04-05/' #
ims_list = os.listdir(ims_path)
R_means = []
G_means = []
B_means = []
for im_list in ims_list:
print(ims_list)
im = cv2.imread(ims_path + im_list)
# extrect value of diffient channel
im_R = im[:, :, 0]
im_G = im[:, :, 1]
im_B = im[:, :, 2]
# count mean for every channel
im_R_mean = np.mean(im_R)
im_G_mean = np.mean(im_G)
im_B_mean = np.mean(im_B)
# save single mean value to a set of means
R_means.append(im_R_mean)
G_means.append(im_G_mean)
B_means.append(im_B_mean)
print("mean",im_list,im_R_mean,im_G_mean,im_B_mean)
# three sets into a large set
a = [R_means, G_means, B_means]
mean = [0, 0, 0]
# count the sum of different channel means
mean[0] = np.mean(a[0])
mean[1] = np.mean(a[1])
mean[2] = np.mean(a[2])
print( "",mean[0],mean[1],mean[2])
나는 폴더별로 해야하니까 ...
다음이시간에
'Coding > Python' 카테고리의 다른 글
python _ image 평균 (0) | 2022.12.10 |
---|---|
python_ Touchdesigner : txt을 csv 파일로, 그래프로 표현하기 (0) | 2022.09.19 |
python: 단어 빈도수 통계 (0) | 2022.09.08 |
python : 사진 분류 정리 (0) | 2022.06.22 |
Python_vi편집기 (0) | 2022.03.10 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Unity
- sequelize
- emotive eeg
- docker
- Java
- oculuspro
- 유니티플러그인
- 후디니
- TouchDesigner
- 라즈베리파이
- JacobianMatrices
- Arduino
- AI
- opencv
- MQTT
- node.js
- Python
- unity 360
- 유니티
- houdini
- motor controll
- DeepLeaning
- Express
- CNC
- VR
- ardity
- colab
- three.js
- RNN
- StableDiffusion
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함