Category Archives: General

Automatically removing foreign objects from photographs

Imagine that you’re on holiday, trying to photograph a famous landmark. There are sure to be other tourists around, messing up your photographs. But what if there were a way to automatically remove these interlopers from your photographs?

Here are eight photographs of the street outside a local car park, taken from the car park’s roof. In each of the photographs there is some sort of foreign object present – either a pedestrian or a car.

IMG_6524 IMG_6525 IMG_6526 IMG_6527 IMG_6528 IMG_6529 IMG_6530 IMG_6531

Below is a copy of the image, but with all of those foreign objects removed. This isn’t the result of hours of painstaking manipulation – it’s the result of running one special filter, a median layer blend, on the collection of images.

blend-resultThe median layer blend works by taking the colour values for the same pixel in each photograph and then using the median value as the value used in the output image.

For example, if the red values for the first pixel in each image were 234, 234, 197, 251, 222, 193 and 218 then the median would be 218, as it falls in the middle when they are arranged in order (193, 197, 213, 218, 222, 234, 234, 251). Because each foreign object is in a different position in each frame, the RGB values for the pixels that make them up will lie at either end of the scale, and those values will be eliminated when the median layer blend filter is applied.

It is very important that whilst taking your images that the camera remains in a fixed position; if the camera is allowed to move you end up with a blurry and oddly smooth image. The leaves in the output photograph above are slightly blurred because they were moved by the wind as the original photographs were being taken.

This technique is also very useful when taking photographs with a high ISO setting in low light. Images taken in low light are prone to noise, but because this noise is different in every image, a median layer blend filter does a very good job of removing this noise.

Here is a boring image of a London Tube network map, taken at ISO 3200 in poor light.

tube-map-original

If we look closely, the image is very noisy.

tube-map-original-closeupBut after running ten of these images through a median layer blend filter, the noise is very satisfactorily removed.

tube-map-comparison

L-R: The original noisy image and the resulting “de-noised” processed image.

I used the GIMP image processing software with the G’MIC plugin to create the images above, but I’m pretty sure similar tools are available for other packages (e.g. Photoshop).

Laser gyroscopes

A gyroscope is a device that uses the principle of the conservation of angular momentum to maintain it’s orientation. That is, when set into a motion, a gyroscope resists any attempt to alter the axis along which it is spinning.

Gyroscopes are commonly used (in combination with accelerometers) in inertial navigation systems (INSs) to detect changes in position, orientation and velocity. INSs were first developed for rockets, but have since been used in many roles, including aboard submarines, aeroplanes and spacecraft.

gyroscope-operating gyroscope-precessing

L-R: A gyroscope resists any attempt to change its orientation; and a gyroscope demonstrating precession. Note that during precession the angle of the spin axis does not change.

Most people know gyroscopes as spinning discs or wheels, as shown above, but not all gyroscopes operate in this way. For extremely high-precision uses ring laser gyroscopes (also known, in one particular form as fibre-optic gyroscopes) are used.

In a ring laser gyroscope (RLG) a beam of laser light is split, bounced off two (or more) mirrors and then these two beams are brought back together. When the two beams recombine an interference pattern is created, and by monitoring this interference pattern any change in the gyroscope’s orientation can be calculated.

A ring laser gyroscope

RLGs make use of the Sagnac effect: if the position of the mirrors changes during the time taken for the laser beam to travel around the ring, then the two beams will be out-of-phase when they recombine, and this causes the change in interference pattern that the gyroscope measures. (As a RLG does not maintain its orientation, it is not a gyroscope in the conventional sense – it is sensitive to changes in orientation due to the invariance of the speed of light rather than the conservation of angular momentum.)

RLGs are usually employed in groups of three, so as to monitor motion in three dimensions; an example of this setup is shown below.

ring-laser-ins

Because they have no moving parts, and because they are able to measure very small changes in orientation, RLGs have found many applications. They are used aboard modern fighter aircraft such as the F-22 Raptor and aboard the UGM-133 Trident II nuclear missiles used by the UK and USA.

Boomerang

The Boomerang Shooter Detection System is a gunfire locator system, designed for use against snipers, that tells its user the location of a source of gunfire, allowing those under attack to return fire. The Boomerang system can be mounted to vehicles, and works at speeds up to 60 mph, or can be used in a stationary perimeter defence role.

boomerang-mountedBoomerang mounted to an armoured vehicle.

When a bullet is fired it makes two types of noise: a muzzle blast as the round exits the barrel, and a supersonic shockwave as it moves through the air. By measuring the differences in volume and in time between these sounds reaching each of its seven microphones, Boomerang is able to calculate the range, elevation and azimuth of the shooter’s (or shooters’) position and then displays this information to its user.

This method is the one that humans use to locate sounds, though we do not have the benefit of seven ears. The algorithms that Boomerang uses are more complex than humans’, as it has to differentiate between incoming and outgoing fire, and between gunfire and other noises such as cars fireworks or cars backfiring.

boomerang-control-panel

The Boomerang display panel is shown above. Range and elevation are displayed on the green digital readout, and the azimuth is indicated on the clock display. This data is combined on the small circular LED panel in the bottom right-hand corner.

Zahavi handicaps

In 1975 biologist Amotz Zahavi proposed his handicap principle.

“It is suggested that [characteristics] which develop through mate preference confer handicaps on the selected individuals in their survival. These handicaps are of use to the selecting sex since they test the quality of the mate. The size of [characteristics] selected in this way serve as marks of quality.”

peacock-plumage

In some populations of animals some of those animals will display a costly (in terms of survival) handicap. The classic example of this is the peacock’s tail: The presence of the tail makes it more likely that the peacock will fall prey to predators; the fact that it has survived despite this handicap suggests to peahens that it possesses superior genes, and is therefore worthy of mating with.

The handicap has to be expensive (in terms of survival) in order for it to be a reliable signal as to reproductive fitness. If it is not, then all males or females could display the same signal, and the signal would serve no purpose. Other examples of Zahavi handicaps include courtship dances, the extravagant nests built by Bowerbirds and the bouncy “stotting” behaviour of gazelles.

It has been suggested that certain activities which humans engage in, such as bungee jumping or conspicuous consumption (especially of Veblen goods) are examples of Zahavi handicaps – attempts by humans to demonstrate reproductive fitness to possible mates.

The Hawaiian climate

The Köppen climate classification defines a number of different climate types.

Group A (Tropical Humid)

  • Tropical Rainforest
  • Tropical Monsoon
  • Tropical Wet and Dry / Savanna

Group B (Dry)

  • Steppe
  • Desert

Group C (Mild Mid-Latitude)

  • Dry-Summer Subtropical / Mediterranean
  • Humid Subtropical
  • Maritime Temperate / Oceanic
  • Temperate Highland Tropical with Dry Winters
  • Maritime subarctic / Subpolar Oceanic

Group D (Severe Mid-Latitude)

  • Hot Summer Continental
  • Warm Summer Continental / Hemiboreal
  • Continental Subarctic / Boreal / Taiga

Group E (Polar)

  • Tundra
  • Ice Cap

koppen-map

A map of the world coloured using the extended Köppen-Geiger scheme which features twenty-nine climate types.

Hawai’i, the largest of the Hawaiian islands, features ten of the thirteen Köppen Climate Types.

At the summits of Mauna Kea and Mauna Loa the climate type is Polar Tundra. Below the summits of the Hawaiian mountains are narrow bands of Continental Subarctic climate, and below that a region of Warm Summer Continental climate. The largest area of Hawai’i is covered by Hot Summer Continental climate.

Moving towards the coast there are regions of Tropical Rainforest, Tropical Wet and Dry, Humid Subtropical and even a tiny region of Tropical Monsoon climate. Towards the north-east of Hawai’i there are even small regions of Steppe and Desert climate.

hawaii-false-colour

A false-colour image of Hawai’i showing the different types of land use.