KCF_ROS + TLD_ROS 原理以及源码分析

发布时间:2017年07月28日 17:04:37    浏览数:1170次    来自:David_Han008
KCF_ROS + TLD_ROS 原理以及源码分析

扩展链接:百度搜素vot2016,会有相关的资料。 
KCF缺点是有边界效应 
有一个改进的版本是:SRDCF 
大牛的 CSDN博客。说明:http://blog.csdn.net/app_12062011/article/details/52230009 
原来大神早就写了源码解析:http://blog.csdn.net/app_12062011/article/details/52277159 
这个地方有大神的论文的源码,所有的关于vot2016的源码 
目标跟踪之GOTURN:Learning to Track at 100 FPS with Deep Regression Networks 
http://blog.csdn.net/linolzhang/article/details/72354427

目标跟踪之相关滤波:CF及后续改进篇 
http://blog.csdn.net/linolzhang/article/details/72759918

目标跟踪之ECO:Efficient Convolution Operators for Tracking 
http://blog.csdn.net/linolzhang/article/details/72824753

我参考这个博客切换OpenCV的 
http://blog.csdn.net/haizimin/article/details/51927386


1.png

代码结构:

turtlebot_cf_tracking
    -src
        -main
            -image_acquisition.cpp
            -image_acquistion.hpp
            -main_kcf.cpp
        -cf_libs
            -common
                cf_track.hpp
                cv_ext.hpp
                feature_channels.hpp
                mat_const.hpp
                math_helper.hpp
                math_helper.hpp
                scale_estimator.hpp
                tracker_debug.hpp
            -kcf
                kcf_tracker.hpp
                kcf_debug.hpp
            -3rdparty
                cv_ext
                piotr
                tclap
    follower
        follower.cpp

在follower.cpp当中,主要分析

最重要的就是这里。最后一个transform_callback是一个回调函数。通过前面产生的BoundingBox

ros::Subscriber tld_msg_sub = m.subscribe("BoundingBox", 1000, transform_callback);

有价值的部分就是这里

void transform_callback(const turtlebot_cf_tracking::BoundingBox& msg)
{
ROS_INFO("transform_callback start! ");ROS_INFO("bool enable_obs_avoid_ in function transform_callback(): %d", enable_obs_avoid_);ros::Rate loop_rate(10);//loop_rate(10)可以控制while(ros:ok()的循环频率if (!enable_obs_avoid_)
{
    ROS_INFO("tracking control program start!");
    int x = msg.x;
    int y = msg.y;
    int width = msg.width;
    int height = msg.height;
    ROS_INFO("x,y,width,height:%d %d %d %d",x,y,width,height);
  //  ROS_INFO("turtlebot tracking control message count: %d",count);

    BB_info.centerX = x+width/2;
    BB_info.centerY = y-height/2;//由于turtleBot不能在三维平面移动,centerY在这里实际上没有起作用
    BB_info.area = width * height;   
  //  ROS_INFO("transformat successs!") ;
    /*发布turtleBot控制消息*/
    geometry_msgs::Twist twist;
    twist.linear.x = msg.controlSpeed; twist.linear.y = 0; twist.linear.z = 0;
    twist.angular.x = 0; twist.angular.y = 0; twist.angular.z = msg.controlTurn;
    pub.publish(twist);
    //ros::spinOnce();
  //  loop_rate.sleep();
    ROS_INFO("Publish turtlebot control message sucess!");
  //  }
}

我觉得启动的顺序应该是:先运行KCF的node。随后再运行follow.cpp。

随后我们查看关于cmake中KCF的节点状况

add_executable(KCFcpp
    src/main/main_kcf.cpp
    src/cf_libs/kcf/kcf_debug.hpp
    src/cf_libs/kcf/kcf_tracker.hpp    
    ${CF_MAIN_SOURCES}
    ${CF_LIB_COMMON_SOURCES})
target_link_libraries(KCFcpp ${OpenCV_LIBS} ${catkin_LIBRARIES})

主要就是main_kcf.cpp kcf_debug.hpp kcf_tracker.hpp和src lib里面的东西。

重新系统安装过程 
1、Ubuntu14.04.5安装之后 
2、ROS 安装 
3、安装opencv3.1 
注意事项 
安装参考博客http://blog.csdn.net/junmuzi/article/details/49888123

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..

将组合算法的包和kcf_follower 
下面出现的这个问题的,是你讲kcf_ros 和另外的 组合算法那包放在同一个工作空间中编译导致cmake 错误,解决办法就是把原来的那个包删掉,就可以了。只留个你要用的包.

CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library  "/opt/ros/indigo/lib/librosconsole_backend_interface.so" to target "KCFcpp"
  which is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library "/usr/lib/liblog4cxx.so" to target "KCFcpp"
  which is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libboost_regex.so"
  to target "KCFcpp" which is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library "/opt/ros/indigo/lib/libxmlrpcpp.so" to target  "KCFcpp" which is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library  "/opt/ros/indigo/lib/libroscpp_serialization.so" to target "KCFcpp" which
  is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library "/opt/ros/indigo/lib/librostime.so" to target  "KCFcpp" which is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library  "/usr/lib/x86_64-linux-gnu/libboost_date_time.so" to target "KCFcpp" which
  is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library "/opt/ros/indigo/lib/libcpp_common.so" to
  target "KCFcpp" which is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libboost_system.so"
  to target "KCFcpp" which is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libboost_thread.so"
  to target "KCFcpp" which is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libpthread.so" to
  target "KCFcpp" which is not built in this directory.


CMake Error at kcf_tracking_ros/turtlebot_cf_tracking/CMakeLists.txt:154 (target_link_libraries):
  Attempt to add link library  "/usr/lib/x86_64-linux-gnu/libconsole_bridge.so" to target "KCFcpp" which
  is not built in this directory.-- Configuring incomplete, errors occurred!See also "/home/jemma_zhou/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/jemma_zhou/catkin_ws/build/CMakeFiles/CMakeError.log".

标签: ROSClubkcftld

评论共0条评论

登录后再评论!

全部评论

目前没有评论