change structure of folder samples and move demo_project
@@ -59,28 +59,194 @@ endif()
|
||||
|
||||
#LIST(APPEND CMAKE_MODULE_PATH ${PRO_DIR}/cmake)
|
||||
|
||||
|
||||
|
||||
|
||||
# targets
|
||||
|
||||
set(OUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/_output")
|
||||
|
||||
|
||||
include_directories(
|
||||
${PRO_DIR}/src
|
||||
)
|
||||
|
||||
set_outdir(
|
||||
"${OUT_DIR}/lib"
|
||||
"${OUT_DIR}/lib"
|
||||
"${OUT_DIR}/bin"
|
||||
)
|
||||
|
||||
if(OS_MAC)
|
||||
# samples above uvc layer
|
||||
|
||||
add_subdirectory(uvc)
|
||||
make_executable(camera_u
|
||||
SRCS uvc_camera.cc
|
||||
LINK_LIBS mynteye ${OpenCV_LIBS}
|
||||
DLL_SEARCH_PATHS ${PRO_DIR}/_install/bin ${OpenCV_LIB_SEARCH_PATH}
|
||||
)
|
||||
else()
|
||||
# samples above device layer
|
||||
|
||||
add_subdirectory(device)
|
||||
|
||||
# tutorials
|
||||
|
||||
if(WITH_API)
|
||||
add_subdirectory(tutorials)
|
||||
endif()
|
||||
make_executable(camera_use_device
|
||||
SRCS device_camera.cc
|
||||
LINK_LIBS mynteye ${OpenCV_LIBS}
|
||||
DLL_SEARCH_PATHS ${PRO_DIR}/_install/bin ${OpenCV_LIB_SEARCH_PATH}
|
||||
)
|
||||
|
||||
# samples above api layer
|
||||
|
||||
if(WITH_API)
|
||||
add_subdirectory(api)
|
||||
## camera_a
|
||||
|
||||
make_executable(camera_use_api
|
||||
SRCS api_camera.cc
|
||||
LINK_LIBS mynteye ${OpenCV_LIBS}
|
||||
DLL_SEARCH_PATHS ${PRO_DIR}/_install/bin ${OpenCV_LIB_SEARCH_PATH}
|
||||
)
|
||||
|
||||
## get_depth_with_region
|
||||
|
||||
make_executable(get_depth_with_region
|
||||
SRCS api_get_depth_with_region.cc
|
||||
LINK_LIBS mynteye ${OpenCV_LIBS}
|
||||
DLL_SEARCH_PATHS ${PRO_DIR}/_install/bin ${OpenCV_LIB_SEARCH_PATH}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
# targets
|
||||
|
||||
include_directories(
|
||||
${OpenCV_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
|
||||
# tutorials
|
||||
|
||||
if(WITH_API)
|
||||
|
||||
# make_executable2(NAME
|
||||
# [SRCS src1 src2 ...]
|
||||
# [WITH_OPENCV]
|
||||
# [WITH_PCL])
|
||||
macro(make_executable2 NAME)
|
||||
set(options WITH_OPENCV WITH_PCL)
|
||||
set(oneValueArgs)
|
||||
set(multiValueArgs SRCS)
|
||||
cmake_parse_arguments(THIS "${options}" "${oneValueArgs}"
|
||||
"${multiValueArgs}" ${ARGN})
|
||||
|
||||
set(__link_libs mynteye)
|
||||
set(__dll_search_paths ${PRO_DIR}/_install/bin)
|
||||
if(THIS_WITH_OPENCV)
|
||||
list(APPEND __link_libs ${OpenCV_LIBS})
|
||||
list(APPEND __dll_search_paths ${OpenCV_LIB_SEARCH_PATH})
|
||||
endif()
|
||||
if(THIS_WITH_PCL)
|
||||
list(APPEND __link_libs ${PCL_LIBRARIES})
|
||||
#list(APPEND __link_libs pcl::pcl)
|
||||
list(APPEND __dll_search_paths ${PCL_LIB_SEARCH_PATH})
|
||||
endif()
|
||||
|
||||
add_executable(${NAME} ${THIS_SRCS})
|
||||
target_link_libraries(${NAME} ${__link_libs})
|
||||
target_create_scripts(${NAME} DLL_SEARCH_PATHS ${__dll_search_paths})
|
||||
|
||||
if(THIS_WITH_PCL)
|
||||
target_include_directories(${NAME} PRIVATE ${PCL_INCLUDE_DIRS})
|
||||
#target_compile_definitions(${NAME} PRIVATE ${PCL_DEFINITIONS})
|
||||
#target_compile_options(${NAME} PRIVATE ${PCL_COMPILE_OPTIONS})
|
||||
endif()
|
||||
if(OS_WIN)
|
||||
target_compile_definitions(${NAME}
|
||||
PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# packages
|
||||
|
||||
# If you install PCL to different directory, please set CMAKE_PREFIX_PATH to find it.
|
||||
#LIST(APPEND CMAKE_PREFIX_PATH /usr/local/share)
|
||||
find_package(PCL)
|
||||
if(PCL_FOUND)
|
||||
message(STATUS "Found PCL: ${PCL_VERSION}")
|
||||
|
||||
#message(STATUS "PCL_LIBRARIES: ${PCL_LIBRARIES}")
|
||||
#message(STATUS "PCL_INCLUDE_DIRS: ${PCL_INCLUDE_DIRS}")
|
||||
#message(STATUS "PCL_LIBRARY_DIRS: ${PCL_LIBRARY_DIRS}")
|
||||
#message(STATUS "PCL_DEFINITIONS: ${PCL_DEFINITIONS}")
|
||||
#message(STATUS "PCL_COMPILE_OPTIONS: ${PCL_COMPILE_OPTIONS}")
|
||||
|
||||
if(OS_WIN)
|
||||
get_filename_component(PCL_LIB_SEARCH_PATH "${PCL_LIBRARY_DIRS}/../bin" ABSOLUTE)
|
||||
else()
|
||||
set(PCL_LIB_SEARCH_PATH "${PCL_LIBRARY_DIRS}")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "PCL not found :(")
|
||||
endif()
|
||||
|
||||
# beginner level
|
||||
|
||||
## data
|
||||
|
||||
make_executable2(get_device_info SRCS data_get_device_info.cc WITH_OPENCV)
|
||||
make_executable2(get_img_params SRCS data_get_img_params.cc WITH_OPENCV)
|
||||
make_executable2(get_imu_params SRCS data_get_imu_params.cc WITH_OPENCV)
|
||||
|
||||
make_executable2(get_stereo SRCS data_get_stereo.cc WITH_OPENCV)
|
||||
make_executable2(get_stereo_rectified SRCS data_get_stereo_rectified.cc WITH_OPENCV)
|
||||
make_executable2(get_disparity SRCS data_get_disparity.cc WITH_OPENCV)
|
||||
make_executable2(get_depth SRCS data_get_depth.cc WITH_OPENCV)
|
||||
|
||||
make_executable2(get_data_without_select SRCS data_get_data_without_select.cc WITH_OPENCV)
|
||||
if(PCL_FOUND)
|
||||
make_executable2(get_points
|
||||
SRCS data_get_points.cc util_pc_viewer.cc
|
||||
WITH_OPENCV WITH_PCL
|
||||
)
|
||||
endif()
|
||||
make_executable2(get_imu_correspondence
|
||||
SRCS data_get_imu_correspondence.cc util_cv_painter.cc
|
||||
WITH_OPENCV
|
||||
)
|
||||
make_executable2(get_imu SRCS data_get_imu.cc util_cv_painter.cc WITH_OPENCV)
|
||||
make_executable2(save_single_image SRCS data_save_single_image.cc WITH_OPENCV)
|
||||
make_executable2(get_from_callbacks
|
||||
SRCS data_get_from_callbacks.cc util_cv_painter.cc
|
||||
WITH_OPENCV
|
||||
)
|
||||
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_low_pass_filter SRCS control_imu_low_pass_filter.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_imu_range SRCS control_imu_range.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_infrared SRCS control_infrared.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_iic_adress SRCS control_iic_address.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_sync_timestamp SRCS control_sync_timestamp.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_auto_exposure
|
||||
SRCS control_auto_exposure.cc util_cv_painter.cc
|
||||
WITH_OPENCV
|
||||
)
|
||||
make_executable2(ctrl_manual_exposure
|
||||
SRCS control_manual_exposure.cc util_cv_painter.cc
|
||||
WITH_OPENCV
|
||||
)
|
||||
|
||||
if(PCL_FOUND)
|
||||
|
||||
make_executable2(get_depth_and_points
|
||||
SRCS intermediate_get_depth_and_points.cc util_cv_painter.cc util_pc_viewer.cc
|
||||
WITH_OPENCV WITH_PCL
|
||||
)
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
@@ -1,37 +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.
|
||||
|
||||
get_filename_component(DIR_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
set_outdir(
|
||||
"${OUT_DIR}/lib/${DIR_NAME}"
|
||||
"${OUT_DIR}/lib/${DIR_NAME}"
|
||||
"${OUT_DIR}/bin/${DIR_NAME}"
|
||||
)
|
||||
|
||||
## camera_a
|
||||
|
||||
make_executable(camera_a
|
||||
SRCS camera.cc
|
||||
LINK_LIBS mynteye ${OpenCV_LIBS}
|
||||
DLL_SEARCH_PATHS ${PRO_DIR}/_install/bin ${OpenCV_LIB_SEARCH_PATH}
|
||||
)
|
||||
|
||||
## get_depth_with_region
|
||||
|
||||
make_executable(get_depth_with_region
|
||||
SRCS get_depth_with_region.cc
|
||||
LINK_LIBS mynteye ${OpenCV_LIBS}
|
||||
DLL_SEARCH_PATHS ${PRO_DIR}/_install/bin ${OpenCV_LIB_SEARCH_PATH}
|
||||
)
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
#include "util_cv_painter.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
#include "util_cv_painter.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
#include "util_cv_painter.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
#include "util_cv_painter.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
#include "util_cv_painter.h"
|
||||
|
||||
// #define CHECK_ACCEL_THEN_GYRO
|
||||
#define SEQ_FIRST 1 // accel
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/pc_viewer.h"
|
||||
#include "util_pc_viewer.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
176
samples/demo/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".
|
||||
74
samples/demo/project_cmake/CMakeLists.txt
Normal file
@@ -0,0 +1,74 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(mynteye_demo VERSION 1.0.0 LANGUAGES C CXX)
|
||||
|
||||
# flags
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -march=native")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -march=native")
|
||||
|
||||
# packages
|
||||
|
||||
if(MSVC)
|
||||
set(SDK_ROOT "$ENV{MYNTEYES_SDK_ROOT}")
|
||||
if(SDK_ROOT)
|
||||
message(STATUS "MYNTEYES_SDK_ROOT: ${SDK_ROOT}")
|
||||
list(APPEND CMAKE_PREFIX_PATH
|
||||
"${SDK_ROOT}/lib/cmake"
|
||||
"${SDK_ROOT}/3rdparty/opencv/build"
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "MYNTEYES_SDK_ROOT not found, please install SDK firstly")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
## mynteye
|
||||
|
||||
find_package(mynteye REQUIRED)
|
||||
message(STATUS "Found mynteye: ${mynteye_VERSION}")
|
||||
|
||||
# When SDK build with OpenCV, we can add WITH_OPENCV macro to enable some
|
||||
# features depending on OpenCV, such as ToMat().
|
||||
if(mynteye_WITH_OPENCV)
|
||||
add_definitions(-DWITH_OPENCV)
|
||||
endif()
|
||||
|
||||
## OpenCV
|
||||
|
||||
# Set where to find OpenCV
|
||||
#set(OpenCV_DIR "/usr/share/OpenCV")
|
||||
|
||||
# When SDK build with OpenCV, we must find the same version here.
|
||||
find_package(OpenCV REQUIRED)
|
||||
message(STATUS "Found OpenCV: ${OpenCV_VERSION}")
|
||||
|
||||
# targets
|
||||
|
||||
include_directories(
|
||||
${OpenCV_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
## mynteye_demo
|
||||
|
||||
add_executable(mynteye_demo mynteye_demo.cc)
|
||||
target_link_libraries(mynteye_demo mynteye ${OpenCV_LIBS})
|
||||
|
||||
|
||||
# Build
|
||||
# mkdir _build
|
||||
# cd _build
|
||||
#
|
||||
# # win
|
||||
# cmake -G "Visual Studio 15 2017 Win64" ..
|
||||
# msbuild.exe ALL_BUILD.vcxproj /property:Configuration=Release
|
||||
#
|
||||
# .\Release\mynteye_demo.exe
|
||||
#
|
||||
# # unix
|
||||
# cmake ..
|
||||
# make
|
||||
#
|
||||
# ./mynteye_demo
|
||||
61
samples/demo/project_cmake/mynteye_demo.cc
Normal file
@@ -0,0 +1,61 @@
|
||||
// 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 <stdio.h>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
int main(int argc, char const *argv[]) {
|
||||
auto &&api = API::Create(0, nullptr);
|
||||
if (!api) return 1;
|
||||
|
||||
bool ok;
|
||||
auto &&request = api->SelectStreamRequest(&ok);
|
||||
if (!ok) return 1;
|
||||
api->ConfigStreamRequest(request);
|
||||
api->Start(Source::VIDEO_STREAMING);
|
||||
|
||||
double fps;
|
||||
double t = 0.01;
|
||||
std::cout << "fps:" << std::endl;
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
cv::Mat img;
|
||||
if (!left_data.frame.empty() && !right_data.frame.empty()) {
|
||||
double t_c = cv::getTickCount() / cv::getTickFrequency();
|
||||
fps = 1.0/(t_c - t);
|
||||
printf("\b\b\b\b\b\b\b\b\b%.2f", fps);
|
||||
t = t_c;
|
||||
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;
|
||||
}
|
||||
76
samples/demo/project_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
samples/demo/project_vs2017/images/10_path.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
samples/demo/project_vs2017/images/1_new_pro.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
samples/demo/project_vs2017/images/2_new_pro.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
samples/demo/project_vs2017/images/3_new_pro.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
samples/demo/project_vs2017/images/4_config.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
samples/demo/project_vs2017/images/5_config_include.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
samples/demo/project_vs2017/images/6_config_lib_dir.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
samples/demo/project_vs2017/images/7_config_lib.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
samples/demo/project_vs2017/images/8_config_debug_lib.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
samples/demo/project_vs2017/images/9_run_x64.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
4
samples/demo/project_vs2017/mynteyes_demo/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/.vs/
|
||||
/x64/
|
||||
/mynteyes_demo/x64/
|
||||
/mynteyes_demo/*.user
|
||||
31
samples/demo/project_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
samples/demo/project_vs2017/mynteyes_demo/mynteyes_demo/stdafx.h
Normal file
@@ -1,33 +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.
|
||||
|
||||
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}"
|
||||
"${OUT_DIR}/bin/${DIR_NAME}"
|
||||
)
|
||||
|
||||
## camera_d
|
||||
|
||||
make_executable(camera_d
|
||||
SRCS camera.cc
|
||||
LINK_LIBS mynteye ${OpenCV_LIBS}
|
||||
DLL_SEARCH_PATHS ${PRO_DIR}/_install/bin ${OpenCV_LIB_SEARCH_PATH}
|
||||
)
|
||||
@@ -17,8 +17,8 @@
|
||||
// #include "mynteye/logger.h"
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
#include "util/cv_painter.h"
|
||||
#include "util/pc_viewer.h"
|
||||
#include "util_cv_painter.h"
|
||||
#include "util_pc_viewer.h"
|
||||
|
||||
namespace {
|
||||
|
||||
61
samples/mynteye_demo.cc
Normal file
@@ -0,0 +1,61 @@
|
||||
// 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 <stdio.h>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/api/api.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
||||
int main(int argc, char const *argv[]) {
|
||||
auto &&api = API::Create(0, nullptr);
|
||||
if (!api) return 1;
|
||||
|
||||
bool ok;
|
||||
auto &&request = api->SelectStreamRequest(&ok);
|
||||
if (!ok) return 1;
|
||||
api->ConfigStreamRequest(request);
|
||||
api->Start(Source::VIDEO_STREAMING);
|
||||
|
||||
double fps;
|
||||
double t = 0.01;
|
||||
std::cout << "fps:" << std::endl;
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
cv::Mat img;
|
||||
if (!left_data.frame.empty() && !right_data.frame.empty()) {
|
||||
double t_c = cv::getTickCount() / cv::getTickFrequency();
|
||||
fps = 1.0/(t_c - t);
|
||||
printf("\b\b\b\b\b\b\b\b\b%.2f", fps);
|
||||
t = t_c;
|
||||
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;
|
||||
}
|
||||
@@ -1,148 +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.
|
||||
|
||||
get_filename_component(DIR_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${PRO_DIR}/src
|
||||
)
|
||||
|
||||
set_outdir(
|
||||
"${OUT_DIR}/lib/${DIR_NAME}"
|
||||
"${OUT_DIR}/lib/${DIR_NAME}"
|
||||
"${OUT_DIR}/bin/${DIR_NAME}"
|
||||
)
|
||||
|
||||
# make_executable2(NAME
|
||||
# [SRCS src1 src2 ...]
|
||||
# [WITH_OPENCV]
|
||||
# [WITH_PCL])
|
||||
macro(make_executable2 NAME)
|
||||
set(options WITH_OPENCV WITH_PCL)
|
||||
set(oneValueArgs)
|
||||
set(multiValueArgs SRCS)
|
||||
cmake_parse_arguments(THIS "${options}" "${oneValueArgs}"
|
||||
"${multiValueArgs}" ${ARGN})
|
||||
|
||||
set(__link_libs mynteye)
|
||||
set(__dll_search_paths ${PRO_DIR}/_install/bin)
|
||||
if(THIS_WITH_OPENCV)
|
||||
list(APPEND __link_libs ${OpenCV_LIBS})
|
||||
list(APPEND __dll_search_paths ${OpenCV_LIB_SEARCH_PATH})
|
||||
endif()
|
||||
if(THIS_WITH_PCL)
|
||||
list(APPEND __link_libs ${PCL_LIBRARIES})
|
||||
#list(APPEND __link_libs pcl::pcl)
|
||||
list(APPEND __dll_search_paths ${PCL_LIB_SEARCH_PATH})
|
||||
endif()
|
||||
|
||||
add_executable(${NAME} ${THIS_SRCS})
|
||||
target_link_libraries(${NAME} ${__link_libs})
|
||||
target_create_scripts(${NAME} DLL_SEARCH_PATHS ${__dll_search_paths})
|
||||
|
||||
if(THIS_WITH_PCL)
|
||||
target_include_directories(${NAME} PRIVATE ${PCL_INCLUDE_DIRS})
|
||||
#target_compile_definitions(${NAME} PRIVATE ${PCL_DEFINITIONS})
|
||||
#target_compile_options(${NAME} PRIVATE ${PCL_COMPILE_OPTIONS})
|
||||
endif()
|
||||
if(OS_WIN)
|
||||
target_compile_definitions(${NAME}
|
||||
PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# packages
|
||||
|
||||
# If you install PCL to different directory, please set CMAKE_PREFIX_PATH to find it.
|
||||
#LIST(APPEND CMAKE_PREFIX_PATH /usr/local/share)
|
||||
find_package(PCL)
|
||||
if(PCL_FOUND)
|
||||
message(STATUS "Found PCL: ${PCL_VERSION}")
|
||||
|
||||
#message(STATUS "PCL_LIBRARIES: ${PCL_LIBRARIES}")
|
||||
#message(STATUS "PCL_INCLUDE_DIRS: ${PCL_INCLUDE_DIRS}")
|
||||
#message(STATUS "PCL_LIBRARY_DIRS: ${PCL_LIBRARY_DIRS}")
|
||||
#message(STATUS "PCL_DEFINITIONS: ${PCL_DEFINITIONS}")
|
||||
#message(STATUS "PCL_COMPILE_OPTIONS: ${PCL_COMPILE_OPTIONS}")
|
||||
|
||||
if(OS_WIN)
|
||||
get_filename_component(PCL_LIB_SEARCH_PATH "${PCL_LIBRARY_DIRS}/../bin" ABSOLUTE)
|
||||
else()
|
||||
set(PCL_LIB_SEARCH_PATH "${PCL_LIBRARY_DIRS}")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "PCL not found :(")
|
||||
endif()
|
||||
|
||||
# beginner level
|
||||
|
||||
## data
|
||||
|
||||
make_executable2(get_device_info SRCS data/get_device_info.cc WITH_OPENCV)
|
||||
make_executable2(get_img_params SRCS data/get_img_params.cc WITH_OPENCV)
|
||||
make_executable2(get_imu_params SRCS data/get_imu_params.cc WITH_OPENCV)
|
||||
|
||||
make_executable2(get_stereo SRCS data/get_stereo.cc WITH_OPENCV)
|
||||
make_executable2(get_stereo_rectified SRCS data/get_stereo_rectified.cc WITH_OPENCV)
|
||||
make_executable2(get_disparity SRCS data/get_disparity.cc WITH_OPENCV)
|
||||
make_executable2(get_depth SRCS data/get_depth.cc WITH_OPENCV)
|
||||
|
||||
make_executable2(get_data_without_select SRCS data/get_data_without_select.cc WITH_OPENCV)
|
||||
if(PCL_FOUND)
|
||||
make_executable2(get_points
|
||||
SRCS data/get_points.cc util/pc_viewer.cc
|
||||
WITH_OPENCV WITH_PCL
|
||||
)
|
||||
endif()
|
||||
make_executable2(get_imu_correspondence
|
||||
SRCS data/get_imu_correspondence.cc util/cv_painter.cc
|
||||
WITH_OPENCV
|
||||
)
|
||||
make_executable2(get_imu SRCS data/get_imu.cc util/cv_painter.cc WITH_OPENCV)
|
||||
make_executable2(save_single_image SRCS data/save_single_image.cc WITH_OPENCV)
|
||||
make_executable2(get_from_callbacks
|
||||
SRCS data/get_from_callbacks.cc util/cv_painter.cc
|
||||
WITH_OPENCV
|
||||
)
|
||||
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_low_pass_filter SRCS control/imu_low_pass_filter.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_imu_range SRCS control/imu_range.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_infrared SRCS control/infrared.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_iic_adress SRCS control/iic_address.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_sync_timestamp SRCS control/sync_timestamp.cc WITH_OPENCV)
|
||||
make_executable2(ctrl_auto_exposure
|
||||
SRCS control/auto_exposure.cc util/cv_painter.cc
|
||||
WITH_OPENCV
|
||||
)
|
||||
make_executable2(ctrl_manual_exposure
|
||||
SRCS control/manual_exposure.cc util/cv_painter.cc
|
||||
WITH_OPENCV
|
||||
)
|
||||
|
||||
if(PCL_FOUND)
|
||||
|
||||
make_executable2(get_depth_and_points
|
||||
SRCS intermediate/get_depth_and_points.cc util/cv_painter.cc util/pc_viewer.cc
|
||||
WITH_OPENCV WITH_PCL
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
# advanced level
|
||||
@@ -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.
|
||||
#include "util/cv_painter.h"
|
||||
#include "util_cv_painter.h"
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
@@ -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.
|
||||
#include "util/pc_viewer.h"
|
||||
#include "util_pc_viewer.h"
|
||||
|
||||
// #include <pcl/common/common_headers.h>
|
||||
|
||||
@@ -1,33 +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.
|
||||
|
||||
get_filename_component(DIR_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
set_outdir(
|
||||
"${OUT_DIR}/lib/${DIR_NAME}"
|
||||
"${OUT_DIR}/lib/${DIR_NAME}"
|
||||
"${OUT_DIR}/bin/${DIR_NAME}"
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${PRO_DIR}/src
|
||||
)
|
||||
|
||||
## camera_u
|
||||
|
||||
make_executable(camera_u
|
||||
SRCS camera.cc
|
||||
LINK_LIBS mynteye ${OpenCV_LIBS}
|
||||
DLL_SEARCH_PATHS ${PRO_DIR}/_install/bin ${OpenCV_LIB_SEARCH_PATH}
|
||||
)
|
||||