how to reconstruct in 3d of a scene from two images - python

I wish to make a 3D reconstruction of a scene. For that, I have 2 images of the scene taken from two different angles.
Is there a library that does that? (I work in python)
if not, what are the steps that must be followed?
if you have the code ready, it is welcome.
thanks

I have not tried it for myself yet, but it seems simple with OpenCV.
OpenCV has module for 3D reconstruction.
Also check out this tutorial.
Upd. Please look at comments from #berak below. I misunderstood yours question at first.
I found SfM-Toy-Library library on github, which uses algorithms from mentioned "Multiple View Geometry" book. It's written using OpenCV and better relates to the topic, but it might be not so easy to use library in Python.

You can use vtk
First step is image processing and second step is 3d reconstructions
For example you can try for first step:
1)Median Filtering
2)Image contrast
3)Thresholding
4)Noise reduction
And second step includes:
1)vtkMarchingCubes
2)vtkPolyDataMapper
3)vtkActor
4)Renderer
Also you can read this article : enter link description here

Related

How to motion deblur an image using OpenCV and Python?

So I have been asked to motion deblur a frame captured from a video, I am kind of new to this deblur filters so need help. The video does not contain any noise, just a vertical motion blur. I am not allowed to use skimage, or any other library except cv2. It would be a great help even if what technique or function I have to use comes to know. Thanks!
You can use the Motion Deblur Filter of opencv, if you specifically want to use opencv.
Following is the link to its documentation, which is fairly easy to understand:
http://amroamroamro.github.io/mexopencv/opencv/weiner_deconvolution_demo_gui.html
You can go for skimage as well. It has many function like deconvolution which can help in deblurring images.
I think that for this kind of problem you have to use the recent deep learning techniques. They outperform the classical approaches. I recommend to look on github for a repository that would already provide a trained network that can deblur the same kind of blur that you have.
I never tried it, but this could be a nice candidate.

Detect if a camera angle changed

I have a fixed camera and I need to check if its position or orientation has been changed. I am trying to use OpenCV (calculating diiferencies between a reference image and a new one) for this, but I am pretty new to OpenCV (and image processing in general) but I am not really sure what specific algorithm would be the best to use for this, or how to interpret the results to find if the camera has been moved/rotated. Any ideas?
Please help,
One way to do it would be to register the two frames to each other using affine image registration from openCV. From this you can extract the rotation and displacement difference between the two frames. Unfortunately this will only work well for in-plane rotations but I still think it is your best bet.
If you post some sample code and data I would be happy to take a look.
You can use Canny or HoughLinesP to find lines,From this you can get two lines,compare it.Maybe this will be effective in some simple background.if some object in your picture,try sift or other feature extractor,you can take features to find the relationship from two frames.

Detection of symmetries in Python

I want to detect symmetries (rotation, translation, etc) of a simple figure or a shape in a image. That is, if I find one symmetry I want to replicate my original figure with it.
Are there any function or module?
I have thought in python-opencv, but I did not find nothing.
Let me just throw some packages at you: OpenCV for Python Cookbook might be a good start. A search for "opencv" on the Python Package Index yields several bindings of OpenCV for Python.
Concerning the detection of symmetries: The answer to question how to detect simple geometric shapes using OpenCV? might be a good start. After you find similar objects, check their orientation. Replacing then should be a piece of cake.

Python - Identifying/Processing an Image

I'm looking in to learning about processing and handling images with Python. I'm experimenting with searching the inside of an image for a specific picture. For example, this picture has two images in it that are the same;
In Python, how would I go about detecting which two images are the same?
I would recommend you to take a look at OpenCV and PIL, if you want to implement simple (or complex) algorithms on your own.
Furthermore you can integrate OpenCV with PIL and also numpy, which makes it a really powerful tool for this kind of jobs.

Detect marker with opencv and python

I am trying to detect a marker in a webcam video feed and overlay it with a 3d object - pretty much exactly like this: http://www.morethantechnical.com/2009/06/28/augmented-reality-with-nyartoolkit-opencv-opengl/
I know artoolkit is the best module for this, but I was hoping to just use opencv in python since I dont know nearly enough c/c++ to be able to use artoolkit. I am hoping someone will be able to get me on the right track towards detecting the marker and determining its location and orientation etc since I have no idea how best to go about this or what functions I should be using.
OpenCV doesn't have marker detection / tracking functionality out of box. However it provides all algorithms needed so it's fairly easy to implement your own one.
The article you are referring to uses OpenCV only for video grabbing. The marker detection is done by NyARToolkit which is derived from ARToolkit. NyARToolkit have versions for Java, C# and ActionScript.
ARToolkit is mostly written in plain C without using fancy C++ features. It's probably easier to use than you thought. The documentation contains well explained tutorials. e.g http://www.hitl.washington.edu/artoolkit/documentation/devstartup.htm
The introductory documentation can help you understand the process of marker detection even if you decide not to use ARToolkit.
I think the most used way to perform marker detection using python and open CV is to use SURF Descriptors.
I have found very useful this video and the linked code you can find in this page. Here you can download the code. I don't know how to overlay it with a 3d object but I'm sure you can do something with pygame or matplotlib.

Categories

Resources