Add demo_utils.

This commit splits the utils file into two different files:
utils and demo_utils, to overcome some opencv problems caused
by demo_utils includes.

Signed-off-by: Davide Sapienza <sapienza.dav@gmail.com>
This commit is contained in:
Davide Sapienza
2021-07-22 10:45:18 +02:00
parent 1216e8bb74
commit b9f82510d3
6 changed files with 43 additions and 22 deletions
+22
View File
@@ -0,0 +1,22 @@
#ifndef DEMO_UTILS_H
#define DEMO_UTILS_H
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <stdlib.h>
#ifdef __linux__
#include <unistd.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <yaml-cpp/yaml.h>
#endif
void readCalibrationMatrix(const std::string& path, cv::Mat& calib_mat);
#endif //DEMO_UTILS_H
-5
View File
@@ -15,11 +15,7 @@
#ifdef __linux__
#include <unistd.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <yaml-cpp/yaml.h>
#endif
#include <ios>
@@ -137,7 +133,6 @@ void matrixMulAdd( cublasHandle_t handle, dnnType* srcData, dnnType* dstData,
void getMemUsage(double& vm_usage_kb, double& resident_set_kb);
void printCudaMemUsage();
void removePathAndExtension(const std::string &full_string, std::string &name);
void readCalibrationMatrix(const std::string& path, cv::Mat& calib_mat);
static inline bool isCudaPointer(void *data) {
cudaPointerAttributes attr;
return cudaPointerGetAttributes(&attr, data) == 0;