Skip to content

updating to the new Optitrack SDK #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(Boost_NO_BOOST_CMAKE ON)
set(Boost_ADDITIONAL_VERSIONS "1.48" "1.48.0")
set(Boost_INCLUDE_DIR $ENV{Boost_INCLUDE_DIR})

find_package( Boost COMPONENTS thread chrono random date_time system REQUIRED )
message(STATUS "Boost information: BOOST_ROOT = $ENV{BOOST_ROOT}")
message(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}")

if (WIN32)
find_package( NP_CAMERASDK )
add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
#add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
include_directories($ENV{MSMPI_INC})
endif()

Expand Down
29 changes: 14 additions & 15 deletions apps/lptOptitrack/optitrackcams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ int main(int argc, char** argv) {

string input = (argc > 1 ? argv[1] : "../../../data/input/");
string output = (argc > 2 ? argv[2] : "../../../data/output/");
string cameras_file = input + "cameras.yaml"; //"../../../data/pivstd/4cams/cameras.yaml"; //
string camera_pairs_file = input + "camera_pairs.yaml"; //"../../../data/pivstd/4cams/camera_pairs.yaml"; //
string cameras_file = input + "8_cameras.yaml"; //"../../../data/pivstd/4cams/cameras.yaml"; //
string camera_pairs_file = input + "8_pairs.yaml"; //"../../../data/pivstd/4cams/camera_pairs.yaml"; //

lpt::StreamingPipeline pipeline;
pipeline.setQueueCapacity(1000);
Expand All @@ -46,36 +46,35 @@ int main(int argc, char** argv) {

auto matcher = lpt::PointMatcher::create();
matcher->params.match_threshold = 2.0;
matcher->params.match_threshold = 20;
// matcher->params.match_thresh_level = 20;

auto matcher_cuda = lpt::PointMatcherCUDA::create();
matcher_cuda->params.match_threshold = 2.0; //pixels
matcher_cuda->params.match_thresh_level = 20;
// matcher_cuda->params.match_threshold = 5.0; //pixels
// matcher_cuda->params.match_thresh_level = 20;

auto tracker = lpt::Tracker::create();
tracker->setCostCalculator(lpt::CostMinimumAcceleration::create());
tracker->params.min_radius = 4.0; //mm
tracker->params.min_radius_level = 4;
tracker->params.max_radius = 25.0; //mm
tracker->params.max_radius_level = 25;
tracker->params.KF_sigma_a = 1E-5;
tracker->params.KF_sigma_z = 1E-1;
tracker->params.KF_sigma_a = 2.75E-4;
tracker->params.KF_sigma_z = 1E-2;

bool KalmanFilter = false;

auto visualizer = lpt::Visualizer::create();
double grid_side_length = 400; // mm
double grid_width = 150; // mm
int cell_counts[3] = {40, 15, 15};
visualizer->getVolumeGrid()->setGridOrigin(-145, 33, -105); // nozzle exit: (X, Y, Z) = (105, -165, -100);
//visualizer->getVolumeGrid()->setGridOrigin(14, -23, -80);
double grid_size[3] = {2032, 1270, 1270}; // mm
double grid_width = 105; // mm
int cell_counts[3] = {21,11,11};//{51, 31, 31};
visualizer->getVolumeGrid()->setGridOrigin(-grid_size[0]/2, 584, -grid_size[2]/2);
//visualizer->getVolumeGrid()->setGridOrigin(150,0,0);
visualizer->getVolumeGrid()->setGridCellCounts(cell_counts[0], cell_counts[1], cell_counts[2]);
//visualizer->getVolumeGrid()->setGridDimensions( cell_counts[0]*grid_side_length/cell_counts[2], grid_side_length, grid_side_length); // mm
visualizer->getVolumeGrid()->setGridDimensions(grid_side_length, grid_width, grid_width);
//visualizer->getVolumeGrid()->setGridDimensions(200, 200, 100);
visualizer->getVolumeGrid()->setGridDimensions(grid_size[0], grid_size[1], grid_size[2]);

pipeline.setInputDataPath(input);
pipeline.setOutputDataPath(output);
pipeline.load_Rotation_Matrix();
pipeline.setKalmanFilter(KalmanFilter);
pipeline.attachCameraSystem(camera_system);
pipeline.attachImageProcessor(processor);
Expand Down
2 changes: 1 addition & 1 deletion apps/lptVirtual/virtualcams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main(int argc, char** argv) {
tracker->params.KF_sigma_a = 1E-5;
tracker->params.KF_sigma_z = 1E-1;

bool KalmanFilter = true;
bool KalmanFilter = false;

lpt::Visualizer::Ptr visualizer = lpt::Visualizer::create();
visualizer->getVolumeGrid()->setGridOrigin(0,0,0);
Expand Down
105 changes: 0 additions & 105 deletions data/input/camera_pairs.yaml

This file was deleted.

126 changes: 0 additions & 126 deletions data/input/cameras.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion modules/calib/include/calib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Chessboard : public CalibrationBoard {

class CirclesGrid : public CalibrationBoard {
public:
CirclesGrid(cv::Size board_size = cv::Size(4, 11), double square_size = 16.62);
CirclesGrid(cv::Size board_size = cv::Size(4, 11), double square_size = 20.0);
bool find(lpt::ImageFrame& frame);
int find_circlesgrid_flags;
};
Expand Down Expand Up @@ -91,6 +91,7 @@ class Calibrator {
get_global_reference = false;
updated = false;
object = new lpt::ThreePointLine();
//board = new lpt::Chessboard(cv::Size(9, 6), 25.6);
board = new lpt::CirclesGrid();
calib_flags = CV_CALIB_FIX_ASPECT_RATIO | CV_CALIB_FIX_K3 | CV_CALIB_FIX_K4 | CV_CALIB_FIX_K5;
}
Expand Down
Loading