无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

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

python 讀取圖片信息寫入文件

2020-03-10 14:56 作者:一心想當(dāng)網(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=[]


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

? ? if event==CV2.EVENT_LBUTTONDOWN:

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

? ? ? ? print(img[y, x])

? ? ? ? data.append(img[y, x])

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

? ? ? ? f.write(data)

? ? ? ? f.close()


def openfile():

? ? file_path=askopenfilename()

? ? img = CV2.imread(file_path)

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

? ? CV2.imshow('image', img)

? ? CV2.setMouseCallback("image", getposBgr)

? ? CV2.waitKey(0)

? ? CV2.destroyAllWindows()

? ? ? ?

top=tkinter.Tk()

Button1=tkinter.Button(top, text ="選擇圖片", command = openfile)

Button1.pack(padx=5) # 構(gòu)建窗口

top.mainloop()


python 讀取圖片信息寫入文件的評論 (共 條)

分享到微博請遵守國家法律
诏安县| 南部县| 金湖县| 姜堰市| 远安县| 安丘市| 莲花县| 蓬莱市| 江安县| 南漳县| 舟山市| 固阳县| 咸宁市| 深水埗区| 桦南县| 翼城县| 阿鲁科尔沁旗| 卫辉市| 德惠市| 临漳县| 霍林郭勒市| 峨边| 科尔| 镇平县| 阿巴嘎旗| 玛多县| 梁平县| 榆树市| 莱芜市| 乌苏市| 封丘县| 德令哈市| 黄石市| 南投市| 雅安市| 阆中市| 西城区| 醴陵市| 兴仁县| 常德市| 灌南县|