Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e7bbfd9
fix libmesasr download file name incorrect cause install failed
wangqiang1588 Aug 25, 2017
413fead
different from pcl persion_classifier.hpp if add (xmin+width-1) > 0 m…
wangqiang1588 Aug 25, 2017
f6794b3
add ubuntu 16.04/ROS kinetic support
wangqiang1588 Sep 11, 2017
821f1c7
Fix driver complier error
wangqiang1588 Sep 11, 2017
dffa719
Fix ROS kinetic 'fatal error: ros/ros.h: No such file or directory'
wangqiang1588 Sep 12, 2017
370817a
Fix swissranger_camera complie error
wangqiang1588 Sep 12, 2017
5245adc
Fix complie error on ROS kinetic
wangqiang1588 Sep 12, 2017
439f4e2
Fix opt_calibration complie error
wangqiang1588 Sep 12, 2017
fa1ca3c
Fix complie error
wangqiang1588 Sep 12, 2017
c917ce4
Fix complie error
wangqiang1588 Sep 12, 2017
c8a42a8
Fix ubuntu 16.04 complie error
wangqiang1588 Sep 12, 2017
490eaa2
Fix complier error on Ubuntu 16.04
wangqiang1588 Sep 12, 2017
62d7d81
Fix Opencv3 Opencv2 compatible
wangqiang1588 Sep 13, 2017
e7d3715
Fix link error
wangqiang1588 Sep 13, 2017
7102582
change calibration_toolkit source version
wangqiang1588 Sep 13, 2017
1ef934c
Fix Ubuntu 16.04 complie error
wangqiang1588 Sep 13, 2017
b6793c8
fix error on ubuntu 16.04
wangqiang1588 Sep 13, 2017
67571a3
fix libfeecnet complie error
wangqiang1588 Sep 13, 2017
96c5be8
Fix GCC 5 bug out of memory
wangqiang1588 Sep 14, 2017
8f0910c
Fix command error
wangqiang1588 Sep 14, 2017
2ac385e
Fix bug https://github.com/code-iai/iai_kinect2/issues/29
wangqiang1588 Sep 14, 2017
3b562c2
Fix kinect install shell bug
wangqiang1588 Sep 15, 2017
131f781
opencv 3.2-dev will not show image if do not call waitKey
wangqiang1588 Sep 18, 2017
5823780
Fix OpenCV Version Marco use error
wangqiang1588 Sep 18, 2017
6f67f9e
Fix OpenCV Version Marco use error
wangqiang1588 Sep 18, 2017
66780a4
Fix ubuntu 14.04 compact
wangqiang1588 Sep 18, 2017
e678c40
Fix ubuntu 14.04 compact
wangqiang1588 Sep 18, 2017
be9826b
dec cv::waitKey delay time
wangqiang1588 Sep 18, 2017
457f58f
for compact after matplotlib 1.5.1 ,we must call matplotlib.pyplot.pa…
wangqiang1588 Sep 21, 2017
084e7cc
Fix another modify cause complie failed
wangqiang1588 Sep 25, 2017
521d380
first install libboost or else it will failed on Nvidia TX2
wangqiang1588 Sep 30, 2017
9f4a456
fix /usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL…
wangqiang1588 Sep 30, 2017
c5437fb
#for Nvidiva TX2 must add drm
wangqiang1588 Sep 30, 2017
1be5e45
for Nvidiva TX2 must add libdrm
wangqiang1588 Sep 30, 2017
c7f6fe3
for Nvidiva TX2 must add libdrm
wangqiang1588 Sep 30, 2017
cf8aa4b
Merge branch 'OpenPTrack:master' into master
wangqiang1588 Jul 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bayes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
cmake_minimum_required(VERSION 2.8.3)
project(bayes)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
find_package(catkin REQUIRED COMPONENTS roscpp )
find_package(catkin REQUIRED COMPONENTS roscpp)

link_libraries(/usr/lib/liblapack.so.3gf)
if (EXISTS "/usr/lib/liblapack.so.3gf")
link_libraries(/usr/lib/liblapack.so.3gf)
elseif(EXISTS "/usr/lib/liblapack.so")
link_libraries(/usr/lib/liblapack.so)
endif()

include_directories(include include/open_ptrack/bayes include/open_ptrack/bayes/filters)

Expand Down
16 changes: 13 additions & 3 deletions detection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ find_package(VTK REQUIRED)
if(VTK_FOUND)
include_directories(${VTK_INCLUDE_DIRS})
link_directories(${VTK_LIBRARY_DIRS})
add_definitions(${VTK_DEFINITIONS})
# add_definitions(${VTK_DEFINITIONS})
include (${VTK_USE_FILE})
endif()

Expand Down Expand Up @@ -49,11 +49,21 @@ target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${OpenCV_LIBS})

add_executable(ground_based_people_detector apps/ground_based_people_detector_node.cpp)
SET_TARGET_PROPERTIES(ground_based_people_detector PROPERTIES LINK_FLAGS -L${PCL_LIBRARY_DIRS})
target_link_libraries(ground_based_people_detector ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} vtkHybrid vtkRendering)
#for Nvidiva TX2 must add drm
if(${VTK_VERSION_MAJOR} GREATER 5)
target_link_libraries(ground_based_people_detector ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} drm)
else()
target_link_libraries(ground_based_people_detector ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} vtkHybrid vtkRendering drm)
endif()

add_executable(ground_based_people_detector_sr apps/ground_based_people_detector_node_sr.cpp)
SET_TARGET_PROPERTIES(ground_based_people_detector_sr PROPERTIES LINK_FLAGS -L${PCL_LIBRARY_DIRS})
target_link_libraries(ground_based_people_detector_sr ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} vtkHybrid vtkRendering)
#for Nvidiva TX2 must add drm
if(${VTK_VERSION_MAJOR} GREATER 5)
target_link_libraries(ground_based_people_detector_sr ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} drm)
else()
target_link_libraries(ground_based_people_detector_sr ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} vtkHybrid vtkRendering drm)
endif()

add_library(haar_disp_ada src/haardispada.cpp apps/haardispada_nodelet.cpp)
target_link_libraries(haar_disp_ada ${catkin_LIBRARIES})
Expand Down
8 changes: 7 additions & 1 deletion detection/include/open_ptrack/detection/haardispada.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <map>
#include <boost/filesystem.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/core/version.hpp>
#include <opencv/cv.h>
#include <opencv/ml.h>
#include <opt_msgs/Rois.h>
Expand All @@ -65,7 +67,6 @@ namespace open_ptrack
/*****************************************************************************
** Class
*****************************************************************************/

class HaarDispAdaClassifier{

public:
Expand Down Expand Up @@ -101,8 +102,13 @@ namespace open_ptrack
void setMinConfidence(float );

private:
#if CV_MAJOR_VERSION >= 3
cv::Ptr<cv::ml::Boost> HDAC_;
cv::String classifier_filename_; // for loading and saving
#else
CvBoost HDAC_;
string classifier_filename_; // for loading and saving
#endif
int maxSamples_;
int num_filters_;
Mat integralImage_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ open_ptrack::detection::PersonClassifier<PointT>::copyMakeBorder (PointCloudPtr&
output_image->points.resize(height*width, black_point);
output_image->width = width;
output_image->height = height;
// if((width <= 0)||(height <= 0)){
// return;
// }

int x_start_in = std::max(0, xmin);
int x_end_in = std::max(x_start_in, std::min(int(input_image->width-1), xmin+width-1));
Expand Down Expand Up @@ -233,8 +236,8 @@ open_ptrack::detection::PersonClassifier<PointT>::evaluate (float height_person,
double confidence;

//std::cout << "Before copyMakeBorder: " << xmin << " " << ymin << " " << width << " " << height << std::endl;

if ((height > 0) & ((xmin+width-1) > 0))
/*different from pcl persion_classifier.hpp if add (xmin+width-1) > 0 must check if width >0 else if width <= 0 cause crash */
if ((height > 0) &&(width > 0) && ((xmin+width-1) > 0))
{
// If near the border, fill with black:
PointCloudPtr box(new PointCloud);
Expand Down
43 changes: 42 additions & 1 deletion detection/src/haardispada.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ namespace open_ptrack
int rtn = haar_features_fast(HF); // compute haar features
if(rtn== 1){
// Compute classifier score:
#if CV_MAJOR_VERSION >= 3
result = HDAC_->predict(HF);
#else
result = HDAC_.predict(HF);
#endif
}
else{
ROS_ERROR("WHY O WHY");
Expand Down Expand Up @@ -120,7 +124,11 @@ namespace open_ptrack
int rtn = haar_features_fast(HF); // compute haar features
if(rtn== 1){
// Compute classifier score:
#if CV_MAJOR_VERSION >= 3
result = HDAC_->predict(HF, cv::Mat(), cv::ml::StatModel::RAW_OUTPUT);
#else
result = HDAC_.predict(HF, cv::Mat(), cv::Range::all(), false, true);
#endif
}
else{
ROS_ERROR("WHY O WHY");
Expand Down Expand Up @@ -188,11 +196,18 @@ namespace open_ptrack
void
HaarDispAdaClassifier::train(string filename)
{
CvBoostParams bparams = CvBoostParams();
float priorFloat[] = { 1.0, HaarDispAdaPrior_ }; // preliminary priors based on ROC)
#if CV_MAJOR_VERSION >= 3
cv::Mat prior(1,sizeof(priorFloat)/sizeof(priorFloat[0]),CV_32F,&priorFloat[0],sizeof(priorFloat)/sizeof(priorFloat[0]));
HDAC_->setPriors(prior);
HDAC_->setUseSurrogates(false);
HDAC_->setWeakCount(100);
#else
CvBoostParams bparams = CvBoostParams();
bparams.priors = &priorFloat[0];
bparams.use_surrogates = false;
bparams.weak_count = 100;
#endif

// copy sub matrix for training
Mat VarIdx;
Expand All @@ -207,14 +222,22 @@ namespace open_ptrack
if(trainingLabels_.at<int>(i,0) == -1) trainingLabels_.at<int>(i,0) = 0;//classes: 0,1
Responses.at<int>(i,0) = trainingLabels_.at<int>(i,0);
}
#if CV_MAJOR_VERSION >= 3
HDAC_->train(Features, cv::ml::ROW_SAMPLE, Responses);
#else
Mat vIdx=Mat::ones(Features.cols,1,CV_8UC1); // variables of interest
Mat sIdx=Mat::ones(Responses.rows,1,CV_8UC1); // samples of interest
Mat vtyp=Mat(Features.cols,1,CV_8UC1,CV_VAR_ORDERED); // could be VAR_CATAGORICAL(discrete)
Mat MDM; // no missing mask
HDAC_.train(Features, CV_ROW_SAMPLE, Responses,vIdx,sIdx,vtyp,MDM,bparams,false);
#endif
ROS_ERROR("saving trained classifier to %s",filename.c_str());
loaded = true;
#if CV_MAJOR_VERSION >= 3
HDAC_->save(filename);
#else
HDAC_.save(filename.c_str());
#endif
// Determine Recall Statistics
int num_TP = 0;
int num_FP = 0;
Expand All @@ -223,7 +246,11 @@ namespace open_ptrack
int num_TN = 0;
int num_FN = 0;
for(int i=0;i<Features.rows;i++){
#if CV_MAJOR_VERSION >= 3
float result = HDAC_->predict(Features.row(i));
#else
float result = HDAC_.predict(Features.row(i));
#endif
if(Responses.at<int>(i,0) == 1) num_people++;
if(Responses.at<int>(i,0) != 1) num_neg++;
if(result==1 && Responses.at<int>(i,0) == 1) num_TP++; // true pos
Expand Down Expand Up @@ -262,6 +289,9 @@ namespace open_ptrack
void
HaarDispAdaClassifier::init()
{
#if CV_MAJOR_VERSION >= 3
HDAC_ = cv::ml::Boost::create();
#endif
num_filters_ = 174;
setMaxSamples(350); //use a small number to have a small memory footprint by default

Expand All @@ -280,7 +310,18 @@ namespace open_ptrack
void
HaarDispAdaClassifier::load(string filename)
{
#if CV_MAJOR_VERSION >= 3
const cv::String cv_filename(filename);
/*bug fix */
/*https://stackoverflow.com/questions/43532122/opencv-logistic-regression-load-failed */
#if CV_VERSION_MINOR > 1
HDAC_->load<cv::ml::Boost>(cv_filename);
#else
HDAC_->load(cv_filename);
#endif
#else
HDAC_.load(filename.c_str());
#endif
loaded = true;
}

Expand Down
8 changes: 7 additions & 1 deletion opt_calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ endif()
catkin_package(
INCLUDE_DIRS include
# LIBRARIES
CATKIN_DEPENDS roscpp opt_msgs calibration_common camera_info_manager cv_bridge image_transport swissranger_camera
CATKIN_DEPENDS roscpp opt_msgs calibration_common camera_info_manager cv_bridge image_transport swissranger_camera kinect
DEPENDS eigen pcl opencv2
)

Expand All @@ -56,10 +56,12 @@ add_executable(opt_calibration

## Add dependencies to the executable
## Specify libraries to link a library or executable target against
#for Nvidiva TX2 must add libdrm
target_link_libraries(opt_calibration
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${OpenCV_LIBS}
drm
)

# Publish camera_info topic for stereo:
Expand All @@ -75,8 +77,10 @@ add_executable(opt_calibration_refinement
apps/opt_calibration_refinement.cpp
src/trajectory_registration.cpp
)
#for Nvidiva TX2 must add libdrm
target_link_libraries(opt_calibration_refinement
${catkin_LIBRARIES}
drm
)

add_executable(opt_define_reference_frame
Expand All @@ -86,8 +90,10 @@ add_executable(opt_define_reference_frame
src/opt_checkerboard_extraction.cpp include/open_ptrack/opt_calibration/opt_checkerboard_extraction.h
)

#for Nvidiva TX2 must add libdrm
target_link_libraries(opt_define_reference_frame
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${OpenCV_LIBS}
drm
)
2 changes: 2 additions & 0 deletions opt_calibration/apps/status_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def spinOnce(self) :
self.lock.release()

plot.draw()
#for compact after matplotlib 1.5.1 ,we must call matplotlib.pyplot.pause(interval) or else no draw
plot.pause(0.00001)
#####################

def spin(self) :
Expand Down
2 changes: 1 addition & 1 deletion opt_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ catkin_package(
CATKIN_DEPENDS roscpp std_msgs sensor_msgs message_runtime
)

include_directories(include include/open_ptrack/${PROJECT_NAME}/)
include_directories(include ${catkin_INCLUDE_DIRS} include/open_ptrack/${PROJECT_NAME}/)

add_library(roi_msgs src/overlap.cpp )

Expand Down
2 changes: 2 additions & 0 deletions opt_utils/apps/roi_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ class roiViewerNode

// Display the cv image
cv::imshow("Detections",cv_ptr->image);
/*opencv 3.2-dev will not show image if do not call waitKey*/
cv::waitKey(1);
}

~roiViewerNode()
Expand Down
10 changes: 9 additions & 1 deletion scripts/calibration_toolkit_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ cd ~/workspace/ros/catkin/src
git clone https://github.com/iaslab-unipd/calibration_toolkit
cd calibration_toolkit
git fetch origin --tags
git checkout tags/v0.2

UBUNTU_VERSION=`lsb_release -c -s`
if [ $UBUNTU_VERSION = trusty ] || [ $UBUNTU_VERSION = saucy ] ; then
git checkout tags/v0.2
elif [ $UBUNTU_VERSION = xenial ] ; then
git checkout tags/v0.3.1
else
git checkout tags/v0.2
fi
2 changes: 2 additions & 0 deletions scripts/ceres_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if [ $UBUNTU_VERSION = trusty ]; then
./ceres_install_trusty.sh
elif [ $UBUNTU_VERSION = raring ]; then
./ceres_install_raring.sh
elif [ $UBUNTU_VERSION = xenial ]; then
./ceres_install_trusty.sh
else

echo "" 1>&2
Expand Down
11 changes: 9 additions & 2 deletions scripts/ceres_install_trusty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ sudo apt-get install cmake libgoogle-glog-dev libatlas-base-dev libeigen3-dev li
mkdir /tmp/ceres_install
cd /tmp/ceres_install

git clone https://ceres-solver.googlesource.com/ceres-solver
git clone https://github.com/ceres-solver/ceres-solver.git
cd ceres-solver
git fetch --tags
git checkout tags/1.9.0

UBUNTU_VERSION=`lsb_release -c -s`
if [ $UBUNTU_VERSION = trusty ]; then
git checkout tags/1.9.0
elif [ $UBUNTU_VERSION = xenial ]; then
git checkout tags/1.13.0
fi

cd ..
mkdir ceres-bin
cd ceres-bin
Expand Down
22 changes: 18 additions & 4 deletions scripts/kinect2_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ cd $HOME
if [ -d "libfreenect2" ]; then
read -p "The folder librefreenect2 already exist. Replace it? (y/n)" yn
case $yn in
[Yy]* ) sudo rm libfreenect2; git clone https://github.com/OpenPTrack/libfreenect2.git;;
[Yy]* ) sudo rm libfreenect2; git clone https://github.com/wangqiang1588/libfreenect2.git;;
[Nn]* ) ;;
esac
else
git clone https://github.com/OpenPTrack/libfreenect2.git;
git clone https://github.com/wangqiang1588/libfreenect2.git;
fi

#####################################################
Expand All @@ -20,13 +20,27 @@ git checkout iai_kinect2
#####################################################

cd depends/
sudo apt-get install git cmake cmake-curses-gui libXmu-dev libXi-dev libgl1-mesa-dev dos2unix xorg-dev libglu1-mesa-dev libtool automake libudev-dev libgtk2.0-dev pkg-config libjpeg-turbo8-dev libturbojpeg libglewmx-dev
sudo apt-get install git cmake cmake-curses-gui libgl1-mesa-dev dos2unix xorg-dev libglu1-mesa-dev libtool automake libudev-dev libgtk2.0-dev pkg-config libjpeg-turbo8-dev libturbojpeg libglewmx-dev libxmu-dev libxi-dev
./install_ubuntu.sh
if [ ! -f /usr/lib/x86_64-linux-gnu/libturbojpeg.so ]
then
sudo ln -s /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0.0.0 /usr/lib/x86_64-linux-gnu/libturbojpeg.so
fi

#Ubuntu 16.04
sudo apt-get install libglewmx-dev
if [ ! -f /usr/lib/gcc/x86_64-linux-gnu/libturbojpeg.so ]
then
sudo ln -s -f /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0 /usr/lib/x86_64-linux-gnu/libturbojpeg.so
fi
if [ ! -f /lib/x86_64-linux-gnu/libudev.so ]
then
sudo ln -s -f /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so
fi

cd ../examples/protonect/
#Fix bug https://github.com/code-iai/iai_kinect2/issues/29
sed -i s/'TARGET_LINK_LIBRARIES(freenect2 ${LIBRARIES})'/'TARGET_LINK_LIBRARIES(freenect2 ${LIBRARIES} udev)'/g CMakeLists.txt
cmake .
make
sudo make install
Expand All @@ -40,7 +54,7 @@ sudo rm -r libfreenect2
#install iai-kinect
cd $ROS_WORKSPACE
cd ../catkin/src/
git clone https://github.com/OpenPTrack/iai_kinect2.git
git clone https://github.com/wangqiang1588/iai_kinect2.git

#####################################################
# Temporary
Expand Down
Loading