I have a video of a road/building and I want to create a 3D model out of it. The scene I am looking at is rigid and the drone is moving. I assume not having any extra info like camera pose, accelerations or GPS position. I would love to find a python implementation that I can adapt to my liking.
So far, I have decided to use the OpenCV calcOpticalFlowFarneback() for optical flow, which seems reasonably fast and accurate. With it, I can get the Fundamental Matrix F with findFundamentalMat(). So far so good.
Now, according to the tutorial I am following here, I am supposed to magically have the Calibration Matrix of the camera, which I obviously don't have nor plan to have available in the future app I am developing.
After some long research, I have found a paper (Self-calibration of a moving camera from point correspondences and
fundamental matrices) from 1997 that defines what I am looking for (with a nice summary here). I am looking for the simplest/easiest implementation possible, and I am stuck with these problems:
If the camera I am going to use changes exposure and focus automatically (no zoom), are the intrinsic parameters of the camera going to change?
I am not familiar with the Homotopy Continuation Method for solving equations numerically, plus they seem to be slow.
I intend to use the Extended Kalman Filter, but do not know where to start, knowing that a bad initialization leads to non-convergence.
Digging some more I found a Multi Camera Self Calibration toolbox open-source written for Octave with a Python wrapper. My last resort will be to break down the code and write it in Python directly. Any other options?
Note: I do not want to use the a chess board nor the planarity constraint.
Is there any other way to very accurately self-calibrate my camera? After 20 years of research since 1997, has anyone come up with a more straightforward method??
Is this a one-shot thing, or are you developing an app to process lots videos like these automatically?
If the former, I'd rather use an integrated tool like Blender. Look up one of the motion tracking (or "matchmoving") tutorials on youtube to get an idea of it, for example this one.
I know this is gonna be a doozy of a question to answer, but I'm wondering how I would make a simple 3D environment out of pygame to place an image at different points on the X, Y, and Z axes. (Yes, axis plural is axes.) I'd really rather have this all done by hand, with no pre-made modules or libraries. What I'm looking for as an answer is something like a link to a page about how to do 3D stuff, or just about it. So what sort of formulas would be required, the formulas themselves, information, etc. Thanks!
Pygame, by default, is a 2D game engine so there is no built-in support for 3D but you can implement your own 3D operations with extensive math. Take a look here.
I've been trying to read through the Stackoverflow questions for generating point clouds (x,y,z) coordinates from a left and right stereo image pair.
I haven't come to any definite solution, and I'm asking the community here for some help.
Problem statement: Given two stereo images, generate 3D (x,y,z) cartesian coordinate point clouds from those and do so in a way that lends itself to completing this point-cloud generation in a way that could work over a large set (thousands) of pairs of stereo images
My programming language experience lends itself to MATLAB, but I've dabbled in Python, and C++ is limited, but I may be able to work in that as well.
Speed is a factor here, so the the idea is to find a quick method of successively going through these pairs and generating the point cloud.
NOTE: I am not asking for the BEST as to avoid comparative solutions, I'm just asking for solutions.
Thank you very much!
Edit: After being recommended to utilize the Stereo Block Matching implementation in OpenCV, I may steer away from this method, as there is a wide variation in regards to texture of the topographical pictures that I'm dealing with.
What you probably want is called "Stereo Block Matching". If you don't feel like writing it yourself, OpenCV has an implementation ready to go (even a CUDA accelerated version).
I'm looking for a Python library that would allow me to visualise geometrical data. Nothing extremely complicated, just a bunch of points in the plane or space and a few basic shapes that I would generate.
I had a look at this question and the answers to it, but the focus over there seems to be on computation.
How about Matplotlib/mplot3D?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
i'm looking for a 3d math library in python or with python bindings.
it needs to handle rotation, translation, perspective projection, everything basically.
what im NOT looking for is a library aimed at drawing on the screen, googling for hours only led to 3d libraries bent on rendering something to the screen. i dont want any visualization whatsoever, all i need is to be able feed a library x,y,z coordinates and recieve the x,y screen coordinates.
i dont mind if its a visualization library, as long as it can be used without rendering anything to the screen.
is there anything like this for python?
Edit:
please dont recommend scipy/numpy as they arent aimed at 3d math but at math in general, they look like great tools if i wanted to build the library myself, which i dont. thanks.
OpenCV - Python Interface can handle all the operations you've mentioned.
I hear SciPy's excellent for this as well, but I've only used OpenCV.
transformations.py
A library for calculating 4x4 matrices for translating, rotating, reflecting,
scaling, shearing, projecting, orthogonalizing, and superimposing arrays of
3D homogeneous coordinates as well as for converting between rotation matrices,
Euler angles, and quaternions. Also includes an Arcball control object and
functions to decompose transformation matrices.
Authors:
Christoph Gohlke http://www.lfd.uci.edu/~gohlke/
Laboratory for Fluorescence Dynamics, University of California, Irvine
Try gameobjects -- it's a math library that includes Python classes for matrices and vectors, along with methods for transformations. I think it will provide most (if not all) of what you need, plus it's pure Python so you can modify it if you need to.
is SAGE any use to you?
http://vnoel.wordpress.com/2008/05/03/bye-matlab-hello-python-thanks-sage/
http://www.sagemath.org/
I'm working on one now.
https://github.com/adamlwgriffiths/Pyrr
It uses numpy for speed.
The aim is to provide a pure python 3D maths lib.
I'm avoiding external libs because I'm sick of having to follow complex software installs. Python should be easy.
python-math3d is another good 3D mathematic library which is object oriented
https://github.com/mortlind/pymath3d
import math3d as m3d
v = m3d.Vector(1,2,3) # A vector object
o = m3d.Orientation.new_euler((1,0,0), "ZYX") # An Orientation object from one type of euler angles
t = m3d.Transform(o, v) # A Transform object created using the vector and orientation
t2 = m3d.Transform()# Another Transform object (Identity)
t2.orient.rotate_x(3) # rotate the transformation around x
res = t * t2 #Matrix multiplication
What about PyGame? I never used it, but it may contain what you're looking for.
I would suggest MayaVi. Please take a look at the given link. It does almost everything you mentioned.
http://cgkit.sourceforge.net/doc/index.html
The implementation isn't always the best, but it includes quaternions as well as the standard matrix and vector types. I've used it for tools on a couple commercial game projects.