资源简介
压缩文件里有一个PDF文档,人脸数据,Python代码,介绍了LDA,PCA,SVD技术在人脸识别中的理论和Python实现
代码片段和文件信息
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012 Philipp Wagner
# All rights reserved.
#
# Redistribution and use in source and binary forms with or without
# modification are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of the author nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# “AS IS“ AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT
# LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT
# INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING
# BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT
# LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import sys math Image
def Distance(p1p2):
dx = p2[0] - p1[0]
dy = p2[1] - p1[1]
return math.sqrt(dx*dx+dy*dy)
def ScaleRotateTranslate(image angle center = None new_center = None scale = None resample=Image.BICUBIC):
if (scale is None) and (center is None):
return image.rotate(angle=angle resample=resample)
nxny = xy = center
sx=sy=1.0
if new_center:
(nxny) = new_center
if scale:
(sxsy) = (scale scale)
cosine = math.cos(angle)
sine = math.sin(angle)
a = cosine/sx
b = sine/sx
c = x-nx*a-ny*b
d = -sine/sy
e = cosine/sy
f = y-nx*d-ny*e
return image.transform(image.size Image.AFFINE (abcdef) resample=resample)
def CropFace(image eye_left=(00) eye_right=(00) offset_pct=(0.20.2) dest_sz = (7070)):
# calculate offsets in original image
offset_h = math.floor(float(offset_pct[0])*dest_sz[0])
offset_v = math.floor(float(offset_pct[1])*dest_sz[1])
# get the direction
eye_direction = (eye_right[0] - eye_left[0] eye_right[1] - eye_left[1])
# calc rotation angle in radians
rotation = -math.atan2(float(eye_direction[1])float(eye_direction[0]))
# distance between them
dist = Distance(eye_left eye_right)
# calculate the reference eye-width
reference = dest_sz[0] - 2.0*offset_h
# scale factor
scale = float(dist)/float(reference)
# rotate original around the left eye
image
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-12-16 15:49 facerecognition_guide\
目录 0 2012-07-28 03:41 facerecognition_guide\bib\
文件 16001 2012-07-28 03:41 facerecognition_guide\bib\facerec.bib
文件 14 2012-07-28 03:41 facerecognition_guide\definitions.tex
文件 1299605 2014-12-16 12:52 facerecognition_guide\facerec.pdf
文件 2420 2012-07-28 03:41 facerecognition_guide\facerec.tex
文件 887819 2012-07-28 03:41 facerecognition_guide\facerec_octave.pdf
文件 1295314 2012-07-28 03:41 facerecognition_guide\facerec_python.pdf
目录 0 2012-07-28 03:41 facerecognition_guide\img\
目录 0 2012-07-28 03:41 facerecognition_guide\img\eigenfaces\
文件 160636 2012-07-28 03:41 facerecognition_guide\img\eigenfaces\octave_pca_eigenfaces.pdf
文件 105056 2012-07-28 03:41 facerecognition_guide\img\eigenfaces\octave_pca_reconstruction.pdf
文件 330249 2012-07-28 03:41 facerecognition_guide\img\eigenfaces\python_pca_eigenfaces.pdf
文件 156461 2012-07-28 03:41 facerecognition_guide\img\eigenfaces\python_pca_reconstruction.pdf
目录 0 2012-07-28 03:41 facerecognition_guide\img\fisherfaces\
文件 7954 2012-07-28 03:41 facerecognition_guide\img\fisherfaces\multiclasslda.pdf
文件 163641 2012-07-28 03:41 facerecognition_guide\img\fisherfaces\octave_fisherfaces_fisherfaces.pdf
文件 102334 2012-07-28 03:41 facerecognition_guide\img\fisherfaces\octave_fisherfaces_reconstruction.pdf
文件 290898 2012-07-28 03:41 facerecognition_guide\img\fisherfaces\python_fisherfaces_fisherfaces.pdf
文件 124754 2012-07-28 03:41 facerecognition_guide\img\fisherfaces\python_fisherfaces_reconstruction.pdf
目录 0 2012-07-28 03:41 facerecognition_guide\img\libfacerec\
目录 0 2012-07-28 03:41 facerecognition_guide\img\libfacerec\colormap\
文件 91814 2012-07-28 03:41 facerecognition_guide\img\libfacerec\colormap\lena.jpg
文件 89761 2012-07-28 03:41 facerecognition_guide\img\libfacerec\colormap\lena_autumn.jpg
文件 96182 2012-07-28 03:41 facerecognition_guide\img\libfacerec\colormap\lena_bone.jpg
文件 72090 2012-07-28 03:41 facerecognition_guide\img\libfacerec\colormap\lena_cool.jpg
文件 121763 2012-07-28 03:41 facerecognition_guide\img\libfacerec\colormap\lena_hot.jpg
文件 162097 2012-07-28 03:41 facerecognition_guide\img\libfacerec\colormap\lena_hsv.jpg
文件 230060 2012-07-28 03:41 facerecognition_guide\img\libfacerec\colormap\lena_imshow_jet.jpg
文件 153115 2012-07-28 03:41 facerecognition_guide\img\libfacerec\colormap\lena_jet.jpg
文件 134351 2012-07-28 03:41 facerecognition_guide\img\libfacerec\colormap\lena_mkpj1.jpg
............此处省略227个文件信息
相关资源
- python实现SGBM图像匹配算法
- python实现灰度直方图均衡化
- scrapy_qunar_one
- Python学习全系列教程永久可用
- python简明教程.chm
- 抽奖大转盘python的图形化界面
- 双边滤波器实验报告及代码python
- python +MYSQL+HTML实现21蛋糕网上商城
- Python-直播答题助手自动检测出题搜索
- OpenCV入门教程+OpenCV官方教程中文版
- Python 串口工具源码+.exe文件
- Python开发的全栈股票系统.zip
- Python操作Excel表格并将其中部分数据写
- python书籍 PDF
- 利用python绘制散点图
- python+labview+No1.vi
- 老男孩python项目实战
- python源码制作whl文件.rar
- python3.5可用的scipy
- PYTHON3 经典50案例.pptx
- 计算机科学导论-python.pdf
- python模拟鼠标点击屏幕
- windows鼠标自动点击py脚本
- 鱼c小甲鱼零基础学python全套课后题和
- Python 练习题100道
- Practical Programming 2nd Edition
- wxPython Application Development Cookbook
- python 3.6
- Python 3.5.2 中文文档 互联网唯一CHM版本
- python3.5.2.chm官方文档
评论
共有 条评论