Tuesday 29 November 2011

Fourier Transform Image Processing.

Image and Photo editors often use various filtering techniques to enhance or degrade an image to the desired effect.
Often these editors do not utilise user controlled Fast Fourier Transform filtering to remove periodic artefacts in the image despite the fact that Fourier transform image processing is used extensively in image files such as JPEG files. It is worth noting that the same technology is used to process most lossy and some lossless audio data formats such as MP3.

Some third party plug-ins exist for image editors which try to bridge the gap, however there is software that exists in the field of Scientific image processing which can do an excellent job with everyday images.
This (unprocessed) image of a Netgem I-Player keyboard has strong diagonal banding which may be a result of the Moire effect. Click to enlarge Image.
The FFT (Frequency domain) image of this image looks like this:
The Low Frequency information is nearer the centre of the image and the high frequency information is nearer the edges. Brighter represents more information, dimmer represents less. The Horizontal and Vertical cross through the centre of the image is representative of the amount of information with strong periodicity horizontally and vertically. (The Keys on the keyboard are arranged in horizontal rows one above another).

The additional crosses in the four quadrants of the image represent the diagonally periodic information which is in the image as diagonal stripes; there are in fact stripes running in both directions with one set stronger than the other. The second set of crosses further out represents a harmonic of the first.

By strategically filtering the frequency domain information to remove these additional crosses then the diagonal lines should be removed from the image when we perform a reverse transformation.
FFT showing Filter.
The image after the inverse FFT has been applied.
The diagonal lines have been severely reduced with a fairly low degradation to the rest of the image. The lower contrast is a side effect of filtering in frequency space as it is representative of power loss or signal loss in these filtered frequency bands.

Notably in the processed image  the number 9 is clearer in comparison to the unprocessed image. The number 5 looks more like a 5 and less like an S in the processed image and, arguably you can read the left "Shift" key more easily than in the unprocessed image.
This processing technique has not magically gained extra information, rather it has removed that which obscured the desired image data.

The software used to process these images is the free, open source and cross platform Gwyddion: http://gwyddion.net/
This software is primarily aimed at Scanning Probe Microscopy image processing; something with which I am very familiar.

I think that there is room for this kind of image processing in image editing software to deal with unusual image artefacts including the Moire effect and vibrational noise sources.

A more technical overview of these processes is given in this link http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm

Friday 4 November 2011

Mounting SMB shares from NAS in Linux

When mounting  SMB shares in linux from a NAS box I got this error:

I discovered that the problem is the NAS device's implementation of SMB requires the "nounix" option to be specified.


Hope this helps someone.

Leak Stereo 30 Plus Speaker Plugs

This will only interest you if you already know what it is about.

The Leak Stereo 30 Plus Amplifier has a proprietary speaker plug which is very hard to source.


You can build a functionally compatible part using a terminal block and some pop-rivets of different sizes. I know that the Aluminium rivet is not a high grade contact, but it works very well in this application.
The Spacing is Spot-On, The bore holes fit snugly and the plug performs well with no apparent degradation.

This DIY Leak Speaker Plug will let you get up and running while you source the original or replace the socket with something a bit more useful.