From edfde661b2d1ff0b891056b22dc7ca2f92b62206 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 13 Jul 2015 19:04:05 +0200 Subject: ht: move docs --- bin/tracker-ht/cleye.config | 4 ---- bin/tracker-ht/license.txt | 32 -------------------------------- bin/tracker-ht/thanks.txt | 5 ----- 3 files changed, 41 deletions(-) delete mode 100644 bin/tracker-ht/cleye.config delete mode 100644 bin/tracker-ht/license.txt delete mode 100644 bin/tracker-ht/thanks.txt (limited to 'bin') diff --git a/bin/tracker-ht/cleye.config b/bin/tracker-ht/cleye.config deleted file mode 100644 index bfb37b47..00000000 --- a/bin/tracker-ht/cleye.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/bin/tracker-ht/license.txt b/bin/tracker-ht/license.txt deleted file mode 100644 index a1a778e6..00000000 --- a/bin/tracker-ht/license.txt +++ /dev/null @@ -1,32 +0,0 @@ -Copyright (c) 2012-2013 Stanisław Halik - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ------------------------------------------------------------------------- - -Credit for the head mesh: - -Jed Frechette submitted the mesh as a pull request. -I cannot thank him enough! - ------------------------------------------------------------------------- - -The project links against the flandmark library, written by -Michal Uřičář and Vojtěch Franc. The library is GPL3-licensed. - -More info at: http://cmp.felk.cvut.cz/~uricamic/flandmark -Github repo: https://github.com/uricamic/flandmark - ------------------------------------------------------------------------- - -The projects uses OpenCV, see http://code.opencv.org for more info. \ No newline at end of file diff --git a/bin/tracker-ht/thanks.txt b/bin/tracker-ht/thanks.txt deleted file mode 100644 index 42612dfa..00000000 --- a/bin/tracker-ht/thanks.txt +++ /dev/null @@ -1,5 +0,0 @@ -The following people deserve thanks for their work on libheadtracker: - -The awesome head mesh, made using a 3D scanner was made by -Jed Frechette. I cannot thank him enough, given how much it -helped improve the program. \ No newline at end of file -- cgit v1.2.3 From 279d6c1b0534edd7c49f2f1fbf56acf9ed1c4a21 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 13 Jul 2015 19:04:22 +0200 Subject: allow for camera calibration --- CMakeLists.txt | 2 ++ bin/camera/Logitech HD Webcam C525.yml | 22 ++++++++++++++++++++++ bin/camera/PS3Eye Camera.yml | 22 ++++++++++++++++++++++ opentrack/opencv-calibration.hpp | 26 ++++++++++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 bin/camera/Logitech HD Webcam C525.yml create mode 100644 bin/camera/PS3Eye Camera.yml create mode 100644 opentrack/opencv-calibration.hpp (limited to 'bin') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c38b4d2..8a14b81f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -542,6 +542,8 @@ if(WIN32) install(FILES "${CMAKE_SOURCE_DIR}/bin/cleye.config" DESTINATION .) endif() +install(DIRECTORY "${CMAKE_SOURCE_DIR}/bin/camera" DESTINATION .) + if(APPLE) install(CODE " execute_process(COMMAND /bin/sh \"${CMAKE_SOURCE_DIR}/install-fail-tool\" \"${CMAKE_INSTALL_PREFIX}\") diff --git a/bin/camera/Logitech HD Webcam C525.yml b/bin/camera/Logitech HD Webcam C525.yml new file mode 100644 index 00000000..ac1bc981 --- /dev/null +++ b/bin/camera/Logitech HD Webcam C525.yml @@ -0,0 +1,22 @@ +%YAML:1.0 +calibration_time: "07/13/15 17:32:58" +image_width: 640 +image_height: 480 +board_width: 24 +board_height: 15 +square_size: 1. +flags: 0 +camera_matrix: !!opencv-matrix + rows: 3 + cols: 3 + dt: d + data: [ 7.1195238148354849e+002, 0., 3.4210284784635138e+002, 0., + 7.1302752784110055e+002, 2.2837679451205264e+002, 0., 0., 1. ] +distortion_coefficients: !!opencv-matrix + rows: 5 + cols: 1 + dt: d + data: [ -1.5165615866415242e-003, 3.6806867018034255e-002, + -6.6432394998828278e-004, 1.7782694073348656e-003, + -4.9225052904494471e-001 ] +avg_reprojection_error: 2.5310746466741296e+000 diff --git a/bin/camera/PS3Eye Camera.yml b/bin/camera/PS3Eye Camera.yml new file mode 100644 index 00000000..6859d0fb --- /dev/null +++ b/bin/camera/PS3Eye Camera.yml @@ -0,0 +1,22 @@ +%YAML:1.0 +calibration_time: "07/13/15 17:45:33" +image_width: 640 +image_height: 480 +board_width: 24 +board_height: 15 +square_size: 1. +flags: 0 +camera_matrix: !!opencv-matrix + rows: 3 + cols: 3 + dt: d + data: [ 7.5119574967224673e+002, 0., 3.2806930334341007e+002, 0., + 7.5112907969240291e+002, 2.2681331450818737e+002, 0., 0., 1. ] +distortion_coefficients: !!opencv-matrix + rows: 5 + cols: 1 + dt: d + data: [ -2.2741190107950382e-001, 9.4372681451250684e-001, + -4.0955586655475494e-003, -2.6778551080439902e-003, + -1.7969804313130640e+000 ] +avg_reprojection_error: 1.9233386799903629e+000 diff --git a/opentrack/opencv-calibration.hpp b/opentrack/opencv-calibration.hpp new file mode 100644 index 00000000..6dee9908 --- /dev/null +++ b/opentrack/opencv-calibration.hpp @@ -0,0 +1,26 @@ +#pragma once +#include +#include +#include +#include +#include + +template +bool get_camera_calibration(const QString& camera_name, cv::Mat& intrinsics, cv::Mat& distortion, int w, int h) +{ + QString pathname_ = QCoreApplication::applicationDirPath() + "/camera/" + camera_name + ".yml"; + std::string pathname = pathname_.toStdString(); + cv::FileStorage fs(pathname, cv::FileStorage::READ); + if (!fs.isOpened()) + return false; + cv::Mat intrinsics_, distortion_; + fs["camera_matrix"] >> intrinsics_; + fs["distortion_coefficients"] >> distortion_; + intrinsics_.at(0, 0) *= w / 640.; + intrinsics_.at(2, 0) *= w / 640.; + intrinsics_.at(1, 1) *= h / 480.; + intrinsics_.at(2, 1) *= h / 480.; + intrinsics = intrinsics_; + distortion = distortion_; + return true; +} -- cgit v1.2.3