Thursday, July 4, 2013


Long and boring technical post. Read at your own risk!

As of writing these words I'm still struggling with my car's AC problem. It works fine one time and not working again; just like that on and off. 
In the meantime, I got some time to do some ideas with my camera back home, and in this post, I'm dedicating my efforts to an old idea that I've long abandoned, for some time, for the sake of other ideas. I've tried to do it before with some specific approach so to say but now it is completely a new door that I'm peeking through!

Peeling Hope!
After many many trials done in very long time ago to do such an effect, I've came about to some kind of a breakthrough; yet it needs more work to be done, I have to say.
The thing I'm talking about here is what I call the Peeing Effect or maybe some people refer to it as the Reverse Panorama or Internal Panorama. The idea is simple: instead of doing a panorama of the space around you, do it in perspective to one object.
The idea is not new in fact. It is used extensively in many websites (specially retailers) to offer a complete view of the object at hand, where the user can click and drag to rotate the object virtually. This is also called Object VR (for Virtual Reality). But my story, somehow related, yet completely different!
What I wanted to do long time ago is to provide a flat 2D view of a 3D object without the need for rendering into a 3D environment with some interaction from the user. A simple image that tells it all. This is all what I wanted to do!
I have to say though, I did indeed try to do an Object VR before using PTGui but I didn't go deeper into that (since I've realized that there is a special type of software to deal with this render) but what got me more interested is the artistic touch of flattening a 3D object; just like planet Earth flattened by Mercator!
My very early trials did involve PTGui but they also failed, and I've done the effect manually using layers in Photoshop. However, now with some change in wisdom and the amount of knowledge I received from previous experiences in (regular) panoramas, I wanted to try it all over again (and for weeks, but only now I got the time!) with PTGui.

Peeling a seashell, done manually by stacking layers in Photoshop (2011).

 With such trials, one thing is for sure: The more mistakes you make, the better you get! As simple as that. For the time being, my simple target was one of my favorite mugs at home! Yep, I had this one (and it has a twin!) since I was 17 probably... or 16... some time before 18, I'm sure!
The first thought about capturing this with a smooth movement is to fix the rotating table in 5o segments. Of course this is done with the help of the base of my Manfrotto 303SPH VR-head. Up till that moment, I really had no idea of how am I going to connect images together using PTGui to make out one long connected peeled mug! I just had to do it. Total images: 360o/5o is 72 images. No HDR intended here but simple RAW files.

Manfrotto's rotating base with improvised disk fixed on top by velcro. Pardon the lousy quality. The image was taken in a haste and not by artistic means!

 As I uploaded my first trial, I was searching the web for some tips, but most of the tips are dedicated to Object VR and not for what I'm trying to do here: a peeling effect! However, the idea stroke me like a bullet when I was reading an online book sample (an old book as it seems) about panoramas and tips about camera types and what methods are appropriate in each case (unfortunately, I can't remember the book's name now, it seemed good!). Within the context, there was a discussion about Slit Cameras (also called scanning cameras I think) in which the shutters of such camera do actually move over the sensor providing a thin band of light covering a portion of the sensor, and this band eventually sweeps through the entire sensor (not sure in which direction though no difference I guess!). The word Slit here inspired me to do the same: what if PTGui only picks the control points from a specific region in which movement is recorded? That would be like a reverse scanning! The proper tool to do this is the Crop tab inside PTGui. The Crop tab is dedicated, originally, for those images in which you don't like to include some portions of the scene to be implemented in generating control points for the whole panorama - the exact thing you want to do when dealing with lower level shots showing your tripod's legs and portions of the VR-head (like the bulky Manfrotto 303SPH). It is like, literally, telling PTGui, please be blind in regard of all these regions and just look at this; a technical retinitis pigmentosa.
However, in my first trial, the mistakes were apparent: so much tilt in shots and such a disturbing background. Probably the background won't do much disturbing because of the slit I'm trying to implement, but the tilt can be a problem indeed for the overall image look. Add to the problems is the uneven light around the mug which changes on the surface of the mug while rotating. The critical question, however, was: of what portion should I take the slit? In other words, what should I crop in PTGui? Naturally, the answer would be: the middle portion of the mug. However, this approach still as so much thoughts going on in my head.

Example shot from the first trial. Notice the uneven light across the surface and the tilt, and of course, the disturbing background. I've tried to isolate it as much as possible with shallow depth (low f-number), yet I had to increase it and consequently, sharpened the background more.

Since the rotating base moves in segments of 5o, I thought first that putting the crop lines for +/- 5o around the middle point of frame would suffice. Anyway, more troubles came about. First, PTGui deals with pixels, not degrees! How many pixels are equal to 5o? The answer was not so obvious in the beginning but it was just in front of me and I didn't see it, until the second trial was done! The answer was simply to find out the movement of the edge of the handle (or any point) from one side to the other (that is for 180o) and voila! You got the equation: 1o=ΔPx/180o; where ΔPx is the difference in pixels for the relative location of any point on the mug (I've taken the handle of the mug to check for this) from one side to the other exactly opposite to it. Care must be taken here because pixels are not divisible; pixels must be an integer number! Thus whenever fractions appear (and they will appear of course) it is the approximation that shall be taken.

The width of the rotation in pixels as I've measured it. Measuring in the Crop facility inside PTGui can be better and more accurate rather than Photoshop. Also, it keeps the work all in one place instead of running 2 programs.

In the beginning, I've based my calculations for the crop on the central point of the frame as a whole (i.e. the middle point of the frame which lies at pixel #2592 width-wise of course), but with my second trial to shoot the mug, I've changed this approach (mainly because it was hard to situate the mug exactly in the center of the rotation), and I've decided later to take the edges of the mug (not including the handle) and find the middle point between these two edges and increase the crop to the left and right of that middle point.

(1) The width on which I based the central crop in my first trials. (2) The width I've used later to specify the central crop.

Originally, +/- 5o was not quite a sufficient quantity because it is so small that PTGui can not find matching points between one slide and the next, thus I've increased the crop to +/- 10o, 15o, 20o. I think it did work smoothly up to +/- 30o, but the more you widen the crop, the messy PTGui gets. This is natural because we have a curvy surface that rotates and that means distorted features from one shot to the other, thus making the alignment of the slides a hard task to do and frequently, no good results at the end. So, after all, we have to keep it minimum and sufficient to include details from one slide to the other (but of course this depends on what you are scanning with this method). In many occasions there were hard times with regular panoramas when I had to, ironically, take the seat of the computer and place control points to aid the computer on aligning images. However, in the case here with the peeling effect the matter goes to the extreme somehow with zooming in and trying to find some common features between 2 slides however possible, even if it takes you to the pixels level!

Down to the second trial after few achievements with the first trial with that lousy background and annoying light levels. This time, I've placed the set in front of a plain wall, and using the lateral arm, I've raised the speedlite (with a reflector and a diffuser on) on the top of the set to illuminate the mug and reduce shadows on its side. It is at this moment only that I've realized I can fix the lateral arm with a 1/4" thread instead of the typical 3/4"! With 3/4" I would have to place it on the monopod which, of course, is not a stable fixture, but here I've used the lateral arm with a regular tripod in a 1/4" thread, which was more stable, not completely!
Source: B&H
The next surprise was still waiting for me though! My savior is now indeed my savior! The 33' Vello cable did work as if by magic! I could access the menu of the speedlite from the camera's body and even work in High-Speed mode. I'm not sure what went wrong in the first trials, but now it is working. I was going to work manually already and I was ready to change the settings from the speedlite itself since I can't access the menu from the camera. However, I was saved! Everything was set and ready, even though with some tiny tilt in the mug still but it is far better than in my first trial (you can compare the images above).

Bring Me Your Mug
First stitching trial for the peeling, with the help of Photoshop to fix some stitching errors.

Generally speaking, there is so much to learn, but Bring Me Your Mug (After UB40's song Bring Me Your Cup) sounds promising. Initially, this is not the look that I've intended to stitch as I wanted the handle to show from the side and not in the front. Anyway, some Photoshop tricks were needed to finalize the image and fix some stitching errors, and also to bring the handle to the middle of the image, as it was, originally, on the left side of the image. The experimenting is still going on in fact and the image above is just a sample for this post as I'm still working on a better image, if any!

Mistakes and Thoughts
This experiment specifically sparked many things that I've never thought of before while working with PTGui. For example, the detailed options for Field of View and the Crop were some sorts of a taboo for me to touch. Not that I can't, but I've never felt the need to do so when working with a regular panorama, because these specific options were fixed automatically by PTGui. Now, however, things had changed. I need to know more specific details about the works of these options to guide PTGui to stitch exactly what I want it to stitch - Talk about a LOT of experiments to be done, not on camera, but with the software itself.
Moreover, there were some points that I think I'm still doing wrong. Even though I've tried to get over the mistakes done in my first trial, yet I don't think I'm able to get over all the issues at once. Typical. Probably I can list some issues in the form of points:
  • Center: Probably one of the latest issues that I've noticed. The center of the rotation to me was the center of the base of the mug. Apparently, this is not the case here because we have a handle dangling on the side! Thus, the diameter of the whole shape must be taken into consideration. Unfortunately for me, my eyes were concentrating on the bulky body of the mug and forgetting about the handle issue as if the body was a perfect cylinder.
    Possibly a better rotation center would be closer to the handle somehow.
  • Shape: I think, possibly, every shape is a project by itself. When doing such peeling effect to shapes other than this mug, I really need to pay attention to how things would turn out while this specific shape is turned around. I'm quite sure at the moment that whatever techniques I've used to compose this peel for this mug, won't absolutely work smoothly for other objects. I guess it is my mistake as well to start off with somehow irregular shape to do the peeling effect on; Should've started with a more regular shape.
  • Control: Up till now, I'm still not controlling PTGui as it should be. Mainly, I'm still not aware of a possible way to specify for PTGui what should be the central part of the stitch. It does it all automatically. Also, the way to make the panorama encompass 360o field of view is still not obvious to me. One time it works as if by magic, then once again it can't be done. The demonstration above, Bring Me Your Mug, was wrapped around by Photoshop and originally, it is not a 360o stitch.
  • Dimensions: So far, all the hassle is for a single point of view: horizontal. What if there are more freedom levels, like taking the object with the same rotation pattern at 45o (either by raising the camera up and pointing down or, which is easier, by tilting the object)? How things would go on with this approach? Definitely, a novel of technical talk.
  • Rotation: Is 360o stitch a must? With different objects that I can place, I'm pretty sure that at some point for some objects there are no interesting details at some angles. Take the mug above for example. I could have done it (and will work on it soon) with stitching 180o rotation only, I presume. Yet, I'm not sure how it would look. I have to look further into this. Moreover, what if I divided the stitch for the whole 360o peel into two 180o? Is it possible to stitch the two parts together? Also, more experiments need to be conducted.
  • QTVR: Unlike the typical panorama and the typical Object VR render, what if I try to make a QTVR out of a peeled object? How does it feel to the viewer? Interesting? Not? We shall see!
  • Photoshop: Stitching errors are inevitable even with a regular, well-done panoramas. Here, it is no exception. However, I know my limits in regular panoramas, and when to rely on Photoshop to fix the errors. Yet, I'm not sure what are the conditions here with peeling. I've been mangling a lot with the Blending option in PTGui trying to reduce the stitching errors, but my attempts were unsuccessful. What I've discovered is, for such stitches, the Blending option is so sensitive (probably because of the tight Crop), making a single digit change leading to a drastic change in the blend - That way, making things hard for me to control. Either way, Photoshop is absolutely needed, either to add or to fix features.
These are my thoughts so far about it and I can't tell many things until I work more with this peeling issue. Next time, I need to get me a simple object, with no handles!
I have some ideas cooking in my head as well other than this peeling effect but the excitement about this ruled me over and made me forget about other stuff that I've set my mind to. Hopefully, some stuff will be ready by next week! 

Source: Amazon
Currently, I've been reading the last book on my list, the Handbook For Classical Research after finishing with the previous Lens Design book. It is a relaxation book if I should say. Yes, it is dedicated for, probably, college students but here I'm reading it in a fast pace without much intelligence needed to digest the contents. However, without much intelligence doesn't mean no sparks of ideas or a dull mind, I presume. The book got some nice discussions, questions and arguments, but majorly it is a resources book if I should say to help the new comers to the field. Even though it is about the Graeco-Roman culture in general, but still, many ideas can be generalized, even into the venue of natural sciences.
Geltani, on the other hand, got some time out of my brain in the past two weeks but I didn't standardize anything yet. This venue is walking slowly I'd say. Probably I will post about it next week, if possible!
Meanwhile, I'm starting to get sick of things around me and specially my car. I'm trying to vent as much as possible through camera work or music. However, I've noticed that to some extent, my daydreaming habit was reduced with the reduction in music consumption. I'm now almost like a quasi-confident that in the Islamic culture and literature, music was frowned upon for some reasons like this one - Daydreaming. Anyway, with the pressure at home, and with my car that persists on giving me headaches, I'm finding myself thrown into a dilemma. I need to vent, to dance, to sing, and simply, to smile. Been a while since I've smiled from the heart, and I've been doing it mostly as a compliment to others. Let me tell you, I'm sick of the others. Closest ones, before the furthest.
In a world where everyone tends to be a philosopher, the classy and the mundane, who has the time for a gazing wretch trying to find a meaning for the word "Happiness," like me?

No comments:

Post a Comment