广告
返回顶部
首页 > 资讯 > 后端开发 > Python >Python实现人脸识别
  • 533
分享到

Python实现人脸识别

2024-04-02 19:04:59 533人浏览 独家记忆

Python 官方文档:入门教程 => 点击学习

摘要

使用到的库: dlib+OpenCV python版本: 3.8 编译环境: Jupyter Notebook (Anaconda3) 0.Dlib人脸特征检测原理 提取特征点:首选

使用到的库: dlib+OpenCV python版本: 3.8 编译环境: Jupyter Notebook (Anaconda3)

0.Dlib人脸特征检测原理

提取特征点:首选抓取多张图片,从中获取特征数据集和平均特征值然后写入 csv 文件 - 计算特征数据集的欧式距离作对比:首先使用Opencv库将摄像头中的人脸框出来,再将摄像头中采取到的人脸特征值与数据集中的每个人的特征均值作对比,选取最接近(欧氏距离最小)的值,将其标注为欧氏距离最小的数据集的人名

一、构建人脸特征数据集

  • 安装Dlib
  • 构建自己的数据集

 抓取人脸图片:

在视频流中抓取人脸特征,并保存为256*256 大小的图片文件共20张,这就是我们建立数据集的第一步,用来训练人脸识别。

不一定是256*256的尺寸,可以根据自己的需求来调整大小,图片越大训练结果会愈加精确,但也会影响训练模型的时间。

其中:

光线:曝光和黑暗的图片需手动剔除- 请使用同一个设备进行数据采集,不同设备的摄像头采集到的数据集会有出入- 这里采用的是从视频流中进行捕捉截图,也可以自己准备20张左右的人脸图片

代码:

import cv2  
import dlib  
import os  
import sys  
import random  
# 存储位置  
output_dir = 'D:/No1WorkSpace/JupyterNotebook/Facetrainset/Num&Name' #这里填编号+人名  
size = 256 #图片边长  

if not os.path.exists(output_dir):  
    os.makedirs(output_dir)  
# 改变图片的亮度与对比度  

def relight(img, light=1, bias=0):  
    w = img.shape[1]  
    h = img.shape[0]  
    #image = []  
    for i in range(0,w):  
        for j in range(0,h):  
            for c in range(3):  
                tmp = int(img[j,i,c]*light + bias)  
                if tmp > 255:  
                    tmp = 255  
                elif tmp < 0:  
                    tmp = 0  
                img[j,i,c] = tmp  
    return img  

#使用dlib自带的frontal_face_detector作为我们的特征提取器  
detector = dlib.get_frontal_face_detector()  
# 打开摄像头 参数为输入流,可以为摄像头或视频文件  
camera = cv2.VideoCapture(0)  
#camera = cv2.VideoCapture('C:/Users/CUNGU/Videos/Captures/wang.mp4')  

index = 1  
while True:  
    if (index <= 20):#存储15张人脸特征图像  
        print('Being processed picture %s' % index)  
        # 从摄像头读取照片  
        success, img = camera.read()  
        # 转为灰度图片  
        gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)  
        # 使用detector进行人脸检测  
        dets = detector(gray_img, 1)  

        for i, d in enumerate(dets):  
            x1 = d.top() if d.top() > 0 else 0  
            y1 = d.bottom() if d.bottom() > 0 else 0  
            x2 = d.left() if d.left() > 0 else 0  
            y2 = d.right() if d.right() > 0 else 0  

            face = img[x1:y1,x2:y2]  
            # 调整图片的对比度与亮度, 对比度与亮度值都取随机数,这样能增加样本的多样性  
            face = relight(face, random.unifORM(0.5, 1.5), random.randint(-50, 50))  

            face = cv2.resize(face, (size,size))  

            cv2.imshow('image', face)  

            cv2.imwrite(output_dir+'/'+str(index)+'.jpg', face)  

            index += 1  
        key = cv2.waiTKEy(30) & 0xff  
        if key == 27:  
            break  
    else:  
        print('Finished!')  
        # 释放摄像头 release camera  
        camera.release()  
        # 删除建立的窗口 delete all the windows  
        cv2.destroyAllWindows()  
        break

运行效果:

分析每张人脸的特征值并存入csv文件:

根据抓取的图片和人脸识别模型->训练得到的20个的68个特征数据集以及1个平均特征值存入csv文件

每张图片的68个特征数据集可以不用存取,他们只是中间量,计算平均值以后就可以抛弃了,这里把他们输出出来只是为了方便学习

代码:

# 从人脸图像文件中提取人脸特征存入 CSV  
# Features extraction from images and save into features_all.csv  

# return_128d_features()          获取某张图像的128D特征  
# compute_the_mean()              计算128D特征均值  

from cv2 import cv2 as cv2  
import os  
import dlib  
from skimage import io  
import csv  
import numpy as np  

# 要读取人脸图像文件的路径  
path_images_from_camera = "D:/No1WorkSpace/JupyterNotebook/Facetrainset/"  

# Dlib 正向人脸检测器  
detector = dlib.get_frontal_face_detector()  

# Dlib 人脸预测器  
predictor = dlib.shape_predictor("D:/No1WorkSpace/JupyterNotebook/model/shape_predictor_68_face_landmarks.dat")  

# Dlib 人脸识别模型  
# Face recognition model, the object maps human faces into 128D vectors  
face_rec = dlib.face_recognition_model_v1("D:/No1WorkSpace/JupyterNotebook/model/dlib_face_recognition_resnet_model_v1.dat")  


# 返回单张图像的 128D 特征  
def return_128d_features(path_img):  
    img_rd = io.imread(path_img)  
    img_gray = cv2.cvtColor(img_rd, cv2.COLOR_BGR2RGB)  
    faces = detector(img_gray, 1)  

    print("%-40s %-20s" % ("检测到人脸的图像 / image with faces detected:", path_img), '\n')  

    # 因为有可能截下来的人脸再去检测,检测不出来人脸了  
    # 所以要确保是 检测到人脸的人脸图像 拿去算特征  
    if len(faces) != 0:  
        shape = predictor(img_gray, faces[0])  
        face_descriptor = face_rec.compute_face_descriptor(img_gray, shape)  
    else:  
        face_descriptor = 0  
        print("no face")  

    return face_descriptor  


# 将文件夹中照片特征提取出来, 写入 CSV  
def return_features_mean_personX(path_faces_personX):  
    features_list_personX = []  
    photos_list = os.listdir(path_faces_personX)  
    if photos_list:  
        for i in range(len(photos_list)):  
            with open("D:/No1WorkSpace/JupyterNotebook/feature/featuresGiao"+str(i)+".csv", "w", newline="") as csvfile:  
                writer = csv.writer(csvfile)  
            # 调用return_128d_features()得到128d特征  
                print("%-40s %-20s" % ("正在读的人脸图像 / image to read:", path_faces_personX + "/" + photos_list[i]))  
                features_128d = return_128d_features(path_faces_personX + "/" + photos_list[i])  
                print(features_128d)  
                writer.writerow(features_128d)  
            # 遇到没有检测出人脸的图片跳过  
                if features_128d == 0:  
                    i += 1  
                else:  
                    features_list_personX.append(features_128d)  
    else:  
        print("文件夹内图像文件为空 / Warning: No images in " + path_faces_personX + '/', '\n')  

    # 计算 128D 特征的均值  
    # N x 128D -> 1 x 128D  
    if features_list_personX:  
        features_mean_personX = np.array(features_list_personX).mean(axis=0)  
    else:  
        features_mean_personX = '0'  

    return features_mean_personX  


# 读取某人所有的人脸图像的数据  
people = os.listdir(path_images_from_camera)  
people.sort()  

with open("D:/No1WorkSpace/JupyterNotebook/feature/features_all.csv", "w", newline="") as csvfile:  
    writer = csv.writer(csvfile)  
    for person in people:  
        print("##### " + person + " #####")  
        # Get the mean/average features of face/personX, it will be a list with a length of 128D  
        features_mean_personX = return_features_mean_personX(path_images_from_camera + person)  
        writer.writerow(features_mean_personX)  
        print("特征均值 / The mean of features:", list(features_mean_personX))  
        print('\n')  
    print("所有录入人脸数据存入 / Save all the features of faces reGIStered into: D:/myworkspace/JupyterNotebook/People/feature/features_all2.csv")

如果要输出每一张图片的特征数据集,这里要用到Python的文件批量生成。

代码运行效果:

二、识别人脸并匹配数据集

1. 原理

通过计算特征数据集的 欧氏距离 作对比来识别人脸,取欧氏距离最小的数据集进行匹配。

欧氏距离也称欧几里得距离或欧几里得度量,是一个通常采用的距离定义,它是在m维空间中两个点之间的真实距离。在二维和三维空间中的欧氏距离的就是两点之间的距离。使用这个距离,欧氏空间成为度量空间。相关联的范数称为欧几里得范数。较早的文献称之为毕达哥拉斯度量。

二维空间公式:

2. 视频流实时识别人脸数据

代码:

# 摄像头实时人脸识别  
import os  
import dlib          # 人脸处理的库 Dlib  
import csv # 存入表格  
import time  
import sys  
import numpy as np   # 数据处理的库 numpy  
from cv2 import cv2 as cv2           # 图像处理的库 OpenCv  
import pandas as pd  # 数据处理的库 Pandas  


# 人脸识别模型,提取128D的特征矢量  
# face recognition model, the object maps human faces into 128D vectors  
# Refer this tutorial: Http://dlib.net/python/index.html#dlib.face_recognition_model_v1  
facerec = dlib.face_recognition_model_v1("D:/No1WorkSpace/JupyterNotebook/model/dlib_face_recognition_resnet_model_v1.dat")  


# 计算两个128D向量间的欧式距离  
# compute the e-distance between two 128D features  
def return_euclidean_distance(feature_1, feature_2):  
    feature_1 = np.array(feature_1)  
    feature_2 = np.array(feature_2)  
    dist = np.sqrt(np.sum(np.square(feature_1 - feature_2)))  
    return dist  


# 处理存放所有人脸特征的 csv  
path_features_known_csv = "D:/No1WorkSpace/JupyterNotebook/feature/features_all.csv"  
csv_rd = pd.read_csv(path_features_known_csv, header=None)  


# 用来存放所有录入人脸特征的数组  
# the array to save the features of faces in the database  
features_known_arr = []  

# 读取已知人脸数据  
# print known faces  
for i in range(csv_rd.shape[0]):  
    features_someone_arr = []  
    for j in range(0, len(csv_rd.loc[i, :])):  
        features_someone_arr.append(csv_rd.loc[i, :][j])  
    features_known_arr.append(features_someone_arr)  
print("Faces in Database:", len(features_known_arr))  

# Dlib 检测器和预测器  
# The detector and predictor will be used  
detector = dlib.get_frontal_face_detector()  
predictor = dlib.shape_predictor('D:/No1WorkSpace/JupyterNotebook/model/shape_predictor_68_face_landmarks.dat')  

# 创建 cv2 摄像头对象  
# cv2.VideoCapture(0) to use the default camera of PC,  
# and you can use local video name by use cv2.VideoCapture(filename)  
cap = cv2.VideoCapture(0)  

# cap.set(propId, value)  
# 设置视频参数,propId 设置的视频参数,value 设置的参数值  
cap.set(3, 480)  

# cap.isOpened() 返回 true/false 检查初始化是否成功  
# when the camera is open  
while cap.isOpened():  

    flag, img_rd = cap.read()  
    kk = cv2.waitKey(1)  

    # 取灰度  
    img_gray = cv2.cvtColor(img_rd, cv2.COLOR_RGB2GRAY)  

    # 人脸数 faces  
    faces = detector(img_gray, 0)  

    # 待会要写的字体 font to write later  
    font = cv2.FONT_HERSHEY_COMPLEX  

    # 存储当前摄像头中捕获到的所有人脸的坐标/名字  
    # the list to save the positions and names of current faces captured  
    pos_namelist = []  
    name_namelist = []  

    # 按下 q 键退出  
    # press 'q' to exit  
    if kk == ord('q'):  
        break  
    else:  
        # 检测到人脸 when face detected  
        if len(faces) != 0:    
            # 获取当前捕获到的图像的所有人脸的特征,存储到 features_cap_arr  
            # get the features captured and save into features_cap_arr  
            features_cap_arr = []  
            for i in range(len(faces)):  
                shape = predictor(img_rd, faces[i])  
                features_cap_arr.append(facerec.compute_face_descriptor(img_rd, shape))  

            # 遍历捕获到的图像中所有的人脸  
            # traversal all the faces in the database  
            for k in range(len(faces)):  
                print("##### camera person", k+1, "#####")  
                # 让人名跟随在矩形框的下方  
                # 确定人名的位置坐标  
                # 先默认所有人不认识,是 unknown  
                # set the default names of faces with "unknown"  
                name_namelist.append("unknown")  

                # 每个捕获人脸的名字坐标 the positions of faces captured  
                pos_namelist.append(tuple([faces[k].left(), int(faces[k].bottom() + (faces[k].bottom() - faces[k].top())/4)]))  

                # 对于某张人脸,遍历所有存储的人脸特征  
                # for every faces detected, compare the faces in the database  
                e_distance_list = []  
                for i in range(len(features_known_arr)):  
                    # 如果 person_X 数据不为空  
                    if str(features_known_arr[i][0]) != '0.0':  
                        print("with person", str(i + 1), "the e distance: ", end='')  
                        e_distance_tmp = return_euclidean_distance(features_cap_arr[k], features_known_arr[i])  
                        print(e_distance_tmp)  
                        e_distance_list.append(e_distance_tmp)  
                    else:  
                        # 空数据 person_X  
                        e_distance_list.append(999999999)  
                # 找出最接近的一个人脸数据是第几个  
                # Find the one with minimum e distance  
                similar_person_num = e_distance_list.index(min(e_distance_list))  
                print("Minimum e distance with person", int(similar_person_num)+1)  

                # 计算人脸识别特征与数据集特征的欧氏距离  
                # 距离小于0.4则标出为可识别人物  
                if min(e_distance_list) < 0.4:  
                    # 这里可以修改摄像头中标出的人名  
                    # Here you can modify the names shown on the camera  
                    # 1、遍历文件夹目录  
                    folder_name = 'D:/No1WorkSpace/JupyterNotebook/Facetrainset/'  
                    # 最接近的人脸  
                    sum=similar_person_num+1  
                    key_id=1 # 从第一个人脸数据文件夹进行对比  
                    # 获取文件夹中的文件名:1wang、2zhou、3...  
                    file_names = os.listdir(folder_name)  
                    for name in file_names:  
                        # print(name+'->'+str(key_id))  
                        if sum ==key_id:  
                            #winsound.Beep(300,500)# 响铃:300频率,500持续时间  
                            name_namelist[k] = name[1:]#人名删去第一个数字(用于视频输出标识)  
                        key_id += 1  
                    # 播放欢迎光临音效  
                    #playsound('D:/myworkspace/JupyterNotebook/People/music/welcome.wav')  
                    # print("May be person "+str(int(similar_person_num)+1))  
                    # -----------筛选出人脸并保存到visitor文件夹------------  
                    for i, d in enumerate(faces):  
                        x1 = d.top() if d.top() > 0 else 0  
                        y1 = d.bottom() if d.bottom() > 0 else 0  
                        x2 = d.left() if d.left() > 0 else 0  
                        y2 = d.right() if d.right() > 0 else 0  
                        face = img_rd[x1:y1,x2:y2]  
                        size = 64  
                        face = cv2.resize(face, (size,size))  
                        # 要存储visitor人脸图像文件的路径  
                        path_visitors_save_dir = "D:/No1WorkSpace/JupyterNotebook/KnownFacetrainset/"  
                        # 存储格式:2019-06-24-14-33-40wang.jpg  
                        now_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())  
                        save_name = str(now_time)+str(name_namelist[k])+'.jpg'  
                        # print(save_name)  
                        # 本次图片保存的完整url  
                        save_path = path_visitors_save_dir+'/'+ save_name      
                        # 遍历visitor文件夹所有文件名  
                        visitor_names = os.listdir(path_visitors_save_dir)  
                        visitor_name=''  
                        for name in visitor_names:  
                            # 名字切片到分钟数:2019-06-26-11-33-00wangyu.jpg  
                            visitor_name=(name[0:16]+'-00'+name[19:])  
                        # print(visitor_name)  
                        visitor_save=(save_name[0:16]+'-00'+save_name[19:])  
                        # print(visitor_save)  
                        # 一分钟之内重复的人名不保存  
                        if visitor_save!=visitor_name:  
                            cv2.imwrite(save_path, face)  
                            print('新存储:'+path_visitors_save_dir+'/'+str(now_time)+str(name_namelist[k])+'.jpg')  
                        else:  
                            print('重复,未保存!')  

                else:  
                    # 播放无法识别音效  
                    #playsound('D:/myworkspace/JupyterNotebook/People/music/sorry.wav')  
                    print("Unknown person")  
                    # -----保存图片-------  
                    # -----------筛选出人脸并保存到visitor文件夹------------  
                    for i, d in enumerate(faces):  
                        x1 = d.top() if d.top() > 0 else 0  
                        y1 = d.bottom() if d.bottom() > 0 else 0  
                        x2 = d.left() if d.left() > 0 else 0  
                        y2 = d.right() if d.right() > 0 else 0  
                        face = img_rd[x1:y1,x2:y2]  
                        size = 64  
                        face = cv2.resize(face, (size,size))  
                        # 要存储visitor-》unknown人脸图像文件的路径  
                        path_visitors_save_dir = "D:/No1WorkSpace/JupyterNotebook/UnKnownFacetrainset/"  
                        # 存储格式:2019-06-24-14-33-40unknown.jpg  
                        now_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())  
                        # print(save_name)  
                        # 本次图片保存的完整url  
                        save_path = path_visitors_save_dir+'/'+ str(now_time)+'unknown.jpg'  
                        cv2.imwrite(save_path, face)  
                        print('新存储:'+path_visitors_save_dir+'/'+str(now_time)+'unknown.jpg')  

                # 矩形框  
                # draw rectangle  
                for kk, d in enumerate(faces):  
                    # 绘制矩形框  
                    cv2.rectangle(img_rd, tuple([d.left(), d.top()]), tuple([d.right(), d.bottom()]), (0, 255, 255), 2)  
                print('\n')  

            # 在人脸框下面写人脸名字  
            # write names under rectangle  
            for i in range(len(faces)):  
                cv2.putText(img_rd, name_namelist[i], pos_namelist[i], font, 0.8, (0, 255, 255), 1, cv2.LINE_AA)  

    print("Faces in camera now:", name_namelist, "\n")  

    #cv2.putText(img_rd, "Press 'q': Quit", (20, 450), font, 0.8, (84, 255, 159), 1, cv2.LINE_AA)  
    cv2.putText(img_rd, "Face Recognition", (20, 40), font, 1, (0, 0, 255), 1, cv2.LINE_AA)  
    cv2.putText(img_rd, "Visitors: " + str(len(faces)), (20, 100), font, 1, (0, 0, 255), 1, cv2.LINE_AA)  

    # 窗口显示 show with opencv  
    cv2.imshow("camera", img_rd)  

# 释放摄像头 release camera  
cap.release()  

# 删除建立的窗口 delete all the windows  
cv2.destroyAllWindows()

若直接使用本代码,文件目录弄成中文会乱码

运行效果:

没有吴京叔叔的数据集,所以他是陌生人

到此这篇关于Python实现人脸识别的文章就介绍到这了,更多相关Python人脸识别内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!

--结束END--

本文标题: Python实现人脸识别

本文链接: https://www.lsjlt.com/news/161988.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Python实现人脸识别
    使用到的库: dlib+Opencv python版本: 3.8 编译环境: Jupyter Notebook (Anaconda3) 0.Dlib人脸特征检测原理 提取特征点:首选...
    99+
    2022-11-12
  • 人脸识别实战之Opencv+SVM实现人脸识别
    目录前言项目结构编码训练人脸识别模型识别图像中的人脸摄像头识别人脸前言 在本文中,您将学习如何使用 OpenCV 进行人脸识别。文章分三部分介绍: 第一,将首先执行人脸检测,使用深度...
    99+
    2022-11-12
  • python实现人脸识别代码
    从实时视频流中识别出人脸区域,从原理上看,其依然属于机器学习的领域之一,本质上与谷歌利用深度学习识别出猫没有什么区别。程序通过大量的人脸图片数据进行训练,利用数学算法建立建立可靠的人脸特征模型,如此即可识别...
    99+
    2022-06-04
    代码 python
  • OpenCV实现人脸识别
    主要有以下步骤: 1、人脸检测 2、人脸预处理 3、从收集的人脸训练机器学习算法 4、人脸识别 5、收尾工作 人脸检测算法: 基于Haar的脸部检测器的基本思想是,对于面部正面大部分区域而言,会有眼睛所在区...
    99+
    2022-06-04
    OpenCV
  • 怎么用Python实现人脸识别
    这篇文章主要讲解了“怎么用Python实现人脸识别”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“怎么用Python实现人脸识别”吧!安装最好是使用 Linux 或 Mac 环境来安装,Win...
    99+
    2023-06-02
  • Python 人脸识别 OpenCV (
    ■环境Python 3.6.0Pycharm 2017.1.3 ■库、库的版本OpenCV 3.4.1 (cp36) ■haarcascades下载https://github.com/opencv/opencv/tree/master/d...
    99+
    2023-01-31
    Python OpenCV
  • 人脸识别4:Android InsightFace实现人脸识别Face Recognition(含源码)
    人脸识别4:Android InsightFace实现人脸识别Face Recognition(含源码) 目录 人脸识别4:Android InsightFace实现人脸识别Face Recognition(含源码) 1. 前言 2. 项目...
    99+
    2023-08-31
    android 人脸识别 人脸检测 android人脸识别
  • Python如何实现人脸识别系统
    小编给大家分享一下Python如何实现人脸识别系统,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!基本原理人脸识别和目标检测这些还不太一样,比如大家传统的训练一个目...
    99+
    2023-06-26
  • Python 人脸识别实现(三种方式)
    所有涉及的配置文件(xml,dat)存储在这里: https://jhc001.lanzoub.com/iyaeo0w8jkgb 密码:JDBC 所有 sdk 包下内容均为自定义,跑不了直接自己改输入...
    99+
    2023-10-18
    python opencv 计算机视觉
  • Python怎么实现AI智能人脸识别
    本篇文章为大家展示了Python怎么实现AI智能人脸识别,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。前言现在人脸识别这东西层出不穷,基本上很多东西都用到,比如现在火车站都是用人脸识别来过关卡,确实...
    99+
    2023-06-02
  • python实现的人脸识别打卡系统
    目录项目地址:简介使用主要代码项目地址: https://github.com/king-xw/Face_Recogntion 简介 本仓库是使用python编写的一个简单的人脸识别考勤打卡系统 主要功能有录入人脸信...
    99+
    2022-06-02
    python 人脸识别 python 打卡系统
  • Python调用API接口实现人脸识别
    目录准备工作代码流程在开始之前,先问问大家: 什么是百度Aip模块? 百度AI平台提供了很多的API接口供开发者快速的调用运用在项目中本文写的是使用百度AI的**在线接口SDK模块(...
    99+
    2023-02-13
    Python调用API接口 Python 人脸识别
  • 怎么用Python代码实现人脸识别
    这篇文章主要介绍“怎么用Python代码实现人脸识别”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“怎么用Python代码实现人脸识别”文章能帮助大家解决问题。正文:环境要求:Ubuntu17.10P...
    99+
    2023-06-29
  • Python PyQt5 人脸识别软件
    # !/usr/bin/python3# -*- coding:utf-8 -*-"""@author: JHC000abc@gmail.com@file: untitled_ctrl.py@tim...
    99+
    2023-08-31
    python qt 开发语言
  • Python 40行代码实现人脸识别功能
    前言 很多人都认为人脸识别是一项非常难以实现的工作,看到名字就害怕,然后心怀忐忑到网上一搜,看到网上N页的教程立马就放弃了。这些人里包括曾经的我自己。其实如果如果你不是非要深究其中的原理,只是要实现这一工作...
    99+
    2022-06-04
    代码 功能 Python
  • Python几行代码即可实现人脸识别
    摘要:一行代码实现人脸识别 首先你需要提供一个文件夹,里面是所有你希望系统认识的人的图片。其中每个人一张图片,图片以人的名字命名。 接下来,你需要准备另一个文件夹,...
    99+
    2022-11-13
  • Python中基于Opencv怎么实现人脸识别
    这篇文章主要讲解了“Python中基于Opencv怎么实现人脸识别”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Python中基于Opencv怎么实现人脸识别”吧!检测人脸。这应该是最基本的...
    99+
    2023-06-02
  • Python怎么实现人脸识别微笑检测
    这篇文章主要介绍“Python怎么实现人脸识别微笑检测”,在日常操作中,相信很多人在Python怎么实现人脸识别微笑检测问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Python怎么实现人脸识别微笑检测”的疑...
    99+
    2023-06-21
  • java+opencv实现人脸识别功能
    背景:最近需要用到人脸识别,但又不花钱使用现有的第三方人脸识别接口,为此使用opencv结合java进行人脸识别(ps:opencv是开源的,使用它来做人脸识别存在一定的误差,效果一...
    99+
    2022-11-12
  • 【ROS】OpenCV+ROS 实现人脸识别(Ubantu16.04)
    目录   前言 一、环境配置   1.安装ROS  2.摄像头调用 3.导入OpenCV 二、创建工作空间和功能包 1.创建工作空间 2.创建功能包 三、人脸识别检测相关代码 1.python文件 2.lanuch文件  3.CvBridg...
    99+
    2023-08-31
    opencv linux 人工智能 python 学习
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作