本文整理汇总了Python中picture.Picture.put_RGB_value方法的典型用法代码示例。如果您正苦于以下问题:Python Picture.put_RGB_value方法的具体用法?Python Picture.put_RGB_value怎么用?Python Picture.put_RGB_value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类picture.Picture
的用法示例。
在下文中一共展示了Picture.put_RGB_value方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from picture import Picture [as 别名]
# 或者: from picture.Picture import put_RGB_value [as 别名]
for x in range(size_x):
r_list = []
g_list = []
b_list = []
for i in img_list:
r, g, b = i.get_RGB_value((x,y))
r_list.append(r)
g_list.append(g)
b_list.append(b)
# insert median values into output image
rm = median.get_median(r_list, user_median)
gm = median.get_median(g_list, user_median)
bm = median.get_median(b_list, user_median)
image.put_RGB_value((x,y),(rm,gm,bm))
image.save(os.path.join(IMAGE_DIRECTORY, 'output.png'))
print "Done processing!"
# compare output image to reference image, named final.png
model = Picture(filename = os.path.join(IMAGE_DIRECTORY, 'final.png'))
print "\n\nBrute Similarity: " + similarity.sim_brute(image, model)
print "Correlation Similarity: " + similarity.sim_correlation(image, model)
print "Chi Squared p-value: " + similarity.sim_chi(image, model)
print "Note: Closer to 0 is perfect for chi-squared, 1 is perfect for brute and correlation\n\n"
# displays output image to the user
image.display()