Skip to content

Conversation

@RyanLam462
Copy link

  • Initialises and Captures Data: The code begins by setting up a connection to the Intel RealSense camera. It then enters a loop where it continuously captures pairs of perfectly synchronised colour and depth video frames.

  • Detects and Describes Visual Features: In each colour frame, it uses the ORB algorithm to find hundreds of distinct, trackable points, like corners or textures. Each feature is then assigned a unique numerical "fingerprint," called a descriptor, that identifies it.

  • Matches Features Between Frames: Then program compares the descriptors from the current frame to those from the previous one to find corresponding points. It then filters these matches, discarding ambiguous or incorrect ones to create a reliable list of features that are visible in both frames.

  • Creates 3D-2D Correspondences: For each reliable match, it takes the 2D pixel location from the previous frame and looks up its distance in the corresponding depth map. Using the camera's intrinsic parameters, it deprojects this 2D pixel + depth information into a full 3D point in space.

  • Estimates Relative Motion: It feeds the set of 3D points (from the last frame) and their corresponding 2D pixel locations (in the current frame) into the Perspective-n-Point (PnP) algorithm. This calculates the precise 6 Degrees of Freedom motion that the camera underwent between the two frames.

  • Accumulates Pose to Track Path: The calculated relative motion is converted into a 4x4 transformation matrix. This matrix is then multiplied with the camera's previously known global pose, continuously updating its total estimated position and orientation relative to its starting point. This final pose is then printed to the console.

Screenshot 2025-10-24 at 12 54 15 am

RyanLam462 and others added 3 commits October 23, 2025 23:50
Tracks camera movement by watching how the scene changes.

Finds and matches interesting points (features) between frames.

Uses the depth camera to know how far away each point is.

Calculates the motion needed to explain the points change in position.

Adds up each small movement to keep a running total of the camera's path.

Prints the camera's coordinates and orientation to the screen.
@eh111eh
Copy link

eh111eh commented Nov 2, 2025

Would you be able to integrate your code with Teymur’s initialization code so that the two steps are connected?

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.

3 participants