Merge branch 'develop' into feature/android
* develop: style: remove CAM_MODELS=? complie prams fix(mac): remove tools complie on mac fix(win): calib models complie fix(models): move value fix(calibmodels): may be merge problem before cause the useless code fix(models): unused debug tag fix(complie): 4.x cv error fix(cv): 4.x error , add macro shield part fix(cv): 4.x error , shield the old algorithm temporarily when complie
This commit is contained in:
commit
01abf3d346
|
@ -316,12 +316,6 @@ if(NOT WITH_GLOG)
|
||||||
DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}
|
DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
# if(WITH_CAM_MODELS)
|
|
||||||
# install(FILES
|
|
||||||
# ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/glog/logging.h
|
|
||||||
# DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}/glog
|
|
||||||
# )
|
|
||||||
# endif()
|
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/callbacks.h
|
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/callbacks.h
|
||||||
|
|
15
Makefile
15
Makefile
|
@ -34,12 +34,7 @@ SUDO ?= sudo
|
||||||
|
|
||||||
CAM_MODELS ?=
|
CAM_MODELS ?=
|
||||||
|
|
||||||
CMAKE_BUILD_EXTRA_OPTIONS :=
|
CMAKE_BUILD_EXTRA_OPTIONS := $(CMAKE_BUILD_EXTRA_OPTIONS) -DWITH_CAM_MODELS=ON
|
||||||
ifeq ($(CAM_MODELS),)
|
|
||||||
CMAKE_BUILD_EXTRA_OPTIONS := $(CMAKE_BUILD_EXTRA_OPTIONS) -DWITH_CAM_MODELS=OFF
|
|
||||||
else
|
|
||||||
CMAKE_BUILD_EXTRA_OPTIONS := $(CMAKE_BUILD_EXTRA_OPTIONS) -DWITH_CAM_MODELS=ON
|
|
||||||
endif
|
|
||||||
|
|
||||||
.DEFAULT_GOAL := all
|
.DEFAULT_GOAL := all
|
||||||
|
|
||||||
|
@ -106,7 +101,7 @@ init:
|
||||||
build:
|
build:
|
||||||
@$(call echo,Make $@)
|
@$(call echo,Make $@)
|
||||||
ifeq ($(HOST_OS),Win)
|
ifeq ($(HOST_OS),Win)
|
||||||
@$(call cmake_build,./_build,..,-DCMAKE_INSTALL_PREFIX=$(MKFILE_DIR)/_install)
|
@$(call cmake_build,./_build,..,-DCMAKE_INSTALL_PREFIX=$(MKFILE_DIR)/_install $(CMAKE_BUILD_EXTRA_OPTIONS))
|
||||||
else
|
else
|
||||||
@$(call cmake_build,./_build,..,$(CMAKE_BUILD_EXTRA_OPTIONS))
|
@$(call cmake_build,./_build,..,$(CMAKE_BUILD_EXTRA_OPTIONS))
|
||||||
endif
|
endif
|
||||||
|
@ -176,7 +171,13 @@ samples: install
|
||||||
|
|
||||||
tools: install
|
tools: install
|
||||||
@$(call echo,Make $@)
|
@$(call echo,Make $@)
|
||||||
|
ifeq ($(HOST_OS),Mac)
|
||||||
|
$(error "Can't make tools on $(HOST_OS)")
|
||||||
|
else
|
||||||
@$(call cmake_build,./tools/_build)
|
@$(call cmake_build,./tools/_build)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: tools
|
.PHONY: tools
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,11 @@ option(WITH_BOOST "Include Boost support" ON)
|
||||||
option(WITH_GLOG "Include glog support" OFF)
|
option(WITH_GLOG "Include glog support" OFF)
|
||||||
|
|
||||||
# packages
|
# packages
|
||||||
|
|
||||||
if(WITH_API)
|
if(WITH_API)
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/DetectOpenCV.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/DetectOpenCV.cmake)
|
||||||
|
if(WITH_OPENCV4)
|
||||||
|
set(WITH_CAM_MODELS OFF)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
# Disable WITH_CAM_MODELS if WITH_API is OFF
|
# Disable WITH_CAM_MODELS if WITH_API is OFF
|
||||||
set(WITH_CAM_MODELS OFF)
|
set(WITH_CAM_MODELS OFF)
|
||||||
|
|
|
@ -80,10 +80,6 @@ const T randomNormal(const T &sigma) {
|
||||||
return x1 * w * sigma;
|
return x1 * w * sigma;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long long timeInMicroseconds(void); // NOLINT
|
|
||||||
|
|
||||||
double timeInSeconds(void);
|
|
||||||
|
|
||||||
void colorDepthImage(
|
void colorDepthImage(
|
||||||
cv::Mat &imgDepth, cv::Mat &imgColoredDepth, float minRange, // NOLINT
|
cv::Mat &imgDepth, cv::Mat &imgColoredDepth, float minRange, // NOLINT
|
||||||
float maxRange);
|
float maxRange);
|
||||||
|
@ -107,8 +103,6 @@ void LLtoUTM(
|
||||||
void UTMtoLL(
|
void UTMtoLL(
|
||||||
double utmNorthing, double utmEasting, const std::string &utmZone, // NOLINT
|
double utmNorthing, double utmEasting, const std::string &utmZone, // NOLINT
|
||||||
double &latitude, double &longitude); // NOLINT
|
double &latitude, double &longitude); // NOLINT
|
||||||
|
|
||||||
long int timestampDiff(uint64_t t1, uint64_t t2); // NOLINT
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_GPL_GPL_H_
|
#endif // SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_GPL_GPL_H_
|
||||||
|
|
|
@ -276,7 +276,8 @@ void EquidistantCamera::estimateIntrinsics(
|
||||||
double f0 = 0.0;
|
double f0 = 0.0;
|
||||||
for (size_t i = 0; i < imagePoints.size(); ++i) {
|
for (size_t i = 0; i < imagePoints.size(); ++i) {
|
||||||
std::vector<Eigen::Vector2d> center(boardSize.height);
|
std::vector<Eigen::Vector2d> center(boardSize.height);
|
||||||
double radius[boardSize.height]; // NOLINT
|
int arrayLength = boardSize.height;
|
||||||
|
double *radius = new double[arrayLength];
|
||||||
for (int r = 0; r < boardSize.height; ++r) {
|
for (int r = 0; r < boardSize.height; ++r) {
|
||||||
std::vector<cv::Point2d> circle;
|
std::vector<cv::Point2d> circle;
|
||||||
for (int c = 0; c < boardSize.width; ++c) {
|
for (int c = 0; c < boardSize.width; ++c) {
|
||||||
|
@ -320,6 +321,7 @@ void EquidistantCamera::estimateIntrinsics(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
delete[] radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f0 <= 0.0 && minReprojErr >= std::numeric_limits<double>::max()) {
|
if (f0 <= 0.0 && minReprojErr >= std::numeric_limits<double>::max()) {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
|
#define M_PI (3.14159265358979323846)
|
||||||
#else
|
#else
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -109,69 +110,8 @@ getFILETIMEoffset() {
|
||||||
return (t);
|
return (t);
|
||||||
}
|
}
|
||||||
|
|
||||||
int clock_gettime(int X, struct timespec *tp) {
|
|
||||||
LARGE_INTEGER t;
|
|
||||||
FILETIME f;
|
|
||||||
double microseconds;
|
|
||||||
static LARGE_INTEGER offset;
|
|
||||||
static double frequencyToMicroseconds;
|
|
||||||
static int initialized = 0;
|
|
||||||
static BOOL usePerformanceCounter = 0;
|
|
||||||
|
|
||||||
if (!initialized) {
|
|
||||||
LARGE_INTEGER performanceFrequency;
|
|
||||||
initialized = 1;
|
|
||||||
usePerformanceCounter = QueryPerformanceFrequency(&performanceFrequency);
|
|
||||||
if (usePerformanceCounter) {
|
|
||||||
QueryPerformanceCounter(&offset);
|
|
||||||
frequencyToMicroseconds =
|
|
||||||
static_cast<double>(performanceFrequency.QuadPart / 1000000.);
|
|
||||||
} else {
|
|
||||||
offset = getFILETIMEoffset();
|
|
||||||
frequencyToMicroseconds = 10.;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (usePerformanceCounter) {
|
|
||||||
QueryPerformanceCounter(&t);
|
|
||||||
} else {
|
|
||||||
GetSystemTimeAsFileTime(&f);
|
|
||||||
t.QuadPart = f.dwHighDateTime;
|
|
||||||
t.QuadPart <<= 32;
|
|
||||||
t.QuadPart |= f.dwLowDateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
t.QuadPart -= offset.QuadPart;
|
|
||||||
microseconds = static_cast<double>(t.QuadPart / frequencyToMicroseconds);
|
|
||||||
t.QuadPart = microseconds;
|
|
||||||
tp->tv_sec = t.QuadPart / 1000000;
|
|
||||||
tp->tv_nsec = (t.QuadPart % 1000000) * 1000;
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned long long timeInMicroseconds(void) { // NOLINT
|
|
||||||
struct timespec tp;
|
|
||||||
#ifdef __APPLE__
|
|
||||||
tp = orwl_gettime();
|
|
||||||
#else
|
|
||||||
clock_gettime(CLOCK_REALTIME, &tp);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return tp.tv_sec * 1000000 + tp.tv_nsec / 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
double timeInSeconds(void) {
|
|
||||||
struct timespec tp;
|
|
||||||
#ifdef __APPLE__
|
|
||||||
tp = orwl_gettime();
|
|
||||||
#else
|
|
||||||
clock_gettime(CLOCK_REALTIME, &tp);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return static_cast<double>(tp.tv_sec) +
|
|
||||||
static_cast<double>(tp.tv_nsec) / 1000000000.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
float colormapAutumn[128][3] = {
|
float colormapAutumn[128][3] = {
|
||||||
{1.0f, 0.f, 0.f}, {1.0f, 0.007874f, 0.f}, {1.0f, 0.015748f, 0.f},
|
{1.0f, 0.f, 0.f}, {1.0f, 0.007874f, 0.f}, {1.0f, 0.015748f, 0.f},
|
||||||
{1.0f, 0.023622f, 0.f}, {1.0f, 0.031496f, 0.f}, {1.0f, 0.03937f, 0.f},
|
{1.0f, 0.023622f, 0.f}, {1.0f, 0.031496f, 0.f}, {1.0f, 0.03937f, 0.f},
|
||||||
|
@ -745,23 +685,4 @@ void UTMtoLL(
|
||||||
longitude = LongOrigin + longitude / M_PI * 180.0;
|
longitude = LongOrigin + longitude / M_PI * 180.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long int timestampDiff(uint64_t t1, uint64_t t2) { // NOLINT
|
|
||||||
if (t2 > t1) {
|
|
||||||
uint64_t d = t2 - t1;
|
|
||||||
|
|
||||||
if (d > std::numeric_limits<long int>::max()) { // NOLINT
|
|
||||||
return std::numeric_limits<long int>::max(); // NOLINT
|
|
||||||
} else {
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uint64_t d = t1 - t2;
|
|
||||||
|
|
||||||
if (d > std::numeric_limits<long int>::max()) { // NOLINT
|
|
||||||
return std::numeric_limits<long int>::min(); // NOLINT
|
|
||||||
} else {
|
|
||||||
return -static_cast<long int>(d); // NOLINT
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,13 +339,6 @@ void RectifyProcessor::InitParams(
|
||||||
generateCameraFromIntrinsicsEquidistant(in_left);
|
generateCameraFromIntrinsicsEquidistant(in_left);
|
||||||
camodocal::CameraPtr camera_odo_ptr_right =
|
camodocal::CameraPtr camera_odo_ptr_right =
|
||||||
generateCameraFromIntrinsicsEquidistant(in_right);
|
generateCameraFromIntrinsicsEquidistant(in_right);
|
||||||
auto calib_infos_temp =
|
|
||||||
stereoRectify(camera_odo_ptr_left,
|
|
||||||
camera_odo_ptr_right,
|
|
||||||
in_left,
|
|
||||||
in_right,
|
|
||||||
ex_right_to_left);
|
|
||||||
*calib_infos = *calib_infos_temp;
|
|
||||||
auto calib_info_tmp = stereoRectify(camera_odo_ptr_left,
|
auto calib_info_tmp = stereoRectify(camera_odo_ptr_left,
|
||||||
camera_odo_ptr_right,
|
camera_odo_ptr_right,
|
||||||
in_left,
|
in_left,
|
||||||
|
|
|
@ -460,8 +460,8 @@ void Synthetic::InitProcessors() {
|
||||||
auto &&rectify_processor_ocv =
|
auto &&rectify_processor_ocv =
|
||||||
std::make_shared<RectifyProcessorOCV>(intr_left_, intr_right_, extr_,
|
std::make_shared<RectifyProcessorOCV>(intr_left_, intr_right_, extr_,
|
||||||
RECTIFY_PROC_PERIOD);
|
RECTIFY_PROC_PERIOD);
|
||||||
rectify_processor = rectify_processor_ocv;
|
|
||||||
Q = rectify_processor_ocv->Q;
|
Q = rectify_processor_ocv->Q;
|
||||||
|
rectify_processor = rectify_processor_ocv;
|
||||||
#ifdef WITH_CAM_MODELS
|
#ifdef WITH_CAM_MODELS
|
||||||
} else if (calib_model_ == CalibrationModel::KANNALA_BRANDT) {
|
} else if (calib_model_ == CalibrationModel::KANNALA_BRANDT) {
|
||||||
rectify_processor_imp =
|
rectify_processor_imp =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user