Archive for April, 2006
Digression
Saturday 29th April
Where do I start?
We went out to the shops this morning - Sarah had to go to the post office and the veg shop, I had to venture further into town for wilko and so on. So, having been to the post office around 9:30 we parted and I expected to be home around 10. So, I did wilko… still on track, but they didn’t have the lightbulbs I needed, so I thought I’d go up to the other end of town, but detour through the park because it’s always nice that way.

Well, as I passed our carillon tower, I noticed the front door was open. As part of my ‘getting over my fear of heights’ thing that I’m working on, I’m going up towers. I went in and asked if I could go up, and yes, for fifty earth pence I was allowed up the tower. The first ninety steps were fine - a stone spiral. The next thirty weren’t so nice - by now we’re in the bell room so the stairs are wooden and narrow and steep and run up the wall for the first twenty, then make their way across the middle of the room on a gangway and up further to the outside.
It took a little while to get the courage up, but I made it and began composing myself out on the balcony when the bells started playing. Bells are QUITE LOUD™ when they are very very near you. I nearly pooed myself.
Fortunately, I then got used to the bells and took some photos before returning to earth, watching the carilloneur spazzing out all over the huge mechanical keyboard on the way down - his little room is just below the bell room, not surprisingly.
As I exited the tower, I noticed some sort of goings on over the other side of the park - I think these must have been hidden by the trees while I was up there - so I pottered over. The mayors of Loughborough and Epinal were dedicating a bench to commemorate 50 years of the twinning of our towns. This was followed by some French folk music and dancing by Les Pinaudrés which was actually rather good. I managed to practice some of my ‘people’ photography… results are over here.
Once all that was over, I just had a chinese wedding to get past before I could recommence my shopping trip after only a minor two-hour diversion.
And I forgot the orange squash.
Perfection
Friday 28th April
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
For a week now, I’ve mostly been removing huge chunks of code. It has been a hard slog, but this morning I remembered this quote, and it became a lot more satisfying.
It’s still miles off perfection, but it gets closer every day.
Summer
Thursday 27th April
Summer is coming… the May Blackthorn blossom is out!
Error Logging
Thursday 27th April
I’m currently visiting a huge amount of error logging code, pulling it from a complicated pile of spaghetti no-one understands into a lean easily useable piece of design. Error logging is absolutely vital in code, and if you’re in any kind of service industry where your only window to problems on site is the returned logs, you need to be careful.
Here are a few musings…
1. Make it easy to use on site. The front-line guys being shot down by the customer while their system blows up do not have a lovely cushy job like you sitting at your desk. Make it easy for them to find logs, and to find relevant parts of logs.
2. Split logs into verbose and normal categories. Don’t overdo the number of categories, but there should be a category which logs everything going on (verbose) and one which logs only error conditions (normal). That way, you can work from the ‘normal’ logs first, and have the verbose ones turned on and returned if necessary later.
3. Don’t log multiple times in a single logic thread. Once a decision has been made by an if, while or case, you don’t need to narrate what is occuring. A log to say which decision has been made is sufficient.
4. Don’t write too many lines of logging where fewer would suffice.
I intend to update this blog with more information, some editing and more case studies. Any input would be appreciated!
Case study 1.
Here, we see a couple of problems:
log("Doing job X") if (x_handler != null) { log("Calling handler") x_handler(); }Firstly, in a working case, we get two lines of logging. In a non-working case, we only get one. This is the wrong way round - exceptional circumstances should log more than normal circumstances. Secondly, we are always logging this information. If this is a commonly occurring event, you will fill the logs with rubbish and make it difficult to spot errors.
Solution:
if (x_handler != null) { logverbose("Doing job X. Calling handler") x_handler(); } else { log("Doing job X. ERROR: handler was null."); }Now, we only ever get one line of logging if job X is attempted - whether it passes or fails. Also, the normal case only appears if we turn on verbose logging. The error case always shows up in the log, and it’s easy to spot and search for.
70-200mm f/4 L
Wednesday 26th April
Ever since I bought an adaptor so I could mount the old Olympus 135mm lens on my camera, I’ve been getting more interested in the sort of things that are possible with a telephoto lens. I actually leave it attached rather a lot - certainly the swan, landing duck and sheep were all taken with it. Unfortunately, it has a few nasty problems. Firstly, it’s manual focus so I have to stare intently at the focussing screen to get it just right. Secondly, it has a bad problem with fringes - red lines appear around the edge of objects which I have to photoshop out before presenting the photos. Thirdly it’s a fixed focal length, so I can’t zoom in and out to get a better composition.
The result of this is that I’ve been moving off the idea of a macro or portrait lens, and more towards a good telephoto zoom. I can see many situations where I’ll use it, and hardly any where I’d use the others.
So - having decided to go for a telephoto zoom, we now get on to the camera shop part of the blog. My opinion of Jessops has changed. As someone who likes to support local independant traders, I usually avoid places such as PC World, Jessops, Dixons and their ilk. However, on several occasions now, I’ve been into the LPS (local photo shop) and had a conversation along these lines:
Me: Hi, I’m thinking about getting Canon lens X or Y.
LPS: Well, we don’t really sell those, sir, we sell A and B by CheapCo which are much cheaper and only a bit worse.
Me: But I don’t really want worse. I’d have better if I could afford it, and I’m saving up as it is.
LPS: Well… we don’t stock them, but you’re welcome to buy A or B.
Me: I’d ideally like to try them, but obviously I can’t. Could you give me a price anyway?
LPS: Well… um… we don’t carry their price list because we don’t want to sell them. But we can order a price list if you like.
Me: Argh.
Always moderately infuriating. So yesterday, I don’t know what posessed me, but I went in Jessops. The first thing I noticed is that the prices were not very expensive. A later check showed they were less than a fiver more than my usual dead-cheap online supplier, so that’s ace. The next thing I noticed is that a man was quite willing to answer questions for me, and said if I take my camera body to the shop, I can fit the lenses and try them out. So today I did just that. It was a toss-up between the 70-200mm f/4 L (upper) and the 70-300mm f/4-5.6 IS (lower).

I tried the 70-300 f/4-5.6 IS first. Good points - the image stabiliser really works. The normal shake associated with holding a large lens is totally missing from the image seen through the viewfinder. Also, the 300mm focal length reaches a good long way. On the bad side, though, the build quality is awful. Plus, the zoom causes the lens to lengthen a great deal as shown in the photo below of both lenses fully zoomed:

Secondly, the whole of that front section rotates while focussing. If you’ve attached a polarising filter, where the orientation matters, then you have no chance. I find it amazing they can sell lenses with such design flaws, but they do. Maybe that’s why it’s the same price with an image stabiliser as the L lens without.
Anyway… on to the f/4 L lens. This has exceptional build quality - L is Canon’s mark of top quality optics and design, and everything happens internally, so on focussing and zooming there is no change at all to the external size of the lens. The lens is designed such that the aperture doesn’t change as you zoom in further - quite rare. So while the former lens is only f/5.6 at full zoom, this one remains at f/4 throughout its range. Next, the optical quality really is astounding. I took a few test shots and as you’ll see below, without moving from the spot I was standing on, I managed to get quite a good amount of detail in the far distance. Hopefully from the sequence, it’s clear where I’m zooming.
I know the final picture isn’t of great quality, but when you consider this is a 100% crop of the image taken from the back of a shop, the other side of a wide road from the cigarette butt, it’s really not too bad!



If we look at a quick comparison with the f/4-5.6 IS we’ll notice firstly the much lower optical quality with blurring and ‘ghosting’ effects present, but also the much better contrast and colour rendition. First the f/4-5.6 IS then just so we can see it again, the f/4 L example from above.


Time to start saving up.
Unimpressed
Wednesday 26th April
I’m sorry… sometimes, something just gets me laughing so hard.
The largest collection I’ve ever seen of photos of someone looking completely unimpressed while meeting a vast array of Disney characters. Scroll down to the section subtitled ‘THE Photos’ over at this here page.
Great work, DoGGa!
Making a model
Tuesday 25th April
1. Take a suitable source picture. Good things to look out for are:
- Strong lighting - models will normally be lit by a single room lamp. Strong shadows help the illusion.
- High vantage point - it’s rare that you take a photo from ‘inside’ a model, you’re normally looking down on it.
- Long lens - to compress the perspective.
- Large - make sure the resolution is large enough to work on. My source is 1000 pixels wide.
- Simple - the mind won’t accept it’s a model if there is too much going on, or too much detail.

2. Once you have your image loaded in photoshop, duplicate the layer and add a blur to the top layer. It doesn’t really matter how much right now, it’s only for visualisation. I used about 4 pixel Gaussian blur, I think.

3. Now we start getting complicated. Show the layer mask for the blurred layer and create a gradient blur giving black at the focal point and white at the extremes. This means that the blurred layer will be visible in foreground and background, and the sharp underlying layer will be visible only in a narrow plane.

The results can be seen below:

4. Now we start to really pop the model from its surroundings. Working on the layer mask, use a brush and the alt key to pick up the mask value at the ground level of any vertical objects, and paint over the object with that value. So… the base of the house is in focus - being on our focal plane, so we pick up the mask value (black) and paint it all over the front face of the house. Because the front face is in our focal plane, it should have full detail and not be affected by the gradient of focus.
Similarly, any trees or other tall objects should have the colour at their base picked up and painted over the whole object. The results start to look good:

And your layer mask should look something like this:

5. So far, we’ve only been working on our ‘preview’ blur. Now we’ll do it properly.
Duplicate the first (non blurred) layer and drag the layer mask onto it. Discard the ‘preview blur’ layer. We should now have two identical layers, but the one on top has our crafted layer mask applied to it (with no effect right now).
Now, apply a lens blur, taking the layer mask as the depth map source. That means a high-quality blur will be applied with defocussing matching the mask we have created. The settings might look something like the following, but fiddle around until you get a good effect:

6. Our results are now looking pretty good, but there’s a slight hitch. Any defocussed foreground objects will have sharp edges. See the bush in front of the left side of the house? It has blurred detail but sharp edges:

Simply use the blur tool on such objects until their outlines are pleasingly indistinct:

And we’re done.
Danger, Will Robinson
Monday 24th April
I was challenged some time ago by Milk Monster’s Mum to take a photo in a home-made camera, on home-made film. Never one to ignore a challenge, I’ve been thinking about it off and on ever since.
I’m currently thinking along the lines of a home-made box camera with a simple lens and long exposure (in the region of several hours) of film made from a geranium leaf.
Information on the film appears on Grand Illusions (thanks to DIY Photography for finding that). The only problem I have with that so far is the bit where I have to simmer the leaf for an hour in warm meths.
Having seen meths go up in flames - which it does rather easily - I’m not so sure about that. If it’s warm, surely it’s even more likely to burst into flames.
Bakewell
Sunday 23rd April
Today, I took Sarah up to Chesterfield for her market then went on to Eyam (I blinked and missed it) then messed around in Bakewell for a couple of hours - I didn’t have a Bakewell pudding, but did find a chippy that does deep-fried battered Mars Bars. Strange - I thought they only did those in Scotland. Anyway… I pootled around the copious amounts of river with my camera, taking pictures of the waterfowl there.


I applied the polarising filter for an amount of time to kill the reflections so I could see underwater. It was great watching a tufted duck in action, and the fish were at least the length of a goose.



Then I headed out to Monsal head to get more photos to turn into models - they’re to come hopefully, then back to Chesterfield stopping off at a field full of sheep and lambs (of course).

That’s all the pics for now. Plus I owe Henry some - we went to the canal with our Sea Magnet yesterday and netted a pile of stuff including two bikes and a hotel room key!
Model
Saturday 22nd April
Today, I mostly learnt how to turn a real photo into a model…




