Hallo everyone,
I hope that it's useful for you.
gesturedata.h
This class can load bag files directly. (you don't need to run roscore everytime)
The following methods are implemented in gesturedata:
1. load bag files
2. show video of bag files
3. several image processing methods
4. extract the midpoints of hand (you can do this after motion detection, which may improve the accuracy)
5. write all bag files from one directory into a document.
Examples:
icl_gesture_recognition::GestureData gesturedata("/xxx/xxx.bag");
gesturedata.handSegmentation();
gesturedata.changeAllFrames(gesturedata.dep_img_seq, &GestureData::Normalize);
gesturedata.changeAllFrames(gesturedata.dep_img_seq, &GestureData::GenerateBinaryImage);
gesturedata.changeAllFrames(gesturedata.dep_img_seq, &GestureData::Erosion_Dilation);
gesturedata.MotionDetection(gesturedata.dep_img_seq,1);
vector<cv::Point2f> loc_seq;
loc_seq=gesturedata.getLocationSeq(gesturedata.dep_img_seq);
gesturedata.showGesture(gesturedata.dep_img_seq);
Note:
1.You must add <depend package="rosbag"/> into manifest.xml in order to use rosbag command in QT or some other IDEs
2.You'd better use QTcreator. new classes can be easily changed by altering CMakeList.txt
3.This code is tested in ROS(groovy). I don't know if it works well in ROS(fuerte) which is installed in computers in lab.(I think it's not a big problem)