!wget https://i.stack.imgur.com/jnxX3.png
a = plt.imread( './jnxX3.png')
plt.imshow( a )
这将加载变量a中100%完成的图像
c =a
c = c[: , 0:c.shape[1] - 50]
aa = np.zeros( dtype= float , shape=( 11,50, 3 ))
c = np.append( c, aa , axis= 1 )
plt.imshow( c)
plt.imshow( c )
制作了一个你应该提供的不完整的图像样本
def status( complete_img , part_image):
"""inputs must be numpy arrays """
complete_img = complete_img[:, 1: ] # as the first pixel column doesn't belong to % completion
part_image = part_image[:, 1:]
counter = 0
while(counter < part_image.shape[1] and counter < complete_img.shape[1]):
if (complete_img[:, counter ] == part_image[:,counter]).all():
counter += 1
else :
break
perc = 100*( float(counter) / complete_img.shape[1])
return
status( a ,c ) # this will return % columns similar in the two images
一个命题:
结果:
我想你应该通过看图片来计算进度 我不确定是否有一个特定的库,但这是我的简单方法
你可以比较图片,直到他们是相似的列,然后可以计算出%的任务完成,让我演示。。你知道吗
这将加载变量a中100%完成的图像
制作了一个你应该提供的不完整的图像样本
你在找Pillow库。有两种方法可以测量颜色、色调、饱和度、亮度(HSL)和红、蓝、绿(RGB)。图书馆里有两种功能。你知道吗
相关问题 更多 >
编程相关推荐