mapillary / OpenSfM

Open source Structure-from-Motion pipeline
https://www.opensfm.org/
BSD 2-Clause "Simplified" License
3.42k stars 861 forks source link

Is it possible for OpenSfM reconstruct a 3D object on a spinning table? #323

Closed rampagedog12 closed 6 years ago

rampagedog12 commented 6 years ago

Hello, @paulinus I am trying to reconstruct a 3D object using OpenSfM in two method. Method 1: I took photos of an object in many different angles. Sometimes I get more than one reconstructions or zero reconstruction. Method 2: I took photos of an object on a spinning table. I got a Runtimewarning: invalid value encountered in arccos and the webviewer had nothing. I want to send message to ask Mr. Gargallo. I attempt to send it via the e-mail in Github I post the issue here.

ManishSahu53 commented 6 years ago

If there is no translation of cameras then you can't make 3D. Also if your object is moving then the matching points/features will be rejected by algorithm. Method 1 should work.

mlopezantequera commented 6 years ago

@rampagedog12 can you share some images? It should be possible, as long as you mask the parts of the images that are outside of the rotating table.

rampagedog12 commented 6 years ago

@mlopezantequera Is it like removing background?

mlopezantequera commented 6 years ago

@rampagedog12 yes, however, the feature detector might detect features on the edge if you remove the background, ruining the process. Ideally you want to remove all features outside of the spinning table after the detector has run, to make sure this doesn't happen.

rampagedog12 commented 6 years ago

@mlopezantequera I tried this dataset in the link below and found I get no white point cloud under the statue. https://onedrive.live.com/?authkey=%21AO6WQY7aaKBtwBk&cid=17DFFF52B691466E&id=17DFFF52B691466E%21658328&parId=17DFFF52B691466E%21134076&action=locate Why isn't there no white point cloud?

mlopezantequera commented 6 years ago

@rampagedog12 , the white area under the statue has no texture, so no keypoints can be detected there. If you need the table to be also included in the reconstruction, you could use a tablecloth that has some texture on it.

rampagedog12 commented 6 years ago

@mlopezantequera Is there any method to create a mask? I tried some methods on Matlab and OpenCV, but I didn't get the desired masks for the video. Or can OpenSfM remove the features that overappear in the video? Only use the features that are shown in 5-10% of frames.

mlopezantequera commented 6 years ago

@rampagedog12 you say you are working with a rotating table, but these images are of a camera moving around a fixed table. Can you share the dataset containing images of a rotating table?

rampagedog12 commented 6 years ago

@mlopezantequera Sorry, actually, it is not rotating table. It is a spinning person like the picture. 0201 I created the masks for the selected frames of the video manually. It took me a long time for the masks, but it worked. I am going to look for some method for background and foreground separation. I found I could change the configuration like matching_order_neighbors, matching_time_neighbors, but openSfM does not consider the beginning and the ending of images......?

mlopezantequera commented 6 years ago

@rampagedog12 I think the best solution for your problem is to spin the camera around the person instead. Then all of the texture of the background can help with the reconstruction and you won't need to mask the images manually.