Another compile fix

This commit is contained in:
AlexeyAB
2019-03-18 02:56:32 +03:00
parent d762df531f
commit 24dc5b7853
2 changed files with 4 additions and 3 deletions

View File

@ -8,7 +8,7 @@
#include <future>
#include <atomic>
#include <mutex> // std::mutex, std::unique_lock
#include <unordered_map> // std::unordered_map
#include <cmath>
// It makes sense only for video-Camera (not for video-File)
@ -184,7 +184,7 @@ void draw_boxes(cv::Mat mat_img, std::vector<bbox_t> result_vec, std::vector<std
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);
std::string coords_3d;
if (!isnan(i.z_3d)) {
if (!std::isnan(i.z_3d)) {
std::stringstream ss;
ss << std::fixed << std::setprecision(2) << "x:" << i.x_3d << "m y:" << i.y_3d << "m z:" << i.z_3d << "m ";
coords_3d = ss.str();

View File

@ -20,6 +20,7 @@ extern "C" {
#include <vector>
#include <iostream>
#include <algorithm>
#include <cmath>
//static Detector* detector = NULL;
@ -411,7 +412,7 @@ LIB_API bool Detector::send_json_http(std::vector<bbox_t> cur_bbox_vec, std::vec
send_str += buf;
if (!isnan(i.z_3d)) {
if (!std::isnan(i.z_3d)) {
sprintf(buf, "\n , \"coordinates_in_meters\":{\"x_3d\":%.2f, \"y_3d\":%.2f, \"z_3d\":%.2f}",
i.x_3d*100, i.y_3d, i.z_3d);
send_str += buf;