Project target and motivations
The goal of the project was to create a relightable image, which is a 2D image having the implicit geometry of a 3D one. This gives the user the ability to change the light source direction in real time, so that different details of the image can be better seen. There are two different mathematical approaches to RTI ( Reflectance Transformation Imaging), and those are called respectively HSH and PTM. Each has its advantages and weaknesses, so it's a trade-off and one must choose what matters most for his visualization. The HSH was developed after PTM, and works better with shiny objects and objects having a lot of self shadowing, thanks to the higher number of coefficients describing every pixel of the resulting image. That's why I chose it, since I was going to work with a silver medal.
There are of course other acquisition techniques, but those are not fitting our needs:
- 3D Scan is not appropriate, since our surface is almost 2D and we would need a very accurate processing. Also, the reflectance of laser beams on silver is a bit tricky.
- Image Based Modeling is really for 3D, creating the model from pictures taken around the subject, but our case we're not interested in viewing our medal from different angles.
- Dense Stereo Matching also works with pictures, but the resulting quality is way below our desired standard
So how does one create a HSH ( or PTM, they're the same acquisition-wise)? You have to take photos. Lots of them. Each one with the very same framing but under different lighting, meaning you point some light source to the subject following a virtual hemisphere. Also, you need to frame a black o red ball a fraction of the subject's size. It has to be shiny, so that the light reflecting from it is basically a white spot. The processing software will analyze each picture, find the ball position estimating a median from the whole lot, and then calculate the light source in each picture from the white spot position on the ball. Finally it will use a polynomial function to determine the color to be rendered for each pixel in all the different light source conditions.
Creating a workspace
This step proved to be quite difficult, especially in the beginning. I was sure about the tools I was going to use, just not as sure about how to set them up. I had:
- Nikon d7000 reflex
- HTC One S running Android with reflex remote app
- USB OTG cable to connect the two
- 35mm 2.8 lens 55200 3.55.5 lens
- Tripod
- Camping compact torch
- Black ball from an earring
- A piece of printing paper, A4 size
- Paper duct tape (lots)
- Sticky strips to hold the medal firmly in place
- Rope for distance measuring
At first I tried a vertical camera setup, with the medal sticked on the paper which in turn was taped to the floor. I placed the tripod-mounted Nikon directly above the medal and focused manually using the Android app to get the best precision. The lens I used then was the longer 55-200mm to get closer to the subject, however I soon encountered a few problems: I still had to zoom almost to the max, losing depth of field on the already thin medal and more importantly losing sharpness. Not only that, I discovered that pointing the light beam from some angles was rather hard when not completely impossible. So the vertical setup proved to be a failure.
I then came up with the logical conclusion of going horizontal: A4 paper taped on a wall in the living room, and tripod-mounted reflex pointing straight at it. This solved most of the lighting issues, but another problem came up, and that was distancing. I knew I had to try and keep the light distance from the subject as uniform as possible to get the best results, given the small scale of the whole workflow, so I tried to use a string of rope tied to the wall and to the torch, but it went in the way of the camera even worse than with the first setup. I had find a way to maintain the distance without going between camera and subject, something that gave me quite the headache. I was quite stressed, so I decided to scrap all the setups and ideas I had in mind and started fresh.
I knew that, theoretically, lights had to come from a virtual emisphere around the subject, and I needed something to "draw" that spherical pattern. Well, if you turn a semicircle around its edges, that's what you get: whole sphere with a 360 degrees rotation, and PacMan with a little less. I just needed 180 degrees and something to conjure that semicircle into reality, so why not using some cardboard from all the eBay thingies I got via courier? I took a compass, made some rough estimates, and drew a circle on the cardboard which then I cut with, well, a cutter. I taped it on the wall so that when perfectly horizontal it would cut the reflex frame in half, thinking it would not affect the camera's FOV at such a short distance. That proved to be only partly true, because I still had to shoot rotating the carboard at different angles, not all of which were picture-safe.
In the final configuration I cut the carboard I had crafted in two halves, leaving enough empty space between them as to have a clean FOV no matter the angle. Photos were taken starting with the two halves almost against the wall and then raising them at equal heights for each round of shoots until I reached the wall again, making a full 180 degrees. To keep them held up I used some rope and again the wall as a support. Some of the lighting would have to come from where the reflex body was, and that was something without a possible solution. I tried to put the torchlight as close as I could to the camera body and then angle it up or down, left or right following the semicircular patterns.
The setup was good enough, and the resulting pictures too. To shoot in sequence I used an Android app that let me automatically fire the camera at predefined intervals. Each image should have been identical to the others in terms of framing, since I used a tripod and didn't touch the camera body at all. However, there was a slight misalignment between scores of pictures, and I had no idea why until I realized that medal, A4 paper and cardboards were all connected and so, when I moved the cardboards, the paper was slightly pushed or pulled and the medal with it. The solution? Sticky strips between the paper and the wall itself, right behind the medal. That fixed once and for all. You shall not move.
Focusing with the shallower 35mm I was using proved to be a little tricky too. Luckily it is a very bright lens, so I could step down some F-stops and gain a decent depth of field, while still being quite close to the subject. For those who don't know, the depth of field is a way of saying how much of what you shoot is focused: since your subject has tipically some depth, you want all of that to be in focus. Our medal is thin, but it still is engraved with bas reliefs so our DOF cannot be too shallow. F-stops are a measure of how much light will reach the camera sensor when you open or close the diaphragm that stand between it and the glasses of the lens. The more you close that down, the more DOF you get and the darker your picture will be. So it's a tradeoff between focus and brightness where you have to find the right balance. Also, each lens has a minimum focusing distance: get closer than that and you won't be able to focus anything because of the lens physical limits.
Counting all the different tests and trials, I took three rounds of acquisitions for the front of the medal, and two for the back. You never know when you accidentally brush against your tripod a little too forcefully, until hundreds of pictures later you are sittig at your PC and realize they're misaligned. Then you bang your head to the wall.