构建主动外观模型

时间:2013-08-26 17:35:09

标签: opencv emgucv face-detection face-recognition

我正在尝试构建一个类似于此guide的活动外观模型。 但有些评论听起来抽象而且难以理解。因此,您可以上传创建模型所需的整个文件集,也可以发送包含该模型的链接。谢谢,抱歉我的英文!

1 个答案:

答案 0 :(得分:0)

从Tim Cootes网站下载aam项目时,它应该包含您开始使用所需的一切。

http://www.isbe.man.ac.uk/~bim/software/am_tools_doc/

我建议在linux上运行带有“wine”的Windows二进制文件。 linux二进制文件依赖于一些过时的库,需要一些努力才能正确安装。

该项目有几个关键文件夹:图像,点,模型,win_bin。 “images”是包含图像文件的文件夹,其对应的.pts文件将转到“points”文件夹。

“models”文件夹包含用于构建模型的配置.smd文件。附带的smd文件的示例如下所示:

~/Documents/am_tools/models$ cat tim_face.smd

// List of images + parameters required to define type of model
// Note: List excludes images in the separate test set (tim_face_test.smd)
model_name: tim_face
model_dir: ./
parts_file: face
image_dir: ../images/
points_dir: ../points/

shape_aligner: align_similar_2d
shape_modes:  { min: 0 max: 30 prop: 0.98 }
tex_modes:  { min: 0 max: 40 prop: 0.99 } 
combined_modes:  { min: 0 max: 30 prop: 0.99 } 
params_limiter: mdpm_box_limits
{
  sd_limits: 3
}
n_pixels: 10000
colour: Grey // Alternatives: Grey,RGB,...
// Texture Sampler can be tri_raw, tri_edge...
tex_sampler: vapm_triangle_sampler<vxl_byte>
tex_aligner: align_linear_1d
// shape_wts define how to compute relative scaling of shape & tex.
// shape_wts can be `EqualVar', `EqualEffect',...
shape_wts: EqualVar

// tex_model defines type of model to represent texture statistics, eg: pca, pca+haar1d
tex_model: pca
// Image Pyramid Builder can be gauss_byte, gauss_float, grad_float ...
pyr_builder: gauss_byte
points_pyr_builder: Same
max_im_pyr_levels: 5

// Levels of multi-res model to build :
min_level: 0
max_level: 4

// Details of points : images
training_set:
{
  107_0764.pts : 107_0764.jpg
  107_0766.pts : 107_0766.jpg
  107_0779.pts : 107_0779.jpg
  107_0780.pts : 107_0780.jpg
  107_0781.pts : 107_0781.jpg
  107_0782.pts : 107_0782.jpg
  107_0784.pts : 107_0784.jpg
  107_0785.pts : 107_0785.jpg
  107_0786.pts : 107_0786.jpg
  107_0787.pts : 107_0787.jpg
  107_0788.pts : 107_0788.jpg
  107_0789.pts : 107_0789.jpg
  107_0790.pts : 107_0790.jpg
  107_0791.pts : 107_0791.jpg
  107_0792.pts : 107_0792.jpg
}

只需确保列出的.pts和.jpg文件出现在图像和点文件夹中。接下来运行am_build_apm.exe / am_build_aam.exe命令:

~/Documents/am_tools/win_bin$ wine am_build_apm ../models/tim_face.smd

这将在win_bin文件夹中创建tim_face.apm文件。现在可以通过运行来查看创建的模型:

~/Documents/am_tools/win_bin$ wine am_view_apm.exe

并在应用程序菜单中打开〜/ Documents / am_tools / models / tim_face.smd文件。

现在在.smd文件中使用不同的参数,尝试使用pts文件添加自己的图像,我认为BioID数据库有几百个用.pts文件注释的图像。

http://www.bioid.com/index.php?q=downloads/software/bioid-face-database.html