五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

python 計數(shù) global變量使用

2020-03-10 16:33 作者:一心想當網(wǎng)紅的李老師  | 我要投稿

# -*- coding: utf-8 -*-

"""

Created on Tue Mar 10 14:04:43 2020


@author: liyan

"""

import tkinter

from tkinter import *

from PIL import Image,ImageTk

from tkinter.filedialog import askopenfilename

import time

import CV2

import tkinter as tk

import array

import numpy as np



data=[]

count=0



def getposBgr(event, x, y, flags, param):

? ? if event==CV2.EVENT_LBUTTONDOWN:

? ? ? ? print("Bgr is", img[y, x])

? ? ? ? global count ? ####不定義會報錯。

? ? ? ? count=count+1

? ? ? ? data=img[y, x]

? ? ? ? print(data)

? ? ? ? f=open('data.txt','a')

? ? ? ? info=str(count)+";"+str(data[0])+";"+str(data[1])+";"+str(data[2])+"\n"

? ? ? ? f.write(info)

? ? ? ? f.close()


? ? ??

top=tkinter.Tk()

file_path=askopenfilename()

img = CV2.imread(file_path)

print(img)

HSV = CV2.cvtColor(img, CV2.COLOR_BGR2HSV)

CV2.imshow('image', img)

CV2.setMouseCallback("image", getposBgr)

CV2.waitKey(0)

CV2.destroyAllWindows()

top.mainloop()?


python 計數(shù) global變量使用的評論 (共 條)

分享到微博請遵守國家法律
阿瓦提县| 邹平县| 健康| 兰溪市| 神池县| 谢通门县| 潮州市| 晋城| 兰考县| 都江堰市| 土默特右旗| 金湖县| 婺源县| 衡南县| 武穴市| 万山特区| 清新县| 贞丰县| 通山县| 贺州市| 汕头市| 安福县| 江西省| 翼城县| 瑞安市| 汤原县| 宁晋县| 千阳县| 得荣县| 改则县| 普定县| 滦平县| 府谷县| 昌宁县| 吉安县| 临漳县| 腾冲县| 青州市| 岫岩| 揭西县| 平遥县|