Method: FLM-PoseEstimator

User luxmanramamoorthy
Publication
Implementation
Views Single
Test image modalities RGB-D
Description

6D Pose Estimation Pipeline

A comprehensive computer vision pipeline for estimating 6DOF (6 Degrees of Freedom) object poses using RGB-D images. This system combines deep learning object detection with 3D point cloud registration to accurately determine the position and orientation of objects in 3D space.

🚀 Features

  • Complete 6DOF Estimation: Full rotation and translation estimation for detected objects
  • Deep Learning Detection: Mask R-CNN for precise pixel-level object segmentation
  • 3D Point Cloud Processing: Organized point cloud generation from RGB-D data
  • Robust Registration: RANSAC + ICP registration against reference CAD models
  • Confidence Scoring: Quality assessment and reliability metrics for each pose
  • Multi-Object Support: Simultaneous pose estimation for multiple objects
  • Flexible Input: Supports various RGB-D camera formats and calibrations
  • Real-time Capability: Optimized pipeline for production environments

📋 Pipeline Overview

RGB-D Images → Object Detection → Point Cloud → ROI Extraction → Pose Registration ↓ ↓ ↓ ↓ ↓ Camera Params Polygon Masks 3D Points Object Regions 6DOF Poses

Stage 1: Object Detection & Segmentation

  • Tool: Mask R-CNN for Mechanical Parts Detection
  • Detects and segments objects at pixel level in RGB images
  • Provides precise object boundaries through polygon masks
  • Trained on mechanical parts (brackets, bolts, nuts, etc.)
  • Outputs: bounding boxes, segmentation masks, class labels

Stage 2: Point Cloud Generation

  • Tool: Organized Point Cloud Generator
  • Converts RGB-D image pairs into organized 3D point clouds
  • Maintains pixel-to-point correspondence for precise mapping
  • Uses camera intrinsic parameters for accurate 3D projection
  • Preserves color information from RGB data

Stage 3: ROI Extraction

  • Tool: Point Cloud ROI Extractor
  • Maps 2D segmentation masks to 3D point cloud regions
  • Extracts object-specific point cloud segments
  • Uses polygon coordinates from detection masks
  • Filters and organizes extracted regions by object class

Stage 4: 6DOF Pose Registration

  • Tool: Point Cloud Registration and Placement
  • Registers extracted object point clouds against reference CAD models
  • Uses RANSAC-based global registration followed by ICP refinement
  • Computes complete 6DOF transformation (rotation + translation)
  • Provides confidence scoring for pose quality assessment

🛠️ Installation

Prerequisites

  • Python 3.7+
  • CUDA-capable GPU (recommended)
  • RGB-D camera with calibration data

Dependencies

```bash

Core dependencies

pip install torch torchvision opencv-python numpy open3d matplotlib scikit-learn scipy pillow pyyaml

Additional system dependencies may be required for PCL

```

Setup

  1. Clone the repository bash git clone <repository-url> cd 6d-pose-estimation-pipeline

  2. Install components ```bash

    Each component can be installed separately

pip install -r requirements.txt ```

  1. Directory structure 6d-pose-estimation-pipeline/ ├── maskrcnn/ # Object detection module ├── pointcloud_generator/ # RGB-D to point cloud conversion ├── roi_extractor/ # ROI extraction from point clouds ├── registration/ # Point cloud registration ├── reference_models/ # 3D CAD models (.ply files) ├── config/ # Configuration files ├── examples/ # Example scripts and data └── main_pipeline.py # Complete pipeline script

⚙️ Configuration

Create a pipeline_config.yaml file:

```yaml

Camera Configuration

camera: intrinsics_file: "config/camera_params.json" depth_scale: 0.1

Detection Configuration

detection: model_path: "models/maskrcnn_mechanical_parts.pth" categories_file: "config/categories.txt" confidence_threshold: 0.7 output_dir: "output/detection/"

Point Cloud Configuration

pointcloud: voxel_size: 0.01 organized: true save_intermediate: true output_dir: "output/pointclouds/"

ROI Extraction Configuration

roi_extraction: output_dir: "output/roi/" min_points: 100 save_rois: true

Registration Configuration

registration: reference_models_dir: "reference_models/" output_dir: "output/registration/" ransac_iterations: 100000 icp_threshold: 0.1 confidence_threshold: 0.6 parallel_workers: 4 ```

🎯 Usage

Complete Pipeline

```python from pose_estimation_pipeline import PoseEstimationPipeline

Initialize pipeline

pipeline = PoseEstimationPipeline("pipeline_config.yaml")

Run complete 6D pose estimation

results = pipeline.estimate_poses( rgb_image="data/rgb_image.jpg", depth_image="data/depth_image.png", camera_params="config/camera_params.json" )

Process results

for result in results: if result['success'] and result['confidence'] > 0.6: print(f"Object: {result['label']}") print(f"Position: {result['translation']}") print(f"Rotation: {result['rotation_matrix']}") print(f"Confidence: {result['confidence']:.3f}") ```

Command Line Interface

```bash

Basic usage

python main_pipeline.py \ --rgb data/rgb_image.jpg \ --depth data/depth_image.png \ --camera config/camera_params.json \ --config pipeline_config.yaml

With custom output directory

python main_pipeline.py \ --rgb data/rgb_image.jpg \ --depth data/depth_image.png \ --camera config/camera_params.json \ --config pipeline_config.yaml \ --output results/experiment_1/

Batch processing

python batch_process.py \ --input_dir data/rgb_d_sequences/ \ --config pipeline_config.yaml \ --output_dir results/batch_results/ ```

Individual Components

Each stage can be run independently:

```bash

1. Object detection only

python maskrcnn/inference.py \ --image data/rgb_image.jpg \ --model models/maskrcnn_model.pth \ --output output/detections/

2. Point cloud generation only

python pointcloud_generator/create_pointcloud.py \ --rgb data/rgb_image.jpg \ --depth data/depth_image.png \ --camera config/camera_params.json \ --output output/scene.ply

3. ROI extraction only

python roi_extractor/extract_rois.py \ --pointcloud output/scene.ply \ --detections output/detections/results.json \ --output output/roi/

4. Registration only

python registration/register_objects.py \ --source output/roi/object_1.ply \ --reference reference_models/object_1_model.ply \ --output output/registration/ ```

📊 Input/Output Formats

Input Requirements

RGB-D Images

  • RGB: Standard image formats (JPG, PNG)
  • Depth: 16-bit depth images or standard depth formats
  • Alignment: RGB and depth images must be aligned

Camera Parameters (JSON)

json { "fx": 1234.5, "fy": 1234.5, "cx": 640.0, "cy": 480.0, "width": 1280, "height": 960, "depth_scale": 0.1 }

Reference Models

  • Format: PLY or PCD point clouds
  • Requirements: Clean, dense models of target objects
  • Naming: Match detection class names

Output Results

```python

Per-object pose estimation result

{ 'object_id': 'bracket_001', 'label': 'bracket', 'success': True, 'confidence': 0.87, 'translation': [x, y, z], # in millimeters 'rotation_matrix': [[r11, r12, r13], # 3x3 rotation matrix [r21, r22, r23], [r31, r32, r33]], 'transformation_4x4': [...], # 4x4 homogeneous matrix 'bounding_box': [x_min, y_min, x_max, y_max], 'point_count': 1547, 'processing_time': 2.34 } ```

🐛 Troubleshooting

Common Issues

  1. Low Detection Confidence

    • Check lighting conditions
    • Retrain detection model with domain-specific data
    • Adjust confidence threshold
  2. Poor Registration Results

    • Verify reference model quality
    • Check camera calibration accuracy
    • Increase RANSAC iterations
    • Ensure sufficient point overlap
  3. Memory Issues

    • Reduce point cloud density
    • Limit parallel workers
    • Process smaller image regions
  4. Slow Performance

    • Use GPU acceleration
    • Increase voxel size for downsampling
    • Reduce RANSAC iterations

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all components work together
  5. Submit a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Mask R-CNN implementation based on torchvision
  • Open3D for point cloud processing
  • PCL (Point Cloud Library) for advanced algorithms
  • PyTorch team for deep learning framework
Computer specifications CPU: AMD Ryzen 7 5700G with Radeon Graphics Cores: 16 RAM: 30Gi GPU: NVIDIA Corporation Device 2782 (rev a1) Storage: 1.7T OS: Ubuntu 22.04.5 LTS Kernel: 6.8.0-57-generic

Public submissions

No submissions yet.