Tag Archives: Photography

3D Printing from Photogrammetry

or

Blender

or

What Have I Gotten Myself Into Now?

This was going be be a blog about using Blender to create 3D scenes. Sort of. I’m just barely starting to learn Blender, so it wasn’t going to be anything fancy or in-depth.

But, I went down a rabbit hole. Imagine that! I started with the ASDM Rock I photographed a few months ago (see my post PHOTOGRAMMETRY: 3D Models from Photos), and was going to try to add some sunshine, and animate the sun moving across the rock, and maybe in the future create some somewhat realistic looking grass around the rock. But, I got sidetracked and decided to try to 3D Print the rock. Not at full scale(!). Just a little plastic rock I could put on my desk.

Blender

OK, so what is Blender? From Wikipedia, “Blender is a free and open-source 3D computer graphics software toolset used for creating animated films, visual effects, art, 3D printed models, motion graphics, interactive 3D applications, virtual reality, and computer games.” Did you read all of that? Free. Open Source. 3D computer graphics software. Animation.

Blender is used to create everything from 2D and 3D still pictures to full length animated movies. Wow!

I’ve known about Blender for several years (at least). I’ve looked at it a few times, but every time the learning curve scared me off. But it can do so much. And FREE, so no big investment (except my time) to play with it. After playing a bit with Open Drone Map, creating 3D models from “just a bunch of photos,” I thought maybe I should look at Blender again. So for the last 4-6 months I’ve been watching tutorials on YouTube and LinkedIn Learning, being awed by what others have done with Blender, and wondering if I could accomplish anything significant with it.

Very brief recap of my blog on Photogrammetry: I shot 40 photos with my cell phone of this cool looking rock that is located in front of the Arizona-Sonora Desert Museum outside of Tucson, AZ. I then used Open Drone Map to process these 40 photos to create a model of the rock, and used Blender to do some very minor editing to eliminate the extraneous parts of the model. I uploaded the model to Sketchfab, where you can view it in all of its 3D-ness.

Starting with this same model, I used Blender to create a base and export it to an STL file, which can be used to print a 3D model. That sounds rather mundane, but I spent many hours trying to get the initial model ready for 3D printing. Several YouTube videos later, I managed to create something that would print nicely. I also added a little sunshine to the scene, just because I could.

For comparison with the printed model, here is one of the photos in the sequence that was used to create the model.

Rock at Arizona-Sonora Desert Museum Entrance
Rock at Arizona-Sonora Desert Museum Entrance

Here is the ASDM Rock, as rendered in Blender. I added a little sunshine to the scene, just because I could :-).

ASDM Rock, from Open Drone Map model, rendered in Blender
ASDM Rock, from Open Drone Map model, rendered in Blender

The final result? Here is my printed “rock.” I think it rather accurately represents the original rock!

3D Print of Rock in Photo Above
3D Print of Rock in Photo Above

PHOTOGRAMMETRY: 3D Models from Photos

(From Autodesk’s website:) What is photogrammetry?

Photogrammetry is the art and science of extracting 3D information from photographs. The process involves taking overlapping photographs of an object, structure, or space, and converting them into 2D or 3D digital models.

Photogrammetry is often used by surveyors, architects, engineers, and contractors to create topographic maps, meshes, point clouds, or drawings based on the real-world.

I’ve written in past posts about 360° panorama photos (360° Panoramas!, More 360° Panoramas!, and 360° Panoramas (again)). In a 360° panorama, the camera (the viewer) is at a single location looking out on the world. Today, we will visit what seems to be the opposite situation.

3D models are created by taking a series of photos of an object from many different directions. The object could be something small, like a sculpture. Or something large, like a movie set. Or something in between, like a building. The camera could be mounted on a tripod and the small model turned to different positions, or the camera could be moved around the small model to take many different views. For an even larger model, the camera could be carried by a drone, for instance, and moved around a very large area to take many images.

I’ve played with 3D models a bit over the last few years. Once you have acquired images of your target, they must be processed in some way to create a 3D object, usually a “mesh” of many triangles that simulate the original model. Much of the software to do this is relatively expensive (hundreds or thousands of dollars), or rented by the month. However, not all software is expensive. After looking at other options, I found Open Drone Map (or ODM). The original purpose of ODM apparently was to create maps and/or models from photos taken from a drone. However, the software doesn’t really care whether the camera was on a drone, or handheld, or on a tripod.

Using ODM, I was able to successfully process several sets of photographs I have accumulated over the last few years. My smallest models were created from about 40 photos shot with my cell phone and the largest I’ve created so far used a couple hundred photos shot with a drone. People successfully use ODM with 5,000+ photos, although that may take days to process, even on a powerful computer.

Once you have created a 3D model you must use special software to view it. Surprisingly, current versions of Windows do come with a simple 3D viewer, but it doesn’t seem to be very robust. There are also websites where the 3D model can be uploaded, then you can view the model with a web browser.

Below is one of the first models I created. It is a tabletop scene of a small wood manger. This model was created from 48 photos shot with my DSLR as I walked around the table, taking photos at different heights to be sure everything was visible. Click the “play” button, wait for it to load, then use your mouse left button spin the model around on your screen, and your mouse scroll wheel to zoom in and out. To see the model full screen, press the “f” key. (I recommend trying that – press the “f” key again to exit full screen mode.)

The photo below is one of the 48 photos that make up the model above.

Another 3D model I created is an interesting rock at the entrance to the Arizona-Sonora Desert Museum (ASDM). This one is created from 40 photos I shot with my cell phone as I walked around it several times.

I used several other programs to generate all of the models shown here. First is WSL – Windows Subsystem for Linux. The version of ODM I used runs on Linux, so this allowed me to run it in a Linux environment on my Windows computer. I used Blender to clean up (remove) the extraneous parts of the 3D images, which were then uploaded to Sketchfab. Other programs played more minor roles. Expect to see more about Blender in this blog in the future.

More 360° Panoramas!

I just discovered this week that YouTube can display 360° panorama videos. So now I can show them in YouTube. And, added bonus, I can embed YouTube videos into this blog.

Click on the video below to see it in action. Once it starts playing, click and drag in the video with your mouse. Or, play it on a mobile device and move the device around. If you want to play with this in a browser in a larger window, here is the link: https://youtu.be/5dxS63p0qmI. This is a still photo displayed as a video. Note that it is only 30 seconds long. To play with it longer than that, pause the video and click and drag around as much as you want.

It took a little work to get it right. 360° panoramas are twice as wide as they are high. Exactly. Thinking about it a bit, that becomes obvious. The panorama is 360° wide (hence the name) and 180° high. But standard HD video is 1920 pixels wide and 1080 pixels high. 4K video (which is what I’m published this at) is twice that: 3840 x 2160. The ratio is 16:9, which obviously is not the same as the 2:1 panoramas.

When I created the first video, there was a black bar top and bottom, which when viewed as a 360° panorama created a round hole at the “top” and “bottom”. Oh, what to do?

The panorama starts out with a horizontal:vertical ratio of 2:1, which is the same as 16:8. If I were to stretch the panorama a bit vertically, maybe about 12.5%, it would then be 16:9 and have the same ratio as the HD video.

So, I created the panorama (I already did that, see https://garystebbins.com/2020/02/04/360-panoramas/), then dropped the file into Photoshop and expanded the image vertically to 112.5%, then dropped that file into Adobe Premiere Pro, added a little music, and there you have it.

Almost… there is a bit of embedded data that has to be added to the file to tell YouTube it is a 360° panorama. I found a little program online called “Spatial Media Metadata Injector,” which can be found here, that does this bit of magic.

Maybe I’ll discover some easier method than this, but now I know the steps, this isn’t bad. I suspect I can do the ratio matching all in Premiere Pro, which would save one step.

If you want to see a wild 360° video check this out:

Be sure to spin it around and look around you. Enjoy!

360° Panoramas!

I’ve been playing with 360° photography for over a year. I find this to be an enjoyable variation to my regular photography.

The simplified explanation of the process is to shoot enough images to capture all directions, then stitch these images together into a special format. I sometimes use a drone to capture the images, and sometimes a camera on a tripod. The result is a spherical image, viewed as though you are at the center of the sphere and can look in all directions.

Camera on 360° panorama mount

On my tripod, I use a panorama attachment, shown here, that allows the camera to pivot horizontally and vertically around the optical center of the lens so that the resulting photos align properly.

This panorama attachment has a pivoting base with detents that help position the camera at the right intervals. Using the 10-22mm lens shown above, I take eight shots in a horizontal circle to have enough overlap between shots to stitch them together properly.

When I create a panorama from a drone, I am currently using a Phantom 4 Pro, which has an automated panorama mode where it takes all of the images with one press of the “shutter.”

When the panorama is assembled from the individual images, it can be viewed with a special viewer on my computer. I publish some of my images on a website, Round.me, that specializes in displaying 360° panorama images. Unfortunately, I can’t display the images as panoramas on this website.

I am going to use an image that I shot at Gates Pass outside Tucson, AZ, this past November as an example . There is a small knoll just off the road that I climbed up to take the photos from. I set my tripod on the highest rocks on the top and took 37 images. The images were taken on manual exposure, all with the same exposure. Because there is a wide range of lighting, from shadows to full sunlight to shooting directly into the sun, I shot the images in RAW to best capture the shadows and highlights. I could also shoot bracketed exposures to capture the full tonal value, but I have found that shooting RAW in this situation yields images that I can work with to get the results I want, and it is a bit simpler than bracketing the exposures and post-processing those (although I have also done that).

Back home I import all of the images into Adobe Lightroom. In this instance, I started by doing an “Auto” process on all of the RAW images, which lightens the shadows and tones down the brightest highlights (like the sun!), then change a few other parameters (primarily Clarity, Vibrance, and Saturation) to make the image a bit more to my liking. I might also do some additional brightness adjustments if I feel that is necessary. I then export all of the images as JPEG files.

I use a program called PTGui (https://www.ptgui.com/) to create the panorama image. It is a very capable program, and can process HDR or RAW files directly, but I feel I have the control I want in a way that makes sense to me by doing the initial processing in Lightroom. Once I have the JPEG files, I import them all into PTGui. It will automatically (and magically!) align the images. Once they are aligned, if there are any problems, I can “assist” PTGui to find matching points in adjacent images. I usually only need to do this when some of the images include almost all sky or water.

It the panorama is shot from the drone, I can’t shoot straight up as the camera is mounted below the drone, and the drone blocks the camera’s view. That leaves a hole in the sky above. In this instance, I use a special mode of PTGui to export an image of the “top” of the panorama. Then I use Photoshop to fill in the hole with “sky color” similar to what is around it, and then “reassemble” the panorama with PTGui.

When using a tripod, I can shoot straight up, but the tripod is in the way when I shoot down. So when I am finished shooting all of the images, I pick the tripod up and take a shot of the ground where it was. Many of the images from the tripod pointing downward contain parts of the tripod, such as the camera platform or the tripod legs. I can select these images and indicate to PTGui which parts of particular images should not be used. If I don’t to this, some of the tripod will show up in the resultant panorama.

Once I’ve done all of the point matching and/or masking, if needed, PTGui creates the panorama photo, which is a JPEG file in a format that panorama programs can interpret. If viewed with any “normal” photo program, the image looks quite distorted as shown below. Even though I took the tripod out of the panorama, you can still see its shadow. Here is the Gates Pass JPEG image.

Gates Pass 360° Panorama
Gates Pass 360° Panorama

You can see the resultant panorama at https://roundme.com/tour/523925/. Once at the site, use your mouse and scroll wheel to look in different directions and zoom in and out. Or view this on a tablet or iPad. With the right browser, you will be able to look in different directions just by turning the tablet.

To see all of the panoramas I have published, check out my Panorama Page at roundme.com/@garystebbins. When on that page, click the “TOURS” button to see the panoramas I have published. Some of the images here have been shot with my camera on a tripod, while others have been shot from a drone. Keep watching this site, as I will be adding new panoramas from time to time. 🙂