Ronja Twibright Labs

Twibright Registrator

Noise Reduction or Resolution Quadrupling by adding more photos together

Shows previously invisible things

Invisible things

A hazy picture was processed to improve contrast. In normal picture, the crane cables, background forest , exact shape of two square buildings and dark lines on the left foreground brown building cannot be recognized. In the Registrator output they can. See also Example on Wikimedia Commons

Quadruples the megapixels of the camera

Software quadrupled resolution

Resolution quadrupling is not perfect because frequencies approaching the maximum one (pixel values 1,0,1,0,1,0,1,...) are lost in the camera. It is also 4 times slower than registration - works on upsampled images.

Removes JPEG artifacts

JPEG artifacts are removed

Removes noise from dark details

Better dark details

Digital effects don't degrade anymore

Stronger effects possible

Misty Zurich was histogram equalized, gamma adjusted and filtered with Retinex. The normal image shows noisy meadows and red artifact over church dial. Twibright Registrator produces perfectly smooth meadows.

Hides people

People are hidden

Removes stripes on CRT's

Assembling oscilloscope image
Monitor without and with stripe

Removes rain

Rain removed

Long exposure in daylight

Crowd smeared through long exposure

Couple minutes of simulated exposure.

Download and install

Tested on Linux, should work on Mac, BSD. For Windows you need Cygwin.

How to use Registrator

Shoot images

Register images for lower noise

Copy JPEGs from the camera or convert RAW format into PPMs. Run registrator with filenames as parameters. Example:

registrator p100????.jpg p101????.ppm
Registrator will print a lot of matching progress info. When it ends, you have file registrator_output.png. It is a 16-bit depth PNG containing the registered output. It also makes partial results - for example - registrator_intermediate_7.png - which contains the first 7 images registered together. This is useful if the registration derails.

Quadruple resolution

This makes sense only if the camera lens is sharper than the resolution of the sensor. It depends on iris setting and tripod. It takes 4 times longer than registering.


Register images for 3D or video stabilization

Copy JPEGs from the camera or convert RAW format into PPMs. Run registrator with OVERWRITE=1 and filenames as parameters. Example:

OVERWRITE=1 registrator p100????.jpg p101????.ppm
Registrator will print a lot of matching progress info. Let's assume you have 100 files on input. Then Registrator produces registrator_intermediate_1.png to registrator_intermediate_99.png and registrator_output.png which is the last frame.


Error during make, undefined reference to png_create_write_struct

Make sure libpng is installed on the system including the header files (png.h). Maybe you need png-dev, libpng-dev, png-devel or libpng-devel package. Various Linux distributions install libraries into various places. There is no standard for that. Maybe some library is in an unexpected location. Please tell me the error so I can try to fix it.

The result looks sharpened, noisy, or blurred

This happens when the count of input images is low. Use more photographs. Registrator uses deconvolution to cancel blurring caused by many photographings and resamplings of the same picture with fractional pixel shifts. However, with small amount of pictures, this blurring depends on exact random relative positioning of the pictures and varies within the image field. It would be very difficult to calculate and deblur this. Therefore an average blurring is calculated when removing the blurring. This can lead to slight sharpening or blurring depending on luck.

Multiple copies of images in the output or part of the image black

Happens when there are more ways how to match or the pictures differ too much. Example: roof or pavement with repeating tiles, people or cars obscuring large portions of the picture, too much noise in the picture. In case of repeating structures use wider view to include parts which are not ambiguous to match and then crop the undesired away in image editor. In case of people or cars discard pictures which have large portion obscured. In case of noise select longer exposure. You may need a tripod for that

Look into registrator_intermediate_*.png to see the progess of the registration and possibly throw away problematic files. The number in the filename says how many files registered that file contains.

JPEG artifacts still recognizable in the output

Happens when the noise in the input images is too low. Some level of noise is necessary to break through the JPEG roundings. Use higher ISO to get more noise.

Vertical or horizontal smears across the whole picture

Happens when heavy effects are used on the output. This is the CCD smear due to imperfect readout. The smears are in tows and columns with areas. Use an effect that isn't so aggressive. Try a better quality camera.

Grainy or different structured edges

Happens when the pictures shift between exposures. The edges are then averaged from only those pictures that contain them. Crop the output or shoot again with tripod.

I want to use raw input, not JPEGs!

Look inside the registrator script. The registrator-bin executable itself takes concatenated PPM (bit depth 8bits) on the input. Convert your raw pictures to PPM and feed registrator-bin manually.

Fringes in the resolution quadrupled image

Happens when the strength of the deconvolution is closer to 2. Use higher number in the deconvolution.

Small letters illegible in resolution quadrupled image

The finest details are already lost in the camera when the resolution quadrupled image was photograped. They cannot be recovered anymore. Letters with 1-pixel wide lines spaced 1 pixel contain this finest detail and are weakened or obliterated.

Happens when the strength of the deconvolution is closer to 2. Use higher number in the deconvolution.

How does it work?

How registration works

Twibright Registrator contains a high precision high performance bilinear interpolation engine working with 32-bit float pixel depth. Using this engine, it tries to find shift, rotation, zoom and exposure change so that the next picture matches the previous one with as little average pixel error as possible. It adds these pictures together and applies an adaptive deconvolution to cancel the blurring caused by stacking many pictures photographed with random fractional pixel offsets. If the count of photos were large, this deconvolution exactly cancels the blur. The work is done in photometrically linear space to ensure physical equivalency - the procedure is equivalent to a shakeless camera which exposes for very long time, gathering the photons, and then counting them.

How resulution quadrupling works

Let'sa imagine the real picture consists of pixels 2 times finer than the camera has. In 1D situation, The camera always takes 2 pixels together (if it's precisely aligned) or 1 pixel and parts of 2 other pixels. Now we assume the pixel offsets are uniformly distributed. Let's take a sample image 0,0,0,1,0,0,0 and calculate resulting images when many such images (upsampled by nearest neighbor after being photograped) are registered. In case the examined pixel falls within the big pixel, it produces the core 1,2,1. In the other case, it produces core 2,5,6,5,2. If the 1st core is scaled to the same sum 7,14,7 and the cores added, we get 2,12,20,12,2, or 1,6,10,6,1. This is a convolution of two cores: 1,2,1 and 1,4,1. The 1,4,1 is actually caused by the registration and the 1,2,1 by smearing always two pixels together. 1,4,1 is already removed by the registrator. So we have to remove 1,2,1. In comparison to 1,4,1 it's impossible to remove completely since some frequencies (the highest) is zeroed out so we would have to divide by zero. So we take a near core like 1,2.5,1 or 1,3,1 and remove that one. The particular middle number of the core has to be tried out manually to get the best tradeoff between fringes and blurriness.


GPL 3 or later. The example photos are under GFDL or CC-BY-SA.



Registrator was written in June 2009 by Karel Kulhavy.

An expected information missing here?