【发布时间】:2019-03-14 13:23:48
【问题描述】:
所以我已经能够读取文件并生成一个数组。我正在努力寻找找到图像中绿色和蓝色百分比的方法。
#Import Libraries
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
from PIL import Image
import glob
#option comd c and then cmd v to paste path /Users/Gilly/Desktop/Comp 180/images
#2 Reads the image of a sunset into an array LOOP
list_files=glob.glob("/Users/Gilly/Desktop/Comp 180/images/*.jpg")
for i in list_files:
img = mpimg.imread(i)
print(img)
#Plots the image from the array data
for i in list_files:
imgplot = plt.imshow(img)
plt.show()
#Calculate % of Green and Blue in the images
【问题讨论】:
-
纯代码编写请求在 Stack Overflow 上是题外话——我们希望这里的问题与特定编程问题有关——但我们很乐意帮助您自己编写!告诉我们what you've tried,以及您遇到的问题。这也将有助于我们更好地回答您的问题。
-
"Can Someone Help Me?" is not a valid SO question。这通常表明您需要的是与当地导师相处或完成教程,而不是 Stack Overflow。在这种情况下,您在识别颜色区域的研究中发现了什么?您的编码尝试在哪里?
-
我明白了,谢谢你,我尝试了很多次,但我不知道我必须发布那个。
标签: python arrays image colors percentage