# Stereo Triangulation & Depth Calculator AI Agent Connect

> Stereo Triangulation & Depth Calculator MCP gives your AI client the geometric math needed for stereo vision reconstruction. It handles the heavy lifting of transforming 2D pixel coordinates into accurate 3D spatial data, correcting for lens distortion, and calculating depth based on camera parameters.

## Overview
- **Category:** geometry
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_0DbyWZDPxXKTj3ki4KLPppGL8jrxMP4xG7e6kD6t/ai-agent-connect
- **Tags:** stereo-vision, triangulation, depth-estimation, camera-calibration, 3d-reconstruction

## Description

You can use this MCP to bridge the gap between raw image data and 3D spatial understanding. If you are working with stereo camera setups, your AI agent can now perform complex geometric reconstructions without you having to write the math manually. It handles the transformation of 2D pixel coordinates into accurate 3D spatial data. You can verify if pixel pairs are valid matches using validate_stereo_match to ensure epipolar alignment. If your lens has imperfections, get_undistorted_coordinates fixes those pixel locations before you do any math. Once the data is clean, you can use triangulate_3d_point to find the exact X, Y, and Z coordinates for any point. For quick distance checks, calculate_point_depth provides the distance from the camera based on your specific baseline and focal length settings. This is a specialized tool for computer vision tasks where spatial accuracy is non-negotiable.

## Tools

### calculate_point_depth
This tool determines how far a specific 3D point sits from your camera setup.

### get_undistorted_coordinates
Use this to get corrected pixel locations that account for lens imperfections.

### triangulate_3d_point
This tool computes the exact X, Y, and Z spatial coordinates for a given point.

### validate_stereo_match
This tool checks if a pair of pixel coordinates actually constitutes a valid stereo match.

## Prompt Examples

**Prompt:** 
```
Calculate the depth for a point with left pixel X=500, right pixel X=480, baseline=0.1, and focal length=800.
```

**Response:** 
```
The calculated depth is 4000.0 units with a disparity of 20.0.
```

**Prompt:** 
```
What are the 3D coordinates for a point with corrected left pixel (250, 300), right pixel (230, 300), intrinsics {'fx': 800, 'fy': 800, 'cx': 320, 'cy': 240}, baseline transform {'translation': [0.1, 0, 0]}, and method 'linear'?
```

**Response:** 
```
The 3D coordinates are X: -20.0, Y: 0.0, Z: 4000.0 with a residual of 0.001.
```

**Prompt:** 
```
Check if these pixels are a valid match: left (100, 100), right (105, 100) with rectification parameters {'rectified': true}.
```

**Response:** 
```
The match is invalid because the points do not satisfy the epipolar constraints.
```

## Capabilities

### 3D Reconstruction
Your agent uses this to turn 2D image points into 3D spatial maps.

### Lens Correction
Your agent uses this to fix pixel inaccuracies caused by camera lens distortion.

### Depth Estimation
Your agent calculates the distance of objects from the camera sensor.

### Match Validation
Your agent checks pixel pairs against epipolar constraints to ensure data integrity.

### Coordinate Transformation
Your agent converts raw pixel data into standardized X, Y, Z coordinates.

## Use Cases

### Robot Navigation
An agent uses depth estimation to help a robot avoid obstacles in real time.

### Automated Inspection
A system uses 3D coordinates to measure the dimensions of parts on a production line.

### Spatial Mapping
Your agent converts stereo image pairs into a 3D point cloud for environmental mapping.

### Camera Calibration
Engineers use the undistortion tools to refine camera models for high-precision tasks.

## Benefits

- Removes the need to manually code geometric triangulation formulas.
- Corrects for lens distortion automatically within the AI workflow.
- Provides direct distance measurements from stereo camera setups.
- Validates stereo matches to prevent errors in 3D reconstruction.

## How It Works

Connecting this MCP to your client gives your agent immediate access to a suite of geometric tools.

1. Connect your preferred MCP client to Vinkius.
2. Provide your camera parameters and pixel coordinates to your agent.
3. Your agent invokes the necessary triangulation or depth tools.
4. Receive precise 3D coordinates or distance values directly in your chat or code environment.

## Frequently Asked Questions

**What can this MCP do with 2D pixel data?**
It transforms 2D pixel coordinates into 3D spatial coordinates (X, Y, Z) and calculates depth based on camera parameters.

**Does this MCP handle lens distortion?**
Yes, the get_undistorted_coordinates tool corrects pixel locations to account for lens imperfections.

**How do I verify if a stereo match is correct?**
You can use the validate_stereo_match tool to check if pixel pairs satisfy epipolar constraints.

**Can I calculate distance directly?**
Yes, the calculate_point_depth tool determines the distance of a 3D point from the camera setup.

**Which AI clients can use this MCP?**
Any MCP-compatible client like Claude, Cursor, Windsurf, or VS Code can use these tools.

**How do I verify if two pixels are a valid match?**
You can use the `validate_stereo_match` tool to check if the provided pixel coordinates align along the expected epipolar lines based on your rectification parameters.

**Can I calculate depth without full 3D triangulation?**
Yes, the `calculate_point_depth` tool provides a direct way to determine distance using only the pixel X coordinates, baseline, and focal length.

**How does the server handle lens distortion?**
The `get_undistorted_coordinates` tool applies non-linear adjustments using your provided distortion coefficients and camera matrix to provide corrected pixel locations.
