Skip to content

About

A comprehensive framework for exploring the use of gradient descent and homotopy continuation techniques in image rectification. Computer Vision project @ PoliMi

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Computer Vision Project 2024/2025 - Homotopy Continuation

This repository provides a comprehensive framework for exploring the use of gradient descent and homotopy continuation techniques in image rectification. The goal is to evaluate whether these methods offer greater robustness compared to traditional numerical and symbolic solvers, and to determine which of the two performs more effectively.

Documentation

A detailed description of the project is available in the report.

Sample videos demonstrating image rectification via gradient descent can be found here.

Authors - HomoTopi

  • Filippo Balzarini
  • Paolo Ginefra
  • Martina Missana

Overview

Gradient Descent

The project leverages the usage of Adam's optimization method to perform image rectification.

Homotopy Continuation

The project leverages the HomotopyContinuation.jl package for solving systems of polynomial equations using the Homotopy Continuation approach.

Simulator

To test the application of homotopy continuation techniques to image rectification it is used a simulator with the following pipeline:

Installation

Python Dependencies

  1. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate
  2. Install dependencies:

    pip install -r requirements.txt

  3. Install the package in development mode:

    pip install -e .

Julia Dependencies

  1. Install Julia from JuliaLang.org

  2. Install the HomotopyContinuation package:

    using Pkg
    Pkg.add("HomotopyContinuation")

MATLAB Dependencies

  1. Install MATLAB from MathWorks

Docker Setup and usage

  1. Build and start the services: docker-compose up -d

  2. Example Julia API call:

    curl -X POST http://localhost:8081/rectify \
      -H "Content-Type: application/json" \
      -d '{"conics": [
            [1.0, 0.0, 1.0, 0.0, 0.0, -1.0],
            [1.0, 0.0, 0.0, 0.0, 0.0, -1.0],
            [0.0, 0.0, 1.0, 0.0, 0.0, -1.0]
          ]}'
          ```
    
  3. Example Conics Intersection API call:

    curl -X POST http://localhost:8082/intersect \
      -H "Content-Type: application/json" \
      -d '{"conics": [
            [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, -1.0]],
            [[3.0, 0.0, 0.0], [0.0, 0.0, -0.5], [0.0, -0.5, -2.0]]
          ]}'
        ```
    
  4. Check services health:

    curl http://localhost:8081/health
    curl http://localhost:8082/health 

Optuna

To test different experiment parameters Optuna is used. To visualize the Optuna dashboard

optuna-dashboard sqlite:///db.sqlite3

Testing

To run the tests for the Python package, use the following command:

pytest

About

A comprehensive framework for exploring the use of gradient descent and homotopy continuation techniques in image rectification. Computer Vision project @ PoliMi

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages