diff --git a/include/yolo_v2_class.hpp b/include/yolo_v2_class.hpp index 2d42576d..bf3b28aa 100644 --- a/include/yolo_v2_class.hpp +++ b/include/yolo_v2_class.hpp @@ -776,8 +776,8 @@ public: kf.processNoiseCov.at(7) = 1e-2; kf.processNoiseCov.at(14) = 1e-2;// 5.0f; kf.processNoiseCov.at(21) = 1e-2;// 5.0f; - kf.processNoiseCov.at(28) = 1e-2; - kf.processNoiseCov.at(35) = 1e-2; + kf.processNoiseCov.at(28) = 5e-3; + kf.processNoiseCov.at(35) = 5e-3; // Measures Noise Covariance Matrix R - result smoother with higher values (1e-1) cv::setIdentity(kf.measurementNoiseCov, cv::Scalar(1e-1)); diff --git a/src/image.h b/src/image.h index be947d34..91c6fde7 100644 --- a/src/image.h +++ b/src/image.h @@ -96,6 +96,7 @@ image **load_alphabet(); image get_image_from_stream(CvCapture* cap); image get_image_from_stream_cpp(CvCapture* cap); image ipl_to_image(IplImage* src); +void save_cv_png(IplImage *img, const char *name); #endif //float get_pixel(image m, int x, int y, int c); //float get_pixel_extend(image m, int x, int y, int c); diff --git a/src/yolo_console_dll.cpp b/src/yolo_console_dll.cpp index 2d7330fa..b0e25e2d 100644 --- a/src/yolo_console_dll.cpp +++ b/src/yolo_console_dll.cpp @@ -39,12 +39,14 @@ std::vector get_3d_coordinates(std::vector bbox_vect, cv::Mat xy { bool valid_measure; int i, j; - const int R_max = 4; + const unsigned int R_max_global = 10; std::vector bbox3d_vect; for (auto &cur_box : bbox_vect) { + const unsigned int obj_size = std::min(cur_box.w, cur_box.h); + const unsigned int R_max = std::min(R_max_global, obj_size / 2); int center_i = cur_box.x + cur_box.w * 0.5f, center_j = cur_box.y + cur_box.h * 0.5f; std::vector x_vect, y_vect, z_vect; @@ -183,6 +185,8 @@ void draw_boxes(cv::Mat mat_img, std::vector result_vec, std::vector 0) obj_name += " - " + std::to_string(i.track_id); cv::Size const text_size = getTextSize(obj_name, cv::FONT_HERSHEY_COMPLEX_SMALL, 1.2, 2, 0); int max_width = (text_size.width > i.w + 2) ? text_size.width : (i.w + 2); + max_width = std::max(max_width, (int)i.w + 2); + //max_width = std::max(max_width, 283); std::string coords_3d; if (!std::isnan(i.z_3d)) { std::stringstream ss; @@ -326,6 +330,8 @@ int main(int argc, char *argv[]) #ifdef ZED_STEREO sl::InitParameters init_params; + init_params.depth_minimum_distance = 0.5; + init_params.depth_mode = sl::DEPTH_MODE_ULTRA; init_params.camera_resolution = sl::RESOLUTION_HD720; init_params.coordinate_units = sl::UNIT_METER; //init_params.sdk_cuda_ctx = (CUcontext)detector.get_cuda_context();