资源简介
可用于测试intraFace的运行效果,不是源代码。效果非常好
代码片段和文件信息
// Author: Philipp Werner
// This code is part of IntraFace.
#include
#include
#include
// Define fixed width types
#if _MSC_VER < 1600
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
#else
#include
#endif
// Check whether we have a big endian architecture
inline bool is_bigendian()
{
const int i = 1;
return (*(char*)&i) == 0;
}
// TODO: To speed up loading in big endian architectures we may overload the function to use optimized platform specific conversion functions
template
T swap_endian(T u)
{
union
{
T u;
unsigned char u8[sizeof(T)];
} source dest;
source.u = u;
for (size_t k = 0; k < sizeof(T); k++)
dest.u8[k] = source.u8[sizeof(T) - k - 1];
return dest.u;
}
// Write array of n elements to file
template
bool write_n(FILE * file const T * data size_t n)
{
if (is_bigendian()) {
// This is not optimized for speed however it‘s only big endian writing....
bool okay = true;
for (size_t i = 0; i < n; ++i) {
T swapped = swap_endian(data[i]);
okay &= fwrite(&swapped sizeof(swapped) 1 file) == 1;
}
return okay;
} else {
return fwrite(data sizeof(*data) n file) == n;
}
}
// Read array of n elements from file
template
bool read_n(FILE * file T * data size_t n)
{
if (fread(data sizeof(*data) n file) != n)
return false;
if (is_bigendian()) {
for (size_t i = 0; i < n; ++i)
data[i] = swap_endian(data[i]);
}
return true;
}
// Write one element to file
template
bool write_one(FILE * file T data)
{
return write_n(file &data 1);
}
// Read one element from file
template
bool read_one(FILE * file T & data)
{
return read_n(file &data 1);
}
// Write one cv::Mat to file
bool write_one(FILE * file const cv::Mat & data)
{
bool okay = true;
okay &= write_one(file int32_t(data.rows));
okay &= write_one(file int32_t(data.cols));
okay &= write_one(file uint32_t(data.type()));
// If matrix memory is continuous we can reshape the matrix
int rows = data.rows cols = data.cols;
if (data.isContinuous()) {
cols = rows*cols;
rows = 1;
}
// Currently only supports float/double matrices!
assert(data.depth() == CV_32F || data.depth() == CV_64F);
if (data.depth() == CV_32F)
for (int r = 0; r < rows; ++r)
okay &= write_n(file data.ptr(r) cols);
else if (data.depth() == CV_64F)
for (int r = 0; r < rows; ++r)
okay &= write_n(file data.ptr(r) cols);
else
return false;
return okay;
}
// Read one cv::Mat from file
bool read_one(FILE * file cv::Mat & data)
{
bool
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 41910 2014-11-15 15:22 IntraFace-v1.2\data\513710585_O.jpg
文件 280666 2013-10-16 01:56 IntraFace-v1.2\data\good_input_rect.jpg
文件 193426 2013-05-09 13:00 IntraFace-v1.2\data\pic.jpg
文件 2701506 2013-04-02 02:28 IntraFace-v1.2\data\vid.wmv
文件 495 2013-11-09 08:02 IntraFace-v1.2\include\intraface\binary_model_file.h
文件 3674 2014-01-25 04:36 IntraFace-v1.2\include\intraface\FaceAlignment.h
文件 920 2014-01-24 00:49 IntraFace-v1.2\include\intraface\Marcos.h
文件 1161 2013-10-20 12:15 IntraFace-v1.2\include\intraface\XXDesc
文件 3439 2013-03-30 06:55 IntraFace-v1.2\include\opencv\cv.h
文件 2411 2013-01-28 07:17 IntraFace-v1.2\include\opencv\cv.hpp
文件 2850 2013-03-30 06:55 IntraFace-v1.2\include\opencv\cvaux.h
文件 2346 2013-01-28 07:17 IntraFace-v1.2\include\opencv\cvaux.hpp
文件 2184 2013-01-28 07:17 IntraFace-v1.2\include\opencv\cvwimage.h
文件 2465 2013-03-30 06:55 IntraFace-v1.2\include\opencv\cxcore.h
文件 2423 2013-01-28 07:17 IntraFace-v1.2\include\opencv\cxcore.hpp
文件 2266 2013-01-28 07:17 IntraFace-v1.2\include\opencv\cxeigen.hpp
文件 110 2013-01-28 07:17 IntraFace-v1.2\include\opencv\cxmisc.h
文件 2306 2013-03-30 06:55 IntraFace-v1.2\include\opencv\highgui.h
文件 2189 2013-03-30 06:55 IntraFace-v1.2\include\opencv\ml.h
文件 37635 2013-06-27 06:55 IntraFace-v1.2\include\opencv2\calib3d\calib3d.hpp
文件 38472 2013-04-03 06:56 IntraFace-v1.2\include\opencv2\contrib\contrib.hpp
文件 3042 2013-03-30 06:55 IntraFace-v1.2\include\opencv2\contrib\detection_ba
文件 7099 2013-03-30 06:55 IntraFace-v1.2\include\opencv2\contrib\hybridtracker.hpp
文件 12807 2013-03-30 06:55 IntraFace-v1.2\include\opencv2\contrib\openfabmap.hpp
文件 23959 2013-03-30 06:55 IntraFace-v1.2\include\opencv2\contrib\retina.hpp
文件 186172 2013-06-27 06:55 IntraFace-v1.2\include\opencv2\core\core.hpp
文件 78488 2013-03-30 06:55 IntraFace-v1.2\include\opencv2\core\core_c.h
文件 7854 2013-03-30 06:55 IntraFace-v1.2\include\opencv2\core\cuda_devptrs.hpp
文件 2198 2013-03-30 06:55 IntraFace-v1.2\include\opencv2\core\devmem2d.hpp
文件 9465 2013-03-30 06:55 IntraFace-v1.2\include\opencv2\core\eigen.hpp
............此处省略312个文件信息
相关资源
- 基于Gabor特征提取和神经网络的表情识
- seetaface的人脸检测-人脸对齐-人脸识别
- 基于深度学习的人脸表情识别Tensorf
- 关于人脸表情识别相关英文文献 IE
- LFW数据集-人脸对齐图片
- 人脸表情识别 源代码
- 人脸表情识别数据集-CMU_PIE_Face-PIE和
- 表情识别数据集
- CK+人脸表情数据集151357
- PCA+KNN人脸表情识别
- opencv2+vs2013实现表情识别 ,SVM+BP神经
- DlibTest.7z
- 68人脸特征点Hog+SVM人脸表情识别
- keras人脸表情识别.rar
- 表情识别fer2013数据集
- lfw人脸数据集原图及人脸对齐图片
- 基于Gabor小波+PCA+LDA特征提取方法的
- 深度学习的表情识别
- 面部表情识别实验 报告
- 微表情识别
- Gabor小波+PCA+LDA特征提取方法的人脸表
- 微表情识别CASME2数据集
- pytorch实现人脸识别包括人脸检测(
评论
共有 条评论