• Subscribe

    Subscribe to This Week In Panospace by eMail.
    Subscribe in a reader
  • License

    Creative Commons License
    This work is © 2008-2012
    by Yuval Levy
    and licensed under a
    Creative Commons License.
  • Entries

    August 2008
    M T W T F S S
    « Jul   Sep »
     123
    45678910
    11121314151617
    18192021222324
    25262728293031
  • Archives

My most beautiful panorama, ever.

Stitched from out of camera JPEGs, using VNC over SSH, with no color management or other bells and whistles whatsoever other than simple plain use of enfuse on three exposures per stack prior to registration, warping and blending. But who cares about technology on such beautiful moments?

24 hours earlier the phone rang at my in-laws, where Nicole spent the last five weeks of her pregnancy at close distance to her doctor and the hospital. The baby was procrastinating and past his due-date. The time to trigger it has come. The hospital was ready for us.

Nicole’s parents drove us to the hospital. After check-in, while Nicole was being prepared, I went for the admission paperwork. The doctor came around 8:30, examined her, applied a gel, and left. The long wait started, accompanied by great nursing personnel that made sure Nicole is comfortable all along.

Nothing happened. For most of the day we were alone. We enjoyed this time, conscious that it will be the last moments of just the two of us for a long time. Nicole was given lunch while I had to cater for myself over the whole three days. Lucky me there are three big shopping malls on the opposite side of the road, and one of them even had free WiFi.

In the afternoon the doctor ordered to step up the effort and inject oxytocin intravenously. The protocol requires continued monitoring and attendance by a nurse. Staffing is a challenge these days as there are not enough nurses and doctors in Québec. Injection started at 16:00 at the shift change. The protocol prescribes regular increases of the dosis over a period up to 12 hours and is almost sure to trigger labor. AFAIK it is the last ditch attempt before a caesarean section, which we wanted to avoid.

We were bracing for a long night. I went for a quick dinner and brought back groceries for the night and morning. Gone was the intimacy, a nurse was with us all the time. We appreciated their presence. These nurses deserve a lot of respect and admiration for their dedication. They are not just “doing their job”. They went the extra mile to make us feel comfortable and develop a relationship. They went with us through the details of Nicole’s birth plan.

At first, also the oxytocin did not seem to have an effect. Nicole had regular but weak contractions throughout the day and they just continued. Then at 21.57 the water broke and things accelerated. The intensity of the contractions increased exponentially and Nicole could barely stand them. It was too late for peridural anaesthesia and anyway Nicole did not want it. Things went so quickly, they even surprised the nurse who had to switch from coaching Nicole’s breathing to pushing. She seemed worried about variable decelerations of the fetal heart rate and called the doctor. I was scared, anxiously watching the monitoring’s device printed graph while trying not to show to Nicole that I was worried. The doctor came in, reassured me and helped Nicole to a quick and successful delivery. At 23.33 the baby was born, that’s very fast for a first baby!

Unfortunately the night was not over. First, I had the honor to cut the ombilical chord and place the baby on Nicole’s belly, were it found her breast and had a first feeding. In the meantime the doctor diagnosed a placenta accreta. The delivery room became surgery room. I held the baby on my skin while Nicole had to endure preparation for the removal of the placenta which included peridural anaesthesia, a quite invasive procedure, and another dosis of intravenous oxytocyn overnight to avoid excessive bleeding after the intervention. Luckily all went well and the long day finished around 4.00.

I allowed myself two hours of sleep, knowing that the nurses were taking good care of Nicole and the baby every 15 minutes. I woke up spontaneously at 6.00, checked quickly the situation around me and felt lucky. The nurse finishing her shift even helped wiping the floor to remove most traces of last night. I shot the panorama and started the day. I typed a quick email to a few people living near enough for a visit to the hospital and sent it from the WiFi hotspot over lunch. This generated a welcome stream of visitors during the remaining 36 hours of our hospital stay that would have otherwise been quite boring and uneventful.

We went home Friday evening. The first night out of the hospital was difficult, but things have improved a lot since. We’re still at the in-laws, but we’re now confident we can make it without help. I even found time to process my most beautiful panorama, ever.

Pause

The moment we’ve been waiting for the last two weeks has finally arrived. I’m away for the next few days. Private matters. I hope to continue next week with a happy announcement and the Qtpfsgui TMO tutorials.

Inept Updater

Yesterday my Kubuntu 8.04 with KDE4 remix install alerted me that there are some updates coming. As usual, I clicked myself through the update procedure. But this time it just seem to hang after download. A click on the Show Details button revealed part of the reason (there might be a bug in the display, and I was not able to interact with the Package Configuration displayed):

Once again, the command line saved me:

Now the configuration dialog was functional:

Out of curiosity, I investigated the difference:

This time it was not me who was inept. I wanted to file a bug report, but others have bumped into this before and it has been fixed recently. Now I am waiting for the update to trickle down the kubuntu distribution channel.

TMO: Mantiuk

Mantiuk is the name given to the first tab from the right in the Tone Mapping Panel of QTpfsgui 1.9.2. Qtpfsgui gives access to a limited subset of Tone Mapping Operators (TMO) from pfstmo, a subproject of pfstools from the comfort of a graphic user interface. In this specific case to the mantiuk06 TMO, based on research by Rafal Mantiuk, Karol Myszkowski and Hans-Peter Seidel.

First thing to do when trying a new TMO is to check out the result with default parameters:

Then play with one parameter at a time to get a feel for them. Try first changing the pre tone mapping gamma adjustment. Below is the result with a pre tonemapping gamma adjustment of 0.500:

Back to default values, it is time to play with the algorithm’s own parameters. Send the Contrast Factor slider all to the right and apply. Then send it all to the left and appy. The resulting images are not ready for consumption, but they give you a feel for the slider’s action.

An interesting one is the Contrast Equalization checkbox. The parameters for the result above, with Contrast Equalization checked, yield a visually more interesting sky:

Next is the Saturation Factor slider. Again, try it at extreme positions, but remember that high saturation is one of the pitfalls of tonemapping. I actually liked the result above.

Mantiuk06 is a great algorithm also when used straight on RAW images out of the camera – assuming they have been properly exposed.

Qtpfsgui

Qtpfsgui (lead author Giuseppe Rota is open for rebranding ideas) is an HDR/tonemapping workflow tool available for Linux, FreeBSD, Windows and OS X.

It covers HDR creation through the merging of multiple exposures (using hugin’s align_image_stack functionality if the images in the stack are not perfectly aligned). And it does tonemapping, offering a choice of eight tone mapping operators (TMO). This is what I like most about Qtpfsgi: the variety of processing options that it offers. Each TMO has its own strenght and weaknesses, and thus its own fields of application. Try them all, you will find your favorites for the different shooting situations!

We’ll be looking in detail at the individual TMOs in the coming articles.

Common to all of them is that

  • we need an HDR image to start with
  • the image can be subject to a pre tone mapping gamma adjustment

Image to start with

Qtpfsgui can be used to compose HDR images from individual exposures. Or it can load the most common HDR file formats. Last but not least, it also load RAW images straight out of the camera. Granted, RAW images have more dynamic range than JPEG images, but in most cases they are still far away from true HDR. Nevertheless, applying TMO’s to RAW images can yield some stunning results. Dare to experiment!

Also it is important to note that the appropriate TMO settings and the results change depending on the type of image processed. Dare to experiment with all sorts of images and available TMOs!

Pre Tone Mapping Gamma Adjustment

Gamma correction is the application of an exponential function to compress (gamma <1) or expand (gamma>1) the image’s dynamic range. A gamma of 1 leaves it unchanged. Gamma <1 compresses the range, resulting in generally higher contrast and darker images. Gamma > 1 expands the range, resulting in generally brighter and lower contrast images. You will find out during the processing with the selected TMO whether applying a pre tone mapping gamma adjustment improves the image.

Last Warnings Before We Go

Tone mapping is a highly subjective topic. There is no right or wrong – follow your inspiration and develop your own style. Nevertheless, there are a few pitfalls:

Noise: If the source images are affected by noise, it is likely to be amplified by the TMOs. Try to shoot at low ISO, or filter noise in the input image before merging to HDR.

Settings: Don’t expect the settings for one image to do the same magic on a completely different image. Settings are case by case. With time you will develop a feeling for each situation.

Saturation: A lot of tone mapped images are over saturated. Keep an eye on it.

Post processing: You will often want to load your tone mapped image and use simple adjustment layers such as levels and curves in your favorite image editor. The goal of the tone mapping process is to reveal the detail, not to finish the image.

Inept Installer

This is what happens when an inept installer tries to use the Adept Installer that comes by default with Kubuntu 8.04.1. In this particular situation, I was trying to install and use krita, but it could have been any other application.

The box ticked next to it shows as if it is already installed, but it is nowhere to find in the menus and when I try to start it from the command line I get the message that it is currently not installed, with a hint on how to install it from the command line.

When I uncheck the box, it says it will remove it. Remove an application that is not installed? Whatever. I did not find the option to install it. I ended up solving my problem the easy way. Thank you, command line.

There is obviously a bug here, so I first went to the KDE Bug Tracker to see if it was known. It seems so, and it seems that this is a distribution issue, not a KDE issue. So I went to my distribution’s homepage (Kubuntu) and looked around. I found how to help out with Adept, and a pretty long list of bugs (as of today – the list is dynamically generated and will change in the future). That “Adept is currently very complicated for the average user when compared to Add/Remove programs or even Synaptic” is not very encouraging. Why punish the users? why not use Synaptic or another mature package manager?

I filed a bug report with KDE as well: the menu would not get updated after the install from the command line. This has affected me also when installing hugin, qtpfsgui and any other package I installed.

High Dynamic Range

For the purpose of image processing, Dynamic Range describes the difference between the smallest and largest discernible quantity of light. Anything that is darker is hidden in the shadow and anything that is lighter is blown out white – out of range.

Bernhard Vogl recently defined High Dynamic Range (HDR) in relation to Low Dynamic Range (LDR), where LDR is defined as “the range, your camera can capture with one shot”.

Our inherently flawed capture and display methods (as Mark Banas calls them in a private email exchange) improve over time. Consequently Bernhard’s definitions of LDR and HDR are a moving target.

Dynamic Range (DR) has a fixed relationship with the Contrast Ratio (CR), the ratio of the luminance of the brightest white to the luminance of the darkest black. They are both derived from the two extreme light quantities in the scene. They both define the boundaries of the range, but they still don’t say anything about what’s inside the range, it’s quality.

The stripes below represent what’s inside the range for the same, arbitrarily chosen DR, between the same white and the same black. They also have the same CR from white to black.

The last stripe, at 8 bits, most likely looks like a continuous gradient from white to black. A few modern displays have higher DR nowadays. Even if you are lucky enough to look at this page through one of those 50.000 USD displays, very few eyes are trained to discern such small contrasts. At less bits, banding occurs when the contrast between two adjacent steps on the scale becomes apparent to the average human eye.

What changes between the different stripes are the gradient steps, a characteristic specific of the primitive digital workflow where the number of steps is discreet and depends on the number of bits. At 1 bit there are 2 steps and at n bits there are n^2 steps. The quality of the DR is good enough when the contrast between two adjacent steps, is small enough not to be discernible as banding.

So what is high dynamic range? it is a push beyond LDR in two dimensions. First and foremost, to cover the scene’s complete Natural Dynamic Range and avoid clipping out of range luminance values. And then it is about the improvement of the quality inside the range.

Bernhard goes on to say that “you will certainly use [LDR] most of your times”. Similarly, Mark stated in the mentioned private exchange that before recurring to techniques to expand the captured dynamic range, proper exposure should be used to make good use of the dynamic range available from the capturing device.

That’s the starting point indeed. Beyond that, there are cases for extra-exposures, that can be grouped in two categories:

1. Increased Dynamic Range (IDR): is what photographers like me do when they add a couple of exposures at the capture stage, usually with the in-camera Auto Exposure Bracket (AEB) function, to improve the detail in the image.

There is a strong case for using this technique also with scenes that would fit in the default dynamic range of the capture device. The capture device’s response is not constant across the whole range. The extra exposures can improve the noise to signal ratio, particularly at the darker end:

And they can recover more detail in the highlights:

Averaging pixels across an exposure stack zeroes out sensor noise.

The technique is not always indicated since it costs more effort and has also drawbacks such as the ghosting when there is movement between the exposures.

2. “True” High Dynamic Range (HDR) is what graphic artists do when they make computer generated images (CGI) from virtual worlds using ray tracing software. When they use photographic input as image based lighting (IBL), they try to capture the whole Natural Dynamic Range. This often means capturing more exposures than what AEB as implemented in most prosumer and many professional cameras can do, often across ten and more exposures, either manually, paying attention not to move the camera when changing the shutter speed between exposures, or with computer-controlled cameras via USB or serial cable.

One could argue that at least theoretically there is an absolute natural dynamic range, marked at one end by the complete absence of photons and at the other end by the physically highest possible concentration of photons in space/time. But what is that highest concentration? nuclear fusion, like in the Sun? and how does distanceof the capturing sensor from the source of light affect the measured luminosity?

Both IDR and HDR processing require extra steps along the process. And tone mapping in the end: