• 大小: 3.62MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-19
  • 语言: 其他
  • 标签: 表情识别  

资源简介

mastering opencv 第六章第二节具体实现,详细分析见博客: http://blog.csdn.net/jinshengtao/article/details/43376049

资源截图

代码片段和文件信息

#include “annotate.h“

Annotate::Annotate()
{
wname = “Annotate“; 
idx = 0; pidx = -1;
}

int Annotate::set_current_image(const int idx = 0)
{
if((idx < 0) || (idx > int(data.imnames.size())))
return 0;
image = data.get_image(idx2); 
return 1;
}

void Annotate::set_clean_image(){
image_clean = image.clone();
}

void Annotate::copy_clean_image(){
image_clean.copyTo(image);
}

void Annotate::draw_instructions(){
if(image.empty())
return;
this->draw_strings(imageinstructions);
}

void Annotate::draw_points(){
data.draw_points(imageidx);
}

void Annotate::draw_chosen_point(){
if(pidx >= 0)
circle(imagedata.points[idx][pidx]1CV_RGB(02550)2CV_AA);
}

void Annotate::draw_connections(){
int m = data.connections.size();
if(m == 0)
this->draw_points();
else{
if(data.connections[m-1][1] < 0){
int i = data.connections[m-1][0];
data.connections[m-1][1] = i;
data.draw_connect(imageidx); 
this->draw_points();
circle(imagedata.points[idx][i]1CV_RGB(02550)2CV_AA);
data.connections[m-1][1] = -1;
}
else
{
data.draw_connect(imageidx);
this->draw_points();
}
}
}

void Annotate::draw_symmetry()
{
this->draw_points(); 
this->draw_connections();
for(int i = 0; i < int(data.symmetry.size()); i++)
{
int j = data.symmetry[i];
if(j != i)
{
circle(imagedata.points[idx][i]1CV_RGB(2552550)2CV_AA);
circle(imagedata.points[idx][j]1CV_RGB(2552550)2CV_AA);
}
}
if(pidx >= 0)
circle(imagedata.points[idx][pidx]1CV_RGB(02550)2CV_AA);
}

void Annotate::set_capture_instructions(){
instructions.clear();
instructions.push_back(string(“Select expressive frames.“));
instructions.push_back(string(“s - use this frame“));
instructions.push_back(string(“q - done“));
}

void Annotate::set_pick_points_instructions(){
instructions.clear();
instructions.push_back(string(“Pick Points“));
instructions.push_back(string(“q - done“));
}

void Annotate::set_connectivity_instructions(){
instructions.clear();
instructions.push_back(string(“Pick Connections“));
instructions.push_back(string(“q - done“));
}

void Annotate::set_symmetry_instructions(){
instructions.clear();
instructions.push_back(string(“Pick Symmetric Points“));
instructions.push_back(string(“q - done“));
}

void Annotate::set_move_points_instructions(){
instructions.clear();
instructions.push_back(string(“Move Points“));
instructions.push_back(string(“p - next image“));
instructions.push_back(string(“o - previous image“));
instructions.push_back(string(“q - done“));
}

void Annotate::initialise_symmetry(const int index){
int n = data.points[index].size();
data.symmetry.resize(n);
for(int i = 0; i < n; i++)
data.symmetry[i] = i;
}

void Annotate::replicate_annotations(const int index){
if((index < 0) || (index >= int(data.points.size())))
return;
for(int i = 0; i < int(data.points

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     231424  2015-02-01 16:00  face_expression\muct_annoate\Debug\muct_annoate.exe

     文件    1228116  2015-02-01 16:00  face_expression\muct_annoate\Debug\muct_annoate.ilk

     文件    1698816  2015-02-01 16:00  face_expression\muct_annoate\Debug\muct_annoate.pdb

     文件       4029  2014-12-28 22:34  face_expression\muct_annoate\muct_annoate\annotate.cpp

     文件       2752  2014-12-28 22:34  face_expression\muct_annoate\muct_annoate\annotate.h

     文件      14906  2015-02-01 16:31  face_expression\muct_annoate\muct_annoate\annotations.xml

     文件      75756  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000qa-fn.jpg

     文件      68290  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000qb-fn.jpg

     文件      71157  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000qc-fn.jpg

     文件      70820  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000qd-fn.jpg

     文件      74473  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000qe-fn.jpg

     文件      78943  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000ra-fn.jpg

     文件      71916  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000rb-fn.jpg

     文件      74523  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000rc-fn.jpg

     文件      77059  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000rd-fn.jpg

     文件      75733  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000re-fn.jpg

     文件      88078  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000sa-fn.jpg

     文件      80603  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000sb-fn.jpg

     文件      82888  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000sc-fn.jpg

     文件      86701  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000sd-fn.jpg

     文件      84380  2009-03-24 18:21  face_expression\muct_annoate\muct_annoate\data\jpg\i000se-fn.jpg

     文件     528118  2015-01-18 11:27  face_expression\muct_annoate\muct_annoate\Debug\annotate.obj

     文件       9886  2015-02-01 16:00  face_expression\muct_annoate\muct_annoate\Debug\BuildLog.htm

     文件     843492  2015-01-18 11:27  face_expression\muct_annoate\muct_annoate\Debug\ft_data.obj

     文件         65  2015-02-01 16:00  face_expression\muct_annoate\muct_annoate\Debug\mt.dep

     文件     206352  2015-01-18 11:27  face_expression\muct_annoate\muct_annoate\Debug\muct.obj

     文件        663  2015-01-18 11:27  face_expression\muct_annoate\muct_annoate\Debug\muct_annoate.exe.embed.manifest

     文件        728  2015-01-18 11:27  face_expression\muct_annoate\muct_annoate\Debug\muct_annoate.exe.embed.manifest.res

     文件        621  2015-02-01 16:00  face_expression\muct_annoate\muct_annoate\Debug\muct_annoate.exe.intermediate.manifest

     文件     652465  2015-02-01 16:00  face_expression\muct_annoate\muct_annoate\Debug\test.obj

............此处省略77个文件信息

评论

共有 条评论