Compile fix. And minor fixes

This commit is contained in:
AlexeyAB
2019-03-19 20:21:34 +03:00
parent d2abf0fa57
commit 9dddf82ab6
3 changed files with 10 additions and 3 deletions

View File

@ -776,8 +776,8 @@ public:
kf.processNoiseCov.at<float>(7) = 1e-2;
kf.processNoiseCov.at<float>(14) = 1e-2;// 5.0f;
kf.processNoiseCov.at<float>(21) = 1e-2;// 5.0f;
kf.processNoiseCov.at<float>(28) = 1e-2;
kf.processNoiseCov.at<float>(35) = 1e-2;
kf.processNoiseCov.at<float>(28) = 5e-3;
kf.processNoiseCov.at<float>(35) = 5e-3;
// Measures Noise Covariance Matrix R - result smoother with higher values (1e-1)
cv::setIdentity(kf.measurementNoiseCov, cv::Scalar(1e-1));

View File

@ -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);

View File

@ -39,12 +39,14 @@ std::vector<bbox_t> get_3d_coordinates(std::vector<bbox_t> 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<bbox_t> 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<float> x_vect, y_vect, z_vect;
@ -183,6 +185,8 @@ void draw_boxes(cv::Mat mat_img, std::vector<bbox_t> result_vec, std::vector<std
if (i.track_id > 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();