Showing posts with label equation. Show all posts
Showing posts with label equation. Show all posts

Thursday, July 4, 2013

Peel!

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! 

Finale
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?




Thursday, June 27, 2013

Paralyzed...

As the title says. This week I've been paralyzed. Not much activity (except of some self portrait issues) and all of that because of, mainly, the car issues. In the middle of the week we had a special religious occasion and it is customary to fast on this day so I did fast 2 days in fact - and with fasting, my powers go down a bit and I wouldn't be able to do much after working hours. some ideas are there, but to work them out, I would need either more resources or, so to say, more objects to buy and/or help (something I seriously lack).

Source: B&H
My savior cable turned out not much of a savior. However, it still works. After getting the Vello 33' cable, I've found out that I can't access the speedlites via the menu in camera but I have to do mostly everything manually. Strangely, this problem persists only when the speedlite is attached to the far end, but I can access the menus when the speedlite is attached to the main head connected to the hot shoe on camera.
After contacting B&H they did indeed help me out and sent me a Return Form to be sent through UPS, but unfortunately, this service doesn't work out for international destinations like from Kuwait. Thus, I have to keep myself contented with what I have right now. The main thing is applying High-Speed options which might be problematic, but the wireless triggering works just fine so probably I would have some work out around this problem.

Source: B&H
On the other hand, the new ColorMunki is working just fine and I've already calibrated my new laptop and the desktop monitors. What is left is to try out and calibrate some projector (which I don't really need but to get the hang of it) beside doing some printer calibration when possible. All of that is on hold for the time being till I finish my car problems!
What I like about this ColorMunki is the more sophisticated options it has (beside of course the basic calibration which a beginner can still use). It has options to calibrate according to the ambient light or according to a light temperature (e.g. D50, D65) and so on. My monitor now looks significantly darker than it was with the calibration done from the old simple ColorMunki (with monitors settings set to default or factory settings).

Other toys are just fine and the pinhole mount specifically needs more experimenting, but initially the test is fine. For the time being, I'm thinking of using my light meter to initiate the calculations for finding out the required exposure time when using the pinhole (of f/222). To find the required exposure here I would have to measure the light level at a specific f-number and then build up the exposure time up to f/222. I will try the simple formula:

V = 2*Log(N) / Log(2)
Where V is the number of stops needed, and N is the f-number. However, for N here, I would substitute for the difference in f-number (i.e. ΔN) between f/222 and the initial f-number (say f/8 for example). I'm not sure this is mathematically correct, because I think I'm suppose to drive ΔV and not simply V. Anyway, my mathematical expertise is not good enough to derive such a formula. My main, and simple, derivation is from the equation mentioned in Wikipedia's page here.
Of course then, after calculating the stops (V in this case) I would use it in the following formula to get the required time for the exposure:

T = S * 2V
Where T is the Time that we need to know for the exposure, and S is the shutter time calculated at the initial f-number (f/8 for example as stated above) by means of the light meter. You might think or feel it is kind of ridiculous to work with all these equations just to use a pinhole (while you have a set of lenses that I can use still with TTL systems), but trust me, it takes a physicist or a mathematician to realize the sweetness of such experimenting and the joy when you find out that you've done the right thing.

Away from this mess, I'm still spending some time with other people's photos and trying to enhance them somehow. Lot of nice photos but the noise level makes it horrible to work with such photos. Anyway, I'm advising everyone I can reach to get a real camera instead of a phone camera.
The Gaze
Canon EF 50mm, f/6.3,
400-1sec, ISO200.
In the meantime, I've decided to work with my own camera little bit and do a half-portrait; after all, I didn't take much photos of myself for a long time, and I didn't even edit much of my photos to make some of them as pieces of art. The setup was time-consuming and I had to stand, literally, in a jungle of tripods. 
I've taken many shots with different setups of the speedlites and among the tens of shots Ive taken, only one that got through, even with some lighting problems. 
The Gaze II (Edit)
The main problem here is that I was using the 430EXII speedlite with a honeycomb grid to act as a spotlight and give extra light to the eye area, after lighting the whole face with 580EXII speedlite plus reflector. Anyway, pointing the spotlight is so critical and I've never got it right after all, and as you can see in the images, the closest I could get is the area under my eye, on the cheek and thus we have an overexposure in this area specifically.
The Gaze III (Edit)
However, I'm glad that one shot survived at least from the tens of shots I've made (and how ironic in the beginning I was using the speedlites on the wrong side of my body). Everything in this experiment was set on a tripod; two speedlites, monitor, and camera. Moving was something delicate. My main idea in the beginning was totally different in which I wanted to use some flash drag technique while moving my face (to create a ghosting effect) but for this case I would probably need a darker atmosphere rather than the hall in which I've conducted this experiment. In hope that I would be able to do this soon. Just thinking about the configurations and the settings that I have to do makes me a bit sluggish and lazy to do all of that. For this experiment though, I might use a simple hatchet configuration, which is made by placing 2 light sources on the sides of the face, and yet because I have 2 different speedlites here with 2 different powers, I might as well have to change the distances accordingly, making the 580EXII further away from my face (or reduce its power accordingly) - and probably the guide numbers would help with this. New venturing, let's hope it goes smoothly without much headache!

Finale
As of writing these words, I'm still struggling with my car yet and I'm not sure there is an easy way out to fix the damn A/C. Living without an A/C in your car in Kuwait means a catastrophe for most of the fields of your life - because you need to do your business outside and with no A/C, you are simply a melted chocolate!
After the shock from the original car dealer which offered fixes for 520 K.D. (approx. US$1500), I've pulled the car from there without fixing it and now I'm trying to find a good substitute. Some times I do get some hope from some garage owners, and some times they get me down, but after all one thing is certain: it's not going to be a cheap fix. I'll be just happy to finish this topic and have some peace of mind before Ramadhan's arrival and the beginning of the fast.
Mom's situation worries me and it does sound more like a chronic issue. Despite the fact that she seems to be in a good health and she goes in and out of the kitchen as she used to do before, but the matter with the dialysis is not finished yet and my elder sister brings some bad news now and then. Poor mother, we keep the bad news away from her to keep her calm, and God knows what's waiting for her. Just wish if I can give her one of my kidneys if that was possible. The least I'm hoping for for the time being, is some reduction in her dialysis times.

All what I want for the few coming days, is to stare at the sky at night and see some stars. Just, some stars...