]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
Merge branch 'master' of https://github.com/Shanigen/kcf
authorShanigen <vkaraf@gmail.com>
Mon, 23 Jul 2018 06:34:51 +0000 (08:34 +0200)
committerShanigen <vkaraf@gmail.com>
Mon, 23 Jul 2018 06:34:51 +0000 (08:34 +0200)
src/kcf.cpp

index 8cb08ad53ee960d23686b253580d517d4d0a4bfb..e63285c4bb1a3bd5238aff8833a943f2b6e1691c 100644 (file)
@@ -97,8 +97,8 @@ void KCF_Tracker::init(cv::Mat &img, const cv::Rect & bbox, int fit_size_x, int
         cv::resize(input_rgb, input_rgb, cv::Size(0,0), p_downscale_factor, p_downscale_factor, cv::INTER_AREA);
     } else if (!(fit_size_x == -1 && fit_size_y == -1)) {
         if (fit_size_x%p_cell_size != 0 || fit_size_y%p_cell_size != 0) {
-            std::cerr << "Fit size does not fit to hog cell size.\n";
-            exit(1);
+            std::cerr << "Fit size does not fit to hog cell size. The dimensions have to be divisible by HOG cell size, which is: " << p_cell_size << std::endl;;
+            std::exit(EXIT_FAILURE);
         }
         double tmp;
         if (( tmp = (p_pose.w * (1. + p_padding) / p_cell_size) * p_cell_size ) != fit_size_x)
@@ -133,17 +133,16 @@ void KCF_Tracker::init(cv::Mat &img, const cv::Rect & bbox, int fit_size_x, int
         p_scales.push_back(1.);
 
 #ifdef CUFFT
-    if(p_windows_size[1]/p_cell_size*(p_windows_size[0]/p_cell_size/2+1) > 1024){
-        std::cerr << "Window after forward FFT is too big for CUDA kernels. Plese use -f to set the window dimensions so its size is less 1024 pixels "
-        "in frequency domain. Currently the size of the window is: " <<  p_windows_size[0] << "x" <<  p_windows_size[1] << " which after forward FFT"
-        "with cell size set to " << p_cell_size << " will be: " << p_windows_size[0]/p_cell_size/2+1 << "x" <<  p_windows_size[1]/p_cell_size << ","
-        "which is " << p_windows_size[1]/p_cell_size*(p_windows_size[0]/p_cell_size/2+1) << " pixels."<< std::endl;
+    if (p_windows_size[1]/p_cell_size*(p_windows_size[0]/p_cell_size/2+1) > 1024) {
+        std::cerr << "Window after forward FFT is too big for CUDA kernels. Plese use -f to set the window dimensions so its size is less or equal to " <<
+        1024*p_cell_size*p_cell_size*2+1 << " pixels . Currently the size of the window is: " <<  p_windows_size[0] << "x" <<  p_windows_size[1] << 
+        " which is  " <<  p_windows_size[0]*p_windows_size[1] << " pixels. " << std::endl;
         std::exit(EXIT_FAILURE);
     }
 
     if (m_use_linearkernel){
         std::cerr << "cuFFT supports only Gaussian kernel." << std::endl;
-        exit(1);
+        std::exit(EXIT_FAILURE);
     }
     cudaSetDeviceFlags(cudaDeviceMapHost);
     CudaSafeCall(cudaHostAlloc((void**)&xf_sqr_norm, p_num_scales*sizeof(float), cudaHostAllocMapped));