要求
存在一个文件夹内有若干张图像,需要计算每张图片的RGB均值,并计算全部图像的RGB均值。
代码
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 1 10:43:29 2018
@author: Administrator
"""
import os
import cv2
import numpy as np
path = 'C:/Users/Administrator/Desktop/rgb'
def compute(path):
file_names = os.listdir(path)
per_image_Rmean = []
2022-03-05 08:38:48
45KB
计算图
1