pans
2017-01-04 2abba1eed779847b85ef44401f2ae410fba56cd8


git-svn-id: http://192.168.1.226/svn/proxy@77 454eff88-639b-444f-9e54-f578c98de674
4个文件已修改
37 ■■■■ 已修改文件
RtspFace/demo/src/DBuntil.cpp 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/demo/src/faceAPI.cpp 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/demo/src/test.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/demo/src/tools.cpp 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/demo/src/DBuntil.cpp
@@ -49,22 +49,30 @@
bool DBuntil::db_select(person* per)
{
    std::cout<<"db_select start"<<std::endl;
    sprintf( sql, "select a.p_id,b.`name`,b.img from face_person a,user_info b where a.face_id = %d AND a.p_id = b.pid " ,per->f_id );
    sprintf( sql, "select a.p_id,b.name,b.img from face_person a,user_info b where a.face_id = %d AND a.p_id = b.pid " ,per->f_id );
    std::cout<<"==========start============"<<std::endl;
    std::cout<<"per->f_id="<<per->f_id<<std::endl;
    std::cout<<sql<<std::endl;
    std::cout<<"==========end=============="<<std::endl;
    mysql_query(&myCont, "SET NAMES utf8"); //设置编码格式
    res = mysql_query(&myCont,sql);//查询
    if (!res)
    {
        result = mysql_store_result(&myCont);
        if (result)
        if (result != NULL)
        {
            while (sql_row = mysql_fetch_row(result))
            {
                //获取具体的数据
                per->p_id = atoi( sql_row[0]);
                per->name = sql_row[1];
                std::cout<<"per->p_id="<<per->p_id<<std::endl;
                std::cout<<"per->name="<<per->name<<std::endl;
                std::cout<<"per->f_id="<<per->f_id<<std::endl;
            }
        }
        }else
            std::cout<<"result is null?"<<std::endl;
    }
    else
    {
RtspFace/demo/src/faceAPI.cpp
@@ -196,8 +196,10 @@
    } else {
        fprintf(stderr, "cv_verify_search_face failed, error code %d\n", cv_result);
    }
    std::cout<<"this is hits"<<std::endl;
    if (top_scores[0] != 0) {
        indx=top_idxs[0];
        std::cout<<"indx="<<indx<<std::endl;
    }
    if (top_idxs) {
        delete[]top_idxs;
@@ -206,6 +208,7 @@
        delete[]top_scores;
    }
    cv_verify_release_feature(p_feature);
    std::cout<<"return indx"<<std::endl;
    return indx;
}
RtspFace/demo/src/test.cpp
@@ -15,7 +15,7 @@
    char *image_list = "../test_image/imglist";
    
    
    person p={0,"axsdcc"};
    person *p={0,"axsdcc"};
    
    cv::Mat bgr_image = cv::imread(image_path);
    if(bgr_image.data != NULL) {
@@ -28,7 +28,8 @@
    int idx = -11;
    tools tool=tools();
    //idx=tool.reg(bgr_image,&p);
    tool.search(bgr_image,&p);
    tool.search(bgr_image,p);
    cout<<"============================================"<<endl;
    cout<<"p_id="<<p.p_id<<endl;
    cout<<"name="<<p.name<<endl;
    cout<<"f_id="<<p.f_id<<endl;
RtspFace/demo/src/tools.cpp
@@ -11,9 +11,12 @@
int tools::search(cv::Mat image,person *p)
{
    p={};
    p->f_id = f_api.do_reasch(image);
    if(p->f_id < 0)
    //p={};
    int temp = f_api.do_reasch(image);
    std::cout<<"temp="<<temp<<std::endl;
    p->f_id = temp;
    std::cout<<"p->f_id"<<p->f_id<<std::endl;
    if(p->f_id > 0)
    {
        if(do_search(p) == 0)
        {
@@ -27,7 +30,7 @@
{
    p={};
    p->f_id = f_api.do_reasch(s_feature);
    if(p->f_id < 0)
    if(p->f_id > 0)
    {
        if(do_search(p) == 0)
        {
@@ -60,7 +63,7 @@
{
    p={};
    p->f_id = f_api.do_register(image);
    if(p->f_id < 0)
    if(p->f_id > 0)
    {
        if(dbu.db_register(p))
        {