计算机视觉之统计形状模型——Stasm源码阅读

本文介绍了Stasm 4.1.0版本,重点解析了stasm_lib.cpp中的stasm_search_single()接口函数,用于在人脸图片中检测landmark点。MOD_1文件夹包含预先训练的ASM模型,Shapemod.cpp用于对b的约束,asm.cpp定义了ASM模型类,而apps文件夹则包含测试程序。
摘要由CSDN通过智能技术生成

我下载的是Stasm 4.1.0版本。

stasm文件夹

包含的是模型的实现。主要的源码文件是 stasm_lib.cpp,其中的函数stasm_search_single()是主要接口函数,在给定的一张人脸图片中搜索landmark点。

1、MOD_1文件夹对ASM进行初始化,给出特征向量、特征值以及对b的约束值,是一个已经训练好的模型。
MOD_1/initasm.cpp:
函数:

  • void InitMods( // initialize 一个 ASM model
    vec_Mod& mods, // out: ASM model (only one model in this version of Stasm)
    const char* datadir) // in: directory of face detector files

2、Shapemod.cpp:
变量:

  • static const int SHAPEHACK_MINPYRLEV = 2;

函数:

  • static void LimitB(
    VEC& b, // io: eigvec weights
    const VEC& eigvals, // in
    double bmax) // in

    对b约束到bmax * sqrt(lambda_i)

  • Shape ConformShapeToMod( // Return a copy of inshape conformed to the model
    VEC& b, // io: eigvec weights, 2n x 1

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值