计算机毕业设计:基于python人脸识别管理系统 OpenCV+Dlib(包含文档+源码+部署教程)

[毕业设计]2023-2024年最新最全计算机专业毕设选题推荐汇总

Python项目——毕业设计选题参考

感兴趣的可以先收藏起来,还有大家在毕设选题,项目以及论文编写等相关问题都可以给我留言咨询,希望帮助更多的人 。

1、项目介绍

Python语言、dlib、OpenCV、Pyqt5界面设计、sqlite3数据库

方法实现、实现步骤
1、实例化人脸检测模型、人脸关键点检测模型、人脸识别模型
2、电脑摄像头设备加载一对图片
3、分别获取图片中的人脸图片所映射的空间向量,即人脸特征值
4、计算特征向量欧氏距离,根据阈值判断是否为同一个人

2、项目界面

(1)摄像头人脸识别界面

计算机毕业设计:基于python人脸识别管理系统 OpenCV+Dlib(包含文档+源码+部署教程)_第1张图片

(2)人脸识别记录

计算机毕业设计:基于python人脸识别管理系统 OpenCV+Dlib(包含文档+源码+部署教程)_第2张图片

(3)人脸录入界面

计算机毕业设计:基于python人脸识别管理系统 OpenCV+Dlib(包含文档+源码+部署教程)_第3张图片

(4)数据库管理界面
计算机毕业设计:基于python人脸识别管理系统 OpenCV+Dlib(包含文档+源码+部署教程)_第4张图片
(5)识别记录界面
计算机毕业设计:基于python人脸识别管理系统 OpenCV+Dlib(包含文档+源码+部署教程)_第5张图片

3、项目说明

Python语言、dlib、OpenCV、Pyqt5界面设计、sqlite3数据库

本系统使用dlib作为人脸识别工具,dlib提供一个方法可将人脸图片数据映射到128维度的空间向量,如果两张图片来源于同一个人,那么两个图片所映射的空间向量距离就很近,否则就会很远。因此,可以通过提取图片并映射到128维空间向量再度量它们的欧氏距离是否足够小来判定是否为同一个人。

方法实现、实现步骤
1、实例化人脸检测模型、人脸关键点检测模型、人脸识别模型
2、电脑摄像头设备加载一对图片
3、分别获取图片中的人脸图片所映射的空间向量,即人脸特征值
4、计算特征向量欧氏距离,根据阈值判断是否为同一个人

开发技术环境: Pycharm + Python3.6 + PyQt5 + OpenCV + 人脸特征模型

本系统先调取opencv摄像头进行人脸信息拍照然后识别人脸特征数据,并且录入自己的学号姓名,将识别的人脸特征向量信息保存到人脸数据库当中产生数据记录,并且可以按照学号搜索人脸数据库当中的学生信息,可以修改学生的姓名以及学号等,学生录入进自己的人脸信息后可以进行人脸识别,人脸识别主要是调用opencv打开摄像头拍摄自己的人脸然后调取人脸模型进行识别,将识别到的人脸特征向量和人脸库中的特征向量匹配并计算出相似度,如果匹配相似度太低则提示不存在请您先录入人脸信息,匹配度达到百分七十以及八十以上则匹配出数据库里面对应的学生识别记录,并且形成识别记录,这个识别记录也是可以搜索修改和删除的。

4、部分代码

from PyQt5.QtWidgets import QApplication
from PyQt5 import QtCore
from control.mainWindow import MyWindow
import sys

#PyQt使用高分辨率
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)

#主函数
if __name__ == '__main__':
    app = QApplication(sys.argv)
    #实例化主界面
    myWin = MyWindow()
    #显示主界面
    myWin.show()
    sys.exit(app.exec_())


from datetime import datetime
import time

#find the course  attend
def find_current_course(tableDict):
    have_class = 0
    course_name = None
    classroom = None
    start_time = None
    end_time =None
    late = 0

    current_time = datetime.now().strftime("%H:%M")
    current_week = int(time.strftime("%w"))
    current_week_key = list(tableDict.keys())[current_week - 1]
    today_course = tableDict[current_week_key]
    if current_week in [0,6]:
        print("None")
        return have_class,course_name,classroom,start_time,end_time,late
    else:
        print(today_course)
        min_diff_time = 24 * 60
        for course in today_course:
            if course != []:
                if in_course_time(course[2],course[3],current_time):
                    print(in_course_time(course[2],course[3],current_time))
                    have_class = 1
                    course_name = course[0]
                    classroom = course[1]
                    start_time = course[2]
                    end_time = course[3]
                    late = 1
                    return have_class,course_name,classroom,start_time,end_time,late
                else:
                    current_diff_time = diff_time(course[2],current_time)
                    if current_diff_time <= 0 and current_diff_time < min_diff_time:
                        min_diff_time = current_diff_time
                        print("min_time:{}".format(min_diff_time))
                        have_class = 1
                        course_name = course[0]
                        classroom = course[1]
                        start_time = course[2]
                        end_time = course[3]
                        late = 0
                        return have_class, course_name, classroom, start_time, end_time, late
        print("None")
        return have_class, course_name, classroom, start_time, end_time, late
    print(current_time)
    print(current_week)

# the difference of two time
def diff_time(time1,time2):
    t1,m1 = int(time1.split(':')[0]), int(time1.split(':')[1])
    t2, m2 = int(time2.split(':')[0]), int(time2.split(':')[1])
    time1_min = t1 * 60 + m1
    time2_min = t2 * 60 + m2
    return time2_min - time1_min

#current time is in course time?
def in_course_time(start_time,end_time,current_time):
    if diff_time(start_time,current_time) > 0 and diff_time(end_time,current_time) < 0:
        return True
    else:
        return False


源码获取:

由于篇幅限制,获取完整文章或源码、代做项目的,查看主页【专栏名称】或者【用户名】或者顶部的【选题链接】就可以找到我获取项目源码学习啦~

大家点赞、收藏、关注、评论啦 !

你可能感兴趣的:(biyesheji0001,毕业设计,biyesheji0002,课程设计,python,opencv,人工智能,深度学习)