Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Using Photos of a Sphere to Create a 2D Equirectangular Map?

  1. #1

    Question Using Photos of a Sphere to Create a 2D Equirectangular Map?

    Hi, per my subject line, has anyone ever taken photos of a 3D sphere (e.g., a tennis ball, watermelon, mineral sphere, or other) and translated those surface images into a 2D equirectangular (or Mercator) map for editing in Photoshop?

    I'm basically trying to do with small spherical objects what NASA has done with some of its Mars and lunar orbiters, where it shoots the entire planet's surface from a distance, then combines those images to get a 2D map. Kind of like this.

    Thank you!

  2. #2
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,610

    Default

    It's been a while since I did the precise task of remapping textures to an object, but here are lots of ways to go about it. It's particularly easy if your photos are guaranteed to cover the entire sphere. A quick search for "create 3d model from photos" should off insights for that as well as suggestion for automated or semi-automated processes.

    One way to do manual alignment is to use a 3D program like Blender and align your photos as textures over a sphere ( https://blender.stackexchange.com/qu...ge-on-a-sphere ). Bake the aligned textures into a single spherical UV map for the sphere and there's your Equirectangular map. More images with overlap is better, of course, but you can do this with just a few images if needed (or half of a sphere from just one image as they did with early moon mapping as described at https://www.futurity.org/moon-maps-l...nding-2109642/ ).

    Another good search term is for "create 360 panorama from photos". Looking from the center of the sphere outwards (a panorama) is more or less the same problem as looking at the center of a sphere.

  3. #3

    Default

    Thanks for the reply, and I might just be misunderstanding you, but...what I'm trying to do sounds like the exact opposite of what you're describing. That is, I don't want to make a 3D model from photos. Instead, I want to take photos OF a 3D model and turn them into a stitched 2D composite photo.

    You mention, "Looking from the center of the sphere outwards (a panorama) is more or less the same problem as looking at the center of the sphere." That doesn't seem correct to me because (again, I'm likely just misunderstanding you, so I apologize for the confusion) when viewing a sphere from any angle you will only ever see half of it, whereas looking at a panorama you will see the entire thing. That's the problem into which I keep running: I can easily take a single photo of a sphere and stretch that into an equirectangular image, but it doesn't cover the entire surface of the sphere I'm shooting, therefore the single-image version would always be incomplete.

  4. #4
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,256
    Blog Entries
    8

    Default

    The way you need to go about doing this is to map coords on the real sphere so that you can get your equivalent pixels on the image located in the mapping.

    Looking at the reflection of a polished ball bearing is quite similar to taking a panorama. I think its different but less so than you might think. If you have a pretty calibrated setup then you can use maths to map the photos to 2D but its a lot easier to let the computer do it.

    There used to be some programs in a suite called Panotools - apparently still available (https://panotools.org/dersch/) where you can take panoramas and stitch them. I have seen that used on ball bearing reflections too.

    The way to do if you can only do it approximately without calibration is to take multiple photos and try and set up the UV coords in blender and let it texture map a sphere. Once you have the UV maps all lined up then it can unwrap that texture back to a 2D with a projection.

    The other way to do it would be to take zoomed up photos of the sphere rotating it about and using a paint package to stitch the bits together with a bit of warp to get it back to 2D. But thats a bit laborious.

    A lot of this depends on how big the original ball is. Is it a globe sized or something much larger or smaller than that.

    Edit: I think Waldronate is correct. The bit your missing in understanding is that once you can create a virtual 3D ball textured in blender from photos taken from a real ball such that the virtual ball matches the real ball, then blender knows enough about the texture mapping to unwrap them back to a 2D Mercator style map.
    Last edited by Redrobes; 09-13-2023 at 02:28 PM.

  5. #5
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,610

    Default

    The approximate solution is to take multiple views of your sphere from different angles and then convert the approximately Orthographic map projection into a piece of an equirectangular one and merge those together. That's what the blender technique does, but automatically doing the merges.
    If you're comfortable using random executables from the Internet and are running Windows, I wrote a program to change map projections for images somes years back. Download and install http://fracterra.com/ReprojectImage.zip on your windows machine. Then process each frame ( you'll need at least six images with four around and one from each pole), starting from Orthographic. You will see a preview with the stretched partial images (one image can cover at most one hemisphere, but it will probably not quite be right because you probably don't have a telecentric lens system). After you get your images processed, align in Photoshop and you're done.

  6. #6

    Default

    Ah, that makes sense now. Thank you. The spheres I'm photographing are mineral spheres of different sizes, with each one being its own project. The smallest is a little less than three inches in diameter and the largest is about nine inches. They have very cool natural patterns in them than lend themselves to map-making, provided I can actually extract maps from their surfaces.

    As I'm writing this, I'm running some panoramic software to test what you're saying. I'm using PT Gui. I'm not sure if it will work, but I'm happy to give it a try. If this doesn't work, I will try Waldronate's and your suggestion of running the images through a 3D program to place them on a digital sphere, then extract them to a 2D surface.

  7. #7

    Default

    Thank you for the further explanation. It makes more sense to me now. I will try to replicate your steps. I can’t use your program, though, since I’m on a Mac, but I appreciate the offer. Maybe could do it with Wine. Hmm. Either way, I’ll keep practicing.

    And for what it’s worth, the reason I’m doing all this is because some mineral spheres have really cool natural structures in them that resemble coastlines on a planet, and I thought it would be cool to make maps of them.

  8. #8
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,610

    Default

    If you have mineral spheres, you probably have one of those fancy pronged display stands that hold the sphere up off the ground. Put that on a lazy susan and then it's easy to get as many well-aligned frames as you want around an axis of rotation of the sphere by turning the lazy susan. The display stand makes it easy to twist the sphere to get the poles visible. Sometimes, it's easier to move the object than the camera and having well-correlated photos usually makes it easier to stitch things together if you're doing it manually.
    You might need camera-attached matte light or ring light to avoid weird highlights when using the basic lazy susan rig, though.

  9. #9
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,256
    Blog Entries
    8

    Default

    Quote Originally Posted by gkoch1 View Post
    I'm using PT Gui.
    Yes, PTGui is the PanoTools with a user interface on them. So I think that's an excellent place to start.

  10. #10

    Default

    I tried using PT Gui and couldn't make it work. Moreover, the folks over at the PT Gui forums told me that PT Gui can't do what I'm seeking.

    Now I'm back to Square One. Hmm.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •