Giter Site home page Giter Site logo

g2o_pose_optimization's Introduction

Pose Optimization Using G2O Library: an Easy Example

A small sample for pose optimization using g2o to minimize reprojection errors.

Usage:

Requirement:

  1. OpenCV 3.1.0 or newer version.

  2. LAPACK && Suitesparse && Eigen3.

  3. (optional) Viz module in opencv (needs compiling with VTK). Disable the display in the macro DISPLAY_3D.

Example:

There is an example given on optimizing a pose calculated from EPnP to give intuitions on the performance of g2o.

You may write extra code to implement other optimization based on g2o.

g2o_pose_optimization's People

Contributors

yucao42 avatar

Stargazers

Bingrui Hu avatar  avatar  avatar Mingrui Fan avatar  avatar ubdmf avatar  avatar  avatar  avatar  avatar  avatar Je_Neil avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

g2o_pose_optimization's Issues

Using a squares chessboard?

Hi, and thank you for making this code available. I realise this is an old repo, but it is exactly what I am trying to do (calculate very accurate extrinsics of two different cameras using pnp with a chessboard, and optimisation).

I use a checkerboard, however, instead of board with dots/circles.

I see in the g2o edge function:

e->Xw[0] = (float)( (i%7)* 8);//8mm each with 7 circles a row

you have:

 e->Xw[0] = (float)( (i%7)* 8);//8mm each with 7 circles a row
 e->Xw[1] = (float)(i%7?row:++row)*8;
 e->Xw[2] = (float)(0);

I assume that I need to change this. My checkerboard is:

int grid_size_x = 7;
int grid_size_y = 5;
double squareSize = 0.045; //4.5 cm

for (int y = 0; y < grid_size_y; y++)
	{
		for (int x = 0; x < grid_size_x; x++)
		{
			object_points_.push_back(cv::Point3f(x * squareSize, y * squareSize, 0));
		}
	}

How would I go about changing your code to use this board?
Aside from the findCircles to findChessboardCorners, is there anything else that I should need to adjust?

Thanks again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.