How seareale/vision-based-localization works
Project type and purpose
• This is a native C++ desktop application for vision-based camera pose localization and real-time 3D visualization using OpenCV and OpenGL.
• The _practice folder holds proof-of-concept tools (calibration, detection, marker generation, simple OpenGL demo).
• The KnuMarkerViewer folder contains the main viewer: it captures a live camera feed, detects a known marker, computes its 3D pose, loads a 3D model via Assimp, and renders everything with OpenGL (gl3w + GLFW + glm), with an ImGui-driven UI.
File structure
• Top-level:
• KnuMarkerViewer/ – core application (CMakeLists.txt, src/, shader/).
• _practice/ – supporting demos (calibration, detection, marker creation).
• libs/ – vendored third-party: gl3w, imgui, stb modules.
• In KnuMarkerViewer/src/:
• main.cpp – application entry, UI setup, main loop.
• knuCamera.{cpp,h} – camera capture & calibration file loader.
• yeAssimp.{cpp,h} – 3D model loader wrapper around Assimp.
• knuGlModel.{cpp,h} – OpenGL mesh and shader binding.
• In KnuMarkerViewer/shader/: GLSL vertex & fragment shaders for grid and sample object.
• Build/config: CMakeLists.txt orchestrates compiler flags and links OpenCV, OpenGL, GLFW, glm, Assimp.
Key insights from README
• Workflow:
a. Generate Charuco board image (charucoboard.cpp)
b. Calibrate camera to produce output.txt (calibrate.cpp)
c. Build viewer (cmake + make)
d. Run ./viewer [markerID] [threadMode] [cameraID]
• Dependencies: OpenCV 4.x, OpenGL 4.x, GLFW, glm, Assimp.