alyssaq / 3dreconstruction Goto Github PK
View Code? Open in Web Editor NEW3D reconstruction, sfm with Python3
3D reconstruction, sfm with Python3
Is it possible to use three or more images reconstruct an object?
Hello @alyssaq , there is a small bug concerning the image folder. In the README.md
, readers are told to put images under imgs/dino
, but a better one is imgs/dinos
. Otherwise, the path bug would cause the interruption.
The repository is awesome and I have stared it. Thanks a lot!
Hi, just tried out python3 cube_reconstruction.py and got:
True essential matrix: [[matrix([[0.]]) matrix([[-1.]]) matrix([[0.]])]
[matrix([[-0.361547]]) matrix([[0.]]) matrix([[-3.14154162]])]
[matrix([[0.]]) matrix([[3.]]) matrix([[0.]])]]
Computed essential matrix: [[-4.85388477e-05 -1.00000000e+00 -4.21762070e-04]
[-3.62391216e-01 -3.38325541e-02 -3.14887717e+00]
[ 1.45616543e-04 3.00000000e+00 1.26528621e-03]]
True fundamental matrix: [[matrix([[0.]]) matrix([[-1.11111111e-05]]) matrix([[0.00166667]])]
[matrix([[-4.01718887e-06]]) matrix([[0.]]) matrix([[-0.00986923]])]
[matrix([[0.00060258]]) matrix([[0.01166667]]) matrix([[-0.26961594]])]]
Traceback (most recent call last):
File "cube_reconstruction.py", line 119, in <module>
print('Computed fundamental matrix:', (F * true_F[2][2]))
File "/home/zangetsu/proj/prometheus-core/demo/demo-20-3dreconstruction-flame/3Dreconstruction/venv3/lib/python3.6/site-packages/numpy/matrixlib/defmatrix.py", line 226, in __rmul__
return N.dot(other, self)
ValueError: shapes (3,3) and (1,1) not aligned: 3 (dim 1) != 1 (dim 0)
Some links in the documentation are broken.
in structure.py
def scale_and_translate_points(points): …… x = points[0] y = points[1] center = points.mean(axis=1) # mean of each row cx = x - center[0] # center the points cy = y - center[1] dist = np.sqrt(np.power(cx, 2) + np.power(cy, 2)) scale = np.sqrt(2) / dist.mean()
Here, computation of scale is different from reference http://ece631web.groups.et.byu.net/Lectures/ECEn631%2013%20-%208%20Point%20Algorithm.pdf
I am sorry that I make a mistake
Current OpenCV versions do not support SIFT.
python3 example.py
returns
Traceback (most recent call last): File "example.py", line 90, in <module> points1, points2, intrinsic = dino() File "example.py", line 68, in dino pts1, pts2 = features.find_correspondence_points(img1, img2) File "/content/3Dreconstruction/features.py", line 6, in find_correspondence_points sift = cv2.xfeatures2d.SIFT_create() cv2.error: OpenCV(3.4.3) /io/opencv_contrib/modules/xfeatures2d/src/sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'create'
when i ran the example.py,an error ocurred
Traceback (most recent call last):
File "/home/ben/PyProjects/3Dreconstruction/example.py", line 9, in
import features
ImportError: No module named 'features'
it seems like the features.py is missing
The image download site in the sample is closed, where else can I download it?
Since the result of the 3D reconstructed points of dino with essential matrix seems unlikely the real world coordinates, and the steps include assuming P1 = [I 0], I wonder is it possible to get the real coordinates by the code provided here? If not, what else do I require to reconstruct the accurate world coordinates by two images or even more(through sfm)?
As far as procedure is concerned, if the intrinsic is not available, the fundamental matrix will be calculated. However, recording the examples, all intrinsic matrices are required. May I ask how to use those examples without intrinsic matrices?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.