Monday, August 17, 2015

2D to 3D Conversion - Marilyn Monroe and Tom Ewell in The Seven Year Hitch

Still from the movie "The Seven Year Hitch" starring Marilyn Monroe and Tom Ewell.

Sparse depth map on top of the reference image.

Sparse depth map all by itself.

The sparse depth map was painted in Gimp using the crayon tool. I just kinda guess what the main depths are and hope that Depth Map Automatic Generator 4 (DMAG4) will fill in the depths so that (hopefully): 1) the depths within an object are as smooth as possible and 2) the depths don't "bleed" into neighboring objects at different depths. Now, you may ask: How do you know if the depths you are painting are even accurate? Well, you don't and it doesn't matter as everything is relative (don't put an object that's behind another in front as that would be very problematic). Since DMAG4 smoothes the depths within a similar color (considering the reference image), it's important to paint across color changes within an object, otherwise the depths will not propagate correctly. Here, I use the cartoon philosophy of planar cardboard objects at different depths. The Champagne bottle and the bag of chips are in front, Marylin is behind, Tom is behind Marylin, and then you have the background. That's easy as pie. When you save the layer that contains the sparse depth map, save it as a png file (or whatever format that has a transparency channel), otherwise you are gonna lose the transparency and DMAG4 ain't gonna work properly (when you load the depth map in DMAG4, the transparent areas should be red, not white).

Dense depth map obtained with Depth Map Automatic Generator 4 (DMAG4).

Obviously, there's a little bit of tweaking to do but that's not a big deal. It probably takes 5 minutes to fix that depth map (probably faster if you have a tablet and a stylus), as long as you are not too picky.

Depth map after a little bit of tweaking in Gimp.

Animated gif obtained in Depth Map Viewer.

You can clearly see how flat the objects are. I guess one could spend a tad more time rounding the objects but I don't think it's necessary for 3d wiggles.

Animated gif (3d stereoscopic wigglegram) obtained in Wiggle Maker.

It's very difficult to properly inpaint when all you have is a reference image and a depth map, especially when the inclusions (areas to inpaint) are relatively large. In an ideal world, one would probably need to inpaint manually but that would be kind of a drag. I am not sure people care that much about the inpainting accuracy but I could be wrong.

Can this pass as 3d? I dunno anymore. Let me know what you think!


  1. For a neophyte is complicated, but for someone accustomed to photography, drawing, someone who knows the basics of perspective can be a very attractive challenge to solve

  2. Pepe: I agree but, in the end, if you want a flawless 3d animated sequence, even if the depth map is near perfect, you're still gonna to have create the views that make up the animation manually because of the occlusions that show up when you move the camera around. I am not sure it's worth doing unless it's a commissioned (paid for) piece.