Search the Community
Showing results for tags '3d scanning'.
Found 2 results
I decided to do a little experiment yesterday after reading a little about photogrammetry and how it's being used in archaeology for 3D scanning sites. The idea of digitizing fossils in 3D is very, very cool to me. I decided to do a little more research on it and possibly give it a try. For this experiment: All software was completely free. I didn't use an expensive camera....In fact, I used my smartphone to take all the photos. Image size was only 1000x1000px and quality wasn't that great (it's a phone) I didn't have a good light setup. I used the flash on my phone. I had no experience with any of this prior to this experiment. For the subject, I used a whale vert that has some odd preservation. It seems like it was crushed a little during fossilization. The whole thing is off center and cracked in a lot of places. I thought it would be a good fossil to play around with for this. So, I took 46 photos at different angles all around the fossil, making sure to keep the distance the same and tried my best to keep my phone's camera in focus. There were two main steps after the photos were taken. 1. Create a point cloud that could be put into a program and used to make a 3D model from the 46 2D photographs 2. Use the same 46 images to create a texture to apply to the new 3D model. Thankfully, both steps were much easier than I expected them to be thanks to some software created as research projects by different students in a few different universities. I'm happy with the results considering it was done with free software and a cell phone. I could have used higher resolution photos and it probably would have looked nicer, but I didn't for this first test. I plan on messing around with this sort of thing more. There's tons of filters and options in the different programs that I haven't tested to see what they would do...and I haven't even tried a real camera with better lighting yet. I'm guessing that a good camera in direct sunlight would make a huge difference. A couple of things on the model didn't come out right, but that was probably just because I didn't get enough photos from different angles in certain places. Also, the bottom of the vert where it was sitting on the table obviously didn't get photographed, so it's just black. I'm sure you could flip the thing over, do the whole thing again and then put it all together, but that would require a lot more experience with these programs. If anybody is interested in playing around with this themselves, I can post the programs used..or I could write out a tutorial. When some even better software comes out, I can see this becoming a pretty common thing. Imagine a "gallery" full of 3D fossil scans! Whale Vertebra 4½" Tall Miocene Hawthorn Fm. Alachua County, FL Here's an additional two-part scan done using this method and a DSLR camera with more photographs: Titanis walleri Phalanx Pleistocene Gilchrist County, FL Beginner Tutorial The Programs & Configuration First, you need Visual SFM. (This is the program that turns the photos into a 3D point cloud) Next, you need CMVS for Windows or if you're not on Windows, go here. (This is just a few files that we put into Visual SFM that helps create our texture that gets applied to the 3D model) The last thing you'll need is Meshlab. (This is a very powerful 3D program that does all kinds of stuff. We'll be using it to turn our 3D point cloud into an actual model and apply our material to it...among a couple other things) Download Visual SFM & CMVS then extract them. Navigate to the correct folder for your computer and copy the contents of the CMVS folder. I'm on Windows 7 64 bit, so I went to the first folder I extracted, "CMVS-PMVS-master" > CMVS-PMVS-master > binariesWin-Linux > Win64-VS2010 and copied everything in there (minus the Readme.txt). Paste those files directly into the Visual SFM folder (the one with all the .dll files where the application to launch the program is) that you just extracted. Obviously, this is a one time thing. You get those files in the right place and every time you open Visual FSM to make a 3D model, it'll have CMVS right where it needs to be. Photographing When I took my photos, I placed the vert on a piece of newspaper with a lot of different colors, lines, images, etc. It's important that the software has common places of reference between different images so it can map out he point cloud accurately. Here's my vert set up ready to be photographed: Thinking about it now, it probably would have been smarter to elevate the vert slightly above the newspaper on a little block or something. I had a little trouble cropping the bright newspaper away from the vert. I took photos starting at a low angle spaced out as I slowly rotated around the fossil. I'd take a pic, move a tiny bit, take another, move a tiny bit, etc. Here's what four of my photos in sequence look like: I went in a full circle until I was sure that I had rotated around the fossil completely and even overlapped a bit, taking photos of the same angle I started with (better to have too many than too few). Then I angled the camera (well, phone in this case) at about a 45 degree angle and rotated around the fossil completely again. Those photos look like this: As you can tell, this are not great photos. I think that the model would have turned out much better looking if I took better photos in better lighting. After I completed that pass, I took one photo of the very top of the vert, facing downward. I made sure to always get a fair amount of the newspaper for tracking purposes. Then I used a great free program called Photoscape and it's batch editor to apply the same filter and crop to all the images at once. Make sure not to crop out your newspaper or whatever you're using to help with tracking. Do not use images with larger dimensions than 3200px! I read in a couple places that this would cause worse tracking and a lot of other problems. If you want to experiment with larger than that, go for it and see what happens..When I tried it, the program ran for a very long time and eventually froze my computer...but my original images were over 5000px each. Visual SFM When your photos are done, open up Visual SFM by going to the folder you extracted and clicking on the application. This is what it looks like: I wrote out some arrows to the things you'll be using in there. #1 is Open Multiple Images. Just click that, navigate to your images and upload them. You'll see the log window to the right doing some stuff....You should see your image thumbnails in the program in just a few moments. When that's done and there's no more activity in the log window, click on #2, Compute Missing Matches. This is the first thing that some computers could have trouble with. This one can take a little while depending on how many images you have and how large they are. When this is done and there's no more activity in the log window, we can get to the cool stuff. Click on #3, Compute 3D Reconstruction. This part is seriously amazing. It takes all of your images and automatically calculates where you were in relation to the object when you took the photo. Then it shows all the places an image was taken and it displays the point cloud in the center. It looks like this: The squares are everywhere I took a photo...You can see that I did a circle around the fossil down low and then a very sloppy "circle" above it. In the center, you'll see your sparse point cloud. If you want to make the little image icons bigger or smaller, it's ctrl + mouse wheel, if you want to change the size of the point cloud points, it's ctrl + alt. Time for the next step. When you clicked on button #3 and got your point cloud, a couple new buttons showed up. This is the one you need: #4 is Run Dense Reconstruction. When you click this, it's going to act like you're saving something. What you're doing is giving the software a directory to dump the files it's going to create. Make a new folder, give the file some name and click save. When you click save, look at the log window (if it's gone, the show/hide button for it is at the top, far left) and look for this: If you see the highlighted part, it means you correctly moved over the files from the CMVS folder you downloaded into the Visual SFM folder. It'll tell you that "this could take quite some time" and it definitely does. For my project (46 images at about 1.2MB each - 1000x1000px) it took 5 - 10 minutes, but before I resized those photos they were over 5000px each and this step ran for nearly an hour before my computer finally froze. Like I mentioned above in the photography part, I read in a few places that your images should be below 3200px on the longest side. You might want to think about closing down other programs that use up a lot of memory while you run this unless your computer has a lot of memory to spare. I closed out my browser and a bunch of other stuff just in case. When the log window says this is done, you should be able to hit Tab on your keyboard and see your dense point cloud....again, you can mess with the size of the points with ctrl + mouse wheel. This is still just a point cloud even though you'll start to see some color and image coming through. There's no need to save anything after this step is done. The program automatically wrote everything you need into the new folder that you created. And that's it for Visual SFM! Meshlab Go ahead and install Meshlab if you haven't already. It can look a little overwhelming at first, but we'll only be doing a couple pretty basic things. This is what Meshlab looks like: Go up to File and click Open Project (or the second button from the left, #1 in the photo above). Remember the folder you had to create when doing the last step (the dense point cloud) in Visual SFM? Navigate to that folder and you'll see a .nvm folder with the name. Open that file. It'll take a few moments to open. When it does, you'll see your point cloud open up into the program (upside down). Now is a good time to try to learn how to navigate around the viewport. The mouse wheel zooms in and out. Holding the left mouse button and moving the mouse rotates around the center. Holding the mouse scroll wheel and moving the mouse will pan the point cloud (or later, the mesh) around. I usually center it in the middle of the center rotation widget. Holding Alt and scrolling the mouse wheel will change the size of your point cloud points....You may need to do that to make them easier to see since we need to delete some soon. All this might take a little getting used to, but if you're patient you'll get the hang of it. Next, click on Show Layer Dialog, the #2 button in the image above. You'll see the little window on the right pop up. If you're at all familiar with photo editing, this layer window should be pretty familiar to you. Now we need to get our cameras showing up. Go to Render (#3) > Show Camera (#4). From there, go over to drop down arrow next to Show Camera on your side window below your layers (#5) and click it. Check on the Scale Factor here and make sure it's set to something like 0.04 or smaller depending on what you want. When I first did this, the camera scale factor was very high when I first clicked on Show Camera and it made it so I couldn't see my point cloud anymore. Time for bringing in our dense point cloud. First, click the little eye next to your layer in the side bar (#6) and you'll see your point cloud disappear. Next, go to File > Import Mesh (#7) and navigate to the same folder you created in Visual SFM where your .nvm file was. You'll see in the same folder a .ply file with the same name. Click that and import it. Reposition the mesh in the center and zoom in. Under Show Camera on the side bar, you may want to uncheck Show Raster Cameras so they don't get in your way for this next step. We're going to be selecting and deleting the stuff that we don't want in our finished model. Position your model carefully and click the Select Vertexes (#8) button. You can then click with the mouse and drag a rectangular selection around the stuff you don't want (#9). Be careful NOT to delete any of the actual model, only the surrounding stuff that was used for tracking (the newspaper in my case) and any random artifacts that might be hovering above or around the model. This isn't difficult, but it can be a little time consuming. This is why I recommended above that you elevate your fossil on a little block or something. Then you could just change to a side view and delete all the newspaper at once, cutting the block in half. When you drag the box around the stuff you don't want, that stuff will turn red meaning it's selected (see #9). When you have the right stuff selected, click #10, which is a Delete Vertices button. The area selected is gone now. Repeat 8, 9 and 10 changing angles carefully to get rid of everything that you need gone. Sometimes the wrong layer gets automatically selected (the invisible one) and when you hit the delete button, it won't do anything. Just click the layer ending in .0.ply if the top one gets selected and keep going. Don't hit the delete button if even a tiny piece of the model is selected...There's no undo button that I've seen, so if you make that mistake, you may have to go back to step 7 and import the mesh again. Here's another angle I used: Remember that you can hold Alt and scroll the mouse wheel to make the points bigger and smaller. If they're too small, you'll have trouble seeing what to delete and what not to. Next, go to Filters > Point Set > Surface Reconstruction: Poisson (#11) here: Then change the settings in the box that pops up to 12, 7, 1, 1 (or experiment a little, but that's what I used) like this: When that's done, hit apply and let it run. What comes out is a 3D model of your fossil! It's just missing the texture right now, but it's still very cool looking. Click the little eye on the layer that ends with .0.ply to hide it. It'll look something like this: Next, we need to go to go to Filters > Selection > Select Non Manifold Edges (#12), making sure the right layer is selected like so: A box will pop up. Just hit apply, then click the Delete Vertices (#13) button. This is just a preventative measure, you shouldn't notice much happening when you click delete. We're getting close! Just one last step and you'll have a fully textured 3D model. Go to Filters > Texture > Parameterization + texturing from registered rasters (#14). A box will pop up. I doubled the size of the texture and left everything else default. The default is 1024, I changed that to 2048. Go ahead and name your texture whatever you want. This step is taking all those images we took and making a single image file that has all angles on it. Hit apply. And there you go! A fully textured 3D model of a fossil from nothing but images: You can go ahead and export your model now. Click File > Export Mesh, give it a name, select the file type drop down here: I made sure to save in a couple different file formats. I saved in .obj and .dae. When you go to upload the 3D model somewhere, all you have to do is upload one of these files and then find your texture image that you created on step (#14) to apply to it. Keep in mind that this technique is not limited to small objects. You can map out environments in 3D too. Archaeologists use this technique (usually with high tech equipment) to take 3D models of archaeological dig sites. This technique can also be used for very detailed topographic mapping if you had a way of taking aerial pics. I'd love to see if anybody gives this thing a shot. If you try it and have trouble, let me know...I'm still very much a newbie at all this, but I'll do whatever I can to help figure it out. I'll post more in this thread as I make more 3D fossils. If anybody gives this a shot, have fun! It's definitely a learning experience. -Cris