Compare commits
155 Commits
2.2.1-rc
...
devel-s210
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e32138c70a | ||
|
|
61b0d85292 | ||
|
|
1c17308a02 | ||
|
|
f6abc57475 | ||
|
|
e7dc4b7def | ||
|
|
54a9159850 | ||
|
|
9b7c36c724 | ||
|
|
f59c918e81 | ||
|
|
324e68bca5 | ||
|
|
486e9d459d | ||
|
|
515bcb5f8a | ||
|
|
a57c096e91 | ||
|
|
132cbc19e2 | ||
|
|
66eb9883ff | ||
|
|
206683b76f | ||
|
|
b9db889fa3 | ||
|
|
28ca9b60b0 | ||
|
|
0ecb395044 | ||
|
|
97701188b8 | ||
|
|
4ebdcf9bee | ||
|
|
0b2fabe550 | ||
|
|
3458aa19cf | ||
|
|
04f32f21ba | ||
|
|
1afe33f924 | ||
|
|
e832fa66b9 | ||
|
|
4c49a6af26 | ||
|
|
2a1232647a | ||
|
|
35e069a858 | ||
|
|
b625dca3df | ||
|
|
02f39dbf9e | ||
|
|
4c291588ab | ||
|
|
ce76b16c07 | ||
|
|
c7f1cb718e | ||
|
|
7a9f9139fd | ||
|
|
0c5a4f7014 | ||
|
|
f0d2950701 | ||
|
|
4fcdb6fc7b | ||
|
|
b346f7fec9 | ||
|
|
1811f20a14 | ||
|
|
bd273eed4f | ||
|
|
772ba8ebfa | ||
|
|
210ddba1ba | ||
|
|
e991d59b45 | ||
|
|
7789bc8474 | ||
|
|
7e5b3ee419 | ||
|
|
2b1288bcd4 | ||
|
|
0fc1196b52 | ||
|
|
ee19a8c857 | ||
|
|
6d39773439 | ||
|
|
677c10925f | ||
|
|
5e8bc7c05b | ||
|
|
0610d43fe5 | ||
|
|
4021c565d2 | ||
|
|
2096f93a92 | ||
|
|
d9393cfe76 | ||
|
|
ae8cc4cae2 | ||
|
|
9ef4820226 | ||
|
|
256730eabe | ||
|
|
aeefa8f48a | ||
|
|
fbec6bfc65 | ||
|
|
154f5f1b91 | ||
|
|
eef9dc0739 | ||
|
|
8331b8415d | ||
|
|
41610fd714 | ||
|
|
bb2f0e4dd1 | ||
|
|
1bd02ef56c | ||
|
|
21a54a4637 | ||
|
|
a57edded4b | ||
|
|
6a15a87782 | ||
|
|
fccc52eceb | ||
|
|
f7abe90c04 | ||
|
|
66ce5c8ad0 | ||
|
|
d6cb89bc04 | ||
|
|
528bf6e700 | ||
|
|
8bc4089677 | ||
|
|
6fa55e9ad7 | ||
|
|
7475dc3dbe | ||
|
|
c214a0c9fd | ||
|
|
9a3a53b240 | ||
|
|
8d12fc8f14 | ||
|
|
969cbfd073 | ||
|
|
3badd53c4b | ||
|
|
f803e3a75b | ||
|
|
f923414660 | ||
|
|
d443029599 | ||
|
|
b102e5ae19 | ||
|
|
4c53515056 | ||
|
|
8e302b9d07 | ||
|
|
9a465b9f04 | ||
|
|
3d38b43d04 | ||
|
|
e95a5e6b1d | ||
|
|
972ab79a76 | ||
|
|
08271be063 | ||
|
|
14988ffd24 | ||
|
|
48a9cd0461 | ||
|
|
1529e77ffd | ||
|
|
5c46c72883 | ||
|
|
8c016597d2 | ||
|
|
e0161ef696 | ||
|
|
a9353c965a | ||
|
|
c58dd28f63 | ||
|
|
b07930cd55 | ||
|
|
77e4411a4c | ||
|
|
2a56616195 | ||
|
|
30363e18c6 | ||
|
|
33e38bba2f | ||
|
|
59370e3e8d | ||
|
|
672b9da6f9 | ||
|
|
6a39aae98f | ||
|
|
aa7e89a502 | ||
|
|
41222abfec | ||
|
|
fbdbb5b6f6 | ||
|
|
30332a80de | ||
|
|
13e9a89b59 | ||
|
|
6feeb49d62 | ||
|
|
dfc0de34d4 | ||
|
|
3c670cedb3 | ||
|
|
8d945fe042 | ||
|
|
0d1b063942 | ||
|
|
c3fc4ba3ba | ||
|
|
0efb51ac11 | ||
|
|
94fd56a65d | ||
|
|
23e28e20a6 | ||
|
|
e40a4aaa3f | ||
|
|
5677aa56b2 | ||
|
|
ef890dee0c | ||
|
|
4614a64dc9 | ||
|
|
f92ecd4371 | ||
|
|
7f6effebbb | ||
|
|
576558e5a1 | ||
|
|
a0c3fcea89 | ||
|
|
b9def3128e | ||
|
|
67a0356a84 | ||
|
|
6d961203be | ||
|
|
26d95ec0ac | ||
|
|
00aa72166d | ||
|
|
33d3f15b86 | ||
|
|
b139fd21c3 | ||
|
|
614227a85c | ||
|
|
d2b4cc3022 | ||
|
|
a7750e8217 | ||
|
|
94053b8e35 | ||
|
|
27c8ccaac3 | ||
|
|
5ef5e8d866 | ||
|
|
f1003b63b3 | ||
|
|
900c44179d | ||
|
|
d4547c5525 | ||
|
|
c5a4161b9c | ||
|
|
08fb1a425f | ||
|
|
01c3c71516 | ||
|
|
259dc968aa | ||
|
|
b33fc86a45 | ||
|
|
25220a27ed | ||
|
|
659f03ac18 | ||
|
|
6c25f06005 |
5
.gitignore
vendored
@@ -16,6 +16,11 @@ _output/
|
||||
|
||||
/plugins/
|
||||
|
||||
/3rdparty/opencv/
|
||||
/pkginfo.sh
|
||||
/*.nsi
|
||||
/*.exe
|
||||
|
||||
# ros
|
||||
|
||||
/wrappers/ros/build
|
||||
|
||||
184
CMakeLists.txt
@@ -14,10 +14,14 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(mynteye VERSION 2.2.1 LANGUAGES C CXX)
|
||||
project(mynteye VERSION 2.2.2 LANGUAGES C CXX)
|
||||
|
||||
include(cmake/Common.cmake)
|
||||
|
||||
if(NOT CMAKE_DEBUG_POSTFIX)
|
||||
set(CMAKE_DEBUG_POSTFIX d)
|
||||
endif()
|
||||
|
||||
# options
|
||||
|
||||
include(cmake/Option.cmake)
|
||||
@@ -79,6 +83,17 @@ configure_file(
|
||||
include/mynteye/mynteye.h @ONLY
|
||||
)
|
||||
|
||||
configure_file(
|
||||
cmake/templates/pkginfo.sh.in
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pkginfo.sh @ONLY
|
||||
)
|
||||
if(OS_WIN)
|
||||
configure_file(
|
||||
scripts/win/nsis/winpack.nsi.in
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/winpack.nsi @ONLY
|
||||
)
|
||||
endif()
|
||||
|
||||
# targets
|
||||
|
||||
add_definitions(-DMYNTEYE_EXPORTS)
|
||||
@@ -90,13 +105,7 @@ set_outdir(
|
||||
"${OUT_DIR}/bin"
|
||||
)
|
||||
|
||||
set(MYNTEYE_CMAKE_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
|
||||
set(MYNTEYE_CMAKE_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
set(MYNTEYE_CMAKE_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
set(MYNTEYE_CMAKE_INSTALLDIR "${MYNTEYE_CMAKE_LIBDIR}/cmake/${MYNTEYE_NAME}")
|
||||
|
||||
## main
|
||||
|
||||
if(WITH_GLOG)
|
||||
add_executable(main src/main.cc)
|
||||
target_link_libraries(main glog::glog)
|
||||
@@ -114,27 +123,6 @@ if(NOT WITH_GLOG AND NOT OS_WIN)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${__MINIGLOG_FLAGS}")
|
||||
unset(__MINIGLOG_FLAGS)
|
||||
endif()
|
||||
|
||||
set(MYNTEYE_PUBLIC_H
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/callbacks.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/global.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/logger.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include/mynteye/mynteye.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/types.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/utils.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/device/context.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/device/device.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/internal/files.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/internal/strings.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/internal/times.h
|
||||
)
|
||||
if(WITH_API)
|
||||
list(APPEND MYNTEYE_PUBLIC_H
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/api/api.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/api/plugin.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/api/processor/object.h
|
||||
)
|
||||
endif()
|
||||
if(NOT WITH_GLOG)
|
||||
list(APPEND MYNTEYE_PUBLIC_H
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/miniglog.h
|
||||
@@ -142,50 +130,68 @@ if(NOT WITH_GLOG)
|
||||
endif()
|
||||
|
||||
if(OS_WIN)
|
||||
set(UVC_SRC src/uvc/uvc-wmf.cc)
|
||||
set(UVC_SRC src/mynteye/uvc/win/uvc-wmf.cc)
|
||||
elseif(OS_MAC)
|
||||
set(UVC_SRC src/uvc/uvc-libuvc.cc)
|
||||
add_compile_options(-x objective-c++)
|
||||
## INCLUDE_DIRECTORIES(src/mynteye/uvc/macosx)
|
||||
## INCLUDE_DIRECTORIES(src/mynteye/uvc/macosx/VVUVCKit)
|
||||
## aux_source_directory(src/mynteye/uvc/macosx/VVUVCKit/ MAC_VVUVCKIT_SRC_LIST)
|
||||
## aux_source_directory(src/mynteye/uvc/macosx/USBBusProber/ MAC_USBBUSPROBER_SRC_LIST)
|
||||
## add_library(usbBusProber SHARED ${MAC_USBBUSPROBER_SRC_LIST})
|
||||
## set_target_properties(usbBusProber PROPERTIES FRAMEWORK TRUE )
|
||||
## add_library(vvuvckit SHARED ${MAC_VVUVCKIT_SRC_LIST})
|
||||
## set_target_properties(vvuvckit PROPERTIES FRAMEWORK TRUE )
|
||||
|
||||
INCLUDE_DIRECTORIES(src/mynteye/uvc/macosx/USBBusProber.framework/Headers)
|
||||
INCLUDE_DIRECTORIES(src/mynteye/uvc/macosx/VVUVCKit.framework/Headers)
|
||||
find_library(VVUVCKIT_LIBRARY VVUVCKit PATHS src/mynteye/uvc/macosx)
|
||||
find_library(USB_LIBRARY USBBusProber PATHS src/mynteye/uvc/macosx)
|
||||
MARK_AS_ADVANCED (VVUVCKIT_LIBRARY USB_LIBRARY)
|
||||
SET(OSX_EXTRA_LIBS ${VVUVCKIT_LIBRARY} ${USB_LIBRARY})
|
||||
|
||||
set(UVC_SRC src/mynteye/uvc/macosx/CameraEngine.cpp src/mynteye/uvc/macosx/AVfoundationCamera.mm src/mynteye/uvc/macosx/uvc-vvuvckit.cc )
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework CoreFoundation -framework AVFoundation -framework IOKit -framework AppKit -framework Cocoa -framework CoreMedia -framework CoreData -framework Foundation -framework CoreVideo ${__MACUVCLOG_FLAGS}")
|
||||
|
||||
find_package(libuvc REQUIRED)
|
||||
set(UVC_LIB ${libuvc_LIBRARIES})
|
||||
|
||||
include_directories(${libuvc_INCLUDE_DIRS})
|
||||
elseif(OS_LINUX)
|
||||
set(UVC_SRC src/uvc/uvc-v4l2.cc)
|
||||
set(UVC_SRC src/mynteye/uvc/linux/uvc-v4l2.cc)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported OS.")
|
||||
endif()
|
||||
|
||||
set(MYNTEYE_SRCS
|
||||
${UVC_SRC}
|
||||
src/internal/channels.cc
|
||||
src/internal/config.cc
|
||||
src/internal/dl.cc
|
||||
src/internal/files.cc
|
||||
src/internal/motions.cc
|
||||
src/internal/streams.cc
|
||||
src/internal/strings.cc
|
||||
src/internal/types.cc
|
||||
src/public/types.cc
|
||||
src/public/utils.cc
|
||||
src/device/context.cc
|
||||
src/device/device.cc
|
||||
src/device/device_s.cc
|
||||
src/mynteye/types.cc
|
||||
src/mynteye/util/files.cc
|
||||
src/mynteye/util/strings.cc
|
||||
src/mynteye/device/channels.cc
|
||||
src/mynteye/device/config.cc
|
||||
src/mynteye/device/context.cc
|
||||
src/mynteye/device/device.cc
|
||||
src/mynteye/device/device_s.cc
|
||||
src/mynteye/device/motions.cc
|
||||
src/mynteye/device/streams.cc
|
||||
src/mynteye/device/types.cc
|
||||
src/mynteye/device/utils.cc
|
||||
)
|
||||
if(WITH_API)
|
||||
list(APPEND MYNTEYE_SRCS
|
||||
src/api/api.cc
|
||||
src/api/synthetic.cc
|
||||
src/api/processor/processor.cc
|
||||
src/api/processor/rectify_processor.cc
|
||||
src/api/processor/disparity_processor.cc
|
||||
src/api/processor/disparity_normalized_processor.cc
|
||||
src/api/processor/depth_processor.cc
|
||||
src/api/processor/points_processor.cc
|
||||
src/mynteye/api/api.cc
|
||||
src/mynteye/api/dl.cc
|
||||
src/mynteye/api/processor.cc
|
||||
src/mynteye/api/synthetic.cc
|
||||
src/mynteye/api/processor/rectify_processor.cc
|
||||
src/mynteye/api/processor/disparity_processor.cc
|
||||
src/mynteye/api/processor/disparity_normalized_processor.cc
|
||||
src/mynteye/api/processor/depth_processor.cc
|
||||
src/mynteye/api/processor/points_processor.cc
|
||||
)
|
||||
endif()
|
||||
if(NOT WITH_GLOG)
|
||||
list(APPEND MYNTEYE_SRCS src/public/miniglog.cc)
|
||||
list(APPEND MYNTEYE_SRCS src/mynteye/miniglog.cc)
|
||||
endif()
|
||||
|
||||
set(MYNTEYE_LINKLIBS ${UVC_LIB})
|
||||
@@ -202,6 +208,9 @@ endif()
|
||||
|
||||
add_library(${MYNTEYE_NAME} SHARED ${MYNTEYE_SRCS})
|
||||
target_link_libraries(${MYNTEYE_NAME} ${MYNTEYE_LINKLIBS})
|
||||
if(OS_MAC)
|
||||
target_link_libraries( ${MYNTEYE_NAME} ${OSX_EXTRA_LIBS} )
|
||||
endif()
|
||||
target_link_threads(${MYNTEYE_NAME})
|
||||
|
||||
if(OS_WIN)
|
||||
@@ -214,27 +223,78 @@ target_include_directories(${MYNTEYE_NAME} PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
|
||||
"$<INSTALL_INTERFACE:${MYNTEYE_CMAKE_INCLUDE_DIR}>"
|
||||
"$<INSTALL_INTERFACE:include>"
|
||||
)
|
||||
|
||||
set_target_properties(${MYNTEYE_NAME} PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||
)
|
||||
set_target_properties(${MYNTEYE_NAME} PROPERTIES
|
||||
PUBLIC_HEADER "${MYNTEYE_PUBLIC_H}"
|
||||
)
|
||||
|
||||
# install
|
||||
|
||||
#message(STATUS "MYNTEYE_CMAKE_INCLUDE_DIR: ${MYNTEYE_CMAKE_INCLUDE_DIR}")
|
||||
#message(STATUS "MYNTEYE_CMAKE_BINDIR: ${MYNTEYE_CMAKE_BINDIR}")
|
||||
#message(STATUS "MYNTEYE_CMAKE_LIBDIR: ${MYNTEYE_CMAKE_LIBDIR}")
|
||||
#message(STATUS "MYNTEYE_CMAKE_INSTALLDIR: ${MYNTEYE_CMAKE_INSTALLDIR}")
|
||||
set(MYNTEYE_CMAKE_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include/${MYNTEYE_NAME}")
|
||||
set(MYNTEYE_CMAKE_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
set(MYNTEYE_CMAKE_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
set(MYNTEYE_CMAKE_INSTALLDIR "${MYNTEYE_CMAKE_LIBDIR}/cmake/${MYNTEYE_NAME}")
|
||||
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include/mynteye/mynteye.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/global.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/logger.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/types.h
|
||||
DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}
|
||||
)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/device/callbacks.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/device/context.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/device/device.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/device/utils.h
|
||||
DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}/device
|
||||
)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/util/files.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/util/strings.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/util/times.h
|
||||
DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}/util
|
||||
)
|
||||
if(WITH_API)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/api/api.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/api/plugin.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/api/object.h
|
||||
DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}/api
|
||||
)
|
||||
endif()
|
||||
if(NOT WITH_GLOG)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/mynteye/miniglog.h
|
||||
DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/callbacks.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/context.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/device.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/files.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/glog_init.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/strings.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/times.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/utils.h
|
||||
DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}
|
||||
)
|
||||
if(WITH_API)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/api.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/plugin.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/deprecated/mynteye/object.h
|
||||
DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
install(TARGETS ${MYNTEYE_NAME}
|
||||
EXPORT ${MYNTEYE_NAME}-targets
|
||||
PUBLIC_HEADER DESTINATION ${MYNTEYE_CMAKE_INCLUDE_DIR}/${MYNTEYE_NAME}
|
||||
RUNTIME DESTINATION ${MYNTEYE_CMAKE_BINDIR}
|
||||
LIBRARY DESTINATION ${MYNTEYE_CMAKE_LIBDIR}
|
||||
ARCHIVE DESTINATION ${MYNTEYE_CMAKE_LIBDIR}
|
||||
|
||||
@@ -26,6 +26,16 @@ SINGLE_QUOTE := '
|
||||
OPEN_PAREN := (
|
||||
CLOSE_PAREN := )
|
||||
|
||||
# Options
|
||||
#
|
||||
# VS_CODE: ignore to auto detect, otherwise specify the version
|
||||
# 15|2017, 14|2015, 12|2013, 11|2012, 10|2010, 9|2008, 8|2005
|
||||
# BUILD_TYPE: Debug|Release
|
||||
#
|
||||
# e.g. make [TARGET] VS_CODE=2017 BUILD_TYPE=Debug
|
||||
|
||||
BUILD_TYPE ?= Release
|
||||
|
||||
# Host detection
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@@ -124,7 +134,7 @@ ifeq ($(HOST_OS),Win)
|
||||
CC := cl
|
||||
CXX := cl
|
||||
MAKE := make
|
||||
BUILD := msbuild.exe ALL_BUILD.vcxproj /property:Configuration=Release
|
||||
BUILD := msbuild.exe ALL_BUILD.vcxproj /property:Configuration=$(BUILD_TYPE)
|
||||
endif
|
||||
else
|
||||
# mac & linux
|
||||
@@ -144,8 +154,7 @@ endif
|
||||
# CMake
|
||||
|
||||
CMAKE := cmake
|
||||
# CMAKE := $(CMAKE) -DCMAKE_BUILD_TYPE=Debug
|
||||
CMAKE := $(CMAKE) -DCMAKE_BUILD_TYPE=Release
|
||||
CMAKE := $(CMAKE) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
ifneq ($(CC),)
|
||||
CMAKE := $(CMAKE) -DCMAKE_C_COMPILER=$(CC)
|
||||
endif
|
||||
@@ -202,6 +211,15 @@ endif
|
||||
|
||||
endif
|
||||
|
||||
# Package
|
||||
|
||||
PKGVERSION := $(shell ./scripts/version.sh)
|
||||
PKGNAME := mynteye-s-$(PKGVERSION)-$(HOST_OS)-$(HOST_ARCH)
|
||||
ifeq ($(HOST_OS),Linux)
|
||||
PKGNAME := $(PKGNAME)-gcc$(shell gcc -dumpversion | cut -c 1-1)
|
||||
endif
|
||||
PKGNAME := $(call lower,$(PKGNAME))
|
||||
|
||||
# Shell
|
||||
|
||||
# `sh` is not possible to export a function
|
||||
|
||||
103
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
pipeline {
|
||||
agent {
|
||||
// docker { image 'ros:kinetic-ros-base-xenial' }
|
||||
docker { image 'joinaero/kinetic-ros-opencv-xenial' }
|
||||
}
|
||||
|
||||
/*
|
||||
environment {
|
||||
// FindOpenCV.cmake
|
||||
OpenCV_DIR = '/opt/ros/kinetic/share/OpenCV-3.3.1-dev'
|
||||
}
|
||||
*/
|
||||
|
||||
stages {
|
||||
stage('Prepare') {
|
||||
steps {
|
||||
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||
echo 'apt-get ..'
|
||||
sh 'apt-get update'
|
||||
}
|
||||
}
|
||||
stage('Init') {
|
||||
steps {
|
||||
echo 'make init ..'
|
||||
sh 'make init INIT_OPTIONS=-y'
|
||||
// echo 'skip get submodules and make test'
|
||||
// sh './scripts/init.sh -y'
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
echo 'make build ..'
|
||||
sh '. /opt/ros/kinetic/setup.sh; make build'
|
||||
}
|
||||
}
|
||||
stage('Install') {
|
||||
steps {
|
||||
echo 'make install ..'
|
||||
sh '. /opt/ros/kinetic/setup.sh; make install SUDO='
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
steps {
|
||||
echo 'make test ..'
|
||||
sh '. /opt/ros/kinetic/setup.sh; make test SUDO='
|
||||
}
|
||||
}
|
||||
stage('Samples') {
|
||||
steps {
|
||||
echo 'make samples ..'
|
||||
sh '. /opt/ros/kinetic/setup.sh; make samples SUDO='
|
||||
}
|
||||
}
|
||||
stage('Tools') {
|
||||
steps {
|
||||
echo 'make tools ..'
|
||||
sh '. /opt/ros/kinetic/setup.sh; make tools SUDO='
|
||||
}
|
||||
}
|
||||
stage('ROS') {
|
||||
steps {
|
||||
echo 'make ros ..'
|
||||
sh '''
|
||||
. /opt/ros/kinetic/setup.sh
|
||||
rosdep install --from-paths wrappers/ros/src --ignore-src --rosdistro kinetic -y
|
||||
make ros SUDO=
|
||||
'''
|
||||
}
|
||||
}
|
||||
/*
|
||||
stage('Clean') {
|
||||
steps {
|
||||
echo 'clean ..'
|
||||
sh '''
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
'''
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
echo 'This will always run'
|
||||
}
|
||||
success {
|
||||
echo 'This will run only if successful'
|
||||
}
|
||||
failure {
|
||||
echo 'This will run only if failed'
|
||||
mail to: 'mynteye-ci@slightech.com',
|
||||
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
|
||||
body: "Something is wrong with ${env.BUILD_URL}"
|
||||
}
|
||||
unstable {
|
||||
echo 'This will run only if the run was marked as unstable'
|
||||
}
|
||||
changed {
|
||||
echo 'This will run only if the state of the Pipeline has changed'
|
||||
echo 'For example, if the Pipeline was previously failing but is now successful'
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Makefile
@@ -22,7 +22,9 @@ MKFILE_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
|
||||
# UNIX: /usr/local
|
||||
# Windows: c:/Program Files/${PROJECT_NAME}
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
SUDO ?= sudo
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
help:
|
||||
@echo "Usage:"
|
||||
@@ -35,13 +37,14 @@ help:
|
||||
@echo " make test build test and run"
|
||||
@echo " make samples build samples"
|
||||
@echo " make tools build tools"
|
||||
@echo " make pkg package sdk"
|
||||
@echo " make ros build ros wrapper"
|
||||
@echo " make py build python wrapper"
|
||||
@echo " make clean|cleanall clean generated or useless things"
|
||||
|
||||
.PHONY: help
|
||||
|
||||
all: test samples tools
|
||||
all: init samples tools ros
|
||||
|
||||
.PHONY: all
|
||||
|
||||
@@ -75,15 +78,15 @@ submodules:
|
||||
|
||||
# init
|
||||
|
||||
init: submodules
|
||||
init:
|
||||
@$(call echo,Make $@)
|
||||
@$(SH) ./scripts/init.sh
|
||||
@$(SH) ./scripts/init.sh $(INIT_OPTIONS)
|
||||
|
||||
.PHONY: init
|
||||
|
||||
# build
|
||||
|
||||
build: submodules
|
||||
build:
|
||||
@$(call echo,Make $@)
|
||||
ifeq ($(HOST_OS),Win)
|
||||
@$(call cmake_build,./_build,..,-DCMAKE_INSTALL_PREFIX=$(MKFILE_DIR)/_install)
|
||||
@@ -95,7 +98,7 @@ endif
|
||||
|
||||
# test
|
||||
|
||||
test: install
|
||||
test: submodules install
|
||||
@$(call echo,Make $@)
|
||||
@$(call echo,Make gtest,33)
|
||||
ifeq ($(HOST_OS),Win)
|
||||
@@ -125,7 +128,7 @@ else
|
||||
endif
|
||||
else
|
||||
ifeq ($(HOST_OS),Linux)
|
||||
@cd ./_build; sudo make install
|
||||
@cd ./_build; $(SUDO) make install
|
||||
else
|
||||
@cd ./_build; make install
|
||||
endif
|
||||
@@ -133,6 +136,17 @@ endif
|
||||
|
||||
.PHONY: install
|
||||
|
||||
uninstall:
|
||||
@$(call echo,Make $@)
|
||||
ifeq ($(HOST_OS),Linux)
|
||||
$(SUDO) rm -rf /usr/local/include/mynteye/
|
||||
$(SUDO) rm -rf /usr/local/lib/libmynteye.so*
|
||||
$(SUDO) rm -rf /usr/local/lib/cmake/mynteye/
|
||||
$(SUDO) rm -rf /usr/local/share/mynteye/
|
||||
endif
|
||||
|
||||
.PHONY: uninstall
|
||||
|
||||
# samples
|
||||
|
||||
samples: install
|
||||
@@ -149,14 +163,30 @@ tools: install
|
||||
|
||||
.PHONY: tools
|
||||
|
||||
# pkg
|
||||
|
||||
pkg: clean
|
||||
@$(call echo,Make $@)
|
||||
ifeq ($(HOST_OS),Win)
|
||||
@$(SH) ./scripts/win/winpack.sh "$(PKGNAME)"
|
||||
else
|
||||
$(error "Can't make pkg on $(HOST_OS)")
|
||||
endif
|
||||
|
||||
cleanpkg:
|
||||
@$(call echo,Make $@)
|
||||
@$(call rm_f,$(PKGNAME)*)
|
||||
|
||||
.PHONY: pkg cleanpkg
|
||||
|
||||
# ros
|
||||
|
||||
ros: install
|
||||
@$(call echo,Make $@)
|
||||
ifeq ($(HOST_OS),Win)
|
||||
$(error "Can't make ros on win")
|
||||
ifeq ($(HOST_OS),Linux)
|
||||
@cd ./wrappers/ros && catkin_make -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
else
|
||||
@cd ./wrappers/ros && catkin_make
|
||||
$(error "Can't make ros on $(HOST_OS)")
|
||||
endif
|
||||
|
||||
.PHONY: ros
|
||||
@@ -265,6 +295,7 @@ host:
|
||||
@echo BUILD: $(BUILD)
|
||||
@echo LDD: $(LDD)
|
||||
@echo CMAKE: $(CMAKE)
|
||||
@echo PKGNAME: $(PKGNAME)
|
||||
|
||||
.PHONY: host
|
||||
|
||||
|
||||
24
README.md
@@ -1,10 +1,10 @@
|
||||
# MYNT® EYE SDK
|
||||
# MYNT® EYE S SDK
|
||||
|
||||
[](https://github.com/slightech/MYNT-EYE-SDK-2)
|
||||
[](https://github.com/slightech/MYNT-EYE-S-SDK)
|
||||
|
||||
## Overview
|
||||
|
||||
MYNT® EYE SDK 2.0 is a cross-platform library for MYNT® EYE cameras.
|
||||
MYNT® EYE S SDK is a cross-platform library for MYNT® EYE Standard cameras.
|
||||
|
||||
The following platforms have been tested:
|
||||
|
||||
@@ -16,12 +16,12 @@ Please follow the guide doc to install the SDK on different platforms.
|
||||
|
||||
## Documentations
|
||||
|
||||
* [API Doc](https://github.com/slightech/MYNT-EYE-SDK-2/releases): API reference, some guides and data spec.
|
||||
* en: [](https://github.com/slightech/MYNT-EYE-SDK-2/files/2422149/mynt-eye-sdk-apidoc-2.0.1-rc2-en.pdf) [](https://github.com/slightech/MYNT-EYE-SDK-2/files/2422151/mynt-eye-sdk-apidoc-2.0.1-rc2-html-en.zip) [](https://slightech.github.io/MYNT-EYE-SDK-2/)
|
||||
* zh-Hans: [](https://github.com/slightech/MYNT-EYE-SDK-2/files/2422152/mynt-eye-sdk-apidoc-2.0.1-rc2-zh-Hans.pdf) [](https://github.com/slightech/MYNT-EYE-SDK-2/files/2422153/mynt-eye-sdk-apidoc-2.0.1-rc2-html-zh-Hans.zip) [](http://doc.myntai.com/resource/api/mynt-eye-sdk-apidoc-2.0.1-rc2-html-zh-Hans/mynt-eye-sdk-apidoc-2.0.1-rc2-html-zh-Hans/index.html)
|
||||
* [Guide Doc](https://github.com/slightech/MYNT-EYE-SDK-2-Guide/releases): How to install and start using the SDK.
|
||||
* en: [](https://github.com/slightech/MYNT-EYE-SDK-2-Guide/files/2422160/mynt-eye-sdk-guide-2.0.1-rc2-en.pdf) [](https://github.com/slightech/MYNT-EYE-SDK-2-Guide/files/2422161/mynt-eye-sdk-guide-2.0.1-rc2-html-en.zip) [](https://slightech.github.io/MYNT-EYE-SDK-2-Guide/)
|
||||
* zh-Hans: [](https://github.com/slightech/MYNT-EYE-SDK-2-Guide/files/2422162/mynt-eye-sdk-guide-2.0.1-rc2-zh-Hans.pdf) [](https://github.com/slightech/MYNT-EYE-SDK-2-Guide/files/2422164/mynt-eye-sdk-guide-2.0.1-rc2-html-zh-Hans.zip) [](http://doc.myntai.com/resource/sdk/mynt-eye-sdk-guide-2.0.1-rc2-html-zh-Hans/mynt-eye-sdk-guide-2.0.1-rc2-html-zh-Hans/index.html)
|
||||
* [API Doc](https://github.com/slightech/MYNT-EYE-S-SDK/releases): API reference, some guides and data spec.
|
||||
* en: [](https://github.com/slightech/MYNT-EYE-S-SDK/files/2683636/mynt-eye-s-sdk-apidoc-2.2.2-en.pdf) [](https://github.com/slightech/MYNT-EYE-S-SDK/files/2683637/mynt-eye-s-sdk-apidoc-2.2.2-en.zip) [](https://slightech.github.io/MYNT-EYE-S-SDK/)
|
||||
* zh-Hans: [](https://github.com/slightech/MYNT-EYE-S-SDK/files/2683638/mynt-eye-s-sdk-apidoc-2.2.2-zh-Hans.pdf) [](https://github.com/slightech/MYNT-EYE-S-SDK/files/2683639/mynt-eye-s-sdk-apidoc-2.2.2-zh-Hans.zip) [](http://doc.myntai.com/resource/api/mynt-eye-s-sdk-apidoc-2.2.2-zh-Hans/mynt-eye-s-sdk-apidoc-2.2.2-zh-Hans/index.html)
|
||||
* [Guide Doc](https://github.com/slightech/MYNT-EYE-S-SDK-Guide/releases): How to install and start using the SDK.
|
||||
* en: [](https://github.com/slightech/MYNT-EYE-S-SDK-Guide/files/2683625/mynt-eye-s-sdk-guide-2.2.2-en.pdf) [](https://github.com/slightech/MYNT-EYE-S-SDK-Guide/files/2683626/mynt-eye-s-sdk-guide-2.2.2-en.zip) [](https://slightech.github.io/MYNT-EYE-S-SDK-Guide/)
|
||||
* zh-Hans: [](https://github.com/slightech/MYNT-EYE-S-SDK-Guide/files/2683627/mynt-eye-s-sdk-guide-2.2.2-zh-Hans.pdf) [](https://github.com/slightech/MYNT-EYE-S-SDK-Guide/files/2683628/mynt-eye-s-sdk-guide-2.2.2-zh-Hans.zip) [](http://doc.myntai.com/resource/sdk/mynt-eye-s-sdk-guide-2.2.2-zh-Hans/mynt-eye-s-sdk-guide-2.2.2-zh-Hans/index.html)
|
||||
|
||||
> Supported languages: `en`, `zh-Hans`.
|
||||
|
||||
@@ -29,7 +29,7 @@ Please follow the guide doc to install the SDK on different platforms.
|
||||
|
||||
[MYNTEYE_BOX]: http://doc.myntai.com/mynteye/s/download
|
||||
|
||||
Get firmwares from our online disks: [MYNTEYE_BOX][]. The latest version is `2.0.1`.
|
||||
Get firmwares from our online disks: [MYNTEYE_BOX][]. The latest version is `2.2.2`.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -61,8 +61,8 @@ make samples
|
||||
|
||||
## Mirrors
|
||||
|
||||
国内镜像:[码云](https://gitee.com/mynt/MYNT-EYE-SDK-2)。
|
||||
国内镜像:[码云](https://gitee.com/mynt/MYNT-EYE-S-SDK)。
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the Apache License, Version 2.0. Copyright 2018 Slightech Co., Ltd.
|
||||
This project is licensed under the [Apache License, Version 2.0](LICENSE). Copyright 2018 Slightech Co., Ltd.
|
||||
|
||||
@@ -70,7 +70,9 @@ macro(set_outdir ARCHIVE_OUTPUT_DIRECTORY LIBRARY_OUTPUT_DIRECTORY RUNTIME_OUTPU
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
set(__exe2bat_relative_path false)
|
||||
if(NOT __exe2bat_relative_path)
|
||||
set(__exe2bat_relative_path false)
|
||||
endif()
|
||||
|
||||
macro(exe2bat exe_name exe_dir dll_search_paths)
|
||||
message(STATUS "Generating ${exe_name}.bat")
|
||||
|
||||
@@ -15,14 +15,25 @@
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/IncludeGuard.cmake)
|
||||
cmake_include_guard()
|
||||
|
||||
find_package(OpenCV REQUIRED)
|
||||
message(STATUS "Found OpenCV: ${OpenCV_VERSION}")
|
||||
if(OpenCV_VERSION VERSION_LESS 3.0)
|
||||
add_definitions(-DUSE_OPENCV2)
|
||||
elseif(OpenCV_VERSION VERSION_LESS 4.0)
|
||||
add_definitions(-DUSE_OPENCV3)
|
||||
if(OpenCV_FIND_QUIET)
|
||||
find_package(OpenCV QUIET)
|
||||
else()
|
||||
add_definitions(-DUSE_OPENCV4)
|
||||
find_package(OpenCV REQUIRED)
|
||||
endif()
|
||||
|
||||
if(OpenCV_FOUND)
|
||||
|
||||
#message(STATUS "Found OpenCV: ${OpenCV_VERSION}")
|
||||
|
||||
set(WITH_OPENCV TRUE)
|
||||
add_definitions(-DWITH_OPENCV)
|
||||
|
||||
if(OpenCV_VERSION VERSION_LESS 3.0)
|
||||
add_definitions(-DWITH_OPENCV2)
|
||||
elseif(OpenCV_VERSION VERSION_LESS 4.0)
|
||||
add_definitions(-DWITH_OPENCV3)
|
||||
else()
|
||||
add_definitions(-DWITH_OPENCV4)
|
||||
endif()
|
||||
|
||||
list(FIND OpenCV_LIBS "opencv_world" __index)
|
||||
@@ -35,3 +46,9 @@ if(MSVC OR MSYS OR MINGW)
|
||||
else()
|
||||
set(OpenCV_LIB_SEARCH_PATH "${OpenCV_LIB_PATH}")
|
||||
endif()
|
||||
|
||||
else()
|
||||
|
||||
set(WITH_OPENCV FALSE)
|
||||
|
||||
endif()
|
||||
|
||||
@@ -21,7 +21,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/Utils.cmake)
|
||||
# build components
|
||||
|
||||
option(WITH_API "Build with API layer, need OpenCV" ON)
|
||||
|
||||
option(WITH_DEVICE_INFO_REQUIRED "Build with device info required" ON)
|
||||
|
||||
# 3rdparty components
|
||||
@@ -32,7 +31,6 @@ option(WITH_BOOST "Include Boost support" ON)
|
||||
# Ubuntu: `sudo apt-get install libgoogle-glog-dev`
|
||||
option(WITH_GLOG "Include glog support" OFF)
|
||||
|
||||
|
||||
# packages
|
||||
|
||||
if(WITH_API)
|
||||
|
||||
16
cmake/templates/pkginfo.sh.in
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
OpenCV_VERSION=@OpenCV_VERSION@
|
||||
OpenCV_VERSION_MAJOR=@OpenCV_VERSION_MAJOR@
|
||||
OpenCV_VERSION_MINOR=@OpenCV_VERSION_MINOR@
|
||||
OpenCV_VERSION_PATCH=@OpenCV_VERSION_PATCH@
|
||||
OpenCV_VERSION_STATUS=@OpenCV_VERSION_STATUS@
|
||||
|
||||
_contains() {
|
||||
[ `echo $1 | grep -c "$2"` -gt 0 ]
|
||||
}
|
||||
|
||||
if _contains "@OpenCV_INCLUDE_DIRS@" "/ros/"; then
|
||||
ROS_VERSION=$(rosversion -d)
|
||||
OpenCV_VERSION=ros-$ROS_VERSION
|
||||
fi
|
||||
@@ -58,7 +58,7 @@ for lang in "${LANGS[@]}"; do
|
||||
|
||||
# html
|
||||
if [ -d "$OUTPUT/$lang/html" ]; then
|
||||
dirname="mynt-eye-sdk-apidoc"; \
|
||||
dirname="mynt-eye-s-sdk-apidoc"; \
|
||||
[ -n "$version" ] && dirname="$dirname-$version"; \
|
||||
dirname="$dirname-$lang"
|
||||
cd "$OUTPUT/$lang"
|
||||
@@ -69,7 +69,7 @@ for lang in "${LANGS[@]}"; do
|
||||
# latex
|
||||
if [ $pdflatex_FOUND ] && [ -f "$OUTPUT/$lang/latex/Makefile" ]; then
|
||||
_echo_in "doxygen make latex"
|
||||
filename="mynt-eye-sdk-apidoc"; \
|
||||
filename="mynt-eye-s-sdk-apidoc"; \
|
||||
[ -n "$version" ] && filename="$filename-$version"; \
|
||||
filename="$filename-$lang.pdf"
|
||||
cd "$OUTPUT/$lang/latex" && _texcjk refman.tex && make
|
||||
|
||||
@@ -32,19 +32,19 @@ DOXYFILE_ENCODING = UTF-8
|
||||
# title of most generated pages and in a few other places.
|
||||
# The default value is: My Project.
|
||||
|
||||
PROJECT_NAME = "MYNT EYE SDK"
|
||||
PROJECT_NAME = "MYNT EYE S SDK"
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 2.2.1-rc
|
||||
PROJECT_NUMBER = 2.2.2
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
# quick idea about the purpose of the project. Keep the description short.
|
||||
|
||||
PROJECT_BRIEF = http://www.myntai.com/camera
|
||||
PROJECT_BRIEF = http://www.myntai.com/mynteye/standard
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
@@ -1310,7 +1310,7 @@ DOCSET_PUBLISHER_ID = com.slightech.mynteye.documentation
|
||||
# The default value is: Publisher.
|
||||
# This tag requires that the tag GENERATE_DOCSET is set to YES.
|
||||
|
||||
DOCSET_PUBLISHER_NAME = MYNT EYE SDK
|
||||
DOCSET_PUBLISHER_NAME = MYNT EYE S SDK
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
|
||||
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# MYNT EYE SDK {#mainpage}
|
||||
# MYNT EYE S SDK {#mainpage}
|
||||
|
||||
* <a class="el" href="annotated.html">API Classes</a>
|
||||
* <a class="el" href="modules.html">API Modules</a>
|
||||
|
||||
@@ -32,19 +32,19 @@ DOXYFILE_ENCODING = UTF-8
|
||||
# title of most generated pages and in a few other places.
|
||||
# The default value is: My Project.
|
||||
|
||||
PROJECT_NAME = "MYNT EYE SDK"
|
||||
PROJECT_NAME = "MYNT EYE S SDK"
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 2.2.1-rc
|
||||
PROJECT_NUMBER = 2.2.2
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
# quick idea about the purpose of the project. Keep the description short.
|
||||
|
||||
PROJECT_BRIEF = http://www.myntai.com/camera
|
||||
PROJECT_BRIEF = http://www.myntai.com/mynteye/standard
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
@@ -1310,7 +1310,7 @@ DOCSET_PUBLISHER_ID = com.slightech.mynteye.documentation
|
||||
# The default value is: Publisher.
|
||||
# This tag requires that the tag GENERATE_DOCSET is set to YES.
|
||||
|
||||
DOCSET_PUBLISHER_NAME = MYNT EYE SDK
|
||||
DOCSET_PUBLISHER_NAME = MYNT EYE S SDK
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
|
||||
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
## 获取代码
|
||||
|
||||
```bash
|
||||
git clone https://github.com/slightech/MYNT-EYE-SDK-2.git
|
||||
git clone https://github.com/slightech/MYNT-EYE-S-SDK.git
|
||||
```
|
||||
|
||||
## 准备依赖
|
||||
|
||||
```bash
|
||||
cd mynt-eye-sdk-2/
|
||||
cd mynt-eye-s-sdk/
|
||||
make init
|
||||
```
|
||||
|
||||
|
||||
@@ -72,13 +72,13 @@ GNU Make 4.2.1
|
||||
## 获取代码
|
||||
|
||||
```cmd
|
||||
>git clone https://github.com/slightech/MYNT-EYE-SDK-2.git
|
||||
>git clone https://github.com/slightech/MYNT-EYE-S-SDK.git
|
||||
```
|
||||
|
||||
## 准备依赖
|
||||
|
||||
```cmd
|
||||
>cd mynt-eye-sdk-2
|
||||
>cd mynt-eye-s-sdk
|
||||
>make init
|
||||
Make init
|
||||
Init deps
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# MYNT EYE SDK {#mainpage}
|
||||
# MYNT EYE S SDK {#mainpage}
|
||||
|
||||
* <a class="el" href="annotated.html">API 类</a>
|
||||
* <a class="el" href="modules.html">API 模块</a>
|
||||
|
||||
@@ -6,23 +6,22 @@
|
||||
|
||||
| 名称 | 字段 | 字节数 | 默认值 | 最小值 | 最大值 | 是否储存 | Flash 地址 | 说明 |
|
||||
| :----- | :----- | :-------- | :-------- | :-------- | :-------- | :----------- | :----------- | :----- |
|
||||
| 增益 | gain | 2 | 24 | 0 | 48 | √ | 0x12 | 关闭自动曝光,手动设定的参数 |
|
||||
| 亮度 | brightness/exposure_time | 2 | 120 | 0 | 240 | √ | 0x14 | 关闭自动曝光,手动设定的参数 |
|
||||
| 对比度 | contrast/black_level_calibration | 2 | 127 | 0 | 255 | √ | 0x10 | 关闭自动曝光,手动设定的参数 |
|
||||
| 亮度 | brightness | 2 | 192 | 0 | 255 | √ | 0x14 | 关闭自动曝光,手动设定的参数 |
|
||||
|
||||
> UVC 标准协议实现的控制,有现成的 API 进行 Get & Set ,包括 Min, Max, Default 。
|
||||
|
||||
## 自定义协议
|
||||
|
||||
| 名称 | 字段 | 字节数 | 默认值 | 最小值 | 最大值 | 是否储存 | Flash 地址 | 所属通道 | 说明 |
|
||||
| :----- | :----- | :-------- | :-------- | :-------- | :-------- | :----------- | :----------- | :----------- | :----- |
|
||||
| 图像帧率 | frame_rate | 2 | 25 | 10 | 60 | √ | 0x21 | XU_CAM_CTRL | 步进为5,即有效值为{10,15,20,25,30,35,40,45,50,55,60} |
|
||||
| IMU 频率 | imu_frequency | 2 | 200 | 100 | 500 | √ | 0x23 | XU_CAM_CTRL | 有效值为{100,200,250,333,500} |
|
||||
| 曝光模式 | exposure_mode | 1 | 0 | 0 | 1 | √ | 0x0F | XU_CAM_CTRL | 0:开启自动曝光; 1:关闭 |
|
||||
| 最大增益 | max_gain | 2 | 48 | 0 | 48 | √ | 0x1D | XU_CAM_CTRL | 开始自动曝光,可设定的阈值 |
|
||||
| 最大曝光时间 | max_exposure_time | 2 | 240 | 0 | 240 | √ | 0x1B | XU_CAM_CTRL | 开始自动曝光,可设定的阈值 |
|
||||
| 期望亮度 | desired_brightness | 2 | 192 | 0 | 255 | √ | 0x19 | XU_CAM_CTRL | 开始自动曝光,可设定的阈值 |
|
||||
| IR 控制 | ir_control | 1 | 0 | 0 | 160 | × | - | XU_CAM_CTRL | |
|
||||
| HDR 模式 | hdr_mode | 1 | 0 | 0 | 1 | √ | 0x1F | XU_CAM_CTRL | 0:10-bit;1:12-bit |
|
||||
| 零漂标定 | zero_drift_calibration | | - | - | - | × | - | XU_HALF_DUPLEX | |
|
||||
| 擦除芯片 | erase_chip | | - | - | - | × | - | XU_HALF_DUPLEX | |
|
||||
| 名称 | 字段 | 字节数 | 默认值 | 最小值 | 最大值 | 是否储存 | Flash 地址 | 所属通道 | 通道地址 | 说明 |
|
||||
| :----- | :----- | :-------- | :-------- | :-------- | :-------- | :----------- | :----------- | :----------- | :----------- | :----- |
|
||||
| 曝光模式 | exposure_mode | 1 | 0 | 0 | 1 | √ | 0x0F | XU_CAM_CTRL | 0x0100 | 0:开启自动曝光; 1:关闭 |
|
||||
| 最大增益 | max_gain | 2 | 8 | 0 | 255 | √ | 0x1D | XU_CAM_CTRL | 0x0100 | 开始自动曝光,可设定的阈值 |
|
||||
| 最大曝光时间 | max_exposure_time | 2 | 333 | 0 | 1000 | √ | 0x1B | XU_CAM_CTRL | 0x0100 | 开始自动曝光,可设定的阈值 |
|
||||
| 期望亮度 | desired_brightness | 2 | 122 | 1 | 255 | √ | 0x19 | XU_CAM_CTRL | 0x0100 | |
|
||||
| 擦除芯片 | erase_chip | | - | - | - | × | - | XU_HALF_DUPLEX | 0x0200 | |
|
||||
| 最小曝光时间 | min_exposure_time | 2 | 0 | 0 | 1000 | √ | - | XU_CAM_CTRL | 0x0100 | 开始自动曝光,可设定的阈值 |
|
||||
| 加速度计量程 | accelerometer_range | 2 | 12 | 6 | 48 | √ | - | XU_CAM_CTRL | 0x0100 | |
|
||||
| 陀螺仪量程 | gyroscope_range | 2 | 1000 | 250 | 4000 | √ | - | XU_CAM_CTRL | 0x0100 | |
|
||||
| 加速度计低通滤波 | accelerometer_low_pass_filter | 2 | 2 | 0 | 2 | √ | - | XU_CAM_CTRL | 0x0100 | |
|
||||
| 陀螺仪低通滤波 | gyroscope__low_pass_filter | 2 | 64 | 23 | 64 | √ | - | XU_CAM_CTRL | 0x0100 | |
|
||||
|
||||
|
||||
@@ -49,5 +49,5 @@
|
||||
| File | ID | Max Size |
|
||||
| :--- | :- | :------- |
|
||||
| 硬件信息 | 1 | 250 |
|
||||
| 图像参数 | 2 | 250 |
|
||||
| 图像参数 | 2 | 404 |
|
||||
| IMU 参数 | 4 | 500 |
|
||||
|
||||
@@ -3,20 +3,19 @@
|
||||
| 名称 | 字段 | 单位 | 字节数 | 说明 |
|
||||
| :----- | :----- | :----- | :-------- | :----- |
|
||||
| 帧 ID | frame_id | - | 2 | uint16_t; [0,65535] |
|
||||
| 时间戳 | timestamp | 10 us | 4 | uint32_t |
|
||||
| 曝光时间 | exposure_time | 10 us | 2 | uint16_t |
|
||||
| 时间戳 | timestamp | 1 us | 8 | uint64_t |
|
||||
| 曝光时间 | exposure_time | 1 us | 2 | uint16_t |
|
||||
|
||||
> 图像数据传输方式:倒序排在图像尾部。
|
||||
|
||||
## 图像数据包
|
||||
|
||||
| Name | Header | Size | Frame ID | Timestamp | Exposure Time | Checksum |
|
||||
| :--- | :----- | :--- | :------- | :-------- | :------------ | :------- |
|
||||
| 字节数 | 1 | 1 | 2 | 4 | 2 | 1 |
|
||||
| 类型 | uint8_t | uint8_t | uint16_t | uint32_t | uint16_t | uint8_t |
|
||||
| 描述 | 0x3B | 0x08 (数据内容大小) | 帧 ID | 时间戳 | 曝光时间 | 校验码(数据内容所有字节异或) |
|
||||
| Name | Header | Size | FrameID | Timestamp | ExposureTime | Checksum |
|
||||
| :--- | :----- | :--- | :------ | :-------- | :----------- | :------- |
|
||||
| 字节数 | 1 | 1 | 2 | 8 | 2 | 1 |
|
||||
| 类型 | uint8_t | uint8_t | uint16_t | uint64_t | uint16_t | uint8_t |
|
||||
| 描述 | 0x3B | 0x10 (数据内容大小) | 帧 ID | 时间戳 | 曝光时间 | 校验码(数据内容所有字节异或) |
|
||||
|
||||
* 数据包校验不过,会丢弃该帧。
|
||||
* 时间单位的精度为: 0.01 ms / 10 us 。
|
||||
* 4 字节能表示的最大时间约是 11.9 小时,溢出后将重累计。
|
||||
* 时间的单位精度为: 1 us 。
|
||||
* 时间累计是从上电时从开始,而不是从打开时开始。
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
## IMU 响应数据包
|
||||
|
||||
IMU 响应数据包里会包含多个 IMU 包,而每个 IMU 包又带有多个 IMU 段。
|
||||
IMU 响应数据包里会包含1个 IMU 包,而每个 IMU 包又带有多个 IMU 段。
|
||||
|
||||
| Name | Header | State | Size | IMU Packets | Checksum |
|
||||
| :--- | :----- | :---- | :--- | :---------- | :------- |
|
||||
@@ -22,21 +22,21 @@ IMU 响应数据包里会包含多个 IMU 包,而每个 IMU 包又带有多个
|
||||
|
||||
IMU 包/小包,是一组 IMU 数据。
|
||||
|
||||
| Name | Serial Number | Timestamp | Count | IMU Datas |
|
||||
| :--- | :------------ | :-------- | :---- | :-------- |
|
||||
| 字节数 | 4 | 4 | 1 | ... |
|
||||
| 类型 | uint32_t | uint32_t | uint8_t | - |
|
||||
| 描述 | 序列号 | IMU 基准时间戳 | IMU 段数量 | 所包含的 IMU 段 |
|
||||
| Name | Count | IMU Datas |
|
||||
| :--- | :-----| :-------- |
|
||||
| 字节数 | 2 | ... |
|
||||
| 类型 | uint16_t | - |
|
||||
| 描述 | IMU 段数量 | 所包含的 IMU 段 |
|
||||
|
||||
### IMU 段
|
||||
|
||||
| Name | Offset | Frame ID | Accelerometer | Temperature | Gyroscope |
|
||||
| :--- | :----- | :------- | :------------ | :---------- | :-------- |
|
||||
| 字节数 | 2 | 2 | 6 | 2 | 6 |
|
||||
| 类型 | int16_t | uint16_t | int16_t * 3 | int16_t | int16_t * 3 |
|
||||
| 描述 | 相对基准时间戳的偏移量 | 图像帧 ID | 加速度计 x y z 三轴的值 | IMU 的温度 | 陀螺仪 x y z 三轴的值 |
|
||||
| Name | Serial Number | Timestamp | flag | Temperature | Accelerometer or Gyroscope |
|
||||
| :--- | :------------ | :-------- | :----| :----------- | :------------------------- |
|
||||
| 字节数 | 4 | 8 | 1 | 2 | 6 |
|
||||
| 类型 | uint32_t | uint64_t | int8_t | int16_t | int16_t * 3 |
|
||||
| Description | 序列号 | 时间戳 | 指定传感器类型 | IMU 的温度 | 陀螺仪或陀螺仪 x y z 三轴的值 |
|
||||
|
||||
* 加速度计和陀螺仪的计量值换算成物理值公式: **real = data * range / 0x10000** 。
|
||||
* 加速度计量程默认值为 **8 g** ,陀螺仪量程默认值为 **1000 deg/s** 。
|
||||
* 加速度计量程默认值为 **12 g** ,陀螺仪量程默认值为 **1000 deg/s** 。
|
||||
* 温度计量值换算成物理值公式: **real = data / ratio + offset** 。
|
||||
* ``ratio`` 默认值为 **326.8** , ``offset`` 默认值为 **25℃** 。
|
||||
|
||||
1
include/deprecated/mynteye/api.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/api/api.h"
|
||||
1
include/deprecated/mynteye/callbacks.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/device/callbacks.h"
|
||||
1
include/deprecated/mynteye/context.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/device/context.h"
|
||||
1
include/deprecated/mynteye/device.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/device/device.h"
|
||||
1
include/deprecated/mynteye/files.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/util/files.h"
|
||||
1
include/deprecated/mynteye/glog_init.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/logger.h"
|
||||
1
include/deprecated/mynteye/object.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/api/object.h"
|
||||
1
include/deprecated/mynteye/plugin.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/api/plugin.h"
|
||||
1
include/deprecated/mynteye/strings.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/util/strings.h"
|
||||
1
include/deprecated/mynteye/times.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/util/times.h"
|
||||
1
include/deprecated/mynteye/utils.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "mynteye/device/utils.h"
|
||||
@@ -11,17 +11,18 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_API_H_ // NOLINT
|
||||
#define MYNTEYE_API_H_
|
||||
#ifndef MYNTEYE_API_API_H_
|
||||
#define MYNTEYE_API_API_H_
|
||||
#pragma once
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
#include "mynteye/mynteye.h"
|
||||
#include "mynteye/types.h"
|
||||
|
||||
@@ -49,6 +50,8 @@ struct MYNTEYE_API StreamData {
|
||||
cv::Mat frame;
|
||||
/** Raw frame. */
|
||||
std::shared_ptr<device::Frame> frame_raw;
|
||||
/** Frame ID. */
|
||||
std::uint16_t frame_id;
|
||||
|
||||
bool operator==(const StreamData &other) const {
|
||||
if (img && other.img) {
|
||||
@@ -69,8 +72,7 @@ struct MYNTEYE_API MotionData {
|
||||
|
||||
bool operator==(const MotionData &other) const {
|
||||
if (imu && other.imu) {
|
||||
return imu->frame_id == other.imu->frame_id &&
|
||||
imu->timestamp == other.imu->timestamp;
|
||||
return imu->timestamp == other.imu->timestamp;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -96,7 +98,14 @@ class MYNTEYE_API API {
|
||||
* @return the API instance.
|
||||
* @note This will call device::select() to select a device.
|
||||
*/
|
||||
static std::shared_ptr<API> Create();
|
||||
static std::shared_ptr<API> Create(Resolution res);
|
||||
/**
|
||||
* Create the API instance.
|
||||
* @param device the selected device.
|
||||
* @return the API instance.
|
||||
*/
|
||||
static std::shared_ptr<API> Create(
|
||||
std::shared_ptr<Device> device, Resolution res);
|
||||
/**
|
||||
* Create the API instance.
|
||||
* @param device the selected device.
|
||||
@@ -145,6 +154,10 @@ class MYNTEYE_API API {
|
||||
*/
|
||||
bool Supports(const AddOns &addon) const;
|
||||
|
||||
/**
|
||||
* set the stream request.
|
||||
*/
|
||||
void SetStreamRequest(const Format &format, const FrameRate &rate);
|
||||
/**
|
||||
* Get all stream requests of the capability.
|
||||
*/
|
||||
@@ -201,6 +214,11 @@ class MYNTEYE_API API {
|
||||
*/
|
||||
bool RunOptionAction(const Option &option) const;
|
||||
|
||||
/**
|
||||
* Init device resolution.
|
||||
*/
|
||||
void InitResolution(const Resolution &res);
|
||||
|
||||
/**
|
||||
* Set the callback of stream.
|
||||
*/
|
||||
@@ -276,8 +294,10 @@ class MYNTEYE_API API {
|
||||
std::shared_ptr<Device> device_;
|
||||
|
||||
std::unique_ptr<Synthetic> synthetic_;
|
||||
|
||||
void CheckImageParams();
|
||||
};
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
#endif // MYNTEYE_API_H_ NOLINT
|
||||
#endif // MYNTEYE_API_API_H_
|
||||
@@ -11,18 +11,20 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_OBJECT_H_ // NOLINT
|
||||
#define MYNTEYE_OBJECT_H_
|
||||
#ifndef MYNTEYE_API_OBJECT_H_
|
||||
#define MYNTEYE_API_OBJECT_H_
|
||||
#pragma once
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
#include "mynteye/mynteye.h"
|
||||
|
||||
MYNTEYE_BEGIN_NAMESPACE
|
||||
|
||||
struct ImgData;
|
||||
|
||||
/**
|
||||
* Input & output object.
|
||||
*/
|
||||
@@ -56,14 +58,22 @@ struct MYNTEYE_API Object {
|
||||
*/
|
||||
struct MYNTEYE_API ObjMat : public Object {
|
||||
ObjMat() = default;
|
||||
explicit ObjMat(const cv::Mat &value) : value(value) {}
|
||||
ObjMat(const cv::Mat &value, std::uint16_t id,
|
||||
const std::shared_ptr<ImgData> &data)
|
||||
: value(value), id(id), data(data) {}
|
||||
|
||||
/** The value */
|
||||
cv::Mat value;
|
||||
/** The id **/
|
||||
std::uint16_t id;
|
||||
/** The data **/
|
||||
std::shared_ptr<ImgData> data;
|
||||
|
||||
Object *Clone() const {
|
||||
ObjMat *mat = new ObjMat;
|
||||
mat->value = value.clone();
|
||||
mat->id = id;
|
||||
mat->data = data;
|
||||
return mat;
|
||||
}
|
||||
|
||||
@@ -77,19 +87,35 @@ struct MYNTEYE_API ObjMat : public Object {
|
||||
*/
|
||||
struct MYNTEYE_API ObjMat2 : public Object {
|
||||
ObjMat2() = default;
|
||||
ObjMat2(const cv::Mat &first, const cv::Mat &second)
|
||||
: first(first), second(second) {}
|
||||
ObjMat2(const cv::Mat &first, std::uint16_t first_id,
|
||||
const std::shared_ptr<ImgData> &first_data,
|
||||
const cv::Mat &second, std::uint16_t second_id,
|
||||
const std::shared_ptr<ImgData> &second_data)
|
||||
: first(first), first_id(first_id), first_data(first_data),
|
||||
second(second), second_id(second_id), second_data(second_data) {}
|
||||
|
||||
/** The first value */
|
||||
cv::Mat first;
|
||||
/** The first id **/
|
||||
std::uint16_t first_id;
|
||||
/** The first data **/
|
||||
std::shared_ptr<ImgData> first_data;
|
||||
|
||||
/** The second value */
|
||||
cv::Mat second;
|
||||
/** The second id **/
|
||||
std::uint16_t second_id;
|
||||
/** The second data **/
|
||||
std::shared_ptr<ImgData> second_data;
|
||||
|
||||
Object *Clone() const {
|
||||
ObjMat2 *mat2 = new ObjMat2;
|
||||
mat2->first = first.clone();
|
||||
mat2->first_id = first_id;
|
||||
mat2->first_data = first_data;
|
||||
mat2->second = second.clone();
|
||||
mat2->second_id = second_id;
|
||||
mat2->second_data = second_data;
|
||||
return mat2;
|
||||
}
|
||||
|
||||
@@ -100,4 +126,4 @@ struct MYNTEYE_API ObjMat2 : public Object {
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
#endif // MYNTEYE_OBJECT_H_ NOLINT
|
||||
#endif // MYNTEYE_API_OBJECT_H_
|
||||
@@ -11,14 +11,14 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_PLUGIN_H_ // NOLINT
|
||||
#define MYNTEYE_PLUGIN_H_
|
||||
#ifndef MYNTEYE_API_PLUGIN_H_
|
||||
#define MYNTEYE_API_PLUGIN_H_
|
||||
#pragma once
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
#include "mynteye/mynteye.h"
|
||||
|
||||
#ifndef MYNTEYE_PLUGIN_VERSION_CODE
|
||||
@@ -135,6 +135,7 @@ MYNTEYE_API mynteye::Plugin *plugin_create();
|
||||
* Destroy the plugin.
|
||||
*/
|
||||
MYNTEYE_API void plugin_destroy(mynteye::Plugin *plugin);
|
||||
|
||||
}
|
||||
|
||||
#endif // MYNTEYE_PLUGIN_H_ NOLINT
|
||||
#endif // MYNTEYE_API_PLUGIN_H_
|
||||
@@ -11,14 +11,15 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_CALLBACKS_H_ // NOLINT
|
||||
#define MYNTEYE_CALLBACKS_H_
|
||||
#ifndef MYNTEYE_DEVICE_CALLBACKS_H_
|
||||
#define MYNTEYE_DEVICE_CALLBACKS_H_
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
@@ -29,6 +30,20 @@ MYNTEYE_BEGIN_NAMESPACE
|
||||
|
||||
namespace device {
|
||||
|
||||
typedef struct ImgParams {
|
||||
bool ok;
|
||||
std::map<Resolution, Intrinsics> in_left_map;
|
||||
std::map<Resolution, Intrinsics> in_right_map;
|
||||
Extrinsics ex_right_to_left;
|
||||
} img_params_t;
|
||||
|
||||
typedef struct ImuParams {
|
||||
bool ok;
|
||||
ImuIntrinsics in_accel;
|
||||
ImuIntrinsics in_gyro;
|
||||
Extrinsics ex_left_to_imu;
|
||||
} imu_params_t;
|
||||
|
||||
/**
|
||||
* @ingroup datatypes
|
||||
* Frame with raw data.
|
||||
@@ -113,6 +128,8 @@ struct MYNTEYE_API StreamData {
|
||||
std::shared_ptr<ImgData> img;
|
||||
/** Frame. */
|
||||
std::shared_ptr<Frame> frame;
|
||||
/** Frame ID. */
|
||||
std::uint16_t frame_id;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -131,4 +148,4 @@ using MotionCallback = std::function<void(const MotionData &data)>;
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
#endif // MYNTEYE_CALLBACKS_H_ NOLINT
|
||||
#endif // MYNTEYE_DEVICE_CALLBACKS_H_
|
||||
@@ -11,8 +11,8 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_CONTEXT_H_ // NOLINT
|
||||
#define MYNTEYE_CONTEXT_H_
|
||||
#ifndef MYNTEYE_DEVICE_CONTEXT_H_
|
||||
#define MYNTEYE_DEVICE_CONTEXT_H_
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
@@ -53,4 +53,4 @@ class MYNTEYE_API Context {
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
#endif // MYNTEYE_CONTEXT_H_ NOLINT
|
||||
#endif // MYNTEYE_DEVICE_CONTEXT_H_
|
||||
@@ -11,20 +11,19 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_DEVICE_H_ // NOLINT
|
||||
#define MYNTEYE_DEVICE_H_
|
||||
#ifndef MYNTEYE_DEVICE_DEVICE_H_
|
||||
#define MYNTEYE_DEVICE_DEVICE_H_
|
||||
#pragma once
|
||||
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "mynteye/callbacks.h"
|
||||
#include "mynteye/mynteye.h"
|
||||
#include "mynteye/types.h"
|
||||
#include "mynteye/device/callbacks.h"
|
||||
|
||||
MYNTEYE_BEGIN_NAMESPACE
|
||||
|
||||
@@ -67,6 +66,9 @@ class MYNTEYE_API Device {
|
||||
using stream_async_callback_ptr_t = std::shared_ptr<stream_async_callback_t>;
|
||||
using motion_async_callback_ptr_t = std::shared_ptr<motion_async_callback_t>;
|
||||
|
||||
using img_params_t = device::img_params_t;
|
||||
using imu_params_t = device::imu_params_t;
|
||||
|
||||
Device(const Model &model, std::shared_ptr<uvc::device> device);
|
||||
virtual ~Device();
|
||||
|
||||
@@ -102,7 +104,14 @@ class MYNTEYE_API Device {
|
||||
* Supports the addon or not.
|
||||
*/
|
||||
bool Supports(const AddOns &addon) const;
|
||||
|
||||
/**
|
||||
* Init device resolution.
|
||||
*/
|
||||
void InitResolution(const Resolution &res);
|
||||
/**
|
||||
* set the stream request.
|
||||
*/
|
||||
void SetStreamRequest(const Format &format, const FrameRate &rate);
|
||||
/**
|
||||
* Get all stream requests of the capability.
|
||||
*/
|
||||
@@ -245,12 +254,19 @@ class MYNTEYE_API Device {
|
||||
/**
|
||||
* Enable cache motion datas.
|
||||
*/
|
||||
void EnableMotionDatas(
|
||||
std::size_t max_size = std::numeric_limits<std::size_t>::max());
|
||||
void EnableMotionDatas();
|
||||
/**
|
||||
* Enable cache motion datas.
|
||||
*/
|
||||
void EnableMotionDatas(std::size_t max_size);
|
||||
/**
|
||||
* Get the motion datas.
|
||||
*/
|
||||
std::vector<device::MotionData> GetMotionDatas();
|
||||
/**
|
||||
* Get the device img params
|
||||
*/
|
||||
img_params_t GetImgParams();
|
||||
|
||||
protected:
|
||||
std::shared_ptr<uvc::device> device() const {
|
||||
@@ -286,6 +302,8 @@ class MYNTEYE_API Device {
|
||||
|
||||
private:
|
||||
Model model_;
|
||||
Resolution res_ = Resolution::RES_752x480;
|
||||
StreamRequest request_;
|
||||
std::shared_ptr<uvc::device> device_;
|
||||
std::shared_ptr<DeviceInfo> device_info_;
|
||||
|
||||
@@ -295,6 +313,7 @@ class MYNTEYE_API Device {
|
||||
std::shared_ptr<MotionIntrinsics> motion_intrinsics_;
|
||||
std::map<Stream, Extrinsics> motion_from_extrinsics_;
|
||||
|
||||
img_params_t img_params_;
|
||||
stream_callbacks_t stream_callbacks_;
|
||||
motion_callback_t motion_callback_;
|
||||
|
||||
@@ -313,6 +332,8 @@ class MYNTEYE_API Device {
|
||||
|
||||
void ReadAllInfos();
|
||||
|
||||
void ConfigIntrinsics(const Resolution &res);
|
||||
|
||||
void CallbackPushedStreamData(const Stream &stream);
|
||||
void CallbackMotionData(const device::MotionData &data);
|
||||
|
||||
@@ -322,4 +343,4 @@ class MYNTEYE_API Device {
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
#endif // MYNTEYE_DEVICE_H_ NOLINT
|
||||
#endif // MYNTEYE_DEVICE_DEVICE_H_
|
||||
@@ -11,11 +11,12 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_UTILS_H_ // NOLINT
|
||||
#define MYNTEYE_UTILS_H_
|
||||
#ifndef MYNTEYE_DEVICE_UTILS_H_
|
||||
#define MYNTEYE_DEVICE_UTILS_H_
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "mynteye/mynteye.h"
|
||||
|
||||
@@ -55,8 +56,22 @@ namespace utils {
|
||||
MYNTEYE_API float get_real_exposure_time(
|
||||
std::int32_t frame_rate, std::uint16_t exposure_time);
|
||||
|
||||
/**
|
||||
* @ingroup utils
|
||||
*
|
||||
* Get sdk root dir.
|
||||
*/
|
||||
MYNTEYE_API std::string get_sdk_root_dir();
|
||||
|
||||
/**
|
||||
* @ingroup utils
|
||||
*
|
||||
* Get sdk install dir.
|
||||
*/
|
||||
MYNTEYE_API std::string get_sdk_install_dir();
|
||||
|
||||
} // namespace utils
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
#endif // MYNTEYE_UTILS_H_ NOLINT
|
||||
#endif // MYNTEYE_DEVICE_UTILS_H_
|
||||
@@ -45,7 +45,7 @@ MYNTEYE_API_VERSION_CHECK( \
|
||||
((major<<16)|(minor<<8)|(patch)) // NOLINT
|
||||
|
||||
/* MYNTEYE_API_VERSION in "X.Y.Z" format */
|
||||
#define MYNTEYE_API_VERSION_STR (STRINGIFY(MYNTEYE_API_VERSION_MAJOR.MYNTEYE_API_VERSION_MINOR.MYNTEYE_API_VERSION_PATCH)) // NOLINT
|
||||
#define MYNTEYE_API_VERSION_STR (MYNTEYE_STRINGIFY(MYNTEYE_API_VERSION_MAJOR.MYNTEYE_API_VERSION_MINOR.MYNTEYE_API_VERSION_PATCH)) // NOLINT
|
||||
|
||||
#cmakedefine MYNTEYE_NAMESPACE @MYNTEYE_NAMESPACE@
|
||||
#if defined(MYNTEYE_NAMESPACE)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_TYPES_H_ // NOLINT
|
||||
#ifndef MYNTEYE_TYPES_H_
|
||||
#define MYNTEYE_TYPES_H_
|
||||
#pragma once
|
||||
|
||||
@@ -76,6 +76,8 @@ enum class Capabilities : std::uint8_t {
|
||||
STEREO,
|
||||
/** Provides color stream */
|
||||
COLOR,
|
||||
/** Provide stereo color stream */
|
||||
STEREO_COLOR,
|
||||
/** Provides depth stream */
|
||||
DEPTH,
|
||||
/** Provides point cloud stream */
|
||||
@@ -163,19 +165,19 @@ enum class Option : std::uint8_t {
|
||||
/**
|
||||
* Max gain, valid if auto-exposure
|
||||
*
|
||||
* range: [0,48], default: 48
|
||||
* range: [0,255], default: 8
|
||||
*/
|
||||
MAX_GAIN,
|
||||
/**
|
||||
* Max exposure time, valid if auto-exposure
|
||||
*
|
||||
* range: [0,240], default: 240
|
||||
* range: [0,1000], default: 333
|
||||
*/
|
||||
MAX_EXPOSURE_TIME,
|
||||
/**
|
||||
* Desired brightness, valid if auto-exposure
|
||||
*
|
||||
* range: [0,255], default: 192
|
||||
* range: [1,255], default: 122
|
||||
*/
|
||||
DESIRED_BRIGHTNESS,
|
||||
/**
|
||||
@@ -195,6 +197,36 @@ enum class Option : std::uint8_t {
|
||||
ZERO_DRIFT_CALIBRATION,
|
||||
/** Erase chip */
|
||||
ERASE_CHIP,
|
||||
/**
|
||||
* min exposure time, valid if auto-exposure
|
||||
*
|
||||
* range: [0,1000], default: 0
|
||||
*/
|
||||
MIN_EXPOSURE_TIME,
|
||||
/**
|
||||
* The range of accelerometer
|
||||
*
|
||||
* values: {6,12,24,48}, default: 6
|
||||
*/
|
||||
ACCELEROMETER_RANGE,
|
||||
/**
|
||||
* The range of gyroscope
|
||||
*
|
||||
* values: {250,500,1000,2000,4000}, default: 1000
|
||||
*/
|
||||
GYROSCOPE_RANGE,
|
||||
/**
|
||||
* The parameter of accelerometer low pass filter
|
||||
*
|
||||
* values: {0,1,2}, default: 2
|
||||
*/
|
||||
ACCELEROMETER_LOW_PASS_FILTER,
|
||||
/**
|
||||
* The parameter of gyroscope low pass filter
|
||||
*
|
||||
* values: {23,64}, default: 64
|
||||
*/
|
||||
GYROSCOPE_LOW_PASS_FILTER,
|
||||
/** Last guard */
|
||||
LAST
|
||||
};
|
||||
@@ -227,6 +259,40 @@ enum class AddOns : std::uint8_t {
|
||||
LAST
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup enumerations
|
||||
* @brief Camera supported resolution.
|
||||
*/
|
||||
enum class Resolution : std::uint8_t {
|
||||
/** 752x480 */
|
||||
RES_752x480,
|
||||
/** 1280x400 */
|
||||
RES_1280x400,
|
||||
/** 2560x800 */
|
||||
RES_2560x800,
|
||||
/** Last guard */
|
||||
LAST
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup enumerations
|
||||
* @brief Camera supported frame rate.
|
||||
*/
|
||||
enum class FrameRate : std::uint8_t {
|
||||
/** 10 fps */
|
||||
RATE_10_FPS = 10,
|
||||
/** 20 fps */
|
||||
RATE_20_FPS = 20,
|
||||
/** 20 fps */
|
||||
RATE_25_FPS = 25,
|
||||
/** 30 fps */
|
||||
RATE_30_FPS = 30,
|
||||
/** 60 fps */
|
||||
RATE_60_FPS = 60,
|
||||
/** Last guard */
|
||||
LAST
|
||||
};
|
||||
|
||||
#define MYNTEYE_ENUM_HELPERS(TYPE) \
|
||||
MYNTEYE_API const char *to_string(const TYPE &value); \
|
||||
inline bool is_valid(const TYPE &value) { \
|
||||
@@ -250,6 +316,8 @@ MYNTEYE_ENUM_HELPERS(Info)
|
||||
MYNTEYE_ENUM_HELPERS(Option)
|
||||
MYNTEYE_ENUM_HELPERS(Source)
|
||||
MYNTEYE_ENUM_HELPERS(AddOns)
|
||||
MYNTEYE_ENUM_HELPERS(Resolution)
|
||||
MYNTEYE_ENUM_HELPERS(FrameRate)
|
||||
|
||||
#undef MYNTEYE_ENUM_HELPERS
|
||||
|
||||
@@ -266,6 +334,8 @@ enum class Format : std::uint32_t {
|
||||
GREY = MYNTEYE_FOURCC('G', 'R', 'E', 'Y'),
|
||||
/** YUV 4:2:2, 16 bits per pixel */
|
||||
YUYV = MYNTEYE_FOURCC('Y', 'U', 'Y', 'V'),
|
||||
/** BGR 8:8:8, 24 bits per pixel */
|
||||
BGR888 = MYNTEYE_FOURCC('B', 'G', 'R', '3'),
|
||||
/** Last guard */
|
||||
LAST
|
||||
};
|
||||
@@ -293,6 +363,33 @@ struct MYNTEYE_API StreamRequest {
|
||||
/** Stream frames per second (unused) */
|
||||
std::uint16_t fps;
|
||||
|
||||
StreamRequest() {}
|
||||
|
||||
StreamRequest(
|
||||
std::uint16_t width, std::uint16_t height, Format format,
|
||||
std::uint16_t fps)
|
||||
: width(width), height(height), format(format), fps(fps) {}
|
||||
|
||||
StreamRequest(Resolution res, Format format, FrameRate rate)
|
||||
: format(format) {
|
||||
fps = static_cast<uint16_t>(rate);
|
||||
|
||||
switch (res) {
|
||||
case Resolution::RES_752x480:
|
||||
width = 480, height = 752;
|
||||
break;
|
||||
case Resolution::RES_1280x400:
|
||||
width = 1280, height = 400;
|
||||
break;
|
||||
case Resolution::RES_2560x800:
|
||||
width = 2560, height = 800;
|
||||
break;
|
||||
default:
|
||||
width = 480, height = 752;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool operator==(const StreamRequest &other) const {
|
||||
return width == other.width && height == other.height &&
|
||||
format == other.format && fps == other.fps;
|
||||
@@ -409,8 +506,8 @@ std::ostream &operator<<(std::ostream &os, const Extrinsics &ex);
|
||||
struct MYNTEYE_API ImgData {
|
||||
/** Image frame id */
|
||||
std::uint16_t frame_id;
|
||||
/** Image timestamp in 0.01ms */
|
||||
std::uint32_t timestamp;
|
||||
/** Image timestamp in 1us */
|
||||
std::uint64_t timestamp;
|
||||
/** Image exposure time, virtual value in [1, 480] */
|
||||
std::uint16_t exposure_time;
|
||||
|
||||
@@ -441,10 +538,12 @@ struct MYNTEYE_API ImgData {
|
||||
* IMU data.
|
||||
*/
|
||||
struct MYNTEYE_API ImuData {
|
||||
/** Image frame id */
|
||||
std::uint16_t frame_id;
|
||||
/** IMU timestamp in 0.01ms */
|
||||
std::uint32_t timestamp;
|
||||
/** Imu serial number */
|
||||
std::uint32_t serial_number;
|
||||
/** accel or gyro flag:1 for accel,2 for gyro,3 for both */
|
||||
std::uint8_t flag;
|
||||
/** IMU timestamp in 1us */
|
||||
std::uint64_t timestamp;
|
||||
/** IMU accelerometer data for 3-axis: X, Y, Z. */
|
||||
double accel[3];
|
||||
/** IMU gyroscope data for 3-axis: X, Y, Z. */
|
||||
@@ -453,7 +552,7 @@ struct MYNTEYE_API ImuData {
|
||||
double temperature;
|
||||
|
||||
void Reset() {
|
||||
frame_id = 0;
|
||||
flag = 0;
|
||||
timestamp = 0;
|
||||
std::fill(accel, accel + 3, 0);
|
||||
std::fill(gyro, gyro + 3, 0);
|
||||
@@ -483,4 +582,4 @@ std::ostream &operator<<(std::ostream &os, const OptionInfo &info);
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
#endif // MYNTEYE_TYPES_H_ NOLINT
|
||||
#endif // MYNTEYE_TYPES_H_
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_INTERNAL_FILES_H_ // NOLINT
|
||||
#define MYNTEYE_INTERNAL_FILES_H_
|
||||
#ifndef MYNTEYE_UTIL_FILES_H_
|
||||
#define MYNTEYE_UTIL_FILES_H_
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
@@ -29,4 +29,4 @@ MYNTEYE_API bool mkdir(const std::string &path);
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
#endif // MYNTEYE_INTERNAL_FILES_H_ NOLINT
|
||||
#endif // MYNTEYE_UTIL_FILES_H_
|
||||
@@ -11,8 +11,8 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_INTERNAL_STRINGS_H_ // NOLINT
|
||||
#define MYNTEYE_INTERNAL_STRINGS_H_
|
||||
#ifndef MYNTEYE_UTIL_STRINGS_H_
|
||||
#define MYNTEYE_UTIL_STRINGS_H_
|
||||
#pragma once
|
||||
|
||||
#include <stdexcept>
|
||||
@@ -59,4 +59,4 @@ std::string trim_copy(const std::string &text);
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
#endif // MYNTEYE_INTERNAL_STRINGS_H_ NOLINT
|
||||
#endif // MYNTEYE_UTIL_STRINGS_H_
|
||||
@@ -11,8 +11,8 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef MYNTEYE_INTERNAL_TIMES_H_ // NOLINT
|
||||
#define MYNTEYE_INTERNAL_TIMES_H_
|
||||
#ifndef MYNTEYE_UTIL_TIMES_H_
|
||||
#define MYNTEYE_UTIL_TIMES_H_
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
@@ -220,4 +220,4 @@ inline std::string to_utc_string(
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
#endif // MYNTEYE_INTERNAL_TIMES_H_ NOLINT
|
||||
#endif // MYNTEYE_UTIL_TIMES_H_
|
||||
@@ -13,6 +13,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
@PACKAGE_INIT@
|
||||
set(mynteye_WITH_API @WITH_API@)
|
||||
set(mynteye_WITH_GLOG @WITH_GLOG@)
|
||||
|
||||
set(mynteye_WITH_API @WITH_API@)
|
||||
set(mynteye_WITH_GLOG @WITH_GLOG@)
|
||||
|
||||
76
platforms/projects/vs2017/README.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# How to use MYNT® EYE S SDK with Visual Studio 2017
|
||||
|
||||
This tutorial will create a project with Visual Studio 2017 to start using MYNT® EYE S SDK.
|
||||
|
||||
## Preparation
|
||||
|
||||
Install the win pack of MYNT® EYE S SDK.
|
||||
|
||||
## Create Project
|
||||
|
||||
Open Visual Studio 2017, then `File > New > Project`,
|
||||
|
||||

|
||||
|
||||
Select "Windows Console Application", set the project's name and location, click "OK",
|
||||
|
||||

|
||||
|
||||
Finally, you will see the new project like this,
|
||||
|
||||

|
||||
|
||||
## Config Properties
|
||||
|
||||
Right click the project, and open its "Properties" window,
|
||||
|
||||

|
||||
|
||||
Change "Configuration" to "All Configurations", then add the following paths to "Additional Include Directories",
|
||||
|
||||
```bash
|
||||
$(MYNTEYES_SDK_ROOT)\include
|
||||
$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\include
|
||||
```
|
||||
|
||||

|
||||
|
||||
Add the following paths to "Additional Library Directories",
|
||||
|
||||
```bash
|
||||
$(MYNTEYES_SDK_ROOT)\lib
|
||||
$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\x64\vc15\lib
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
Add the following libs to "Additional Dependencies",
|
||||
|
||||
```bash
|
||||
mynteye.lib
|
||||
opencv_world343.lib
|
||||
```
|
||||
|
||||

|
||||
|
||||
If you wanna debug, could change "Configuration" to "Debug" and add these debug libs,
|
||||
|
||||
```bash
|
||||
mynteyed.lib
|
||||
opencv_world343d.lib
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Start using SDK
|
||||
|
||||
Include the headers of SDK and start using its APIs,
|
||||
|
||||

|
||||
|
||||
Select "Release x64" or "Debug x64" to run the project.
|
||||
|
||||
<!--
|
||||

|
||||
-->
|
||||
BIN
platforms/projects/vs2017/images/10_path.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
platforms/projects/vs2017/images/1_new_pro.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
platforms/projects/vs2017/images/2_new_pro.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
platforms/projects/vs2017/images/3_new_pro.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
platforms/projects/vs2017/images/4_config.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
platforms/projects/vs2017/images/5_config_include.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
platforms/projects/vs2017/images/6_config_lib_dir.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
platforms/projects/vs2017/images/7_config_lib.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
platforms/projects/vs2017/images/8_config_debug_lib.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
platforms/projects/vs2017/images/9_run_x64.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
4
platforms/projects/vs2017/mynteyes_demo/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/.vs/
|
||||
/x64/
|
||||
/mynteyes_demo/x64/
|
||||
/mynteyes_demo/*.user
|
||||
31
platforms/projects/vs2017/mynteyes_demo/mynteyes_demo.sln
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27703.2018
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mynteyes_demo", "mynteyes_demo\mynteyes_demo.vcxproj", "{49798F84-3EA3-4CB5-A873-6163DB4B4A43}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{49798F84-3EA3-4CB5-A873-6163DB4B4A43}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{49798F84-3EA3-4CB5-A873-6163DB4B4A43}.Debug|x64.Build.0 = Debug|x64
|
||||
{49798F84-3EA3-4CB5-A873-6163DB4B4A43}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{49798F84-3EA3-4CB5-A873-6163DB4B4A43}.Debug|x86.Build.0 = Debug|Win32
|
||||
{49798F84-3EA3-4CB5-A873-6163DB4B4A43}.Release|x64.ActiveCfg = Release|x64
|
||||
{49798F84-3EA3-4CB5-A873-6163DB4B4A43}.Release|x64.Build.0 = Release|x64
|
||||
{49798F84-3EA3-4CB5-A873-6163DB4B4A43}.Release|x86.ActiveCfg = Release|Win32
|
||||
{49798F84-3EA3-4CB5-A873-6163DB4B4A43}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F6C50224-4EC6-46EB-AA63-7E32FC6F0648}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,177 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{49798F84-3EA3-4CB5-A873-6163DB4B4A43}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>mynteyesdemo</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\include;$(MYNTEYES_SDK_ROOT)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\x64\vc15\lib;$(MYNTEYES_SDK_ROOT)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>mynteyed.lib;opencv_world343d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\include;$(MYNTEYES_SDK_ROOT)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\x64\vc15\lib;$(MYNTEYES_SDK_ROOT)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>mynteyed.lib;opencv_world343d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\include;$(MYNTEYES_SDK_ROOT)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\x64\vc15\lib;$(MYNTEYES_SDK_ROOT)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>mynteye.lib;opencv_world343.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\include;$(MYNTEYES_SDK_ROOT)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\x64\vc15\lib;$(MYNTEYES_SDK_ROOT)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>mynteye.lib;opencv_world343.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="mynteyes_demo.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mynteyes_demo.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
BIN
platforms/projects/vs2017/mynteyes_demo/mynteyes_demo/stdafx.cpp
Normal file
BIN
platforms/projects/vs2017/mynteyes_demo/mynteyes_demo/stdafx.h
Normal file
176
platforms/win/README.txt
Normal file
@@ -0,0 +1,176 @@
|
||||
# MYNT® EYE S SDK
|
||||
|
||||
################################################################################
|
||||
Language: 简体中文
|
||||
################################################################################
|
||||
|
||||
## 如何开始使用 SDK
|
||||
|
||||
1) 运行样例程序
|
||||
|
||||
安装完 SDK 的 exe 安装包后,桌面会生成 SDK 根目录的快捷方式。
|
||||
|
||||
进入 "<SDK_ROOT_DIR>\bin\samples\tutorials" 目录,双击 "get_stereo.exe" 运行,即可看到双目实时画面。
|
||||
|
||||
2)生成样例工程
|
||||
|
||||
首先,安装好 Visual Studio 2017 <https://visualstudio.microsoft.com/> 和 CMake <https://cmake.org/> 。
|
||||
|
||||
接着,进入 "<SDK_ROOT_DIR>\samples" 目录, 双击 "generate.bat" 即可生成样例工程。
|
||||
|
||||
p.s. 样例教程,可见 https://slightech.github.io/MYNT-EYE-S-SDK/ 主页给出的 Guide 文档。
|
||||
|
||||
p.p.s. 运行结果,参考下方英文内容。
|
||||
|
||||
3)如何于 Visual Studio 2017 下使用 SDK
|
||||
|
||||
进入 "<SDK_ROOT_DIR>\projects\vs2017" ,见 "README.md" 说明。
|
||||
|
||||
################################################################################
|
||||
Language: English
|
||||
################################################################################
|
||||
|
||||
## How to start using SDK
|
||||
|
||||
1) Run the prebuilt samples, ensure the SDK works well.
|
||||
|
||||
After you install the win pack of SDK, there will be a shortcut to the SDK root directory on your desktop.
|
||||
|
||||
First, you should plug the MYNT® EYE camera in a USB 3.0 port.
|
||||
|
||||
Second, goto the "<SDK_ROOT_DIR>\bin\samples\tutorials" directory and click "get_stereo.exe" to run.
|
||||
|
||||
Finally, you will see the window that display the realtime frame of the camera.
|
||||
|
||||
2) Generate samples project of Visual Studio 2017.
|
||||
|
||||
First, you should install Visual Studio 2017 <https://visualstudio.microsoft.com/> and CMake <https://cmake.org/>.
|
||||
|
||||
Second, goto the "<SDK_ROOT_DIR>\samples" directory and click "generate.bat" to run.
|
||||
|
||||
Finally, you could click `_build\mynteye_samples.sln` to open the samples project.
|
||||
|
||||
p.s. The tutorials of samples are here: https://slightech.github.io/MYNT-EYE-S-SDK-Guide/src/data/contents.html.
|
||||
|
||||
p.p.s. The example result of "generate.bat",
|
||||
|
||||
```cmd
|
||||
-- The C compiler identification is MSVC 19.14.26429.4
|
||||
-- The CXX compiler identification is MSVC 19.14.26429.4
|
||||
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
|
||||
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe -- works
|
||||
-- Detecting C compiler ABI info
|
||||
-- Detecting C compiler ABI info - done
|
||||
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
|
||||
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe -- works
|
||||
-- Detecting CXX compiler ABI info
|
||||
-- Detecting CXX compiler ABI info - done
|
||||
-- Detecting CXX compile features
|
||||
-- Detecting CXX compile features - done
|
||||
-- HOST_ARCH: x86_64
|
||||
-- OpenCV ARCH: x64
|
||||
-- OpenCV RUNTIME: vc15
|
||||
-- OpenCV STATIC: OFF
|
||||
-- Found OpenCV: C:/Users/John/AppData/Roaming/Slightech/MYNTEYES/SDK/2.2.1/3rdparty/opencv/build (found version "3.4.3")
|
||||
-- Found OpenCV 3.4.3 in C:/Users/John/AppData/Roaming/Slightech/MYNTEYES/SDK/2.2.1/3rdparty/opencv/build/x64/vc15/lib
|
||||
-- You might need to add C:\Users\John\AppData\Roaming\Slightech\MYNTEYES\SDK\2.2.1\3rdparty\opencv\build\x64\vc15\bin to your PATH to be able to run your applications.
|
||||
-- Found OpenCV: 3.4.3
|
||||
CMake Warning at C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
|
||||
Imported targets and dependency information not available for Boost version
|
||||
(all versions older than 1.33)
|
||||
Call Stack (most recent call first):
|
||||
C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:907 (_Boost_COMPONENT_DEPENDENCIES)
|
||||
C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:1542 (_Boost_MISSING_DEPENDENCIES)
|
||||
C:/Users/John/AppData/Roaming/Slightech/MYNTEYES/SDK/2.2.1/cmake/Option.cmake:47 (find_package)
|
||||
CMakeLists.txt:26 (include)
|
||||
|
||||
|
||||
-- Could NOT find Boost
|
||||
--
|
||||
-- Platform:
|
||||
-- HOST_OS: Win
|
||||
-- HOST_NAME: Win
|
||||
-- HOST_ARCH: x86_64
|
||||
-- HOST_COMPILER: MSVC
|
||||
-- COMPILER_VERSION: 19.14.26429.4
|
||||
-- COMPILER_VERSION_MAJOR: 19
|
||||
-- COMPILER_VERSION_MINOR: 14
|
||||
-- COMPILER_VERSION_PATCH: 26429
|
||||
-- COMPILER_VERSION_TWEAK: 4
|
||||
-- CUDA_VERSION: 9.2
|
||||
-- CUDA_VERSION_MAJOR: 9
|
||||
-- CUDA_VERSION_MINOR: 2
|
||||
-- CUDA_VERSION_STRING: 9.2
|
||||
-- OpenCV_VERSION: 3.4.3
|
||||
-- OpenCV_VERSION_MAJOR: 3
|
||||
-- OpenCV_VERSION_MINOR: 4
|
||||
-- OpenCV_VERSION_PATCH: 3
|
||||
-- OpenCV_VERSION_TWEAK: 0
|
||||
-- OpenCV_VERSION_STATUS:
|
||||
-- OpenCV_WITH_WORLD: TRUE
|
||||
--
|
||||
-- Options:
|
||||
-- WITH_API: ON
|
||||
-- OpenCV: YES
|
||||
-- OpenCV_VERSION: 3.4.3
|
||||
-- OpenCV_WORLD: YES
|
||||
-- WITH_DEVICE_INFO_REQUIRED: ON
|
||||
-- WITH_BOOST: ON
|
||||
-- Boost: NO
|
||||
-- WITH_GLOG: OFF
|
||||
--
|
||||
-- Features:
|
||||
-- Filesystem: native
|
||||
--
|
||||
-- Visual Studio >= 2010, MSVC >= 10.0
|
||||
-- C_FLAGS: /DWIN32 /D_WINDOWS /W3 -Wall -march=native
|
||||
-- CXX_FLAGS: /DWIN32 /D_WINDOWS /W3 /GR /EHsc -Wall -march=native
|
||||
-- Found mynteye: 2.2.1
|
||||
-- Generating camera_a.bat
|
||||
-- Generating get_depth_with_region.bat
|
||||
-- Generating camera_d.bat
|
||||
-- Generating camera_u.bat
|
||||
CMake Warning at tutorials/CMakeLists.txt:70 (find_package):
|
||||
By not providing "FindPCL.cmake" in CMAKE_MODULE_PATH this project has
|
||||
asked CMake to find a package configuration file provided by "PCL", but
|
||||
CMake did not find one.
|
||||
|
||||
Could not find a package configuration file provided by "PCL" with any of
|
||||
the following names:
|
||||
|
||||
PCLConfig.cmake
|
||||
pcl-config.cmake
|
||||
|
||||
Add the installation prefix of "PCL" to CMAKE_PREFIX_PATH or set "PCL_DIR"
|
||||
to a directory containing one of the above files. If "PCL" provides a
|
||||
separate development package or SDK, be sure it has been installed.
|
||||
|
||||
|
||||
CMake Warning at tutorials/CMakeLists.txt:86 (message):
|
||||
PCL not found :(
|
||||
|
||||
|
||||
-- Generating get_device_info.bat
|
||||
-- Generating get_img_params.bat
|
||||
-- Generating get_imu_params.bat
|
||||
-- Generating get_stereo.bat
|
||||
-- Generating get_stereo_rectified.bat
|
||||
-- Generating get_disparity.bat
|
||||
-- Generating get_depth.bat
|
||||
-- Generating get_imu.bat
|
||||
-- Generating get_from_callbacks.bat
|
||||
-- Generating get_with_plugin.bat
|
||||
-- Generating ctrl_framerate.bat
|
||||
-- Generating ctrl_auto_exposure.bat
|
||||
-- Generating ctrl_manual_exposure.bat
|
||||
-- Generating ctrl_infrared.bat
|
||||
-- Generating get_all_device_info.bat
|
||||
-- Configuring done
|
||||
-- Generating done
|
||||
-- Build files have been written to: C:/Users/John/AppData/Roaming/Slightech/MYNTEYES/SDK/2.2.1/samples/_build
|
||||
Press any key to continue . . .
|
||||
```
|
||||
|
||||
3) Start using MYNT® EYE S SDK with Visual Studio 2017
|
||||
|
||||
Goto the "<SDK_ROOT_DIR>\projects\vs2017", see the "README.md".
|
||||
@@ -53,6 +53,10 @@ message(STATUS "Found mynteye: ${mynteye_VERSION}")
|
||||
|
||||
include(${PRO_DIR}/cmake/DetectOpenCV.cmake)
|
||||
|
||||
if(mynteye_WITH_GLOG)
|
||||
include(${PRO_DIR}/cmake/DetectGLog.cmake)
|
||||
endif()
|
||||
|
||||
#LIST(APPEND CMAKE_MODULE_PATH ${PRO_DIR}/cmake)
|
||||
|
||||
# targets
|
||||
@@ -71,7 +75,7 @@ add_subdirectory(device)
|
||||
|
||||
# samples above uvc layer
|
||||
|
||||
add_subdirectory(uvc)
|
||||
#add_subdirectory(uvc)
|
||||
|
||||
# tutorials
|
||||
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/logger.h"
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/times.h"
|
||||
#include "mynteye/api/api.h"
|
||||
#include "mynteye/util/times.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
@@ -24,10 +23,7 @@ int main(int argc, char *argv[]) {
|
||||
auto &&api = API::Create(argc, argv);
|
||||
if (!api)
|
||||
return 1;
|
||||
|
||||
// api->SetOptionValue(Option::FRAME_RATE, 25);
|
||||
// api->SetOptionValue(Option::IMU_FREQUENCY, 500);
|
||||
api->SetOptionValue(Option::IR_CONTROL, 80);
|
||||
api->SetStreamRequest(Format::BGR888, FrameRate::RATE_30_FPS);
|
||||
api->LogOptionInfos();
|
||||
|
||||
std::size_t left_count = 0;
|
||||
@@ -56,8 +52,7 @@ int main(int argc, char *argv[]) {
|
||||
CHECK_NOTNULL(data.imu);
|
||||
++imu_count;
|
||||
VLOG(2) << "Imu count: " << imu_count;
|
||||
VLOG(2) << " frame_id: " << data.imu->frame_id
|
||||
<< ", timestamp: " << data.imu->timestamp
|
||||
VLOG(2) << ", timestamp: " << data.imu->timestamp
|
||||
<< ", accel_x: " << data.imu->accel[0]
|
||||
<< ", accel_y: " << data.imu->accel[1]
|
||||
<< ", accel_z: " << data.imu->accel[2]
|
||||
@@ -107,8 +102,7 @@ int main(int argc, char *argv[]) {
|
||||
auto &&motion_datas = api->GetMotionDatas();
|
||||
motion_count += motion_datas.size();
|
||||
for (auto &&data : motion_datas) {
|
||||
LOG(INFO) << "Imu frame_id: " << data.imu->frame_id
|
||||
<< ", timestamp: " << data.imu->timestamp
|
||||
LOG(INFO) << ", timestamp: " << data.imu->timestamp
|
||||
<< ", accel_x: " << data.imu->accel[0]
|
||||
<< ", accel_y: " << data.imu->accel[1]
|
||||
<< ", accel_z: " << data.imu->accel[2]
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -184,7 +184,7 @@ int main(int argc, char *argv[]) {
|
||||
// Show disparity instead of depth, but show depth values in region.
|
||||
auto &&depth_frame = disp_data.frame;
|
||||
|
||||
#ifdef USE_OPENCV3
|
||||
#ifdef WITH_OPENCV3
|
||||
// ColormapTypes
|
||||
// http://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html#ga9a805d8262bcbe273f16be9ea2055a65
|
||||
cv::applyColorMap(depth_frame, depth_frame, cv::COLORMAP_JET);
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
|
||||
get_filename_component(DIR_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
include_directories(
|
||||
${PRO_DIR}/src
|
||||
)
|
||||
|
||||
set_outdir(
|
||||
"${OUT_DIR}/lib/${DIR_NAME}"
|
||||
"${OUT_DIR}/lib/${DIR_NAME}"
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#include "mynteye/logger.h"
|
||||
|
||||
#include "mynteye/device.h"
|
||||
#include "mynteye/utils.h"
|
||||
|
||||
#include "mynteye/times.h"
|
||||
#include "mynteye/device/device.h"
|
||||
#include "mynteye/device/utils.h"
|
||||
#include "mynteye/util/times.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
@@ -29,33 +27,15 @@ int main(int argc, char *argv[]) {
|
||||
auto &&device = device::select();
|
||||
if (!device)
|
||||
return 1;
|
||||
/*
|
||||
{ // auto-exposure
|
||||
device->SetOptionValue(Option::EXPOSURE_MODE, 0);
|
||||
device->SetOptionValue(Option::MAX_GAIN, 40); // [0.48]
|
||||
device->SetOptionValue(Option::MAX_EXPOSURE_TIME, 120); // [0,240]
|
||||
device->SetOptionValue(Option::DESIRED_BRIGHTNESS, 200); // [0,255]
|
||||
}
|
||||
{ // manual-exposure
|
||||
device->SetOptionValue(Option::EXPOSURE_MODE, 1);
|
||||
device->SetOptionValue(Option::GAIN, 20); // [0.48]
|
||||
device->SetOptionValue(Option::BRIGHTNESS, 20); // [0,240]
|
||||
device->SetOptionValue(Option::CONTRAST, 20); // [0,255]
|
||||
}
|
||||
device->SetOptionValue(Option::IR_CONTROL, 80);
|
||||
device->SetOptionValue(Option::FRAME_RATE, 25);
|
||||
device->SetOptionValue(Option::IMU_FREQUENCY, 500);
|
||||
*/
|
||||
device->LogOptionInfos();
|
||||
|
||||
// device->RunOptionAction(Option::ZERO_DRIFT_CALIBRATION);
|
||||
|
||||
std::size_t left_count = 0;
|
||||
device->InitResolution(Resolution::RES_1280x400);
|
||||
device->SetStreamRequest(Format::BGR888, FrameRate::RATE_30_FPS);
|
||||
device->SetStreamCallback(
|
||||
Stream::LEFT, [&left_count](const device::StreamData &data) {
|
||||
CHECK_NOTNULL(data.img);
|
||||
++left_count;
|
||||
VLOG(2) << Stream::LEFT << ", count: " << left_count;
|
||||
VLOG(2) << Stream::LEFT << "count: " << left_count;
|
||||
VLOG(2) << " frame_id: " << data.img->frame_id
|
||||
<< ", timestamp: " << data.img->timestamp
|
||||
<< ", exposure_time: " << data.img->exposure_time;
|
||||
@@ -65,19 +45,19 @@ int main(int argc, char *argv[]) {
|
||||
Stream::RIGHT, [&right_count](const device::StreamData &data) {
|
||||
CHECK_NOTNULL(data.img);
|
||||
++right_count;
|
||||
VLOG(2) << Stream::RIGHT << ", count: " << right_count;
|
||||
VLOG(2) << Stream::RIGHT << "count: " << right_count;
|
||||
VLOG(2) << " frame_id: " << data.img->frame_id
|
||||
<< ", timestamp: " << data.img->timestamp
|
||||
<< ", exposure_time: " << data.img->exposure_time;
|
||||
});
|
||||
|
||||
std::size_t imu_count = 0;
|
||||
|
||||
device->SetMotionCallback([&imu_count](const device::MotionData &data) {
|
||||
CHECK_NOTNULL(data.imu);
|
||||
++imu_count;
|
||||
VLOG(2) << "Imu count: " << imu_count;
|
||||
VLOG(2) << " frame_id: " << data.imu->frame_id
|
||||
<< ", timestamp: " << data.imu->timestamp
|
||||
VLOG(2) << ", timestamp: " << data.imu->timestamp
|
||||
<< ", accel_x: " << data.imu->accel[0]
|
||||
<< ", accel_y: " << data.imu->accel[1]
|
||||
<< ", accel_z: " << data.imu->accel[2]
|
||||
@@ -90,7 +70,6 @@ int main(int argc, char *argv[]) {
|
||||
// Enable this will cache the motion datas until you get them.
|
||||
device->EnableMotionDatas();
|
||||
device->Start(Source::ALL);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
std::size_t motion_count = 0;
|
||||
@@ -104,8 +83,7 @@ int main(int argc, char *argv[]) {
|
||||
auto &&motion_datas = device->GetMotionDatas();
|
||||
motion_count += motion_datas.size();
|
||||
for (auto &&data : motion_datas) {
|
||||
LOG(INFO) << "Imu frame_id: " << data.imu->frame_id
|
||||
<< ", timestamp: " << data.imu->timestamp
|
||||
LOG(INFO) << "timestamp: " << data.imu->timestamp
|
||||
<< ", accel_x: " << data.imu->accel[0]
|
||||
<< ", accel_y: " << data.imu->accel[1]
|
||||
<< ", accel_z: " << data.imu->accel[2]
|
||||
@@ -115,15 +93,41 @@ int main(int argc, char *argv[]) {
|
||||
<< ", temperature: " << data.imu->temperature;
|
||||
}
|
||||
|
||||
cv::Mat left_img(
|
||||
left_data.frame->height(), left_data.frame->width(), CV_8UC1,
|
||||
left_data.frame->data());
|
||||
cv::Mat right_img(
|
||||
right_data.frame->height(), right_data.frame->width(), CV_8UC1,
|
||||
right_data.frame->data());
|
||||
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_img, right_img, img);
|
||||
|
||||
// TODO(Kalman): Extract into public or internal method
|
||||
if (left_data.frame->format() == Format::GREY) {
|
||||
cv::Mat left_img(
|
||||
left_data.frame->height(), left_data.frame->width(), CV_8UC1,
|
||||
left_data.frame->data());
|
||||
cv::Mat right_img(
|
||||
right_data.frame->height(), right_data.frame->width(), CV_8UC1,
|
||||
right_data.frame->data());
|
||||
cv::hconcat(left_img, right_img, img);
|
||||
} else if (left_data.frame->format() == Format::YUYV) {
|
||||
cv::Mat left_img(
|
||||
left_data.frame->height(), left_data.frame->width(), CV_8UC2,
|
||||
left_data.frame->data());
|
||||
cv::Mat right_img(
|
||||
right_data.frame->height(), right_data.frame->width(), CV_8UC2,
|
||||
right_data.frame->data());
|
||||
cv::cvtColor(left_img, left_img, cv::COLOR_YUV2BGR_YUY2);
|
||||
cv::cvtColor(right_img, right_img, cv::COLOR_YUV2BGR_YUY2);
|
||||
cv::hconcat(left_img, right_img, img);
|
||||
} else if (left_data.frame->format() == Format::BGR888) {
|
||||
cv::Mat left_img(
|
||||
left_data.frame->height(), left_data.frame->width(), CV_8UC3,
|
||||
left_data.frame->data());
|
||||
cv::Mat right_img(
|
||||
right_data.frame->height(), right_data.frame->width(), CV_8UC3,
|
||||
right_data.frame->data());
|
||||
cv::cvtColor(left_img, left_img, CV_BGR2RGB);
|
||||
cv::cvtColor(right_img, right_img, CV_BGR2RGB);
|
||||
cv::hconcat(left_img, right_img, img);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
cv::imshow("frame", img);
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
@@ -146,7 +150,7 @@ int main(int argc, char *argv[]) {
|
||||
<< ", fps: " << (1000.f * right_count / elapsed_ms);
|
||||
LOG(INFO) << "Imu count: " << imu_count
|
||||
<< ", hz: " << (1000.f * imu_count / elapsed_ms);
|
||||
// LOG(INFO) << "Motion count: " << motion_count
|
||||
// << ", hz: " << (1000.f * motion_count / elapsed_ms);
|
||||
LOG(INFO) << "Motion count: " << motion_count
|
||||
<< ", hz: " << (1000.f * motion_count / elapsed_ms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ get_filename_component(DIR_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${PRO_DIR}/src
|
||||
)
|
||||
|
||||
set_outdir(
|
||||
@@ -114,6 +115,7 @@ make_executable2(get_with_plugin SRCS data/get_with_plugin.cc WITH_OPENCV)
|
||||
## control
|
||||
|
||||
make_executable2(ctrl_framerate SRCS control/framerate.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_imu_range SRCS control/imu_range.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_auto_exposure
|
||||
SRCS control/auto_exposure.cc util/cv_painter.cc
|
||||
WITH_OPENCV
|
||||
@@ -122,7 +124,6 @@ make_executable2(ctrl_manual_exposure
|
||||
SRCS control/manual_exposure.cc util/cv_painter.cc
|
||||
WITH_OPENCV
|
||||
)
|
||||
make_executable2(ctrl_infrared SRCS control/infrared.cc WITH_OPENCV)
|
||||
|
||||
# intermediate level
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
|
||||
@@ -24,16 +24,19 @@ int main(int argc, char *argv[]) {
|
||||
auto &&api = API::Create(argc, argv);
|
||||
if (!api)
|
||||
return 1;
|
||||
api->SetStreamRequest(Format::BGR888, FrameRate::RATE_30_FPS);
|
||||
|
||||
// auto-exposure: 0
|
||||
api->SetOptionValue(Option::EXPOSURE_MODE, 0);
|
||||
|
||||
// max_gain: range [0,48], default 48
|
||||
api->SetOptionValue(Option::MAX_GAIN, 48);
|
||||
// max_exposure_time: range [0,240], default 240
|
||||
api->SetOptionValue(Option::MAX_EXPOSURE_TIME, 240);
|
||||
// desired_brightness: range [0,255], default 192
|
||||
api->SetOptionValue(Option::DESIRED_BRIGHTNESS, 192);
|
||||
// max_gain: range [0,255], default 8
|
||||
api->SetOptionValue(Option::MAX_GAIN, 8);
|
||||
// max_exposure_time: range [0,1000], default 333
|
||||
api->SetOptionValue(Option::MAX_EXPOSURE_TIME, 333);
|
||||
// desired_brightness: range [1,255], default 122
|
||||
api->SetOptionValue(Option::DESIRED_BRIGHTNESS, 122);
|
||||
// min_exposure_time: range [0,1000], default 0
|
||||
api->SetOptionValue(Option::MIN_EXPOSURE_TIME, 0);
|
||||
|
||||
LOG(INFO) << "Enable auto-exposure";
|
||||
LOG(INFO) << "Set MAX_GAIN to " << api->GetOptionValue(Option::MAX_GAIN);
|
||||
@@ -41,10 +44,12 @@ int main(int argc, char *argv[]) {
|
||||
<< api->GetOptionValue(Option::MAX_EXPOSURE_TIME);
|
||||
LOG(INFO) << "Set DESIRED_BRIGHTNESS to "
|
||||
<< api->GetOptionValue(Option::DESIRED_BRIGHTNESS);
|
||||
LOG(INFO) << "Set MIN_EXPOSURE_TIME to "
|
||||
<< api->GetOptionValue(Option::MIN_EXPOSURE_TIME);
|
||||
|
||||
api->Start(Source::VIDEO_STREAMING);
|
||||
|
||||
CVPainter painter(api->GetOptionValue(Option::FRAME_RATE));
|
||||
CVPainter painter(30);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
|
||||
@@ -11,33 +11,22 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/times.h"
|
||||
#include "mynteye/api/api.h"
|
||||
#include "mynteye/util/times.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
auto &&api = API::Create(argc, argv);
|
||||
auto &&api = API::Create(Resolution::RES_1280x400);
|
||||
// auto &&api = API::Create(argc, argv);
|
||||
if (!api)
|
||||
return 1;
|
||||
|
||||
// Attention: must set FRAME_RATE and IMU_FREQUENCY together, otherwise won't
|
||||
// succeed.
|
||||
|
||||
// FRAME_RATE values: 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60
|
||||
api->SetOptionValue(Option::FRAME_RATE, 25);
|
||||
// IMU_FREQUENCY values: 100, 200, 250, 333, 500
|
||||
api->SetOptionValue(Option::IMU_FREQUENCY, 500);
|
||||
|
||||
LOG(INFO) << "Set FRAME_RATE to " << api->GetOptionValue(Option::FRAME_RATE);
|
||||
LOG(INFO) << "Set IMU_FREQUENCY to "
|
||||
<< api->GetOptionValue(Option::IMU_FREQUENCY);
|
||||
|
||||
api->SetStreamRequest(Format::BGR888, FrameRate::RATE_30_FPS);
|
||||
// Count img
|
||||
std::atomic_uint img_count(0);
|
||||
api->SetStreamCallback(
|
||||
@@ -46,13 +35,6 @@ int main(int argc, char *argv[]) {
|
||||
++img_count;
|
||||
});
|
||||
|
||||
// Count imu
|
||||
std::atomic_uint imu_count(0);
|
||||
api->SetMotionCallback([&imu_count](const api::MotionData &data) {
|
||||
CHECK_NOTNULL(data.imu);
|
||||
++imu_count;
|
||||
});
|
||||
|
||||
api->Start(Source::ALL);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
@@ -85,7 +67,5 @@ int main(int argc, char *argv[]) {
|
||||
<< ", cost: " << elapsed_ms << "ms";
|
||||
LOG(INFO) << "Img count: " << img_count
|
||||
<< ", fps: " << (1000.f * img_count / elapsed_ms);
|
||||
LOG(INFO) << "Imu count: " << imu_count
|
||||
<< ", hz: " << (1000.f * imu_count / elapsed_ms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
89
samples/tutorials/control/imu_range.cc
Normal file
@@ -0,0 +1,89 @@
|
||||
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#include <atomic>
|
||||
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
#include "mynteye/util/times.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
auto &&api = API::Create(argc, argv);
|
||||
if (!api)
|
||||
return 1;
|
||||
|
||||
// ACCELEROMETER_RANGE values: 6, 12, 24, 32
|
||||
api->SetOptionValue(Option::ACCELEROMETER_RANGE, 6);
|
||||
// GYROSCOPE_RANGE values: 250, 500, 1000, 2000, 4000
|
||||
api->SetOptionValue(Option::GYROSCOPE_RANGE, 1000);
|
||||
|
||||
LOG(INFO) << "Set ACCELEROMETER_RANGE to "
|
||||
<< api->GetOptionValue(Option::ACCELEROMETER_RANGE);
|
||||
LOG(INFO) << "Set GYROSCOPE_RANGE to "
|
||||
<< api->GetOptionValue(Option::GYROSCOPE_RANGE);
|
||||
|
||||
// Count img
|
||||
std::atomic_uint img_count(0);
|
||||
api->SetStreamCallback(
|
||||
Stream::LEFT, [&img_count](const api::StreamData &data) {
|
||||
CHECK_NOTNULL(data.img);
|
||||
++img_count;
|
||||
});
|
||||
|
||||
// Count imu
|
||||
std::atomic_uint imu_count(0);
|
||||
api->SetMotionCallback([&imu_count](const api::MotionData &data) {
|
||||
CHECK_NOTNULL(data.imu);
|
||||
++imu_count;
|
||||
});
|
||||
|
||||
api->Start(Source::ALL);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
auto &&time_beg = times::now();
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_data.frame, right_data.frame, img);
|
||||
cv::imshow("frame", img);
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||
break;
|
||||
}
|
||||
}
|
||||
auto &&time_end = times::now();
|
||||
|
||||
api->Stop(Source::ALL);
|
||||
|
||||
// Calculate img fps and imu hz
|
||||
float elapsed_ms =
|
||||
times::count<times::microseconds>(time_end - time_beg) * 0.001f;
|
||||
LOG(INFO) << "Time beg: " << times::to_local_string(time_beg)
|
||||
<< ", end: " << times::to_local_string(time_end)
|
||||
<< ", cost: " << elapsed_ms << "ms";
|
||||
LOG(INFO) << "Img count: " << img_count
|
||||
<< ", fps: " << (1000.f * img_count / elapsed_ms);
|
||||
LOG(INFO) << "Imu count: " << imu_count
|
||||
<< ", hz: " << (1000.f * imu_count / elapsed_ms);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/logger.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
auto &&api = API::Create(argc, argv);
|
||||
if (!api)
|
||||
return 1;
|
||||
|
||||
// Detect infrared add-ons
|
||||
LOG(INFO) << "Support infrared: " << std::boolalpha
|
||||
<< api->Supports(AddOns::INFRARED);
|
||||
LOG(INFO) << "Support infrared2: " << std::boolalpha
|
||||
<< api->Supports(AddOns::INFRARED2);
|
||||
|
||||
// Get infrared intensity range
|
||||
auto &&info = api->GetOptionInfo(Option::IR_CONTROL);
|
||||
LOG(INFO) << Option::IR_CONTROL << ": {" << info << "}";
|
||||
|
||||
// Set infrared intensity value
|
||||
api->SetOptionValue(Option::IR_CONTROL, 80);
|
||||
|
||||
api->Start(Source::VIDEO_STREAMING);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_data.frame, right_data.frame, img);
|
||||
cv::imshow("frame", img);
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
api->Stop(Source::VIDEO_STREAMING);
|
||||
return 0;
|
||||
}
|
||||
@@ -13,8 +13,8 @@
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
|
||||
@@ -24,25 +24,20 @@ int main(int argc, char *argv[]) {
|
||||
auto &&api = API::Create(argc, argv);
|
||||
if (!api)
|
||||
return 1;
|
||||
api->SetStreamRequest(Format::BGR888, FrameRate::RATE_30_FPS);
|
||||
|
||||
// manual-exposure: 1
|
||||
api->SetOptionValue(Option::EXPOSURE_MODE, 1);
|
||||
|
||||
// gain: range [0,48], default 24
|
||||
api->SetOptionValue(Option::GAIN, 24);
|
||||
// brightness/exposure_time: range [0,240], default 120
|
||||
api->SetOptionValue(Option::BRIGHTNESS, 120);
|
||||
// contrast/black_level_calibration: range [0,255], default 127
|
||||
api->SetOptionValue(Option::CONTRAST, 127);
|
||||
|
||||
LOG(INFO) << "Enable manual-exposure";
|
||||
LOG(INFO) << "Set GAIN to " << api->GetOptionValue(Option::GAIN);
|
||||
LOG(INFO) << "Set BRIGHTNESS to " << api->GetOptionValue(Option::BRIGHTNESS);
|
||||
LOG(INFO) << "Set CONTRAST to " << api->GetOptionValue(Option::CONTRAST);
|
||||
|
||||
api->Start(Source::VIDEO_STREAMING);
|
||||
|
||||
CVPainter painter(api->GetOptionValue(Option::FRAME_RATE));
|
||||
CVPainter painter(30);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <sstream>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
@@ -20,7 +20,7 @@ int main(int argc, char *argv[]) {
|
||||
auto &&api = API::Create(argc, argv);
|
||||
if (!api)
|
||||
return 1;
|
||||
|
||||
api->SetStreamRequest(Format::BGR888, FrameRate::RATE_30_FPS);
|
||||
LOG(INFO) << "Intrinsics left: {" << api->GetIntrinsics(Stream::LEFT) << "}";
|
||||
LOG(INFO) << "Intrinsics right: {" << api->GetIntrinsics(Stream::RIGHT)
|
||||
<< "}";
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/pc_viewer.h"
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#include "mynteye/context.h"
|
||||
#include "mynteye/device.h"
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/device/context.h"
|
||||
#include "mynteye/device/device.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#include "mynteye/api.h"
|
||||
// #include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
#include "util/pc_viewer.h"
|
||||
@@ -186,6 +187,8 @@ int main(int argc, char *argv[]) {
|
||||
painter.DrawImgData(img, *left_data.img);
|
||||
|
||||
cv::imshow("frame", img);
|
||||
// LOG(INFO) << "left id: " << left_data.frame_id
|
||||
// << ", right id: " << right_data.frame_id;
|
||||
|
||||
auto &&disp_data = api->GetStreamData(Stream::DISPARITY_NORMALIZED);
|
||||
auto &&depth_data = api->GetStreamData(Stream::DEPTH);
|
||||
@@ -193,7 +196,7 @@ int main(int argc, char *argv[]) {
|
||||
// Show disparity instead of depth, but show depth values in region.
|
||||
auto &&depth_frame = disp_data.frame;
|
||||
|
||||
#ifdef USE_OPENCV3
|
||||
#ifdef WITH_OPENCV3
|
||||
// ColormapTypes
|
||||
// http://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html#ga9a805d8262bcbe273f16be9ea2055a65
|
||||
cv::applyColorMap(depth_frame, depth_frame, cv::COLORMAP_JET);
|
||||
@@ -204,6 +207,7 @@ int main(int argc, char *argv[]) {
|
||||
depth_region.DrawRect(depth_frame);
|
||||
|
||||
cv::imshow("depth", depth_frame);
|
||||
// LOG(INFO) << "depth id: " << disp_data.frame_id;
|
||||
|
||||
depth_region.ShowElems<ushort>(
|
||||
depth_data.frame,
|
||||
@@ -223,6 +227,7 @@ int main(int argc, char *argv[]) {
|
||||
auto &&points_data = api->GetStreamData(Stream::POINTS);
|
||||
if (!points_data.frame.empty()) {
|
||||
pcviewer.Update(points_data.frame);
|
||||
// LOG(INFO) << "points id: " << points_data.frame_id;
|
||||
}
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
// limitations under the License.
|
||||
#include "util/cv_painter.h"
|
||||
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/utils.h"
|
||||
#include "mynteye/device/utils.h"
|
||||
|
||||
#define FONT_FACE cv::FONT_HERSHEY_PLAIN
|
||||
#define FONT_SCALE 1
|
||||
@@ -117,7 +117,7 @@ cv::Rect CVPainter::DrawImuData(
|
||||
if (gravity == BOTTOM_LEFT || gravity == BOTTOM_RIGHT)
|
||||
sign = -1;
|
||||
|
||||
Clear(ss) << "frame_id: " << data.frame_id << ", stamp: " << data.timestamp
|
||||
Clear(ss) << "stamp: " << data.timestamp
|
||||
<< ", temp: " << fmt_temp << data.temperature;
|
||||
cv::Rect rect_i = DrawText(img, ss.str(), gravity, 5);
|
||||
|
||||
@@ -178,7 +178,7 @@ cv::Rect CVPainter::DrawText(
|
||||
y += offset_y;
|
||||
|
||||
cv::Point org(x, y);
|
||||
#ifdef USE_OPENCV2
|
||||
#ifdef WITH_OPENCV2
|
||||
cv::putText(
|
||||
const_cast<cv::Mat &>(img), text, org, FONT_FACE, FONT_SCALE, FONT_COLOR,
|
||||
THICKNESS);
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
#define MYNTEYE_TUTORIALS_CV_PAINTER_H_
|
||||
#pragma once
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
#include "mynteye/types.h"
|
||||
|
||||
class CVPainter {
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
#define MYNTEYE_TUTORIALS_PC_VIEWER_H_
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
#include <pcl/visualization/pcl_visualizer.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
class PCViewer {
|
||||
public:
|
||||
PCViewer();
|
||||
|
||||
@@ -11,19 +11,19 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <mutex>
|
||||
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/mynteye.h"
|
||||
#include "mynteye/types.h"
|
||||
#include "uvc/uvc.h"
|
||||
#include "mynteye/uvc/uvc.h"
|
||||
|
||||
struct frame {
|
||||
const void *data = nullptr;
|
||||
@@ -108,7 +108,7 @@ int main(int argc, char *argv[]) {
|
||||
const auto frame_empty = [&frame]() { return frame == nullptr; };
|
||||
|
||||
uvc::set_device_mode(
|
||||
*device, 752, 480, static_cast<int>(Format::YUYV), 25,
|
||||
*device, 1280, 400, static_cast<int>(Format::BGR888), 20,
|
||||
[&mtx, &cv, &frame, &frame_ready](
|
||||
const void *data, std::function<void()> continuation) {
|
||||
// reinterpret_cast<const std::uint8_t *>(data);
|
||||
@@ -143,8 +143,8 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
// only lastest frame is valid
|
||||
cv::Mat img(480, 752, CV_8UC2, const_cast<void *>(frame->data));
|
||||
cv::cvtColor(img, img, cv::COLOR_YUV2BGR_YUY2);
|
||||
cv::Mat img(400, 1280, CV_8UC3, const_cast<void *>(frame->data));
|
||||
cv::cvtColor(img, img, CV_BGR2RGB);
|
||||
cv::imshow("frame", img);
|
||||
|
||||
frame = nullptr;
|
||||
|
||||
@@ -27,11 +27,13 @@ ECHO="echo -e"
|
||||
# task colors
|
||||
COLOR_STRONG="1;35" # Magenta
|
||||
COLOR_INFO="1;34" # Blue
|
||||
COLOR_WARN="1;33" # Yellow
|
||||
COLOR_DONE="1;32" # Green
|
||||
COLOR_ERROR="1;31" # Red
|
||||
# action colors
|
||||
COLOR_STRONG_NORMAL="35"
|
||||
COLOR_INFO_NORMAL="34"
|
||||
COLOR_WARN_NORMAL="33"
|
||||
COLOR_DONE_NORMAL="32"
|
||||
COLOR_ERROR_NORMAL="31"
|
||||
|
||||
@@ -59,6 +61,10 @@ _echo_i() {
|
||||
_echo_ "$1" "$COLOR_INFO"
|
||||
}
|
||||
|
||||
_echo_w() {
|
||||
_echo_ "$1" "$COLOR_WARN"
|
||||
}
|
||||
|
||||
_echo_d() {
|
||||
_echo_ "$1" "$COLOR_DONE"
|
||||
}
|
||||
@@ -75,6 +81,10 @@ _echo_in() {
|
||||
_echo_ "$1" "$COLOR_INFO_NORMAL"
|
||||
}
|
||||
|
||||
_echo_wn() {
|
||||
_echo_ "$1" "$COLOR_WARN_NORMAL"
|
||||
}
|
||||
|
||||
_echo_dn() {
|
||||
_echo_ "$1" "$COLOR_DONE_NORMAL"
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
# _VERBOSE_=1
|
||||
# _INIT_LINTER_=1
|
||||
# _FORCE_INSRALL_=1
|
||||
_INSTALL_OPTIONS_=$@
|
||||
|
||||
BASE_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
_INIT_BUILD_=1
|
||||
# _INIT_LINTER_=1
|
||||
# _FORCE_INSRALL_=1
|
||||
# _INSTALL_OPTIONS_=-y
|
||||
|
||||
BASE_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
|
||||
@@ -42,6 +43,9 @@ fi
|
||||
|
||||
_install_deps() {
|
||||
_cmd="$1"; shift; _deps_all=($@)
|
||||
if [ -n "${_INSTALL_OPTIONS_}" ]; then
|
||||
_cmd="$_cmd $_INSTALL_OPTIONS_"
|
||||
fi
|
||||
_echo "Install cmd: $_cmd"
|
||||
_echo "Install deps: ${_deps_all[*]}"
|
||||
if [ -n "${_FORCE_INSRALL_}" ]; then
|
||||
@@ -68,6 +72,7 @@ _echo_s "Init tools"
|
||||
if [ "$HOST_OS" = "Linux" ]; then
|
||||
# sudo
|
||||
SUDO="sudo"
|
||||
_detect_cmd $SUDO || SUDO=
|
||||
# detect apt-get
|
||||
_detect apt-get
|
||||
# apt-get install
|
||||
|
||||
24
scripts/version.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2018 Slightech Co., Ltd. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
BASE_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
ROOT_DIR=$(dirname "$BASE_DIR")
|
||||
CONFIG_FILE="$ROOT_DIR/CMakeLists.txt"
|
||||
|
||||
version=$(cat "$CONFIG_FILE" | grep -m1 "mynteye VERSION")
|
||||
version=$(echo "${version%LANGUAGES*}")
|
||||
version=$(echo "${version#*VERSION}" | tr -d '[:space:]')
|
||||
|
||||
echo "$version"
|
||||
29
scripts/win/cmake/mynteye-targets-release.cmake
Normal file
@@ -0,0 +1,29 @@
|
||||
#----------------------------------------------------------------
|
||||
# Generated CMake target import file for configuration "Release".
|
||||
#----------------------------------------------------------------
|
||||
|
||||
# Commands may need to know the format version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
|
||||
# Import target "mynteye" for configuration "Release"
|
||||
set_property(TARGET mynteye APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(mynteye PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${MYNTEYES_SDK_ROOT}/lib/mynteye.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${MYNTEYES_SDK_ROOT}/bin/mynteye.dll"
|
||||
)
|
||||
|
||||
# Import target "mynteye" for configuration "Debug"
|
||||
set_property(TARGET mynteye APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(mynteye PROPERTIES
|
||||
IMPORTED_IMPLIB_DEBUG "${MYNTEYES_SDK_ROOT}/lib/mynteyed.lib"
|
||||
IMPORTED_LOCATION_DEBUG "${MYNTEYES_SDK_ROOT}/bin/mynteyed.dll"
|
||||
)
|
||||
|
||||
list(APPEND _IMPORT_CHECK_TARGETS mynteye )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_mynteye
|
||||
"${MYNTEYES_SDK_ROOT}/lib/mynteye.lib" "${MYNTEYES_SDK_ROOT}/bin/mynteye.dll"
|
||||
"${MYNTEYES_SDK_ROOT}/lib/mynteyed.lib" "${MYNTEYES_SDK_ROOT}/bin/mynteyed.dll"
|
||||
)
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
102
scripts/win/cmake/mynteye-targets.cmake
Normal file
@@ -0,0 +1,102 @@
|
||||
# Generated by CMake
|
||||
|
||||
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
|
||||
message(FATAL_ERROR "CMake >= 2.6.0 required")
|
||||
endif()
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(VERSION 2.6)
|
||||
#----------------------------------------------------------------
|
||||
# Generated CMake target import file.
|
||||
#----------------------------------------------------------------
|
||||
|
||||
# Commands may need to know the format version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
|
||||
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
||||
set(_targetsDefined)
|
||||
set(_targetsNotDefined)
|
||||
set(_expectedTargets)
|
||||
foreach(_expectedTarget mynteye)
|
||||
list(APPEND _expectedTargets ${_expectedTarget})
|
||||
if(NOT TARGET ${_expectedTarget})
|
||||
list(APPEND _targetsNotDefined ${_expectedTarget})
|
||||
endif()
|
||||
if(TARGET ${_expectedTarget})
|
||||
list(APPEND _targetsDefined ${_expectedTarget})
|
||||
endif()
|
||||
endforeach()
|
||||
if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
|
||||
unset(_targetsDefined)
|
||||
unset(_targetsNotDefined)
|
||||
unset(_expectedTargets)
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
||||
return()
|
||||
endif()
|
||||
if(NOT "${_targetsDefined}" STREQUAL "")
|
||||
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
|
||||
endif()
|
||||
unset(_targetsDefined)
|
||||
unset(_targetsNotDefined)
|
||||
unset(_expectedTargets)
|
||||
|
||||
|
||||
if(NOT MYNTEYES_SDK_ROOT)
|
||||
if(DEFINED ENV{MYNTEYES_SDK_ROOT})
|
||||
set(MYNTEYES_SDK_ROOT $ENV{MYNTEYES_SDK_ROOT})
|
||||
else()
|
||||
get_filename_component(MYNTEYES_SDK_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# The installation prefix configured by this project.
|
||||
set(_IMPORT_PREFIX "${MYNTEYES_SDK_ROOT}")
|
||||
|
||||
# Create imported target mynteye
|
||||
add_library(mynteye SHARED IMPORTED)
|
||||
|
||||
set_target_properties(mynteye PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "GLOG_NO_ABBREVIATED_SEVERITIES"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
|
||||
INTERFACE_LINK_LIBRARIES "opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab;opencv_world"
|
||||
)
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 2.8.12)
|
||||
message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
|
||||
endif()
|
||||
|
||||
# Load information for each installed configuration.
|
||||
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
file(GLOB CONFIG_FILES "${_DIR}/mynteye-targets-*.cmake")
|
||||
foreach(f ${CONFIG_FILES})
|
||||
include(${f})
|
||||
endforeach()
|
||||
|
||||
# Cleanup temporary variables.
|
||||
set(_IMPORT_PREFIX)
|
||||
|
||||
# Loop over all imported files and verify that they actually exist
|
||||
foreach(target ${_IMPORT_CHECK_TARGETS} )
|
||||
foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
|
||||
if(NOT EXISTS "${file}" )
|
||||
message(FATAL_ERROR "The imported target \"${target}\" references the file
|
||||
\"${file}\"
|
||||
but this file does not exist. Possible reasons include:
|
||||
* The file was deleted, renamed, or moved to another location.
|
||||
* An install or uninstall procedure did not complete successfully.
|
||||
* The installation package was faulty and contained
|
||||
\"${CMAKE_CURRENT_LIST_FILE}\"
|
||||
but not all the files it references.
|
||||
")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(_IMPORT_CHECK_FILES_FOR_${target})
|
||||
endforeach()
|
||||
unset(_IMPORT_CHECK_TARGETS)
|
||||
|
||||
# This file does not depend on other imported targets which have
|
||||
# been exported from the same project but in a separate export set.
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
||||
20
scripts/win/generate.bat
Normal file
@@ -0,0 +1,20 @@
|
||||
@echo off
|
||||
setlocal
|
||||
set _MY_DIR=%~dp0
|
||||
|
||||
set _VS_GEN="Visual Studio 15 2017 Win64"
|
||||
REM set _VS_GEN="Visual Studio 14 2015 Win64"
|
||||
|
||||
cd %_MY_DIR%
|
||||
|
||||
mkdir _build
|
||||
cd _build/
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ^
|
||||
-DCMAKE_PREFIX_PATH="%_MY_DIR%/../lib/cmake" ^
|
||||
-DOpenCV_DIR="%_MY_DIR%/../3rdparty/opencv/build" ^
|
||||
-G %_VS_GEN% ^
|
||||
..
|
||||
|
||||
cd %_MY_DIR%
|
||||
pause
|
||||