├── parameters.yml
├── run_tld
└── src
├── FerNNClassifier.cpp
├── LKTracker.cpp
├── run_tld.cpp
├── TLD.cpp
└── tld_utils.cpp
2、往run_tld.cpp加入语音提示功能代码:
2.1、头文件
#include "config.h" // xiaoyi added here--ekho
#include "ekho.h" //xiaoyi added here—ekho
2.2、线程函数
因为语音的合成和播放需要一定的时间,所以为了使得在语音播放的同时,TLD系统正常工作,就需要通过创建新的进程或者线程,将语音合成放在新的线程上面来实现:
在main函数前添加:
//xiaoyi added here
void* voicetip(void *arg)
{
string tiptext = *(string *)arg; //线程传递参数的转换比较麻烦
Ekho voice("Mandarin");
voice.blockSpeak(tiptext);
}
2.3、添加语音提示:
在main函数中需要添加语音提示的地方(例如:系统初始化时,跟踪目标不见时等)添加创建线程的代码:
//xiaoyi added here
pthread_t tid;
string tiptext = "您好,欢迎进入人机交互系统!";
if (pthread_create(&tid, NULL, voicetip, &tiptext)) //create thread
perror("Fail to create thread");
3、修改Makefile:
由于编译TTS需要添加不少的头文件和链接库,所以使得这个Makefile比较凌乱和庞大了。