在写opencv多线程的时候用到了pthread_create()函数,
int
pthread_create(pthread_t *tidp,
const
pthread_attr_t *attr,
(
void
*)(*start_rtn)(
void
*),
void
*arg);
其中函数里最后一个变量声明为void* args。因为涉及到函数之间的传参,因此考虑将void*指针转换为string类型存放opencv图片存放路径,因为void*指针的特殊性,将void*作为中间指针变量,在string转换后的void*指针传入后,再将void* 转换为string类型,在调用的线程函数中imread(string path)。记录下来这种思路,以作以后参考。
此外还有些小问题要注