58 Commits

Author SHA1 Message Date
Tini Oh
fde0b17c0b fix: 3.4.19 opencv complie. 2023-01-06 14:45:31 +08:00
TinyO
9455ed8a0f fix(*) error code revert to 2.3.9. 2019-08-22 09:39:29 +08:00
Osenberg
50509d539e fix(src): fixed error setting extrinsics 2019-08-21 16:04:02 +08:00
Osenberg
dd839a3cfd fix(src): fixed error setting extrinsics. 2019-08-21 15:57:14 +08:00
TinyO
593abc1b3d fix(*) Quaternion warning and model alpha. 2019-08-21 10:51:43 +08:00
TinyO
47471ed2ea Merge branch 'develop' of http://gitlab.mynt.com/mynteye/mynt-eye-s-sdk into develop 2019-08-21 09:13:38 +08:00
TinyO
baa7243792 fix(*) s device slam error. 2019-08-21 09:13:23 +08:00
Osenberg
615fe74965 docs(docs): modified description of hdr_mode 2019-08-19 19:48:32 +08:00
TinyO
29a9895969 fix(*): setNumDisparities(64) -> setNumDisparities(128). 2019-08-19 13:59:18 +08:00
TinyO
140b4aec18 Merge branch 'develop' of http://gitlab.mynt.com/mynteye/mynt-eye-s-sdk into develop 2019-08-19 09:45:47 +08:00
TinyO
559b1e4d80 fix(windows): runtime core. 2019-08-19 09:45:10 +08:00
John Zhao
c6525cca31 docs(*): update version 2019-08-17 19:20:36 +08:00
TinyO
5bcf9ecf1f Merge branch 'develop' of http://gitlab.mynt.com/mynteye/mynt-eye-s-sdk into develop 2019-08-17 18:53:25 +08:00
TinyO
35d91c25b9 fix(calib): covert params change. 2019-08-17 18:52:31 +08:00
Osenberg
425af10e1f fix(ros): modified max exposure time value 2019-08-16 18:06:21 +08:00
John Zhao
7baf7ba744 docs(*): update changelog 2019-08-12 10:34:29 +08:00
John Zhao
4e6d0e5d99 chore(*): update readme and changelog 2019-08-09 22:07:29 +08:00
harjeb
96e4fdc8fc docs(*): update v2.4.0 doc 2019-08-09 17:45:51 +08:00
Osenberg
76c7336007 feat(doc): 2.3.9 --> 2.4.0
n
2019-08-09 16:36:30 +08:00
Osenberg
9541dfcd35 feat(docs): added new sample to doc 2019-08-09 16:05:43 +08:00
Osenberg
ba1874435a Merge branch 'release/v2.4.0' of http://gitlab.mynt.com/mynteye/mynt-eye-s-sdk into release/v2.4.0 2019-08-09 15:52:13 +08:00
Osenberg
7bd34d5cef feat(src): added feature of saving single image 2019-08-09 15:51:58 +08:00
TinyO
4a250f5ab5 fix(*): rviz imu location. 2019-08-09 15:07:46 +08:00
TinyO
d041f22d7e Merge branch 'release/v2.4.0' of http://gitlab.mynt.com/mynteye/mynt-eye-s-sdk into release/v2.4.0 2019-08-08 17:12:53 +08:00
TinyO
acbd3eff4c fix(*): add imu pipeline empty error output info. 2019-08-08 17:11:58 +08:00
Osenberg
841de6ea77 Merge branch 'release/v2.4.0' of http://gitlab.mynt.com/mynteye/mynt-eye-s-sdk into release/v2.4.0 2019-08-08 15:01:48 +08:00
Osenberg
190d066ddf feat(src): added feature of syncing timestamp for 200B 2019-08-08 15:01:32 +08:00
TinyO
af72213f50 fix(*): imu decode bug 2019-08-08 13:15:32 +08:00
Osenberg
37b98e0d33 feat(src): added S200B device support 2019-08-07 18:42:37 +08:00
Osenberg
acabe04a92 feat(samples): modified get_img_params for default intrinsics 2019-08-06 20:23:22 +08:00
Osenberg
2260f5c582 fix(src): Determine the default intrinsics based on the resulution 2019-08-06 20:04:38 +08:00
Osenberg
1cda60d137 fix(src): Determine the default intrinsics based on the resulution 2019-08-06 15:13:29 +08:00
Osenberg
de6dc0d712 fix(src): if camera is s1030, the frame rate is not show. 2019-08-02 14:59:50 +08:00
Osenberg
404d74b0b7 feat(src): brightness 192 --> 70 2019-08-02 14:16:57 +08:00
Osenberg
a2f24aa62f fix(ros): fixed ros timestamp is inaccurate because of imu timestamp 2019-08-02 10:49:33 +08:00
Osenberg
4f124fe074 fix(src): contrast 127 --> 116 for less noise 2019-07-31 10:54:53 +08:00
Osenberg
388f8466d5 fix(samples): fixed problem of core for get_depth_with_region 2019-07-30 18:47:36 +08:00
Osenberg
220b1e352e feat(src): removed ir conctrol feature for S2100 2019-07-30 18:27:08 +08:00
Osenberg
95f79d406a fix(ros): fix(ros): fixed multiple launch is uncompatible for 1030 2019-07-30 11:15:07 +08:00
TinyO
ec8aba3184 Merge branch 'develop' of http://gitlab.mynt.com/mynteye/mynt-eye-s-sdk into develop 2019-07-29 13:52:56 +08:00
TinyO
68d6b0f4a2 fix(windows): complie error. 2019-07-29 13:46:57 +08:00
Osenberg
cb9c4fae74 src: fixed camera can't be used on kernel 4.16+ 2019-07-26 18:45:11 +08:00
TinyO
9775903fb1 fix(process): fix rectify slpha api. 2019-07-23 17:25:00 +08:00
TinyO
aff716189e Merge branch 'develop' of http://gitlab.mynt.com/mynteye/mynt-eye-s-sdk into develop 2019-07-23 16:47:03 +08:00
TinyO
636471b1cf feat(process): add rectify slpha api. 2019-07-23 16:46:25 +08:00
Osenberg
fc9507aa3e fix(ros): fixed error of no frame_id with image information 2019-07-19 18:28:39 +08:00
harjeb
19ad46f2d2 docs(*): fix glog dependency 2019-07-12 20:26:01 +08:00
John Zhao
8387a20ce6 fix(android): fix type conversion 2019-07-08 11:06:32 +08:00
John Zhao
15a933c2fc Merge branch 'hotfix/2.3.9' into develop
* hotfix/2.3.9:
  docs(sdk): update change log
2019-07-03 14:03:18 +08:00
John Zhao
b23905657e Merge branch 'hotfix/2.3.9' into develop
* hotfix/2.3.9:
  docs(*): update doc
  docs(*): update v2.3.9 changelog
  docs(*): fix requirements
  docs(*): update doc
  更新Datasheet和标定文档
  新版文档更新
  docs(*): update docs
2019-07-03 13:56:47 +08:00
Osenberg
19c604702f Merge branch 'develop' of http://gitlab.mynt.com/mynteye/mynt-eye-s-sdk into develop 2019-07-01 11:57:27 +08:00
Osenberg
7a23c28965 fix(src): fixed problem of printing accuracy 2019-06-25 12:49:41 +08:00
TinyO
0881a70922 fix(ros): points smalll resolution error. 2019-06-25 10:22:57 +08:00
John Zhao
c55db46760 feat(api): return empty plugin paths directly if no info path 2019-05-30 16:30:18 +08:00
John Zhao
f54eef8ad1 refactor(api): move camera models 2019-05-30 16:19:06 +08:00
John Zhao
bc7e4919e2 refactor(api): improve get sdk version and style changes 2019-05-30 15:30:17 +08:00
John Zhao
05e5552e46 build(make): simplify with camera models default on 2019-05-30 15:28:35 +08:00
John Zhao
178e362900 fix(ros): fix config name 2019-05-30 14:49:04 +08:00
89 changed files with 1215 additions and 409 deletions

View File

@@ -14,7 +14,7 @@
cmake_minimum_required(VERSION 3.0)
project(mynteye VERSION 2.3.9 LANGUAGES C CXX)
project(mynteye VERSION 2.4.1 LANGUAGES C CXX)
include(cmake/Common.cmake)
@@ -128,22 +128,25 @@ if(WITH_GLOG)
)
endif()
## camodocal
## camera_models
if(WITH_CAM_MODELS)
set(EIGEN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty)
message(STATUS "EIGEN_INCLUDE_DIR: ${EIGEN_INCLUDE_DIR}")
include_directories(
include
${CMAKE_CURRENT_BINARY_DIR}/include
${EIGEN_INCLUDE_DIR}
src/mynteye/api/camodocal/include
src/mynteye/api/camera_models
)
add_library(camodocal STATIC
src/mynteye/api/camodocal/src/camera_models/Camera.cc
src/mynteye/api/camodocal/src/camera_models/EquidistantCamera.cc
src/mynteye/api/camodocal/src/gpl/gpl.cc
add_library(camera_models STATIC
src/mynteye/api/camera_models/camera.cc
src/mynteye/api/camera_models/equidistant_camera.cc
src/mynteye/api/camera_models/gpl.cc
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
@@ -215,7 +218,6 @@ if(WITH_API)
src/mynteye/api/processor/points_processor_ocv.cc
src/mynteye/api/processor/depth_processor_ocv.cc
src/mynteye/api/processor/rectify_processor_ocv.cc
src/mynteye/api/config.cc
src/mynteye/api/correspondence.cc
src/mynteye/api/version_checker.cc
src/mynteye/api/data_tools.cc
@@ -252,7 +254,7 @@ if(OS_MAC)
target_link_libraries(${MYNTEYE_NAME} PUBLIC ${OSX_EXTRA_LIBS} )
endif()
if(WITH_CAM_MODELS)
target_link_libraries(${MYNTEYE_NAME} PRIVATE camodocal)
target_link_libraries(${MYNTEYE_NAME} PRIVATE camera_models)
endif()
target_link_threads(${MYNTEYE_NAME})

View File

@@ -25,16 +25,11 @@ MKFILE_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
# Options
#
# SUDO: sudo command
# CAM_MODELS: cmake build with -DWITH_CAM_MODELS=ON
#
# e.g. make [TARGET] SUDO=
# e.g. make [TARGET] CAM_MODELS=1
SUDO ?= sudo
CAM_MODELS ?=
CMAKE_BUILD_EXTRA_OPTIONS := $(CMAKE_BUILD_EXTRA_OPTIONS) -DWITH_CAM_MODELS=ON
CMAKE_BUILD_EXTRA_OPTIONS ?=
.DEFAULT_GOAL := all

View File

@@ -1,6 +1,6 @@
# MYNT® EYE S SDK
[![](https://img.shields.io/badge/MYNT%20EYE%20S%20SDK-2.3.9-brightgreen.svg?style=flat)](https://github.com/slightech/MYNT-EYE-S-SDK)
[![](https://img.shields.io/badge/MYNT%20EYE%20S%20SDK-2.4.1-brightgreen.svg?style=flat)](https://github.com/slightech/MYNT-EYE-S-SDK)
## Overview

View File

@@ -23,7 +23,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/Utils.cmake)
option(WITH_API "Build with API layer, need OpenCV" ON)
option(WITH_DEVICE_INFO_REQUIRED "Build with device info required" ON)
option(WITH_CAM_MODELS "Build with more camera models, WITH_API must be ON" OFF)
option(WITH_CAM_MODELS "Build with more camera models, WITH_API must be ON" ON)
# 3rdparty components

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = "MYNT EYE S SDK"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 2.3.9
PROJECT_NUMBER = 2.4.1
# 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

View File

@@ -20,11 +20,11 @@
# -- Project information -----------------------------------------------------
project = 'MYNT® EYE S SDK'
copyright = '2018, MYNTAI'
copyright = '2019, MYNTAI'
author = 'MYNTAI'
# The short X.Y version
version = '2.3.9'
version = '2.4.1'
# The full version, including alpha/beta/rc tags
release = version

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@@ -6,6 +6,10 @@ Firmware and SDK compatibility
============================ ========================
S1030 Firmwares SDK Version
============================ ========================
MYNTEYE-S1030-2.5.0.img 2.4.0 (2.4.0 ~ latest)
MYNTEYE_S_2.4.0.img 2.3.4 (2.3.4 ~ 2.3.9)
MYNTEYE_S_2.3.0.img 2.3.0 (2.2.2-rc1 ~ 2.3.3)
MYNTEYE_S_2.2.2.img 2.3.0 (2.2.2-rc1 ~ 2.3.0)
MYNTEYE_S_2.0.0_rc.img 2.0.0-rc (2.0.0-rc ~ 2.0.0-rc2)
MYNTEYE_S_2.0.0_rc2.img 2.0.0-rc2 (2.0.0-rc ~ 2.0.0-rc2)
MYNTEYE_S_2.0.0_rc1.img 2.0.0-rc1
@@ -13,19 +17,16 @@ MYNTEYE_S_2.0.0_rc0.img 2.0.0-rc0 (2.0.0-rc1 ~ 2.0.0-alpha1)
MYNTEYE_S_2.0.0_alpha1.1.img 2.0.0-alpha1 (2.0.0-rc1 ~ 2.0.0-alpha1)
MYNTEYE_S_2.0.0_alpha1.img 2.0.0-alpha1 (2.0.0-rc1 ~ 2.0.0-alpha1)
MYNTEYE_S_2.0.0_alpha0.img 2.0.0-alpha0
MYNTEYE_S_2.2.2.img 2.3.0 (2.2.2-rc1 ~ 2.3.0)
MYNTEYE_S_2.3.0.img 2.3.0 (2.2.2-rc1 ~ 2.3.3)
MYNTEYE_S_2.4.0.img 2.3.4 (2.3.4 ~ latest)
============================ ========================
============================ ===========================
S2100 Firmwares SDK Version
============================ ===========================
MYNTEYE_S2100_1.1.img 2.3.4
MYNTEYE_S2100_1.2.img 2.3.5 (2.3.5 ~ latest)
MYNTEYE-S2100-1.3.2.img 2.4.0(2.4.0 ~ latest)
MYNTEYE_S2100_1.2.img 2.3.5(2.3.5 ~ 2.3.9)
MYNTEYE_S2100_1.1.img 2.3.4
============================ ===========================
.. attention::
Please CONFIRM your device model and use CORRECT firmware.

View File

@@ -6,3 +6,4 @@ FIRMWARE
fw_info
fw_update
fw_changelog

View File

@@ -3,3 +3,29 @@ Change Log
.. toctree::
:maxdepth: 2
2019-08-09
-------------------
S1030 Main Chip Firmware: MYNTEYE-S1030-2.5.0.img
1. Optimize the synchronization of image and imu
2. Not save the camera control parameters
3. Fix the overexplosion problem at low resolution
4. Fix USB 2.0 first open failure problem
5. Add automatic recovery function when updating wrong firmware
S2100 Main Chip Firmware: MYNTEYE-S2100-1.3.2.img
1. Optimize the synchronization of image and imu
2. Not save the camera control parameters
3. Optimize IMU low-pass filter default values
4. Optimize the exposure time calculation method, the maximum exposure time is limited to 66.5ms
5. Add automatic recovery function when updating wrong firmware
6. Fix and optimize some other issues
S2100 Auxiliary Chip Firmware: MYNTEYE-S2100-auxiliary-chip-1.4.2.bin
1. Time synchronization adds uart interface, io interruption judgement
2. Time synchronization i2c interface adds whoami, read timestamp and median filter open state interface
3. Fix and optimize some other issues

View File

@@ -16,13 +16,8 @@ Update auxiliary chip (Only Support S2100/S210A)
.. image:: ../../images/firmware/stmupdate.png
* In the open file selection box, select the firmware ``MYNTEYE-S210x-auxiliary-chip-v1.0.bin`` and start upgrading.
* In the open file selection box, select the firmware ``MYNTEYE-S2100-auxiliary-chip-1.4.2.bin`` and start upgrading.
* Once the upgrade is complete, it will display update finished.
.. image:: ../../images/firmware/stmsuccess.png

View File

@@ -10,25 +10,21 @@ You can download the firmware and MYNT EYE TOOL installation package in the ``Fi
.. code-block:: none
Firmwares/
├─Checksum.txt # file checksum
├─MYNTEYE_S_2.4.0.img # S1030 firmware
├─MYNTEYE_S2100_1.2.img # S2100 firmware
├─Checksum.txt # File checksum
├─MYNTEYE-S1030-2.5.0.img # S1030 firmware
├─MYNTEYE-S2100-1.3.2.img # S2100 firmware
├─...
└─setup.zip # MYNTEYE TOOL zip
└─mynt-eye-tool-setup.zip # MYNT EYE TOOL zip
The firmware upgrade program currently only supports Windows, so you need to operate under Windows. Proceed as follows:
Download preparation
---------------------
* Download and unzip ``setup.zip``
* Find firmware, such as ``MYNTEYE_S_2.4.0.img``
* Download and unzip ``mynt-eye-tool-setup.zip``
* Find firmware, such as ``MYNTEYE-S1030-2.5.0.img``
* Please refer to :ref:`firmware_applicable` to select the firmware suitable for the SDK version
* Please refer to ``Checksum.txt`` to find the firmware check code as follows:
* Run the command in CMD ``certutil -hashfile <*.img> MD5`` .
* If the check code is incorrect, it means that the download went wrong. Please download it again!
Install MYNT EYE TOOL
---------------------

View File

@@ -9,4 +9,5 @@ SDK
data/contents
control/contents
tools/contents
project/contents
sdk_changelog

View File

@@ -33,8 +33,8 @@ s1030
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);
// contrast/black_level_calibration: range [0,255], default 116
api->SetOptionValue(Option::CONTRAST, 116);
LOG(INFO) << "Enable manual-exposure";
LOG(INFO) << "Set GAIN to " << api->GetOptionValue(Option::GAIN);
@@ -55,8 +55,8 @@ s2100/s210a
// manual-exposure: 1
api->SetOptionValue(Option::EXPOSURE_MODE, 1);
// brightness/exposure_time: range [0,240], default 120
api->SetOptionValue(Option::BRIGHTNESS, 120);
// brightness/exposure_time: range [1,255], default 70
api->SetOptionValue(Option::BRIGHTNESS, 70);
LOG(INFO) << "Enable manual-exposure";
LOG(INFO) << "Set EXPOSURE_MODE to "
@@ -79,7 +79,7 @@ s1030
I0513 14:09:17.552918 31908 manual_exposure.cc:37] Enable manual-exposure
I0513 14:09:17.552953 31908 manual_exposure.cc:38] Set GAIN to 24
I0513 14:09:17.552958 31908 manual_exposure.cc:39] Set BRIGHTNESS to 120
I0513 14:09:17.552963 31908 manual_exposure.cc:40] Set CONTRAST to 127
I0513 14:09:17.552963 31908 manual_exposure.cc:40] Set CONTRAST to 116
s2100/s210a
@@ -102,7 +102,7 @@ s2100/s210a
3
I/manual_exposure.cc:62 Enable manual-exposure
I/manual_exposure.cc:63 Set EXPOSURE_MODE to 1
I/manual_exposure.cc:65 Set BRIGHTNESS to 120
I/manual_exposure.cc:65 Set BRIGHTNESS to 70
The sample program displays an image with a real exposure time in the upper left corner, in milliseconds.

View File

@@ -17,3 +17,4 @@ SDK Data Samples
get_imu_correspondence
get_from_callbacks
get_with_plugin
save_single_image

View File

@@ -0,0 +1,52 @@
.. _data_save_single_image:
Save Single Image
=============================
Press "Space" "s" "S" to save image.
Reference commands:
.. code-block:: c++
api->Start(Source::VIDEO_STREAMING);
cv::namedWindow("frame");
std::int32_t count = 0;
std::cout << "Press 'Space' 's' 'S' to save image." << std::endl;
while (true) {
api->WaitForStreams();
auto &&left_data = api->GetStreamData(Stream::LEFT);
auto &&right_data = api->GetStreamData(Stream::RIGHT);
if (!left_data.frame.empty() && !right_data.frame.empty()) {
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;
} else if (key == 32 || key == 's' || key == 'S') {
if (!left_data.frame.empty() && !right_data.frame.empty()) {
char l_name[20];
char r_name[20];
++count;
snprintf(l_name, sizeof(l_name), "left_%d.jpg", count);
snprintf(r_name, sizeof(r_name), "right_%d.jpg", count);
cv::imwrite(l_name, left_data.frame);
cv::imwrite(r_name, right_data.frame);
std::cout << "Saved " << l_name << " " << r_name << " to current directory" << std::endl;
}
}
}
api->Stop(Source::VIDEO_STREAMING);
The above code uses OpenCV to display the image. When the display window is selected, pressing ``ESC/Q`` will end the program.
Complete code examples, see `save_single_image.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/save_single_image.cc>`_ .

View File

@@ -0,0 +1,136 @@
.. _cmake:
How to use SDK with CMake
=========================
This tutorial will create a project with CMake to start using SDK.
You could find the project demo in ``<sdk>/platforms/projects/cmake directory`` .
Preparation
-----------
- Windows: Install the win pack of SDK
- Linux: build from source and ``make install``
Create Project
--------------
Add ``CMakeLists.txt`` and ``mynteye_demo.cc`` files,
.. code-block:: cmake
cmake_minimum_required(VERSION 3.0)
project(mynteyed_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")
## mynteye_demo
add_executable(mynteye_demo mynteye_demo.cc)
target_link_libraries(mynteye_demo mynteye ${OpenCV_LIBS})
Config Project
--------------
Add ``mynteye`` and ``OpenCV`` packages to ``CMakeLists.txt`` ,
.. code-block:: cmake
# 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}")
Add ``include_directories`` and ``target_link_libraries`` to
``mynteye_demo`` target,
.. code-block:: cmake
# targets
include_directories(
${OpenCV_INCLUDE_DIRS}
)
## mynteye_demo
add_executable(mynteye_demo mynteye_demo.cc)
target_link_libraries(mynteye_demo mynteye ${OpenCV_LIBS})
Start using SDK
---------------
Include the headers of SDK and start using its APIs, view the project demo.
Windows
~~~~~~~
Reference to “Install Build Tools” in :ref:`install_windows_exe` .
Then open ``x64 Native Tools Command Prompt for VS 2017``
command shell to build and run.
.. code-block:: bat
mkdir _build
cd _build
cmake -G "Visual Studio 15 2017 Win64" ..
msbuild.exe ALL_BUILD.vcxproj /property:Configuration=Release
.\Release\mynteye_demo.exe
Linux
~~~~~
Open ``Terminal`` to build and run.
.. code-block:: bash
mkdir _build
cd _build/
cmake ..
make
./mynteye_demo

View File

@@ -0,0 +1,10 @@
.. _data:
SDK Project Demos
==================
.. toctree::
:maxdepth: 2
cmake
vs2017

View File

@@ -0,0 +1,83 @@
.. _vs2017:
How to use SDK with Visual Studio 2017
======================================
This tutorial will create a project with Visual Studio 2017 to start using SDK.
You could find the project demo in ``<sdk>/platforms/projects/vs2017`` directory.
Preparation
------------
- Windows: install the win pack of SDK
Create Project
--------------
Open Visual Studio 2017, then ``File > New > Project`` ,
.. image:: ../../../images/project/vs2017/1_new_pro.png
Select “Windows Console Application”, set the projects name and location, click “OK”,
.. image:: ../../../images/project/vs2017/2_new_pro.png
Finally, you will see the new project like this,
.. image:: ../../../images/project/vs2017/3_new_pro.png
Config Properties
------------------
Right click the project, and open its ``Properties`` window,
.. image:: ../../../images/project/vs2017/4_config.png
Change ``Configuration`` to ``All Configurations`` , then add the following paths to ``Additional Include Directories`` ,
.. code:: bash
$(MYNTEYES_SDK_ROOT)\include
$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\include
.. image:: ../../../images/project/vs2017/5_config_include.png
Add the following definitions to ``Preprocessor Definitions`` ,
.. code:: bash
$(MYNTEYES_SDK_ROOT)\lib
$(MYNTEYES_SDK_ROOT)\3rdparty\opencv\build\x64\vc15\lib
.. image:: ../../../images/project/vs2017/6_config_lib_dir.png
Add the following paths to ``Additional Dependencies``
.. code:: bash
mynteye.lib
opencv_world343.lib
.. image:: ../../../images/project/vs2017/7_config_lib.png
If want to use debug mode, could change ``Configuration`` to ``Debug`` and add following debug libs:
.. code:: bash
mynteyed.lib
opencv_world343d.lib
.. image:: ../../../images/project/vs2017/8_config_debug_lib.png
Start using SDK
---------------
Include the headers of SDK and start using its APIs,
.. image:: ../../../images/project/vs2017/9_run_x64.png
Select ``Release x64`` or ``Debug x64`` to run the project.
.. image:: ../../../images/project/vs2017/10_path.png

View File

@@ -3,23 +3,39 @@
Change Log
==========
2019-08-17(v2.4.1)
-------------------
1. Optimize disparity calculation
2019-08-09(v2.4.0)
-------------------
1. Optimize the synchronization of images and imu
2. Add 4.16+ kernel support on Ubuntu
3. Fix missinf frame_id issue in image information
4. Fix S1030 device not work issue in mynteye_multiple.launch
5. Add save single picture sample save_single_image
2019-07-03(v2.3.9)
-------------------
1. Fix ros timestamp issue
2. Add calibration tool doc
2019-05-20(v2.3.8)
-------------------
1. Improve VINS-Fusion supporting
2. Improve VINS-MONO supporting
3. Fix left/right rect image order error
2019-04-19(v2.3.7)
-------------------
1. Improve VINS-Fusion supporting
2. Improve ORB-SLAM2 supporting
2019-04-15(v2.3.6)
-------------------
@@ -30,34 +46,21 @@ Change Log
2019-04-01(v2.3.5)
-------------------
1. Improve camera info.
2. Modify image algorithm parameters by yaml file.
3. Add opening multi devices launch file in ROS.
4. Add setting IIC address API of S210A.
5. Add image/imu flag of external time source.
6. Add LaserScan sample for S1030.
7. Modify default orientation of point in ROS.
1. Improve camera info
2. Modify image algorithm parameters by yaml file
3. Add opening multi devices launch file in ROS
4. Add setting IIC address API of S210A
5. Add image/imu flag of external time source
6. Add LaserScan sample for S1030
7. Modify default orientation of point in ROS
2019-03-18(v2.3.4)
-------------------
1. Add API to get auxiliary chip&ISP's version(Depend on S2100/S210A 1.1 firmware & 1.0 subsidiary chip firmware).
2. Fix point fragment issue in image algorithm.
3. Add 376*240 resolution support to S1030(Depend on 2.4.0 firmware of S1030).
4. Add API to handle imu temperature drift.(Depend on imu calibration)
5. Add version check feature.
6. Fix depth image crash issue when use CUDA plugin.
7. Documents update.
1. Add API to get auxiliary chip&ISP's version (Depend on S2100/S210A 1.1 firmware & 1.0 subsidiary chip firmware)
2. Fix point fragment issue in image algorithm
3. Add 376*240 resolution support to S1030 (Depend on 2.4.0 firmware of S1030)
4. Add API to handle imu temperature drift (Depend on imu calibration)
5. Add version check feature
6. Fix depth image crash issue when use CUDA plugin
7. Documents update

View File

@@ -11,6 +11,11 @@ If you wanna run OKVIS with MYNT EYE camera, please follow the steps:
3. Update camera parameters to ``<OKVIS>/config/config_mynteye.yaml``.
4. Run OKVIS using MYNT® EYE.
.. tip::
OKVIS doesn't support ARM right now
Install MYNTEYE OKVIS
---------------------

View File

@@ -16,7 +16,7 @@ Prerequisites
.. code-block:: bash
sudo apt-get -y install libglew-dev cmake
sudo apt-get -y install libglew-dev cmake libgoogle-glog-dev
cd ~
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin

View File

@@ -93,15 +93,15 @@ standard.yaml/standard2.yaml:
...
# s2100 modify brightness
# standard2/brightness range: [0,240]
# standard2/brightness range: [1,255]
standard2/brightness: -1
# standard2/brightness: 120
# standard2/brightness: 70
...
# s210a modify brightness
# standard210a/brightness range: [0,240]
# standard210a/brightness range: [1,255]
standard210a/brightness: -1
# standard210a/brightness: 120
# standard210a/brightness: 70
...

View File

@@ -237,6 +237,11 @@ class MYNTEYE_API API {
void SetDisparityComputingMethodType(
const DisparityComputingMethod &MethodType);
/**
* Set the rectify bord cut alpha.
*/
void SetRectifyAlpha(const double &alpha);
/**
* Set if the duplicate frames is enable.
*/
@@ -247,6 +252,11 @@ class MYNTEYE_API API {
*/
void SetOptionValue(const Option &option, std::int32_t value);
/**
* Set the option value.
*/
bool SetOptionValue(const Option &option, std::uint64_t value);
/**
* Run the option action.
*/
@@ -364,6 +374,8 @@ class MYNTEYE_API API {
*/
bool ConfigDisparityFromFile(const std::string& config_file);
bool IsDefaultIntrinsics();
private:
std::shared_ptr<Device> device_;

View File

@@ -223,6 +223,10 @@ class MYNTEYE_API Device {
* Set the option value.
*/
void SetOptionValue(const Option &option, std::int32_t value);
/**
* Set the option value.
*/
bool SetOptionValue(const Option &option, std::uint64_t value);
/**
* Run the option action.
@@ -300,6 +304,8 @@ class MYNTEYE_API Device {
/** Enable process mode, e.g. imu assembly, temp_drift */
void EnableProcessMode(const std::int32_t& mode);
bool CheckImageParams();
protected:
std::shared_ptr<uvc::device> device() const {
return device_;
@@ -379,6 +385,8 @@ class MYNTEYE_API Device {
bool SetFiles(
DeviceInfo *info, img_params_map_t *img_params, imu_params_t *imu_params);
bool is_default_intrinsics_;
friend API;
friend tools::DeviceWriter;
};

View File

@@ -44,6 +44,8 @@ enum class Model : std::uint8_t {
STANDARD2,
/** Standard 210a */
STANDARD210A,
/** Standard 200b */
STANDARD200B,
/** Last guard */
LAST
};
@@ -223,8 +225,8 @@ enum class Option : std::uint8_t {
/**
* HDR mode
* <p>
* 0: 10-bit<br>
* 1: 12-bit
* 0: normal<br>
* 1: WDR
* </p>
*/
HDR_MODE,
@@ -273,6 +275,9 @@ enum class Option : std::uint8_t {
/** Erase chip */
ERASE_CHIP,
/** Sync timestamp */
SYNC_TIMESTAMP,
/** Last guard */
LAST
};
@@ -770,6 +775,7 @@ struct CameraROSMsgInfoPair {
struct CameraROSMsgInfo left;
struct CameraROSMsgInfo right;
double T_mul_f = -1.f;
double cx1_minus_cx2 = 0.f;
double R[9] = {0};
double P[12] = {0};
};

View File

@@ -178,6 +178,9 @@ int main(int argc, char *argv[]) {
auto &&left_data = api->GetStreamData(Stream::LEFT);
auto &&right_data = api->GetStreamData(Stream::RIGHT);
if (left_data.frame.empty() || right_data.frame.empty())
continue;
cv::Mat img;
cv::hconcat(left_data.frame, right_data.frame, img);
cv::imshow("frame", img);

View File

@@ -112,6 +112,7 @@ make_executable2(get_imu_correspondence
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
@@ -125,6 +126,7 @@ make_executable2(ctrl_imu_low_pass_filter SRCS control/imu_low_pass_filter.cc WI
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

View File

@@ -58,8 +58,9 @@ int main(int argc, char *argv[]) {
<< api->GetOptionValue(Option::DESIRED_BRIGHTNESS);
}
// Set auto exposure options fo S2000/S2100/S210A
if (model == Model::STANDARD2 || model == Model::STANDARD210A) {
// Set auto exposure options fo S2000/S2100/S210A/S200B
if (model == Model::STANDARD2 ||
model == Model::STANDARD210A || model == Model::STANDARD200B) {
// auto-exposure: 0
api->SetOptionValue(Option::EXPOSURE_MODE, 0);

View File

@@ -45,8 +45,9 @@ int main(int argc, char *argv[]) {
<< api->GetOptionValue(Option::IMU_FREQUENCY);
}
// You should set frame rate for S2000/S2100/S210A by 'SelectStreamRequest()'
if (model == Model::STANDARD2 || model == Model::STANDARD210A) {
// You should set frame rate for S2000/S2100/S210A/S200B by 'SelectStreamRequest()'
if (model == Model::STANDARD2 ||
model == Model::STANDARD210A || model == Model::STANDARD200B) {
LOG(INFO) << "Please set frame rate by 'SelectStreamRequest()'";
}

View File

@@ -38,8 +38,9 @@ int main(int argc, char *argv[]) {
return 0;
}
// Set imu low pass filter for S2000/S2100/S210A
if (model == Model::STANDARD2 || model == Model::STANDARD210A) {
// Set imu low pass filter for S2000/S2100/S210A/S200B
if (model == Model::STANDARD2 ||
model == Model::STANDARD210A || model == Model::STANDARD200B) {
// ACCELEROMETER_RANGE values: 0, 1, 2
api->SetOptionValue(Option::ACCELEROMETER_LOW_PASS_FILTER, 2);
// GYROSCOPE_RANGE values: 23, 64

View File

@@ -40,8 +40,9 @@ int main(int argc, char *argv[]) {
api->SetOptionValue(Option::GYROSCOPE_RANGE, 1000);
}
// Set imu range for S2000/S2100/S210A
if (model == Model::STANDARD2 || model == Model::STANDARD210A) {
// Set imu range for S2000/S2100/S210A/S200B
if (model == Model::STANDARD2 ||
model == Model::STANDARD210A || model == Model::STANDARD200B) {
// ACCELEROMETER_RANGE values: 6, 12, 24, 48
api->SetOptionValue(Option::ACCELEROMETER_RANGE, 6);
// GYROSCOPE_RANGE values: 250, 500, 1000, 2000, 4000

View File

@@ -29,7 +29,7 @@ int main(int argc, char *argv[]) {
Model model = api->GetModel();
if (model == Model::STANDARD || model == Model::STANDARD2) {
if (model == Model::STANDARD) {
// ir control: range [0,160], default 0
api->SetOptionValue(Option::IR_CONTROL, 80);
@@ -37,9 +37,10 @@ int main(int argc, char *argv[]) {
<< api->GetOptionValue(Option::IR_CONTROL);
}
// MYNTEYE-S210A don't support this option
if (model == Model::STANDARD210A) {
LOG(INFO) << "Sorry,MYNTEYE-S210A don't support ir control";
// MYNTEYE-S210A S2000 S200B don't support this option
if (model == Model::STANDARD210A ||
model == Model::STANDARD2 || model == Model::STANDARD200B) {
LOG(INFO) << "Sorry, MYNTEYE-S210A S2000 S200B don't support ir control";
return 0;
}

View File

@@ -40,8 +40,8 @@ int main(int argc, char *argv[]) {
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);
// contrast/black_level_calibration: range [0,255], default 116
api->SetOptionValue(Option::CONTRAST, 116);
frame_rate = api->GetOptionValue(Option::FRAME_RATE);
@@ -54,13 +54,14 @@ int main(int argc, char *argv[]) {
LOG(INFO) << "Set CONTRAST to " << api->GetOptionValue(Option::CONTRAST);
}
// Set manual exposure options fo S2000/S2100/S210A
if (model == Model::STANDARD2 || model == Model::STANDARD210A) {
// Set manual exposure options fo S2000/S2100/S210A/S200B
if (model == Model::STANDARD2 ||
model == Model::STANDARD210A || model == Model::STANDARD200B) {
// manual-exposure: 1
api->SetOptionValue(Option::EXPOSURE_MODE, 1);
// brightness/exposure_time: range [0,240], default 120
api->SetOptionValue(Option::BRIGHTNESS, 120);
// brightness/exposure_time: range [1,255], default 70
api->SetOptionValue(Option::BRIGHTNESS, 70);
LOG(INFO) << "Enable manual-exposure";
LOG(INFO) << "Set EXPOSURE_MODE to "

View File

@@ -0,0 +1,56 @@
#include <opencv2/highgui/highgui.hpp>
#include "mynteye/logger.h"
#include "mynteye/api/api.h"
MYNTEYE_USE_NAMESPACE
int main(int argc, char *argv[]) {
auto &&api = API::Create(argc, argv);
if (!api) return 1;
bool ok;
auto &&request = api->SelectStreamRequest(&ok);
if (!ok) return 1;
api->ConfigStreamRequest(request);
Model model = api->GetModel();
if (model != Model::STANDARD200B) {
LOG(INFO) << "Sorry, This device don't support sync timestamp";
return 0;
}
if (model == Model::STANDARD200B) {
std::uint64_t value = 10;
auto ok = api->SetOptionValue(Option::SYNC_TIMESTAMP, value);
if (ok) {
LOG(INFO) << "Set timestamp is successful.";
} else {
LOG(INFO) << "Set timestamp is failed.";
}
}
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;
}

View File

@@ -48,8 +48,21 @@ int main(int argc, char *argv[]) {
auto info = api->GetCameraROSMsgInfoPair();
if (info && !info->isEmpty())
std::cout << "ROSMsgInfoPair:"<< std::endl << *info << std::endl;
if (info && !info->isEmpty()) {
LOG(INFO) << "ROSMsgInfoPair:";
LOG(INFO) << *info;
}
if (api->IsDefaultIntrinsics()) {
LOG(WARNING) << "Default intrinsics are currently being used.";
LOG(WARNING) << "Image params not found, but we need it to process the "
"images. Please `make tools` and use `img_params_writer` "
"to write the image params. If you update the SDK from "
"1.x, the `SN*.conf` is the file contains them. Besides, "
"you could also calibrate them by yourself. Read the guide "
"doc (https://github.com/slightech/MYNT-EYE-SDK-2-Guide) "
"to learn more.";
}
return 0;
}

View File

@@ -30,6 +30,11 @@ int main(int argc, char *argv[]) {
api->EnableStreamData(Stream::LEFT_RECTIFIED);
api->EnableStreamData(Stream::RIGHT_RECTIFIED);
/** SetRectifyAlpha
-1 is default
*/
// api->SetRectifyAlpha(0.5);
api->Start(Source::VIDEO_STREAMING);
double fps;

View File

@@ -0,0 +1,55 @@
#include <stdio.h>
#include <opencv2/highgui/highgui.hpp>
#include "mynteye/api/api.h"
MYNTEYE_USE_NAMESPACE
int main(int argc, char *argv[]) {
auto &&api = API::Create(argc, argv);
if (!api) return 1;
bool ok;
auto &&request = api->SelectStreamRequest(&ok);
if (!ok) return 1;
api->ConfigStreamRequest(request);
api->Start(Source::VIDEO_STREAMING);
cv::namedWindow("frame");
std::int32_t count = 0;
std::cout << "Press 'Space' 's' 'S' to save image." << std::endl;
while (true) {
api->WaitForStreams();
auto &&left_data = api->GetStreamData(Stream::LEFT);
auto &&right_data = api->GetStreamData(Stream::RIGHT);
if (!left_data.frame.empty() && !right_data.frame.empty()) {
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;
} else if (key == 32 || key == 's' || key == 'S') {
if (!left_data.frame.empty() && !right_data.frame.empty()) {
char l_name[20];
char r_name[20];
++count;
snprintf(l_name, sizeof(l_name), "left_%d.jpg", count);
snprintf(r_name, sizeof(r_name), "right_%d.jpg", count);
cv::imwrite(l_name, left_data.frame);
cv::imwrite(r_name, right_data.frame);
std::cout << "Saved " << l_name << " " << r_name << " to current directory" << std::endl;
}
}
}
api->Stop(Source::VIDEO_STREAMING);
return 0;
}

View File

@@ -90,7 +90,10 @@ bool dir_exists(const std::string &p) {
std::vector<std::string> get_plugin_paths() {
std::string info_path = utils::get_sdk_install_dir();
info_path.append(MYNTEYE_OS_SEP "share" MYNTEYE_OS_SEP "mynteye" MYNTEYE_OS_SEP "build.info");
if (info_path.empty()) return {};
info_path.append(MYNTEYE_OS_SEP "share" MYNTEYE_OS_SEP "mynteye"
MYNTEYE_OS_SEP "build.info");
cv::FileStorage fs(info_path, cv::FileStorage::READ);
if (!fs.isOpened()) {
@@ -241,27 +244,15 @@ std::shared_ptr<API> API::Create(const std::shared_ptr<Device> &device) {
bool in_l_ok, in_r_ok;
auto left_intr = device->GetIntrinsics(Stream::LEFT, &in_l_ok);
auto right_intr = device->GetIntrinsics(Stream::RIGHT, &in_r_ok);
if (!in_l_ok || !in_r_ok) {
LOG(ERROR) << "Image params not found, but we need it to process the "
"images. Please `make tools` and use `img_params_writer` "
"to write the image params. If you update the SDK from "
"1.x, the `SN*.conf` is the file contains them. Besides, "
"you could also calibrate them by yourself. Read the guide "
"doc (https://github.com/slightech/MYNT-EYE-SDK-2-Guide) "
"to learn more.";
if (left_intr->calib_model() != right_intr->calib_model()) {
LOG(ERROR) << "left camera and right camera use different calib models!";
LOG(WARNING) << "use pinhole as default";
api = std::make_shared<API>(device, CalibrationModel::UNKNOW);
return api;
} else {
if (left_intr->calib_model() != right_intr->calib_model()) {
LOG(ERROR) << "left camera and right camera use different calib models!";
LOG(WARNING) << "use pinhole as default";
api = std::make_shared<API>(device, CalibrationModel::UNKNOW);
return api;
} else {
api = std::make_shared<API>(device, left_intr->calib_model());
return api;
}
api = std::make_shared<API>(device, left_intr->calib_model());
return api;
}
} else {
LOG(ERROR) <<"no device!";
@@ -332,17 +323,7 @@ std::string API::GetInfo(const Info &info) const {
}
std::string API::GetSDKVersion() const {
std::string info_path =
utils::get_sdk_install_dir();
info_path.append(MYNTEYE_OS_SEP "share" \
MYNTEYE_OS_SEP "mynteye" MYNTEYE_OS_SEP "build.info");
cv::FileStorage fs(info_path, cv::FileStorage::READ);
if (!fs.isOpened()) {
LOG(WARNING) << "build.info not found: " << info_path;
return "null";
}
return fs["MYNTEYE_VERSION"];
return MYNTEYE_API_VERSION_STR;
}
IntrinsicsPinhole API::GetIntrinsics(const Stream &stream) const {
@@ -387,6 +368,10 @@ void API::SetOptionValue(const Option &option, std::int32_t value) {
device_->SetOptionValue(option, value);
}
bool API::SetOptionValue(const Option &option, std::uint64_t value) {
return device_->SetOptionValue(option, value);
}
bool API::RunOptionAction(const Option &option) const {
return device_->RunOptionAction(option);
}
@@ -569,6 +554,10 @@ void API::SetDisparityComputingMethodType(
synthetic_->SetDisparityComputingMethodType(MethodType);
}
void API::SetRectifyAlpha(const double &alpha) {
synthetic_->SetRectifyAlpha(alpha);
}
std::shared_ptr<Device> API::device() {
return device_;
}
@@ -576,11 +565,7 @@ std::shared_ptr<Device> API::device() {
// TODO(Kalman): Call this function in the appropriate place
void API::CheckImageParams() {
if (device_ != nullptr) {
bool in_l_ok, in_r_ok, ex_l2r_ok;
device_->GetIntrinsics(Stream::LEFT, &in_l_ok);
device_->GetIntrinsics(Stream::RIGHT, &in_r_ok);
device_->GetExtrinsics(Stream::LEFT, Stream::RIGHT, &ex_l2r_ok);
if (!in_l_ok || !in_r_ok || !ex_l2r_ok) {
if (device_->CheckImageParams()) {
LOG(FATAL) << "Image params not found, but we need it to process the "
"images. Please `make tools` and use `img_params_writer` "
"to write the image params. If you update the SDK from "
@@ -608,4 +593,12 @@ bool API::ConfigDisparityFromFile(const std::string& config_file) {
return synthetic_->ConfigDisparityFromFile(config_file);
}
bool API::IsDefaultIntrinsics() {
if (device_ != nullptr) {
return device_->CheckImageParams();
}
return false;
}
MYNTEYE_END_NAMESPACE

View File

@@ -12,9 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include <opencv2/calib3d/calib3d.hpp>
#include "camodocal/camera_models/Camera.h"
namespace camodocal {
#include "camera.h"
MYNTEYE_BEGIN_NAMESPACE
namespace models {
Camera::Parameters::Parameters(ModelType modelType)
: m_modelType(modelType), m_imageWidth(0), m_imageHeight(0) {
@@ -208,4 +211,7 @@ void Camera::projectPoints(
imagePoints.push_back(cv::Point2f(p(0), p(1)));
}
}
}
} // namespace models
MYNTEYE_END_NAMESPACE

View File

@@ -11,15 +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 SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_CAMERA_MODELS_CAMERA_H_
#define SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_CAMERA_MODELS_CAMERA_H_
#ifndef MYNTEYE_CAMERA_MODELS_CAMERA_H_
#define MYNTEYE_CAMERA_MODELS_CAMERA_H_
#include <vector>
#include <memory>
#include "eigen3/Eigen/Dense"
#include <opencv2/core/core.hpp>
namespace camodocal {
#include "mynteye/mynteye.h"
MYNTEYE_BEGIN_NAMESPACE
namespace models {
class Camera {
public:
@@ -134,5 +138,7 @@ typedef std::shared_ptr<Camera> CameraPtr;
typedef std::shared_ptr<const Camera> CameraConstPtr;
}
#endif // SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_CAMERA_MODELS_CAMERA_H_
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_CAMERA_MODELS_CAMERA_H_

View File

@@ -16,15 +16,19 @@
#include <cstdint>
#include <cmath>
#include <cstdio>
#include "camodocal/camera_models/EquidistantCamera.h"
#include "eigen3/Eigen/Dense"
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/core/eigen.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "camodocal/gpl/gpl.h"
// #include "mynteye/logger.h"
namespace camodocal {
#include "equidistant_camera.h"
#include "gpl.h"
MYNTEYE_BEGIN_NAMESPACE
namespace models {
#define PI M_PI
#define PI_2 1.5707963
float ApproxAtan2(float y, float x)
@@ -652,4 +656,7 @@ void EquidistantCamera::backprojectSymmetric(
}
}
}
} // namespace camodocal
} // namespace models
MYNTEYE_END_NAMESPACE

View File

@@ -11,14 +11,17 @@
// 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 SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_CAMERA_MODELS_EQUIDISTANTCAMERA_H_
#define SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_CAMERA_MODELS_EQUIDISTANTCAMERA_H_
#ifndef MYNTEYE_CAMERA_MODELS_EQUIDISTANT_CAMERA_H_
#define MYNTEYE_CAMERA_MODELS_EQUIDISTANT_CAMERA_H_
#include <string>
#include "Camera.h"
#include <opencv2/core/core.hpp>
namespace camodocal {
#include "camera.h"
MYNTEYE_BEGIN_NAMESPACE
namespace models {
/**
* J. Kannala, and S. Brandt, A Generic Camera Model and Calibration Method
@@ -227,5 +230,7 @@ void EquidistantCamera::spaceToPlane(
}
}
#endif // SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_CAMERA_MODELS_EQUIDISTANTCAMERA_H_
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_CAMERA_MODELS_EQUIDISTANT_CAMERA_H_

View File

@@ -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 "camodocal/gpl/gpl.h"
#include "gpl.h"
#include <set>
#ifdef _WIN32
@@ -56,7 +56,9 @@ const double WGS84_ECCSQ = 0.00669437999013;
#define fminf(x, y) (((x) < (y)) ? (x) : (y))
#endif
namespace camodocal {
MYNTEYE_BEGIN_NAMESPACE
namespace models {
double hypot3(double x, double y, double z) {
return sqrt(square(x) + square(y) + square(z));
@@ -524,5 +526,6 @@ char UTMLetterDesignator(double latitude) {
return letterDesignator;
}
} // namespace camodocal
} // namespace models
MYNTEYE_END_NAMESPACE

View File

@@ -11,15 +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 SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_GPL_GPL_H_
#define SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_GPL_GPL_H_
#ifndef MYNTEYE_CAMERA_MODELS_GPL_H_
#define MYNTEYE_CAMERA_MODELS_GPL_H_
#include <vector>
#include <algorithm>
#include <cmath>
#include <opencv2/core/core.hpp>
namespace camodocal {
#include "mynteye/mynteye.h"
MYNTEYE_BEGIN_NAMESPACE
namespace models {
template <class T>
const T clamp(const T &v, const T &a, const T &b) {
@@ -105,5 +109,7 @@ void UTMtoLL(
double &latitude, double &longitude); // NOLINT
}
#endif // SRC_MYNTEYE_API_CAMODOCAL_INCLUDE_CAMODOCAL_GPL_GPL_H_
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_CAMERA_MODELS_GPL_H_

View File

@@ -1,88 +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 "mynteye/api/config.h"
MYNTEYE_BEGIN_NAMESPACE
/**
* default intrinsics
*/
std::shared_ptr<IntrinsicsBase> getDefaultIntrinsics() {
auto res = std::make_shared<IntrinsicsPinhole>();
res->width = 640;
res->height = 400;
res->model = 0;
res->fx = 3.6220059643202876e+02;
res->fy = 3.6350065250745848e+02;
res->cx = 4.0658699068023441e+02;
res->cy = 2.3435161110061483e+02;
double codffs[5] = {
-2.5034765682756088e-01,
5.0579399202897619e-02,
-7.0536676161976066e-04,
-8.5255451307033846e-03,
0.
};
for (unsigned int i = 0; i < 5; i++) {
res->coeffs[i] = codffs[i];
}
return res;
}
std::shared_ptr<Extrinsics> getDefaultExtrinsics() {
auto res = std::make_shared<Extrinsics>();
double rotation[9] = {
9.9867908939669447e-01, -6.3445566137485428e-03, 5.0988459509619687e-02,
5.9890316389333252e-03, 9.9995670037792639e-01, 7.1224201868366971e-03,
-5.1031440326695092e-02, -6.8076406092671274e-03, 9.9867384471984544e-01
};
double translation[3] = {-1.2002489764113250e+02, -1.1782637409050747e+00,
-5.2058205159996538e+00};
for (unsigned int i = 0; i < 3; i++) {
for (unsigned int j = 0; j < 3; j++) {
res->rotation[i][j] = rotation[i*3 + j];
}
}
for (unsigned int i = 0; i < 3; i++) {
res->translation[i] = translation[i];
}
return res;
}
// sgbm_matcher = cv::StereoSGBM::create(0, 16, 3);
// sgbm_matcher->setPreFilterCap(63);
// sgbm_matcher->setBlockSize(sgbmWinSize);
// sgbm_matcher->setP1(8 * sgbmWinSize * sgbmWinSize);
// sgbm_matcher->setP2(32 * sgbmWinSize * sgbmWinSize);
// sgbm_matcher->setMinDisparity(0);
// sgbm_matcher->setNumDisparities(numberOfDisparities);
// sgbm_matcher->setUniquenessRatio(10);
// sgbm_matcher->setSpeckleWindowSize(100);
// sgbm_matcher->setSpeckleRange(32);
// sgbm_matcher->setDisp12MaxDiff(1);
// bm_matcher = cv::StereoBM::create(0, 3);
// bm_matcher->setPreFilterSize(9);
// bm_matcher->setPreFilterCap(31);
// bm_matcher->setBlockSize(15);
// bm_matcher->setMinDisparity(0);
// bm_matcher->setNumDisparities(64);
// bm_matcher->setUniquenessRatio(60);
// bm_matcher->setTextureThreshold(10);
// bm_matcher->setSpeckleWindowSize(100);
// bm_matcher->setSpeckleRange(4);
MYNTEYE_END_NAMESPACE

View File

@@ -1,28 +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.
#ifndef MYNTEYE_API_CONFIG_H_
#define MYNTEYE_API_CONFIG_H_
#pragma once
#include "mynteye/api/api.h"
MYNTEYE_BEGIN_NAMESPACE
std::shared_ptr<IntrinsicsBase> getDefaultIntrinsics();
std::shared_ptr<Extrinsics> getDefaultExtrinsics();
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_API_CONFIG_H_

View File

@@ -27,8 +27,14 @@ MYNTEYE_BEGIN_NAMESPACE
const char DisparityProcessor::NAME[] = "DisparityProcessor";
DisparityProcessor::DisparityProcessor(DisparityComputingMethod type,
std::shared_ptr<struct CameraROSMsgInfoPair> calib_infos,
std::int32_t proc_period)
: Processor(std::move(proc_period)), type_(type) {
if (calib_infos) {
cx1_minus_cx2_ = calib_infos->cx1_minus_cx2;
} else {
cx1_minus_cx2_ = 1.f;
}
VLOG(2) << __func__ << ": proc_period=" << proc_period;
int sgbmWinSize = 3;
int numberOfDisparities = 64;
@@ -81,7 +87,7 @@ DisparityProcessor::DisparityProcessor(DisparityComputingMethod type,
bm_matcher->setPreFilterCap(31);
bm_matcher->setBlockSize(15);
bm_matcher->setMinDisparity(0);
bm_matcher->setNumDisparities(64);
bm_matcher->setNumDisparities(128);
bm_matcher->setUniquenessRatio(60);
bm_matcher->setTextureThreshold(10);
bm_matcher->setSpeckleWindowSize(100);
@@ -156,6 +162,7 @@ bool DisparityProcessor::OnProcess(
} else if (type_ == DisparityComputingMethod::BM) {
// LOG(ERROR) << "not supported in opencv 2.x";
(*sgbm_matcher)(input->first, input->second, disparity);
disparity.convertTo(output->value, CV_32F, 1./16, 1);
// cv::Mat tmp1, tmp2;
// cv::cvtColor(input->first, tmp1, CV_RGB2GRAY);
// cv::cvtColor(input->second, tmp2, CV_RGB2GRAY);
@@ -188,7 +195,7 @@ bool DisparityProcessor::OnProcess(
sgbm_matcher->compute(input->first, input->second, disparity);
}
#endif
disparity.convertTo(output->value, CV_32F, 1./16, 1);
disparity.convertTo(output->value, CV_32F, 1./16, cx1_minus_cx2_);
output->id = input->first_id;
output->data = input->first_data;
return true;

View File

@@ -32,6 +32,7 @@ class DisparityProcessor : public Processor {
static const char NAME[];
explicit DisparityProcessor(DisparityComputingMethod type,
std::shared_ptr<struct CameraROSMsgInfoPair> calib_infos,
std::int32_t proc_period = 0);
virtual ~DisparityProcessor();
@@ -54,6 +55,7 @@ class DisparityProcessor : public Processor {
cv::Ptr<cv::StereoSGBM> sgbm_matcher;
cv::Ptr<cv::StereoBM> bm_matcher;
DisparityComputingMethod type_;
double cx1_minus_cx2_;
};
MYNTEYE_END_NAMESPACE

View File

@@ -37,12 +37,15 @@ cv::Mat RectifyProcessor::rectifyrad(const cv::Mat& R) {
return R.clone();
}
void RectifyProcessor::stereoRectify(camodocal::CameraPtr leftOdo,
camodocal::CameraPtr rightOdo, const CvMat* K1, const CvMat* K2,
void RectifyProcessor::stereoRectify(models::CameraPtr leftOdo,
models::CameraPtr rightOdo, const CvMat* K1, const CvMat* K2,
const CvMat* D1, const CvMat* D2, CvSize imageSize,
const CvMat* matR, const CvMat* matT,
CvMat* _R1, CvMat* _R2, CvMat* _P1, CvMat* _P2, double* T_mul_f,
double *cx1_min_cx2,
int flags, double alpha, CvSize newImgSize) {
// std::cout << _alpha << std::endl;
alpha = _alpha;
double _om[3], _t[3] = {0}, _uu[3]={0, 0, 0}, _r_r[3][3], _pp[3][4];
double _ww[3], _wr[3][3], _z[3] = {0, 0, 0}, _ri[3][3], _w3[3];
cv::Rect_<float> inner1, inner2, outer1, outer2;
@@ -170,7 +173,7 @@ void RectifyProcessor::stereoRectify(camodocal::CameraPtr leftOdo,
*T_mul_f = 0. - _t[idx] * fc_new;
cvConvert(&pp, _P2);
alpha = MIN(alpha, 1.);
_alpha = MIN(alpha, 1.);
{
newImgSize = newImgSize.width*newImgSize.height != 0 ? newImgSize : imageSize;
double cx1_0 = cc_new[0].x;
@@ -183,6 +186,25 @@ void RectifyProcessor::stereoRectify(camodocal::CameraPtr leftOdo,
double cy2 = newImgSize.height*cy2_0/imageSize.height;
double s = 1.;
if ( _alpha >= 0 ) {
double s0 = std::max(std::max(std::max((double)cx1/(cx1_0 - inner1.x), (double)cy1/(cy1_0 - inner1.y)),
(double)(newImgSize.width - cx1)/(inner1.x + inner1.width - cx1_0)),
(double)(newImgSize.height - cy1)/(inner1.y + inner1.height - cy1_0));
s0 = std::max(std::max(std::max(std::max((double)cx2/(cx2_0 - inner2.x), (double)cy2/(cy2_0 - inner2.y)),
(double)(newImgSize.width - cx2)/(inner2.x + inner2.width - cx2_0)),
(double)(newImgSize.height - cy2)/(inner2.y + inner2.height - cy2_0)),
s0);
double s1 = std::min(std::min(std::min((double)cx1/(cx1_0 - outer1.x), (double)cy1/(cy1_0 - outer1.y)),
(double)(newImgSize.width - cx1)/(outer1.x + outer1.width - cx1_0)),
(double)(newImgSize.height - cy1)/(outer1.y + outer1.height - cy1_0));
s1 = std::min(std::min(std::min(std::min((double)cx2/(cx2_0 - outer2.x), (double)cy2/(cy2_0 - outer2.y)),
(double)(newImgSize.width - cx2)/(outer2.x + outer2.width - cx2_0)),
(double)(newImgSize.height - cy2)/(outer2.y + outer2.height - cy2_0)),
s1);
s = s0*(1 - alpha) + s1*alpha;
}
fc_new *= s;
cc_new[0] = cvPoint2D64f(cx1, cy1);
cc_new[1] = cvPoint2D64f(cx2, cy2);
@@ -197,6 +219,8 @@ void RectifyProcessor::stereoRectify(camodocal::CameraPtr leftOdo,
cvmSet(_P2, 0, 2, cx2);
cvmSet(_P2, 1, 2, cy2);
cvmSet(_P2, idx, 3, s*cvmGet(_P2, idx, 3));
*cx1_min_cx2 = -(cx1 - cx2);
}
}
@@ -249,8 +273,8 @@ struct CameraROSMsgInfo RectifyProcessor::getCalibMatData(
}
std::shared_ptr<struct CameraROSMsgInfoPair> RectifyProcessor::stereoRectify(
camodocal::CameraPtr leftOdo,
camodocal::CameraPtr rightOdo,
models::CameraPtr leftOdo,
models::CameraPtr rightOdo,
mynteye::IntrinsicsEquidistant in_left,
mynteye::IntrinsicsEquidistant in_right,
mynteye::Extrinsics ex_right_to_left) {
@@ -274,12 +298,14 @@ std::shared_ptr<struct CameraROSMsgInfoPair> RectifyProcessor::stereoRectify(
cv::Mat P1 = cv::Mat(3, 4, CV_64F);
cv::Mat P2 = cv::Mat(3, 4, CV_64F);
CvMat c_R = cv_R, c_t = cv_t;
CvMat c_K1 = K1, c_K2 = K2, c_D1 = D1, c_D2 = D2;
CvMat c_R1 = R1, c_R2 = R2, c_P1 = P1, c_P2 = P2;
CvMat c_R = cvMat(cv_R), c_t = cvMat(cv_t);
CvMat c_K1 = cvMat(K1), c_K2 = cvMat(K2), c_D1 =cvMat(D1), c_D2 = cvMat(D2);
CvMat c_R1 = cvMat(R1), c_R2 = cvMat(R2), c_P1 = cvMat(P1), c_P2 = cvMat(P2);
double T_mul_f;
double cx1_min_cx2;
stereoRectify(leftOdo, rightOdo, &c_K1, &c_K2, &c_D1, &c_D2,
image_size1, &c_R, &c_t, &c_R1, &c_R2, &c_P1, &c_P2, &T_mul_f);
cvSize(image_size1.width, image_size1.height), &c_R, &c_t, &c_R1, &c_R2, &c_P1, &c_P2, &T_mul_f,
&cx1_min_cx2);
VLOG(2) << "K1: " << K1 << std::endl;
VLOG(2) << "D1: " << D1 << std::endl;
@@ -313,6 +339,7 @@ std::shared_ptr<struct CameraROSMsgInfoPair> RectifyProcessor::stereoRectify(
info_pair.left = calib_mat_data_left;
info_pair.right = calib_mat_data_right;
info_pair.T_mul_f = T_mul_f;
info_pair.cx1_minus_cx2 = cx1_min_cx2;
for (std::size_t i = 0; i< 3 * 4; i++) {
info_pair.P[i] = calib_mat_data_left.P[i];
}
@@ -330,10 +357,10 @@ std::shared_ptr<struct CameraROSMsgInfoPair> RectifyProcessor::stereoRectify(
return std::make_shared<struct CameraROSMsgInfoPair>(info_pair);
}
camodocal::CameraPtr RectifyProcessor::generateCameraFromIntrinsicsEquidistant(
models::CameraPtr RectifyProcessor::generateCameraFromIntrinsicsEquidistant(
const mynteye::IntrinsicsEquidistant & in) {
camodocal::EquidistantCameraPtr camera(
new camodocal::EquidistantCamera("KANNALA_BRANDT",
models::EquidistantCameraPtr camera(
new models::EquidistantCamera("KANNALA_BRANDT",
in.width,
in.height,
in.coeffs[0],
@@ -354,9 +381,12 @@ void RectifyProcessor::InitParams(
calib_model = CalibrationModel::KANNALA_BRANDT;
in_left.ResizeIntrinsics();
in_right.ResizeIntrinsics();
camodocal::CameraPtr camera_odo_ptr_left =
in_left_cur = in_left;
in_right_cur = in_right;
ex_right_to_left_cur = ex_right_to_left;
models::CameraPtr camera_odo_ptr_left =
generateCameraFromIntrinsicsEquidistant(in_left);
camodocal::CameraPtr camera_odo_ptr_right =
models::CameraPtr camera_odo_ptr_right =
generateCameraFromIntrinsicsEquidistant(in_right);
auto calib_info_tmp = stereoRectify(camera_odo_ptr_left,
camera_odo_ptr_right,
@@ -398,7 +428,8 @@ RectifyProcessor::RectifyProcessor(
std::shared_ptr<Extrinsics> extr,
std::int32_t proc_period)
: Processor(std::move(proc_period)),
calib_model(CalibrationModel::UNKNOW) {
calib_model(CalibrationModel::UNKNOW),
_alpha(-1) {
calib_infos = std::make_shared<struct CameraROSMsgInfoPair>();
InitParams(
*std::dynamic_pointer_cast<IntrinsicsEquidistant>(intr_left),
@@ -428,6 +459,12 @@ Object *RectifyProcessor::OnCreateOutput() {
return new ObjMat2();
}
bool RectifyProcessor::SetRectifyAlpha(float alpha) {
_alpha = alpha;
ReloadImageParams();
return true;
}
bool RectifyProcessor::OnProcess(
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) {

View File

@@ -23,11 +23,13 @@
#include "mynteye/types.h"
#include "mynteye/api/processor.h"
#include "mynteye/device/device.h"
#include <camodocal/camera_models/EquidistantCamera.h>
#include <opencv2/core/eigen.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include "equidistant_camera.h"
#include <opencv2/core/core.hpp>
#include <opencv2/core/eigen.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/highgui/highgui.hpp>
MYNTEYE_BEGIN_NAMESPACE
@@ -50,6 +52,9 @@ class RectifyProcessor : public Processor {
std::shared_ptr<IntrinsicsBase> intr_left,
std::shared_ptr<IntrinsicsBase> intr_right,
std::shared_ptr<Extrinsics> extr);
void ReloadImageParams() {
InitParams(in_left_cur, in_right_cur, ex_right_to_left_cur);
}
cv::Mat R1, P1, R2, P2, Q;
cv::Mat map11, map12, map21, map22;
@@ -57,6 +62,7 @@ class RectifyProcessor : public Processor {
getCameraROSMsgInfoPair() {
return calib_infos;
}
bool SetRectifyAlpha(float alpha);
protected:
Object *OnCreateOutput() override;
@@ -76,13 +82,14 @@ class RectifyProcessor : public Processor {
cv::Mat rectifyrad(const cv::Mat& R);
void stereoRectify(camodocal::CameraPtr leftOdo,
camodocal::CameraPtr rightOdo, const CvMat* K1, const CvMat* K2,
void stereoRectify(models::CameraPtr leftOdo,
models::CameraPtr rightOdo, const CvMat* K1, const CvMat* K2,
const CvMat* D1, const CvMat* D2, CvSize imageSize,
const CvMat* matR, const CvMat* matT,
CvMat* _R1, CvMat* _R2, CvMat* _P1, CvMat* _P2, double* T_mul_f,
double *cx1_min_cx2,
int flags = cv::CALIB_ZERO_DISPARITY, double alpha = -1,
CvSize newImgSize = cv::Size());
CvSize newImgSize = cvSize(0,0));
Eigen::Matrix4d loadT(const mynteye::Extrinsics& in);
void loadCameraMatrix(cv::Mat& K, cv::Mat& D, // NOLINT
@@ -93,17 +100,21 @@ class RectifyProcessor : public Processor {
const mynteye::IntrinsicsEquidistant& in);
std::shared_ptr<struct CameraROSMsgInfoPair> stereoRectify(
camodocal::CameraPtr leftOdo,
camodocal::CameraPtr rightOdo,
models::CameraPtr leftOdo,
models::CameraPtr rightOdo,
mynteye::IntrinsicsEquidistant in_left,
mynteye::IntrinsicsEquidistant in_right,
mynteye::Extrinsics ex_right_to_left);
camodocal::CameraPtr generateCameraFromIntrinsicsEquidistant(
models::CameraPtr generateCameraFromIntrinsicsEquidistant(
const mynteye::IntrinsicsEquidistant & in);
CalibrationModel calib_model;
std::shared_ptr<struct CameraROSMsgInfoPair> calib_infos;
double _alpha;
IntrinsicsEquidistant in_left_cur;
IntrinsicsEquidistant in_right_cur;
Extrinsics ex_right_to_left_cur;
};
MYNTEYE_END_NAMESPACE

View File

@@ -29,7 +29,6 @@
#include "mynteye/api/processor/rectify_processor_ocv.h"
#include "mynteye/api/processor/depth_processor_ocv.h"
#include "mynteye/api/processor/points_processor_ocv.h"
#include "mynteye/api/config.h"
#ifdef WITH_CAM_MODELS
#include "mynteye/api/processor/depth_processor.h"
#include "mynteye/api/processor/points_processor.h"
@@ -50,26 +49,16 @@ MYNTEYE_BEGIN_NAMESPACE
void Synthetic::InitCalibInfo() {
if (calib_model_ == CalibrationModel::PINHOLE) {
LOG(INFO) << "camera calib model: pinhole";
intr_left_ = api_->GetIntrinsicsBase(Stream::LEFT);
intr_right_ = api_->GetIntrinsicsBase(Stream::RIGHT);
extr_ = std::make_shared<Extrinsics>(
api_->GetExtrinsics(Stream::LEFT, Stream::RIGHT));
#ifdef WITH_CAM_MODELS
} else if (calib_model_ == CalibrationModel::KANNALA_BRANDT) {
LOG(INFO) << "camera calib model: kannala_brandt";
intr_left_ = api_->GetIntrinsicsBase(Stream::LEFT);
intr_right_ = api_->GetIntrinsicsBase(Stream::RIGHT);
extr_ = std::make_shared<Extrinsics>(
api_->GetExtrinsics(Stream::LEFT, Stream::RIGHT));
#endif
} else {
calib_default_tag_ = true;
calib_model_ = CalibrationModel::PINHOLE;
LOG(INFO) << "camera calib model: unknow ,use default pinhole data";
intr_left_ = getDefaultIntrinsics();
intr_right_ = getDefaultIntrinsics();
extr_ = getDefaultExtrinsics();
}
intr_left_ = api_->GetIntrinsicsBase(Stream::LEFT);
intr_right_ = api_->GetIntrinsicsBase(Stream::RIGHT);
extr_ = std::make_shared<Extrinsics>(
api_->GetExtrinsics(Stream::RIGHT, Stream::LEFT));
}
Synthetic::Synthetic(API *api, CalibrationModel calib_model)
@@ -102,7 +91,7 @@ void Synthetic::NotifyImageParamsChanged() {
intr_left_ = api_->GetIntrinsicsBase(Stream::LEFT);
intr_right_ = api_->GetIntrinsicsBase(Stream::RIGHT);
extr_ = std::make_shared<Extrinsics>(
api_->GetExtrinsics(Stream::LEFT, Stream::RIGHT));
api_->GetExtrinsics(Stream::RIGHT, Stream::LEFT));
}
auto processor = getProcessorWithStream(Stream::LEFT_RECTIFIED);
@@ -324,10 +313,8 @@ void Synthetic::InitProcessors() {
std::shared_ptr<Processor> rectify_processor = nullptr;
std::shared_ptr<Processor> points_processor = nullptr;
std::shared_ptr<Processor> depth_processor = nullptr;
std::shared_ptr<Processor> disparity_processor = nullptr;
auto &&disparity_processor =
std::make_shared<DisparityProcessor>(DisparityComputingMethod::BM,
DISPARITY_PROC_PERIOD);
auto &&disparitynormalized_processor =
std::make_shared<DisparityNormalizedProcessor>(
DISPARITY_NORM_PROC_PERIOD);
@@ -344,6 +331,10 @@ void Synthetic::InitProcessors() {
points_processor = std::make_shared<PointsProcessorOCV>(
rectify_processor_ocv->Q, POINTS_PROC_PERIOD);
depth_processor = std::make_shared<DepthProcessorOCV>(DEPTH_PROC_PERIOD);
disparity_processor =
std::make_shared<DisparityProcessor>(DisparityComputingMethod::BM,
nullptr,
DISPARITY_PROC_PERIOD);
root_processor->AddChild(rectify_processor);
rectify_processor->AddChild(disparity_processor);
@@ -363,6 +354,10 @@ void Synthetic::InitProcessors() {
depth_processor = std::make_shared<DepthProcessor>(
rectify_processor_imp -> getCameraROSMsgInfoPair(),
DEPTH_PROC_PERIOD);
disparity_processor =
std::make_shared<DisparityProcessor>(DisparityComputingMethod::BM,
rectify_processor_imp -> getCameraROSMsgInfoPair(),
DISPARITY_PROC_PERIOD);
root_processor->AddChild(rectify_processor);
rectify_processor->AddChild(disparity_processor);
@@ -555,7 +550,7 @@ void Synthetic::OnDepthPostProcess(Object *const out) {
}
void Synthetic::SetDisparityComputingMethodType(
const DisparityComputingMethod &MethodType) {
const DisparityComputingMethod &MethodType) {
if (checkControlDateWithStream(Stream::LEFT_RECTIFIED)) {
auto processor = find_processor<DisparityProcessor>(processor_);
if (processor)
@@ -565,6 +560,19 @@ void Synthetic::SetDisparityComputingMethodType(
LOG(ERROR) << "ERROR: no suited processor for disparity computing.";
}
bool Synthetic::SetRectifyAlpha(const double &alpha) {
if (checkControlDateWithStream(Stream::LEFT_RECTIFIED)) {
#ifdef WITH_CAM_MODELS
auto processor = find_processor<RectifyProcessor>(processor_);
if (processor)
processor->SetRectifyAlpha(alpha);
return true;
#endif
}
LOG(ERROR) << "ERROR: no suited processor for rectify.";
return false;
}
void Synthetic::NotifyStreamData(
const Stream &stream, const api::StreamData &data) {
if (stream_data_listener_) {

View File

@@ -22,7 +22,6 @@
#include <mutex>
#include "mynteye/api/api.h"
#include "mynteye/api/config.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -95,6 +94,7 @@ class Synthetic {
const DisparityComputingMethod &MethoType);
std::shared_ptr<struct CameraROSMsgInfoPair> GetCameraROSMsgInfoPair();
bool ConfigDisparityFromFile(const std::string& config_file);
bool SetRectifyAlpha(const double &alpha);
private:
void InitCalibInfo();

View File

@@ -96,6 +96,9 @@ int XuHalfDuplexId(Option option) {
case Option::ERASE_CHIP:
return 1;
break;
case Option::SYNC_TIMESTAMP:
return 3;
break;
default:
LOG(FATAL) << "No half duplex id for " << option;
}
@@ -206,6 +209,9 @@ std::int32_t Channels::GetControlValue(const Option &option) const {
case Option::ERASE_CHIP:
LOG(WARNING) << option << " get value useless";
return -1;
case Option::SYNC_TIMESTAMP:
LOG(WARNING) << option << " get value useless";
return -1;
default:
LOG(ERROR) << "Unsupported option " << option;
}
@@ -292,11 +298,49 @@ void Channels::SetControlValue(const Option &option, std::int32_t value) {
case Option::ERASE_CHIP:
LOG(WARNING) << option << " set value useless";
break;
case Option::SYNC_TIMESTAMP:
XuCamCtrlSet(option, value);
break;
default:
LOG(ERROR) << "Unsupported option " << option;
}
}
bool Channels::SetControlValue(const Option &option, std::uint64_t value) {
switch (option) {
case Option::GAIN:
case Option::BRIGHTNESS:
case Option::CONTRAST:
case Option::FRAME_RATE:
case Option::IMU_FREQUENCY:
case Option::ACCELEROMETER_RANGE:
case Option::GYROSCOPE_RANGE:
case Option::ACCELEROMETER_LOW_PASS_FILTER:
case Option::GYROSCOPE_LOW_PASS_FILTER:
case Option::EXPOSURE_MODE:
case Option::MAX_GAIN:
case Option::MAX_EXPOSURE_TIME:
case Option::DESIRED_BRIGHTNESS:
case Option::IR_CONTROL:
case Option::HDR_MODE:
case Option::MIN_EXPOSURE_TIME:
case Option::IIC_ADDRESS_SETTING:
case Option::ZERO_DRIFT_CALIBRATION:
LOG(WARNING) << option << " refer to function SetControlValue(const Option &option, std::int32_t value)";
break;
case Option::ERASE_CHIP:
LOG(WARNING) << option << " set value useless";
break;
case Option::SYNC_TIMESTAMP:
return XuHalfDuplexSet(option, value);
break;
default:
LOG(ERROR) << "Unsupported option " << option;
}
return false;
}
bool Channels::RunControlAction(const Option &option) const {
switch (option) {
case Option::ZERO_DRIFT_CALIBRATION:
@@ -675,6 +719,29 @@ bool Channels::XuHalfDuplexSet(Option option, xu_cmd_t cmd) const {
}
}
bool Channels::XuHalfDuplexSet(Option option, std::uint64_t value) const {
int id = XuHalfDuplexId(option);
std::uint8_t data[20] = {static_cast<std::uint8_t>(id & 0xFF),
static_cast<std::uint8_t>(value & 0xFF),
static_cast<std::uint8_t>((value >> 8) & 0xFF),
static_cast<std::uint8_t>((value >> 16) & 0xFF),
static_cast<std::uint8_t>((value >> 24) & 0xFF),
static_cast<std::uint8_t>((value >> 32) & 0xFF),
static_cast<std::uint8_t>((value >> 40) & 0xFF),
static_cast<std::uint8_t>((value >> 48) & 0xFF),
static_cast<std::uint8_t>((value >> 56) & 0xFF)};
if (XuControlQuery(CHANNEL_HALF_DUPLEX, uvc::XU_QUERY_SET, 20, data)) {
VLOG(2) << "XuHalfDuplexSet value (0x" << std::hex << std::uppercase << value
<< ") of " << option << " success";
return true;
} else {
LOG(WARNING) << "XuHalfDuplexSet value (0x" << std::hex << std::uppercase
<< value << ") of " << option << " failed";
return false;
}
}
bool Channels::XuImuWrite(const ImuReqPacket &req) const {
auto &&data = req.to_data();
if (XuControlQuery(

View File

@@ -50,6 +50,7 @@ class MYNTEYE_API Channels {
typedef enum XuCmd {
XU_CMD_ZDC = 0xE6, // zero drift calibration
XU_CMD_ERASE = 0xDE, // erase chip
XU_SYNC_TIMESTAMP = 0x200, // sync timestamp
XU_CMD_LAST
} xu_cmd_t;
@@ -72,6 +73,7 @@ class MYNTEYE_API Channels {
std::int32_t GetControlValue(const Option &option) const;
void SetControlValue(const Option &option, std::int32_t value);
bool SetControlValue(const Option &option, std::uint64_t value);
bool RunControlAction(const Option &option) const;
@@ -110,6 +112,7 @@ class MYNTEYE_API Channels {
void XuCamCtrlSet(Option option, std::int32_t value) const;
bool XuHalfDuplexSet(Option option, xu_cmd_t cmd) const;
bool XuHalfDuplexSet(Option option, std::uint64_t value) const;
bool XuImuWrite(const ImuReqPacket &req) const;
bool XuImuRead(ImuResPacket *res) const;

View File

@@ -18,13 +18,15 @@ MYNTEYE_BEGIN_NAMESPACE
const std::map<Model, StreamSupports> stream_supports_map = {
{Model::STANDARD, {Stream::LEFT, Stream::RIGHT}},
{Model::STANDARD2, {Stream::LEFT, Stream::RIGHT}},
{Model::STANDARD210A, {Stream::LEFT, Stream::RIGHT}}
{Model::STANDARD210A, {Stream::LEFT, Stream::RIGHT}},
{Model::STANDARD200B, {Stream::LEFT, Stream::RIGHT}},
};
const std::map<Model, CapabilitiesSupports> capabilities_supports_map = {
{Model::STANDARD, {Capabilities::STEREO, Capabilities::IMU}},
{Model::STANDARD2, {Capabilities::STEREO_COLOR, Capabilities::IMU}},
{Model::STANDARD210A, {Capabilities::STEREO_COLOR, Capabilities::IMU}}
{Model::STANDARD210A, {Capabilities::STEREO_COLOR, Capabilities::IMU}},
{Model::STANDARD200B, {Capabilities::STEREO_COLOR, Capabilities::IMU}}
};
const std::map<Model, OptionSupports> option_supports_map = {
@@ -42,8 +44,7 @@ const std::map<Model, OptionSupports> option_supports_map = {
{Model::STANDARD2, {
Option::BRIGHTNESS,
Option::EXPOSURE_MODE, Option::MAX_GAIN, Option::MAX_EXPOSURE_TIME,
Option::IR_CONTROL, Option::MIN_EXPOSURE_TIME,
Option::DESIRED_BRIGHTNESS, Option::ACCELEROMETER_RANGE,
Option::MIN_EXPOSURE_TIME, Option::DESIRED_BRIGHTNESS, Option::ACCELEROMETER_RANGE,
Option::GYROSCOPE_RANGE, Option::ACCELEROMETER_LOW_PASS_FILTER,
Option::GYROSCOPE_LOW_PASS_FILTER, Option::IIC_ADDRESS_SETTING,
Option::ERASE_CHIP}
@@ -55,7 +56,14 @@ const std::map<Model, OptionSupports> option_supports_map = {
Option::ACCELEROMETER_RANGE, Option::GYROSCOPE_RANGE,
Option::ACCELEROMETER_LOW_PASS_FILTER, Option::GYROSCOPE_LOW_PASS_FILTER,
Option::IIC_ADDRESS_SETTING, Option::ERASE_CHIP}
}
},
{Model::STANDARD200B, {
Option::BRIGHTNESS,
Option::EXPOSURE_MODE, Option::MAX_GAIN, Option::MAX_EXPOSURE_TIME,
Option::MIN_EXPOSURE_TIME, Option::DESIRED_BRIGHTNESS, Option::ACCELEROMETER_RANGE,
Option::GYROSCOPE_RANGE, Option::ACCELEROMETER_LOW_PASS_FILTER,
Option::GYROSCOPE_LOW_PASS_FILTER, Option::ERASE_CHIP, Option::SYNC_TIMESTAMP}
},
};
const std::map<Model, std::map<Capabilities, StreamRequests>>
@@ -87,7 +95,94 @@ stream_requests_map = {
{2560, 800, Format::BGR888, 20},
{2560, 800, Format::BGR888, 30}}
}}
}
},
{Model::STANDARD200B,
{{Capabilities::STEREO_COLOR, {
{1280, 400, Format::YUYV, 10},
{1280, 400, Format::YUYV, 20},
{1280, 400, Format::YUYV, 30},
{1280, 400, Format::YUYV, 60},
{2560, 800, Format::YUYV, 10},
{2560, 800, Format::YUYV, 20},
{2560, 800, Format::YUYV, 30}}
}}
},
};
/**
* default intrinsics
*/
std::shared_ptr<IntrinsicsBase> getDefaultIntrinsics() {
auto res = std::make_shared<IntrinsicsPinhole>();
res->width = 640;
res->height = 400;
res->model = 0;
res->fx = 3.6220059643202876e+02;
res->fy = 3.6350065250745848e+02;
res->cx = 4.0658699068023441e+02;
res->cy = 2.3435161110061483e+02;
double codffs[5] = {
-2.5034765682756088e-01,
5.0579399202897619e-02,
-7.0536676161976066e-04,
-8.5255451307033846e-03,
0.
};
for (unsigned int i = 0; i < 5; i++) {
res->coeffs[i] = codffs[i];
}
return res;
}
std::shared_ptr<IntrinsicsBase> getDefaultIntrinsics(const Resolution &resolution) {
auto res = getDefaultIntrinsics();
res->resize_scale = static_cast<double>(resolution.width / res->width);
res->ResizeIntrinsics();
return res;
}
std::shared_ptr<Extrinsics> getDefaultExtrinsics() {
auto res = std::make_shared<Extrinsics>();
double rotation[9] = {
9.9867908939669447e-01, -6.3445566137485428e-03, 5.0988459509619687e-02,
5.9890316389333252e-03, 9.9995670037792639e-01, 7.1224201868366971e-03,
-5.1031440326695092e-02, -6.8076406092671274e-03, 9.9867384471984544e-01
};
double translation[3] = {-1.2002489764113250e+02, -1.1782637409050747e+00,
-5.2058205159996538e+00};
for (unsigned int i = 0; i < 3; i++) {
for (unsigned int j = 0; j < 3; j++) {
res->rotation[i][j] = rotation[i*3 + j];
}
}
for (unsigned int i = 0; i < 3; i++) {
res->translation[i] = translation[i];
}
return res;
}
// sgbm_matcher = cv::StereoSGBM::create(0, 16, 3);
// sgbm_matcher->setPreFilterCap(63);
// sgbm_matcher->setBlockSize(sgbmWinSize);
// sgbm_matcher->setP1(8 * sgbmWinSize * sgbmWinSize);
// sgbm_matcher->setP2(32 * sgbmWinSize * sgbmWinSize);
// sgbm_matcher->setMinDisparity(0);
// sgbm_matcher->setNumDisparities(numberOfDisparities);
// sgbm_matcher->setUniquenessRatio(10);
// sgbm_matcher->setSpeckleWindowSize(100);
// sgbm_matcher->setSpeckleRange(32);
// sgbm_matcher->setDisp12MaxDiff(1);
// bm_matcher = cv::StereoBM::create(0, 3);
// bm_matcher->setPreFilterSize(9);
// bm_matcher->setPreFilterCap(31);
// bm_matcher->setBlockSize(15);
// bm_matcher->setMinDisparity(0);
// bm_matcher->setNumDisparities(64);
// bm_matcher->setUniquenessRatio(60);
// bm_matcher->setTextureThreshold(10);
// bm_matcher->setSpeckleWindowSize(100);
// bm_matcher->setSpeckleRange(4);
MYNTEYE_END_NAMESPACE

View File

@@ -18,6 +18,7 @@
#include <map>
#include <set>
#include <vector>
#include <memory>
#include "mynteye/mynteye.h"
#include "mynteye/types.h"
@@ -37,6 +38,14 @@ using StreamRequests = std::vector<StreamRequest>;
extern const std::map<Model, std::map<Capabilities, StreamRequests>>
stream_requests_map;
const std::vector<Resolution> resolution_list = {{640, 400},
{1280, 800}};
std::shared_ptr<IntrinsicsBase> getDefaultIntrinsics();
std::shared_ptr<IntrinsicsBase> getDefaultIntrinsics(const Resolution &resolution);
std::shared_ptr<Extrinsics> getDefaultExtrinsics();
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_DEVICE_CONFIG_H_

View File

@@ -89,7 +89,8 @@ Device::Device(const Model &model,
device_(device),
streams_(std::make_shared<Streams>(streams_adapter)),
channels_(std::make_shared<Channels>(device_, channels_adapter)),
motions_(std::make_shared<Motions>(channels_)) {
motions_(std::make_shared<Motions>(channels_)),
is_default_intrinsics_(false) {
VLOG(2) << __func__;
ReadAllInfos();
}
@@ -110,12 +111,23 @@ std::shared_ptr<Device> Device::Create(
if (model.generation == '1') {
return std::make_shared<StandardDevice>(device);
} else if (model.generation == '2') {
if (model.custom_code == '0') {
return std::make_shared<Standard2Device>(Model::STANDARD2, device);
} else if (model.custom_code == 'A') {
return std::make_shared<Standard2Device>(Model::STANDARD210A, device);
if (model.baseline_code == '1') {
if (model.custom_code == '0') {
return std::make_shared<Standard2Device>(Model::STANDARD2, device);
} else if (model.custom_code == 'A') {
return std::make_shared<Standard2Device>(
Model::STANDARD210A, device);
} else {
LOG(FATAL) << "No such custom code now";
}
} else if (model.baseline_code == '0') {
if (model.custom_code == 'B') {
return std::make_shared<Standard2Device>(Model::STANDARD200B, device);
} else {
LOG(FATAL) << "No such custom code now";
}
} else {
LOG(FATAL) << "No such custom code now";
LOG(FATAL) << "No such baseline now";
}
} else {
LOG(FATAL) << "No such generation now";
@@ -369,6 +381,14 @@ void Device::SetOptionValue(const Option &option, std::int32_t value) {
channels_->SetControlValue(option, value);
}
bool Device::SetOptionValue(const Option &option, std::uint64_t value) {
if (!Supports(option)) {
LOG(WARNING) << "Unsupported option: " << option;
return false;
}
return channels_->SetControlValue(option, value);
}
bool Device::RunOptionAction(const Option &option) const {
if (!Supports(option)) {
LOG(WARNING) << "Unsupported option: " << option;
@@ -612,24 +632,38 @@ void Device::ReadAllInfos() {
motions_->SetDeviceInfo(device_info_);
bool img_params_ok = false;
if (all_img_params_.empty()) {
is_default_intrinsics_ = true;
LOG(ERROR) << "Image params not found, but we need it to process the "
"images. Please `make tools` and use `img_params_writer` "
"to write the image params. If you update the SDK from "
"1.x, the `SN*.conf` is the file contains them. Besides, "
"you could also calibrate them by yourself. Read the guide "
"doc (https://github.com/slightech/MYNT-EYE-SDK-2-Guide) "
"to learn more.";
LOG(WARNING) << "Intrinsics & extrinsics not exist. Use default intrinsics.";
LOG(INFO) << "camera calib model: unknow, use default pinhole data";
auto spec_string = device_info_->spec_version.to_string();
for (auto &&resolution : resolution_list) {
all_img_params_[resolution] = {
true, spec_string, getDefaultIntrinsics(resolution),
getDefaultIntrinsics(resolution), *getDefaultExtrinsics()};
}
}
for (auto &&params : all_img_params_) {
auto &&img_params = params.second;
if (img_params.ok) {
img_params_ok = true;
SetIntrinsics(Stream::LEFT, img_params.in_left);
SetIntrinsics(Stream::RIGHT, img_params.in_right);
SetExtrinsics(Stream::RIGHT, Stream::LEFT, img_params.ex_right_to_left);
VLOG(2) << "Intrinsics left: {" << *GetIntrinsics(Stream::LEFT) << "}";
VLOG(2) << "Intrinsics right: {" << *GetIntrinsics(Stream::RIGHT) << "}";
VLOG(2) << "Extrinsics left to right: {"
<< GetExtrinsics(Stream::LEFT, Stream::RIGHT) << "}";
<< GetExtrinsics(Stream::RIGHT, Stream::LEFT) << "}";
break;
}
}
if (!img_params_ok) {
LOG(WARNING) << "Intrinsics & extrinsics not exist";
}
if (imu_params.ok) {
imu_params_ = imu_params;
@@ -675,11 +709,11 @@ void Device::UpdateStreamIntrinsics(
if (ok) {
SetIntrinsics(Stream::LEFT, img_params.in_left);
SetIntrinsics(Stream::RIGHT, img_params.in_right);
SetExtrinsics(Stream::LEFT, Stream::RIGHT, img_params.ex_right_to_left);
SetExtrinsics(Stream::RIGHT, Stream::LEFT, img_params.ex_right_to_left);
VLOG(2) << "Intrinsics left: {" << *GetIntrinsics(Stream::LEFT) << "}";
VLOG(2) << "Intrinsics right: {" << *GetIntrinsics(Stream::RIGHT) << "}";
VLOG(2) << "Extrinsics left to right: {"
<< GetExtrinsics(Stream::LEFT, Stream::RIGHT) << "}";
<< GetExtrinsics(Stream::RIGHT, Stream::LEFT) << "}";
break;
}
}
@@ -726,4 +760,8 @@ void Device::EnableProcessMode(const std::int32_t& mode) {
motions_->EnableProcessMode(mode);
}
bool Device::CheckImageParams() {
return is_default_intrinsics_;
}
MYNTEYE_END_NAMESPACE

View File

@@ -73,7 +73,12 @@ void unpack_imu_packet(const std::uint8_t *data, ImuPacket *pkg) {
unpack_imu_segment(ImuData(data + data_n * i), &seg);
pkg->segments.push_back(seg);
}
pkg->serial_number = pkg->segments.back().frame_id;
if (pkg->count) {
pkg->serial_number = pkg->segments.back().frame_id;
} else {
LOG(ERROR) << "The imu data pipeline lost more than 5 samples continuously, "
<< "please check the device and firmware";
}
}
void unpack_imu_res_packet(const std::uint8_t *data, ImuResPacket *res) {

View File

@@ -26,7 +26,8 @@ Standard2Device::Standard2Device(const Model &model,
std::make_shared<Standard2StreamsAdapter>(model),
std::make_shared<Standard2ChannelsAdapter>(model)) {
VLOG(2) << __func__;
CHECK(model == Model::STANDARD2 || model == Model::STANDARD210A);
CHECK(model == Model::STANDARD2 || model == Model::STANDARD210A ||
model == Model::STANDARD200B);
}
Standard2Device::~Standard2Device() {

View File

@@ -227,6 +227,7 @@ Standard2StreamsAdapter::GetUnpackImgPixelsMap() {
{Stream::RIGHT, s210a::unpack_right_img_pixels}
};
case Model::STANDARD2:
case Model::STANDARD200B:
default:
return {
{Stream::LEFT, unpack_left_img_pixels},

View File

@@ -31,6 +31,7 @@ const char *to_string(const Model &value) {
CASE(STANDARD)
CASE(STANDARD2)
CASE(STANDARD210A)
CASE(STANDARD200B)
default:
CHECK(is_valid(value));
return "Model::UNKNOWN";
@@ -125,6 +126,7 @@ const char *to_string(const Option &value) {
CASE(IIC_ADDRESS_SETTING)
CASE(ZERO_DRIFT_CALIBRATION)
CASE(ERASE_CHIP)
CASE(SYNC_TIMESTAMP)
default:
CHECK(is_valid(value));
return "Option::UNKNOWN";
@@ -188,8 +190,13 @@ std::size_t bytes_per_pixel(const Format &value) {
}
std::ostream &operator<<(std::ostream &os, const StreamRequest &request) {
return os << "width: " << request.width << ", height: " << request.height
<< ", format: " << request.format << ", fps: " << request.fps;
if (request.fps == 0) {
return os << "width: " << request.width << ", height: " << request.height
<< ", format: " << request.format;
} else {
return os << "width: " << request.width << ", height: " << request.height
<< ", format: " << request.format << ", fps: " << request.fps;
}
}
const char *to_string(const CalibrationModel &model) {
@@ -313,13 +320,14 @@ std::ostream &operator<<(std::ostream &os, const Extrinsics &ex) {
}
std::ostream &operator<<(std::ostream &os, const OptionInfo &info) {
return os << "min: " << info.min << ", max: " << info.max
return os << FULL_PRECISION << "min: " << info.min << ", max: " << info.max
<< ", def: " << info.def;
}
std::ostream &operator<<(std::ostream &os, const CameraROSMsgInfo &info) {
os << "width: " << info.width << ", height: " << info.height << std::endl
<< "distortion_model: " << info.distortion_model;
os << FULL_PRECISION << "width: " << info.width << ", height: "
<< info.height << std::endl << "distortion_model: "
<< info.distortion_model;
os << std::endl << "D: ";
for (size_t i = 0; i < 5; i++)
os << info.D[i] << ",";

View File

@@ -197,6 +197,7 @@ struct device {
}
}
} else {
throw_error() << dev_name + " is no video capture device";
} // Errors ignored
}
@@ -474,7 +475,8 @@ std::vector<std::shared_ptr<device>> query_devices(
}
try {
devices.push_back(std::make_shared<device>(context, name));
auto one_device = std::make_shared<device>(context, name);
devices.push_back(one_device);
} catch (const std::exception &e) {
VLOG(2) << "Not a USB video device: " << e.what();
}

View File

@@ -75,6 +75,7 @@ TEST(Option, VerifyToString) {
"Option::ZERO_DRIFT_CALIBRATION",
to_string(Option::ZERO_DRIFT_CALIBRATION));
EXPECT_STREQ("Option::ERASE_CHIP", to_string(Option::ERASE_CHIP));
EXPECT_STREQ("Option::SYNC_TIMESTAMP", to_string(Option::SYNC_TIMESTAMP));
}
TEST(Source, VerifyToString) {

View File

@@ -14,6 +14,8 @@ enum class Model : int {
STANDARD2,
/** Standard 210a */
STANDARD210A,
/** Standard 200b */
STANDARD200B,
};
} // namespace mynteye_jni

View File

@@ -69,8 +69,8 @@ enum class Option : int {
IR_CONTROL,
/**
* HDR mode
* 0: 10-bit
* 1: 12-bit
* 0: normal
* 1: WDR
*/
HDR_MODE,
/**
@@ -104,6 +104,8 @@ enum class Option : int {
ZERO_DRIFT_CALIBRATION,
/** Erase chip */
ERASE_CHIP,
/** Sync timestamp */
SYNC_TIMESTAMP,
};
} // namespace mynteye_jni

View File

@@ -64,6 +64,7 @@ RawModel from_jni(const JniModel& model) {
case JniModel::STANDARD: return RawModel::STANDARD;
case JniModel::STANDARD2: return RawModel::STANDARD2;
case JniModel::STANDARD210A: return RawModel::STANDARD210A;
case JniModel::STANDARD200B: return RawModel::STANDARD200B;
default:
LOG(FATAL) << "Model is unknown";
}
@@ -75,6 +76,7 @@ JniModel to_jni(const RawModel& model) {
case RawModel::STANDARD: return JniModel::STANDARD;
case RawModel::STANDARD2: return JniModel::STANDARD2;
case RawModel::STANDARD210A: return JniModel::STANDARD210A;
case RawModel::STANDARD200B: return JniModel::STANDARD200B;
default:
LOG(FATAL) << "Model is unknown";
}
@@ -323,8 +325,8 @@ JniOption to_jni(const RawOption& Option) {
return JniOption::ACCELEROMETER_LOW_PASS_FILTER;
case RawOption::GYROSCOPE_LOW_PASS_FILTER:
return JniOption::GYROSCOPE_LOW_PASS_FILTER;
case JniOption::IIC_ADDRESS_SETTING:
return RawOption::IIC_ADDRESS_SETTING;
case RawOption::IIC_ADDRESS_SETTING:
return JniOption::IIC_ADDRESS_SETTING;
case RawOption::ZERO_DRIFT_CALIBRATION:
return JniOption::ZERO_DRIFT_CALIBRATION;
case RawOption::ERASE_CHIP:

View File

@@ -14,5 +14,7 @@ public enum Model {
STANDARD2,
/** Standard 210a */
STANDARD210A,
/** Standard 200b */
STANDARD200B,
;
}

View File

@@ -69,8 +69,8 @@ public enum Option {
IR_CONTROL,
/**
* HDR mode
* 0: 10-bit
* 1: 12-bit
* 0: normal
* 1: WDR
*/
HDR_MODE,
/**

View File

@@ -27,6 +27,8 @@ model = enum {
standard2;
# Standard 210a
standard210a;
# Standard 200b
standard200B;
}
# Formats define how each stream can be encoded
@@ -159,8 +161,8 @@ option = enum {
# range: [0,160], default: 0
ir_control;
# HDR mode
# 0: 10-bit
# 1: 12-bit
# 0: normal
# 1: WDR
hdr_mode;
# The range of accelerometer

View File

@@ -1,5 +1,5 @@
# standard/gain range: [0,48]
sstandard/gain: -1
standard/gain: -1
# standard/gain: 24
# standard/brightness range: [0,240]
@@ -8,7 +8,7 @@ standard/brightness: -1
# contrast range: [0,255]
standard/contrast: -1
# standard/contrast: 127
# standard/contrast: 116
# standard/frame_rate range: {10,15,20,25,30,35,40,45,50,55,60}
standard/frame_rate: -1
@@ -38,7 +38,7 @@ standard/desired_brightness: -1
standard/ir_control: 80
# standard/ir_control: 0
# standard/hdr_mode, 0: 10-bit, 1: 12-bit
# standard/hdr_mode, 0: normal, 1: WDR
standard/hdr_mode: -1
# standard/hdr_mode: 0
@@ -55,4 +55,4 @@ standard/gyro_range: -1
# MYNTEYE-S1030, Reslution: 376x240, Format: YUYV
# index_s_1: 1
standard/request_index: 0
standard/request_index: 0

View File

@@ -19,15 +19,15 @@
standard2/request_index: 2
# MYNTEYE-S2100/S2000/S210A/imu_process_mode range: [0,3]
# MYNTEYE-S2100/S2000/S210A/S200B imu_process_mode range: [0,3]
# 0 - none process, 1 - temperature process, 2 - scale and assembly process, 3 - both
standard2/imu_process_mode: 2
# device options of standard2, -1 will not set the value
# standard2/brightness range: [0,240]
# standard2/brightness range: [1,255]
standard2/brightness: -1
# standard2/brightness: 120
# standard2/brightness: 70
# standard2/exposure_mode, 0: auto-exposure, 1: manual-exposure
standard2/exposure_mode: -1
@@ -37,7 +37,7 @@ standard2/exposure_mode: -1
standard2/max_gain: -1
# standard2/max_gain: 8
# standard2/max_exposure_time range: [0,1000]
# standard2/max_exposure_time range: [0,655]
standard2/max_exposure_time: -1
# standard2/max_exposure_time: 333
@@ -49,10 +49,6 @@ standard2/desired_brightness: -1
standard2/min_exposure_time: -1
# standard2/min_exposure_time: 0
# standard2/ir_control range: [0,160]
standard2/ir_control: 80
# standard2/ir_control: 0
# standard2/accel_range range: [6,48]
standard2/accel_range: -1
# standard2/accel_range: 6
@@ -71,9 +67,9 @@ standard2/gyro_low_filter: -1
# device options of standard210a, -1 will not set the value
# standard210a/brightness range: [0,240]
# standard210a/brightness range: [1,255]
standard210a/brightness: -1
# standard210a/brightness: 120
# standard210a/brightness: 70
# standard210a/exposure_mode, 0: auto-exposure, 1: manual-exposure
standard210a/exposure_mode: -1
@@ -83,7 +79,7 @@ standard210a/exposure_mode: -1
standard210a/max_gain: -1
# standard210a/max_gain: 8
# standard210a/max_exposure_time range: [0,1000]
# standard210a/max_exposure_time range: [0,655]
standard210a/max_exposure_time: -1
# standard210a/max_exposure_time: 333
@@ -114,3 +110,45 @@ standard210a/gyro_low_filter: -1
# standard210a/iic_address_setting range: [0,127]
standard210a/iic_address_setting: -1
# standard210a/iic_address_setting: 0x01
# device options of standard200b, -1 will not set the value
# standard200b/brightness range: [1,255]
standard200b/brightness: -1
# standard200b/brightness: 70
# standard200b/exposure_mode, 0: auto-exposure, 1: manual-exposure
standard200b/exposure_mode: -1
# standard200b/exposure_mode: 0
# standard200b/max_gain range: [0,255]
standard200b/max_gain: -1
# standard200b/max_gain: 8
# standard200b/max_exposure_time range: [0,655]
standard200b/max_exposure_time: -1
# standard200b/max_exposure_time: 333
# standard200b/desired_brightness range: [1,255]
standard200b/desired_brightness: -1
# standard200b/desired_brightness: 122
# standard200b/min_exposure_time range: [0,1000]
standard200b/min_exposure_time: -1
# standard200b/min_exposure_time: 0
# standard200b/accel_range range: [6,48]
standard200b/accel_range: -1
# standard200b/accel_range: 6
# standard200b/gyro_range range: [250,4000]
standard200b/gyro_range: -1
# standard200b/gyro_range: 1000
# standard200b/accel_low_filter range: [0,2]
standard200b/accel_low_filter: -1
# standard200b/accel_low_filter: 2
# standard200b/gyro_low_filter range: [23,64]
standard200b/gyro_low_filter: -1
# standard200b/gyro_low_filter: 64

View File

@@ -38,7 +38,7 @@ standard/desired_brightness: -1
standard/ir_control: 80
# standard/ir_control: 0
# standard/hdr_mode, 0: 10-bit, 1: 12-bit
# standard/hdr_mode, 0: normal, 1: WDR
standard/hdr_mode: -1
# standard/hdr_mode: 0
@@ -55,4 +55,4 @@ standard/gyro_range: -1
# MYNTEYE-S1030, Reslution: 376x240, Format: YUYV
# index_s_1: 1
standard/request_index: 0
standard/request_index: 0

View File

@@ -19,15 +19,15 @@
standard2/request_index: 2
# MYNTEYE-S2100/S2000/S210A/imu_process_mode range: [0,3]
# MYNTEYE-S2100/S2000/S210A/S200B imu_process_mode range: [0,3]
# 0 - none process, 1 - temperature process, 2 - scale and assembly process, 3 - both
standard2/imu_process_mode: 0
standard2/imu_process_mode: 2
# device options of standard2, -1 will not set the value
# standard2/brightness range: [0,240]
# standard2/brightness range: [1,255]
standard2/brightness: -1
# standard2/brightness: 120
# standard2/brightness: 70
# standard2/exposure_mode, 0: auto-exposure, 1: manual-exposure
standard2/exposure_mode: -1
@@ -49,10 +49,6 @@ standard2/desired_brightness: -1
standard2/min_exposure_time: -1
# standard2/min_exposure_time: 0
# standard2/ir_control range: [0,160]
standard2/ir_control: 80
# standard2/ir_control: 0
# standard2/accel_range range: [6,48]
standard2/accel_range: -1
# standard2/accel_range: 6
@@ -71,9 +67,9 @@ standard2/gyro_low_filter: -1
# device options of standard210a, -1 will not set the value
# standard210a/brightness range: [0,240]
# standard210a/brightness range: [1,255]
standard210a/brightness: -1
# standard210a/brightness: 120
# standard210a/brightness: 70
# standard210a/exposure_mode, 0: auto-exposure, 1: manual-exposure
standard210a/exposure_mode: -1
@@ -114,3 +110,45 @@ standard210a/gyro_low_filter: -1
# standard210a/iic_address_setting range: [0,127]
standard210a/iic_address_setting: -1
# standard210a/iic_address_setting: 0x01
# device options of standard200b, -1 will not set the value
# standard200b/brightness range: [1,255]
standard200b/brightness: -1
# standard200b/brightness: 70
# standard200b/exposure_mode, 0: auto-exposure, 1: manual-exposure
standard200b/exposure_mode: -1
# standard200b/exposure_mode: 0
# standard200b/max_gain range: [0,255]
standard200b/max_gain: -1
# standard200b/max_gain: 8
# standard200b/max_exposure_time range: [0,1000]
standard200b/max_exposure_time: -1
# standard200b/max_exposure_time: 333
# standard200b/desired_brightness range: [1,255]
standard200b/desired_brightness: -1
# standard200b/desired_brightness: 122
# standard200b/min_exposure_time range: [0,1000]
standard200b/min_exposure_time: -1
# standard200b/min_exposure_time: 0
# standard200b/accel_range range: [6,48]
standard200b/accel_range: -1
# standard200b/accel_range: 6
# standard200b/gyro_range range: [250,4000]
standard200b/gyro_range: -1
# standard200b/gyro_range: 1000
# standard200b/accel_low_filter range: [0,2]
standard200b/accel_low_filter: -1
# standard200b/accel_low_filter: 2
# standard200b/gyro_low_filter range: [23,64]
standard200b/gyro_low_filter: -1
# standard200b/gyro_low_filter: 64

View File

@@ -38,7 +38,7 @@ standard/desired_brightness: -1
standard/ir_control: 80
# standard/ir_control: 0
# standard/hdr_mode, 0: 10-bit, 1: 12-bit
# standard/hdr_mode, 0: normal, 1: WDR
standard/hdr_mode: -1
# standard/hdr_mode: 0
@@ -55,4 +55,4 @@ standard/gyro_range: -1
# MYNTEYE-S1030, Reslution: 376x240, Format: YUYV
# index_s_1: 1
standard/request_index: 0
standard/request_index: 0

View File

@@ -19,15 +19,15 @@
standard2/request_index: 2
# MYNTEYE-S2100/S2000/S210A/imu_process_mode range: [0,3]
# MYNTEYE-S2100/S2000/S210A/S200B imu_process_mode range: [0,3]
# 0 - none process, 1 - temperature process, 2 - scale and assembly process, 3 - both
standard2/imu_process_mode: 0
standard2/imu_process_mode: 2
# device options of standard2, -1 will not set the value
# standard2/brightness range: [0,240]
# standard2/brightness range: [1,255]
standard2/brightness: -1
# standard2/brightness: 120
# standard2/brightness: 70
# standard2/exposure_mode, 0: auto-exposure, 1: manual-exposure
standard2/exposure_mode: -1
@@ -49,10 +49,6 @@ standard2/desired_brightness: -1
standard2/min_exposure_time: -1
# standard2/min_exposure_time: 0
# standard2/ir_control range: [0,160]
standard2/ir_control: 80
# standard2/ir_control: 0
# standard2/accel_range range: [6,48]
standard2/accel_range: -1
# standard2/accel_range: 6
@@ -71,9 +67,9 @@ standard2/gyro_low_filter: -1
# device options of standard210a, -1 will not set the value
# standard210a/brightness range: [0,240]
# standard210a/brightness range: [1,255]
standard210a/brightness: -1
# standard210a/brightness: 120
# standard210a/brightness: 70
# standard210a/exposure_mode, 0: auto-exposure, 1: manual-exposure
standard210a/exposure_mode: -1
@@ -114,3 +110,45 @@ standard210a/gyro_low_filter: -1
# standard210a/iic_address_setting range: [0,127]
standard210a/iic_address_setting: -1
# standard210a/iic_address_setting: 0x01
# device options of standard200b, -1 will not set the value
# standard200b/brightness range: [1,255]
standard200b/brightness: -1
# standard200b/brightness: 70
# standard200b/exposure_mode, 0: auto-exposure, 1: manual-exposure
standard200b/exposure_mode: -1
# standard200b/exposure_mode: 0
# standard200b/max_gain range: [0,255]
standard200b/max_gain: -1
# standard200b/max_gain: 8
# standard200b/max_exposure_time range: [0,1000]
standard200b/max_exposure_time: -1
# standard200b/max_exposure_time: 333
# standard200b/desired_brightness range: [1,255]
standard200b/desired_brightness: -1
# standard200b/desired_brightness: 122
# standard200b/min_exposure_time range: [0,1000]
standard200b/min_exposure_time: -1
# standard200b/min_exposure_time: 0
# standard200b/accel_range range: [6,48]
standard200b/accel_range: -1
# standard200b/accel_range: 6
# standard200b/gyro_range range: [250,4000]
standard200b/gyro_range: -1
# standard200b/gyro_range: 1000
# standard200b/accel_low_filter range: [0,2]
standard200b/accel_low_filter: -1
# standard200b/accel_low_filter: 2
# standard200b/gyro_low_filter range: [23,64]
standard200b/gyro_low_filter: -1
# standard200b/gyro_low_filter: 64

View File

@@ -53,7 +53,7 @@
<!-- node params -->
<param name="is_multiple" value="$(arg is_multiple)" />
<param name="serial_number" value="$(arg serial_number)" />
<param name="serial_number" type="string" value="$(arg serial_number)" />
<param name="depth_type" value="$(arg depth_type)" />

View File

@@ -53,7 +53,7 @@
<!-- node params -->
<param name="is_multiple" value="$(arg is_multiple)" />
<param name="serial_number" value="$(arg serial_number)" />
<param name="serial_number" type="string" value="$(arg serial_number)" />
<param name="depth_type" value="$(arg depth_type)" />

View File

@@ -53,7 +53,7 @@
<!-- node params -->
<param name="is_multiple" value="$(arg is_multiple)" />
<param name="serial_number" value="$(arg serial_number)" />
<param name="serial_number" type="string" value="$(arg serial_number)" />
<param name="depth_type" value="$(arg depth_type)" />

View File

@@ -1226,11 +1226,15 @@ class ROSWrapperNodelet : public nodelet::Nodelet {
mesh_msg_.header.frame_id = base_frame_id_;
mesh_msg_.header.stamp = ros::Time::now();
mesh_msg_.type = visualization_msgs::Marker::MESH_RESOURCE;
geometry_msgs::Quaternion q;
double Pie = 3.1416;
q = tf::createQuaternionMsgFromRollPitchYaw(Pie/2, 0.0, Pie/2);
// fill orientation
mesh_msg_.pose.orientation.x = 1;
mesh_msg_.pose.orientation.y = 1;
mesh_msg_.pose.orientation.z = 1;
mesh_msg_.pose.orientation.w = 1;
mesh_msg_.pose.orientation.x = q.x;
mesh_msg_.pose.orientation.y = q.y;
mesh_msg_.pose.orientation.z = q.z;
mesh_msg_.pose.orientation.w = q.w;
// fill position
mesh_msg_.pose.position.x = 0;
@@ -1243,7 +1247,7 @@ class ROSWrapperNodelet : public nodelet::Nodelet {
mesh_msg_.scale.z = 0.003;
mesh_msg_.action = visualization_msgs::Marker::ADD;
mesh_msg_.color.a = 1.0; // Don't forget to set the alpha!
mesh_msg_.color.a = 0.5; // Don't forget to set the alpha!
mesh_msg_.color.r = 1.0;
mesh_msg_.color.g = 1.0;
mesh_msg_.color.b = 1.0;