He can't remember where his office is, but he can program machines to check the icing on cakes - Adrian Mourby meets a Cardiff friend of Mr Kipling.
Bruce Batchelor does not look like an archetypal absent-minded professor. He is very much on top of his subject. For 25 years, Batchelor has created computer programs that will allow a machine to see and - more importantly - to understand what it sees.
Nevertheless, he can be a bit vague. "This sequence can be replaced by a single command," he announces while standing at the overhead projector in front of a packed class of Cardiff University students. "But my mind's gone a complete blank as to what it is. We'll draw a veil over that, shall we?" Later, when he invites his class to see a practical application in his laboratory, he cannot quite remember where it is. "S2-21," he decides. "Or is that my room number? Does anyone know?" What Batchelor can remember is a fascinating method for explaining how he has programed machines to recognise playing cards, set correct place settings at a dinner table or tell the time. Any Batchelor-built robot would be able to recognise that it is ten past four by observing the angle between an analogue clock's two hands. Not many machines can do that.
Facing students who range from BScs in computer science and MScs in artificial intelligence to engineers and mathematicians, Batchelor has refined a simple technique for illustrating machine vision that, as he puts it, has to work at the lowest common denominator.
"This session will give relevance to the theory," he announces. "It will show how image-processing operators can be put together to perform useful functions."
Many years ago in Cardiff, Batchelor developed a combination of processing operators so that a machine could be programed to identify the suit and number of a playing card.
"We only ever thought of this as a piece of fun," Batchelor explains. "Last year a former student of mine, Chris Bowman, got in touch to say that he actually sold a machine to a casino in Melbourne that can check a winning hand."
The Batchelor approach to identifying objects involves teaching the machine to create a convex hull around it. Batchelor refers to this as placing a notional "elastic band" round the object to be identified. A number of spaces left between the elastic band and the object will give an indication of its identity. Clubs, for instance, produce four bays, a common term in the world of machine vision because they resemble inlets on an island. Hearts produce three bays, spades two, and diamonds none. Thus a machine running Batchelor's program can decide the suit of a card by counting bays, and its numerical value by counting how many times the image occurs on a card.
If the idea of machines with vision sounds alarmingly futuristic, Batchelor is able to make the workings of his programs easily accessible.
Sitting at his computer he demonstrates how PIP (the name given to the Batchelor program) can identify a correctly laid table setting. "I have a spoon to the right of a knife," the screen flashes up. "I have a fork to the left of a knife."
Yet when Batchelor presses the button to ask PIP whether the place setting is acceptably laid he hits a key twice by mistake and PIP begins comparing the relative sizes of Britain and Ireland. The students have to be sent out for coffee while he tinkers with his brainchild.
It is this human touch and his humour that make Batchelor's lectures a huge draw.
He reels out a string of anecdotes to keep the class amused. "In 1990, I was working for Mr Kipling and the factory was producing huge quantities of cake - the daily output was measured in kilometres! My job was to write a computer program that could guarantee that the decoration pattern was applied correctly and consistently. Our program measured the whirls and loops on Mr Kipling cakes, recognising any significant deviations from normal and then warned the production staff, so that they could take corrective action."
As we all know, it takes an exceedingly good academic to work with Mr Kipling.