import numpy as np # 数据处理的库 Numpy
import cv2 # 图像处理的库 OpenCv
import os
import shutil
import _thread
import wx
import csv
from importlib import reload
from skimage import io as iio
import face_recognize_punchcard
import sys
# 创建 cv2 摄像头对象
# C++: VideoCapture::VideoCapture(int device);
#API:http://www.opencv.org.cn/opencvdoc/2.3.2/html/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture
# 保存
path_make_dir = "data/face_img_database/"
path_feature_all = "data/feature_all.csv"
info = 'icon/info.png'
#register ui
class RegisterUi(wx.Frame):
def __init__(self,superion):
wx.Frame.__init__(self,parent=superion,title="人脸录入",size=(800,590),style=wx.DEFAULT_FRAME_STYLE|wx.STAY_ON_TOP)
self.SetBackgroundColour('white')
self.Center()
self.NewButton = wx.Button(parent=self,pos=(50,120),size=(80,50),label='新建录入')
self.ShortCutButton = wx.Button(parent=self,pos=(50,220),size=(80,50),label='截图保存')
self.SaveButton = wx.Button(parent=self,pos=(50,320),size=(80,50),label='完成录入')
# 封面图片
self.image_info = wx.Image(info, wx.BITMAP_TYPE_ANY).Scale(600, 480)
# 显示图片
self.bmp = wx.StaticBitmap(parent=self, pos=(180,20), bitmap=wx.Bitmap(self.image_info))
self.Bind(wx.EVT_BUTTON,self.OnShortCutButtonClicked,self.ShortCutButton)
self.Bind(wx.EVT_BUTTON,self.OnNewButtonClicked,self.NewB