Skip to content
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

PR2: Adding ColorUtils namespace with functions to replace cv::viz::color calls in non-visualizer classes. #3

Open
wants to merge 3 commits into
base: xcomp_refactor/move_mesh_viz
Choose a base branch
from

Conversation

sarika93
Copy link
Member

@sarika93 sarika93 commented Dec 9, 2024

This is the second PR in a series of changes that aim to make building with the visualizer module optional and remove the cv::viz dependency from other modules. A number of different non-visualization classes include cv::viz, which we would like to optionally remove when building without visualization. In the majority of these cases, this is only to get cv::viz::Color values.

This PR adds a new ColorUtils namespace with inline Color related functions that can be used instead of cv::viz::Color functions in non-visualizer classes. Non-visualizer classes are updated to remove the cv::viz-related includes and make use of these new functions. Things to note:

  • In testTracker.cpp and testOpticalFlowPredictor.cpp the cv::viz::Color calls are not updated because those are part of larger cv::viz-dependent blocks that need to be handled differently (e.g. using #ifdef blocks to exclude that logic).
  • Color functions are only included for those colors that are required outside of visualizer classes.

Full design document:
Visualization Build Option Refactor for Kimera-VIO.pdf

Testing process
Build docker container for testing

  • Navigate to Kimera-VIO/scripts/Docker
  • Modify the Dockerfile to get the relevant testing branch instead of master. Change line 85 to the following:
RUN git clone https://github.com/Virtana/Kimera-VIO.git && git checkout origin/<branch_name>
  • Build and run the image:
./kimera_vio_docker.bash

Testing

  1. Update Kimera-VIO to generate logs:
    1. For stereo: Open Kimera-VIO/params/Euroc/flags/stereoVIOEuroc.flags with your editor of choice and modify -- log_output to true.
    2. For mono:
      1. Open Kimera-VIO/params/EurocMono/flags/stereoVIOEuroc.flags and modify -- log_output to true.
      2. Open Kimera-VIO/params/EurocMono/BackendParams.yaml with the following changes:
        • linearizationMode: 1
      3. Open Kimera-VIO/params/EurocMono/FrontendParams.yaml with the following changes:
        • maxFeatureAge: 15
        • feature_detector_type: 0
        • maxFeaturesPerFrame: 200
      4. Open Kimera-VIO/script/stereoVIOEuroc.bash and change the LOG_OUTPUT variable from 0 to 1.
  2. Run Kimera-VIO: ./stereoVIOEuroc.bash.
  3. You can examine output logs in Kimera-VIO/output_logs/ to ensure the values in traj_gt.csv are the same as the version on master. You can re-run after checking out to master and rebuilding and installing:
git checkout master
rm -r build && mkdir build
cd build
cmake .. && make -j4 install

Then re-run Kimera-VIO as shown in step 2. You should be re-running with the same configuration options.

You should also be looking out for any differences in the visualizer behaviour.

@sarika93 sarika93 changed the title Adding ColorUtils namespace with functions to replace cv::viz::color calls in non-visualizer classes. PR2: Adding ColorUtils namespace with functions to replace cv::viz::color calls in non-visualizer classes. Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant