五月天青色头像情侣网名,国产亚洲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變量使用的評論 (共 條)

分享到微博請遵守國家法律
石河子市| 望奎县| 雷州市| 女性| 梅州市| 英德市| 临泽县| 曲靖市| 甘谷县| 宜章县| 许昌市| 辽宁省| 屯门区| 萨迦县| 英德市| 吐鲁番市| 仙游县| 茂名市| 大洼县| 苍溪县| 新建县| 兴义市| 蒙城县| 余江县| 武平县| 朝阳县| 宁南县| 公安县| 棋牌| 广州市| 景东| 衡南县| 黄龙县| 固镇县| 肃宁县| 胶州市| 武安市| 铜陵市| 曲周县| 酉阳| 镇江市|