Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of...

19
Introduction to Lynkeos What is it ? Lynkeos is a Cocoa application dedicated to the processing of planet images taken with a webcam through a telescope. Where does that weird name comes from ? Lynkeos was one of the argonauts, the Jason's fellows who sailed on the Argo ship, seeking for the golden fleece. Lynkeos was surnaturally keen sighted, hence the name of this software, hoping that this sponsorship will help it giving surnatural results It is to be noticed that the Argo ship sails the skies as the Carina, Puppis and Vela constellations ; among the argonauts were Castor and Pollux : the "Gemini" and Hercules. At last, Lynkeos himself roams the skies as the Lynx constellation. How does it works ? By stacking the best images, the signal to noise ratio is increased and details lost in the noise of individual images become visible in the resulting image. This software accepts QuickTime® sequences or still images, in any image format supported by Cocoa, as input It generates a 16 bits RGB TIFF image as output, to be further processed with some all-purpose image processing application. The steps to process a collection of images are : collect calibration (dark and flat fields) movies and/or pictures (optional), collect the movies and/or pictures, align the images, select the best images, stack the selected ones, process the resulting image. If you are new to Lynkeos, you should go on with the Tutorial. Lynkeos tutorial This tutorial will guide you through the processing of a sequence of webcam images. Before the tutorial you must be familiar with some basics about planetary webcam imaging. The first step is to build a list of Quicktime® sequences and/or still images of your target planetary object. When your image list is complete, you need to align all the images. Lynkeos does this with sub-pixel accuracy.

Transcript of Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of...

Page 1: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

Introduction to Lynkeos What is it ? Lynkeos is a Cocoa application dedicated to the processing of planet images taken with a webcam through a telescope. Where does that weird name comes from ? Lynkeos was one of the argonauts, the Jason's fellows who sailed on the Argo ship, seeking for the golden fleece. Lynkeos was surnaturally keen sighted, hence the name of this software, hoping that this sponsorship will help it giving surnatural results It is to be noticed that the Argo ship sails the skies as the Carina, Puppis and Vela constellations ; among the argonauts were Castor and Pollux : the "Gemini" and Hercules. At last, Lynkeos himself roams the skies as the Lynx constellation. How does it works ? By stacking the best images, the signal to noise ratio is increased and details lost in the noise of individual images become visible in the resulting image. This software accepts QuickTime® sequences or still images, in any image format supported by Cocoa, as input It generates a 16 bits RGB TIFF image as output, to be further processed with some all-purpose image processing application. The steps to process a collection of images are : • collect calibration (dark and flat fields) movies and/or pictures (optional), • collect the movies and/or pictures, • align the images, • select the best images, • stack the selected ones, • process the resulting image.

If you are new to Lynkeos, you should go on with the Tutorial. Lynkeos tutorial This tutorial will guide you through the processing of a sequence of webcam images. Before the tutorial you must be familiar with some basics about planetary webcam imaging. The first step is to build a list of Quicktime® sequences and/or still images of your target planetary object. When your image list is complete, you need to align all the images. Lynkeos does this with sub-pixel accuracy.

Page 2: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

An optional step is then to analyse the quality of all the images, which allow you to select the images to stack, automatically. Either way you can select them manually. When the best images are selected, you can stack them into one. The last step is to process this stacked image to enhance its subtle details. Shooting the planets with a webcam The quality of your final image will be limited by the weakest link in the chain that goes from the photons entering your telescope, to the planet print on your wall. The weakest link is the atmosphere, but, unless you bought a space shuttle at an auction, you have mostly no control on it. The best you can do to limit atmospheric turbulence is to avoid the proximity of buildings, and observe from your lawn. The second weakest link is your telescope, it hosts a lot of gremlins. To stress the most important points : • Your telescope shall be at ambient temperature, and it can take several

hours to cool down to equilibrium.This is very important for "open tube" reflectors.

• Your telescope must be nearly perfectly collimated. If you move around a reflector, the collimation process should be redone.

• The refractors, even "apos", are not color corrected for infrared. Hence, use an IR blocking filter because your webcam sees pretty well in the infrared.

The next link is the amplifying device you use to form the image (nothing, barlow lens, eyepiece projection, ...). To get all the information you expect from your telescope, the detector shall have a sampling frequency at least twice the highest frequency in the image (Shannon theorem). That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter ratio higher than f/D = 3.44 x p where p is the pixel size of your webcam in micrometers. Ex : for a ToUcam with 5.6 µm pixels your optical setup must be at least at f/D = 19. This is not only boring theory : I was reluctant to use eyepiece projection for my first tries with a webcam and used a barlow lens with which I attained f/D=9, and the results where encouraging... The day (no ! the night) I used eyepiece projection to obtain f/D=20, I regreted I had wasted so much time gathering bad images ! This must be pondered with the fact that the exposure times must remain short enough to freeze the turbulence (1/20 sec at most). Having the right image scale is not enough, the image must be very precisely focused. The internet is full of techniques to achieve "perfect focus". I have no preferred one. All I have to say is that it is not easy, and of prime importance The next link is the webcam.

Page 3: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

To send large images at a high frame rate across a USB® link, the webcam compresses the images with some losses. These losses are not like random noise, they tend to form artifacts that are eventually enhanced by processing. To avoid these, use the lowest frame rates possible (I use 5 Hz) and, if you can afford to increase your focal length, lower frame sizes. Another option, I'm considering, is to use a FireWire® webcam. When you master all the issues described hereabove, you will have no troubles getting great pictures of the planets. On the contrary, if you don't care, no software will help you. Collecting the list The first step to process planetary images is to build the list of images/movies to process. Launch Lynkeos, it starts with a new empty document.

Click on the "+" button in the bottom left part of the document window, the tabs frame, to add to the list. An "open panel" invites you to choose the files to add. Choose one QuickTime® sequence containing planetary images.

Page 4: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

The sequence appears in the left part of the document window, the list frame. The triangle in the left margin opens the sequence and displays one line for each frame of the sequence. Click on one of these lines and the image is displayed in the right part of the document window, the image frame. A slider, under the image, allows to zoom in or out.

This is all you have to do to build the list ; you can now go on with the alignment tutorial Aligning the images Once the list of images is complete, you need to align the images to prepare the next steps. Select the "Align" tab, the alignment tools are displayed. Select a square size, wide enough to contain the planet or a surface marking, and not too wide (to save CPU need).

A red square is displayed on the bottom left corner of the image frame (right part of the window). Center this square on the planet or surface marking you choose, by dragging with the mouse.

Page 5: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

Press the "Align" button and wait for the align process to complete. Each aligned image name is displayed green, if Lynkeos fails to align an image, it remains displayed black.

You're done with the alignment, you can go on with the quality analysis. Image quality analysis If the images in the list are not equally sharp, you can use the "Analysis" tab to analyze the quality (or sharpness) of each image. Select the "Analyze" tab, the analyzis tools are displayed.

Page 6: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

Select an analyzis square side, just wide enough to enclose a typical part of the image, and drag the red square on that part.

Press the "Analyze" button ; when the analysis is done for an image, its quality level is displayed as a number in the "Quality" column of the list frame.

When all the images are analyzed, you can automatically select which images to include in the result, based on their quality. Automatic selection of images After analysis of all the images, the autoselect slider becomes active. The minimum and maximum quality levels are displayed above it.

Page 7: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

With the slider, you can select the quality threshold under which an image is not included in subsequent processing. In the list frame, the images selected for processing have a checkmark in the leftmost column checkbox Alternatively, whether you used the analyze tool or not, you can manually toggle an image selection for further processing by clicking on the checkbox

All is now set for stacking the selected images Stacking the images When all the images worth of being processed are selected, select the "Stack" tab.

The reference image is displayed in the image frame ; draw a crop box around the planet or the area of interest in your image. This box defines the area that will be kept in the final image.

Page 8: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

You can select the double size checkbox to stack in a resulting image twice the size of the crop box. This will not add any information to your image, but as Lynkeos stacks each image with a subpixel translation, it can give a more pleasing result for small crop boxes. Press the stack button to start stacking. When the stacking is complete, it is now time for the last step : process the stacked image. Processing the stacked image Now that the stacked image is generated, select the "Process" tab. Many sliders are displayed. • At left are the sliders for the deconvolution filter radius and threshold. • The deconvolution filter "unblurs" your image. You must set the radius of

blurring in your image, usually 2 to 3 pixels, and then adjust the threshold to have an acceptable result (1 means no deconvolution, 0 means too much ;o).

• At center are the sliders for the unsharp masking filter radius and gain. • The unsharp masking filter amplifies the contrast of the small details and

levels the slow brightness changes (soft planet edges for example). Experiment with the sliders...

• At right are the black and white levels. Use them to set the brightness and contrast of your image

Page 9: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

The processed image is displayed in the image frame at right. When you are satisfied with the result, first save your work with the "File->Save" menu item, in case you later change your mind ;o). If you are really satisfied with the processed image save it in a TIFF file with the "File->Save image..." menu item. Use an all purpose image tool to put your image right side up (depending on what you call the right side ;o), and twinkle the levels and colors, here is the result.

This image was acquired Jan 4, 2004 with my homemade 200 mm newton telescope, a ToUcam webcam hooked to a "do it yourself" eyepiece projection system yielding a 3.7 m focal length. It was later processed with Lynkeos as a test case. Lynkeos concepts Lynkeos uses some signal processing concepts which are explained hereunder. Aligning images To align two images, Lynkeos uses intercorrelation. To speed up the computing, it uses a fast fourier transform (FFT), this is why the alignment box is a square with a power of two as side. It then searches a peak in the correlation result, which gives the alignment offset between the images. Some user preferences affect this processing : • The align frequency cutoff defines a frequency limit, above which the

spectrums are cleared.

Page 10: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

• This is used to avoid spurious aligning on some systematic noise like interleaving.

• The align precision threshold is the maximum value the standard deviation of the correlation peak can have for the alignment to be declared successful.

Analyzing images To compute an image quality level, Lynkeos calculates the power spectrum of the image part to analyze. Once again FFT is used for speed's sake, that's why the image part is a square and its side a power of two. The quality level is the mean value of the power spectrum between two frequencies, which are modifiable in user preferences : • Analysis lower frequency cutoff which defines the threshold where lower

frequencies are suposed to be "blur". • Analysis upper frequency cutoff which defines the threshold where higher

frequencies are suposed to be noise. Stacking the images To stack the images, Lynkeos translate the images by their alignment offset down to fractions of pixels. Each pixels is split in 4 according to the pixel fraction and accumulated in the pixels of the resulting image. The stacking is done in double floating precision, there is no risk of "brightness overflow" if you have many bright images. Final processing The final processing uses two filters, the deconvolution filter and the unsharp masking filter The deconvolution filter is exactly what it says. This is done by dividing the spectrum of the image by the spectrum of the presumed convolver, a gaussian in this case. The threshold value is the convolver spectrum module value under which the division is not performed. This avoids amplifying too much the highest frequencies. The unsharp masking filter is the digital translation of a darkroom technique. It adds to the image an image made of the substraction of a blurred original image to the original image and amplified. The filtered image, wich is a double floating precision image is then brought back to an 8 bit integer RGB image for display on the screen. This conversion uses the black and white levels provided by you. There is once again no risk of brightness under or overflow whatever processing you do. The filtered image is converted the same way to a 16 bit integer RGB image for exporting into a TIFF file Lynkeos reference In this chapter, detailed description of all the windows is provided. Related menu commands are detailed in each window paragraph.

Page 11: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

The document window is the main window. It contains 3 frames which are explained separately : list frame, image frame and the tools frame. This last frame contains several tabs which are also described separately : List tab, Align tab, Analyze tab, Stack tab and the Process tab. The user preferences window is the only other window with which user can interact. To be complete, the "About" menu opens an informational window which gives informations about the version of Lynkeos you are using and the GPL License, under which Lynkeos is distributed ;

and the "Help" menu opens the help window you are now reading. Lynkeos document window

Page 12: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

This is the window in which is displayed your Lynkeos document, ie: the work you've done so far. Use the "Open ..." menu to open a Lynkeos file ; use the "Save" or "Save as ..." menu to save your work to a file. The window is divided in three frames : • At top left, the list frame displays all the items you are working on, • At right, the image frame displays an image related to the tool you are

using, • At bottom left, the tools frame gives access (via tab selection) to ... the

tools. Lynkeos List frame

This frame displays a table list of expandable items. The items are either images (which are not expandable), or QuickTime® movies which can be expanded to show each frame of the movie. This frame displays 6 columns, from left to right : • The selection column displays a checkbox, which is checked when the

image is selected for further processing. The checkbox can be affected by mouse click or by the autoselect tool.

• The "Name" column displays the image/movie file name. It is displayed green once the image is aligned.

• The "Index" column displays the frame number of the image in its movie. • The "∂x" and "∂y" columns display the alignment offset of this image,

provided it has been aligned. • The "Quality" column displays the quality level for that image.

The up and down arrow keys move the line highlight up or down one by one. The left and right arrow key move the line highlight up or down to the next image where the checkbox is checked.

Page 13: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

When applicable, the delete and backspace keys delete the highlighted line from the list, and the space and return keys toggle the checkbox of the highlighted line. Lynkeos Image frame

This frame displays an image, which can be zoomed in or out with the slider at the frame's bottom. Buttons - and + or key equivalents alt- and alt+ can be used to step the zoom in or out. Dragging the mouse allows, when applicable, to draw a rectangle, to resize or move it around. Depending on the tool used, the rectangle can be a fixed size square. Tools frame

The tools frame contains the controls associated with the possible actions on the document. These controls are grouped in "tabs" dedicated to each phase of the processing.

Page 14: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

• The "List" tab is used to build the list of images or movies to process, • The "Align" tab is used to align all the images, • The "Analyze" tab is used to analyze the quality (or sharpness) of all the

images, • The "Stack" tab is used to stack all the selected images into one, • The "Process" tab is used to enhance the stacked image.

To select a tab, just click on it. It is impossible to select another tab while alignment, analyze or stack is running. List tab

The controls of this tab are used to build the list of images and/or movies : • The "+" button, or the "File->Add ..." menu, adds a movie or image file to

the list. • The "-" button, delete or backspace keys, delete the entry associated with

the highlighted line in the list frame. • If this entry is a movie, all its images are deleted alltogether. • The "<<" button or the left arrow key, highlights the previous entry

selected for further processing (ie: with a checkmark). • The ">>" button or the right arrow key, highlights the next entry selected

for further processing (ie: with a checkmark). • The "√" button, space or return keys, toggle the highlighted line checkbox

state in the list frame. When this tab is selected, the image frame displays the image associated with the list frame highlighted line, if any (ie: the line represents an image file or a movie image). Align tab

Page 15: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

This tab is used to control the alignment process : • The "x" an "y" numeric fields set the origin (in pixels unit) of the align

square (0,0 is at the bottom left corner). • The square position can also be (and usually is) changed by dragging it in

the image frame. • By holding the option key while finishing the drag, the square position is

set only for the highlighted entry in the list frame. • For best results : on images of the moon, frame a conspiscuous detail ; on

planets images, frame the entire planet. • The "side" button menu sets the align square side, this side is a power of

two, not larger than the lower side of all the images and movies in the list. • The "Ref" checkbox sets the highlighted entry in the list frame to be the

reference image ; that is the image against which all others will be aligned. The default reference image is the first image of the list.

• The "Align" button starts to align each image selected for processing (ie: with a checkmark).

Once started, it is impossible to select another tab and the "Align" button becomes a "Stop" button (you guess what it does ;o). When this tab is selected, the image frame displays the image of the highlighted line in the list frame. The align square is drawn as a red square on this image. The left and right arrow keys, delete, backspace, space and return keys act as in the list tab. During alignment process, each processed image is : • highlighted in the list frame, • its name displayed green if alignment is successful, • its ∂x and ∂y columns updated, • displayed with its alignment offset corrected, in the image frame.

This last feature can be disabled in user preferences, to speed up the alignment. Analyze tab

This tab is used to control the quality analysis process :

Page 16: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

• The "x" an "y" numeric fields set the origin (in pixels unit) of the analyze

square (0,0 is at the bottom left corner). • The square position can also be (and usually is) changed by dragging it in

the image frame. • Frame a detail on which the quality of the image can be judged, for

example: the great red spot on Jupiter. • The "side" button menu sets the analyze square side, it has the same

constraints as in the align tab. • The "Analyze" button starts to analyze each image selected for processing

(ie: with a checkmark). • Once started, it is impossible to select another tab and the "Analyze"

button becomes a "Stop" button. • The autoselect slider becomes enabled once the images quality has been

analyzed. When you change the quality threshold, images with a quality lower than the threshold are desselected for futher processing, or images with a quality higher than the threshold are selected.

When this tab is selected, the image frame displays the image of the highlighted line in the list frame. The analyze square is drawn as a red square on this image. The left and right arrow keys, delete, backspace, space and return keys act as in the list tab. During analyze process, each analyzed image is : • highlighted in the list frame, • its quality column updated, • displayed in the image frame.

This last feature can be disabled in user preferences, to speed up the analyze. Stack tab

This tab is used to control the stacking process : • The "x" an "y" numeric fields set the origin (in pixels unit) of the crop

rectangle (0,0 is at the bottom left corner). • The rectangle position can also be (and usually is) changed by dragging it

in the image frame.

Page 17: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

• The "w" and "h" numeric fields set the width and height of the crop rectangle.

• The rectangle size can also be (and usually is) changed by dragging its corners or border in the image frame, if the rectangle is not drawn, it can be created by dragging the mouse in the image.

• The crop rectangle is the region of the image which will be stacked in the final image. Parts of the image outside of the rectangle will be discarded.

• The "Double size" checkbox makes the stacked image be twice the size of the crop rectangle. As the stacking is done with sub-pixel accuracy, there is no pixellisation in the result.

• The "Stack" button starts to stack each image selected for processing (ie: with a checkmark) in the (almost) final image.

• Once started, it is impossible to select another tab and the "Stack" button becomes a "Stop" button.

When this tab is selected, the image frame displays the reference image. The crop rectangle is drawn in red on this image. During the stacking process, each image, once added to the stack, is highlighted in the list frame. Process tab

This tab is used to control the processing of the stacked image : • The "deconvolution" sliders control the deconvolution filter, which

"unblurs" your image. • The "radius" slider controls the size of the "unblur", while the "threshold"

slider controls the strength of the filter (at 1 there is no deconvolution at all).

• The "unsharp" sliders control the unsharp masking filter, which enhance small scale details and levels the large scale brightness variation (lunar terminator, jupiter "soft" edge...).

• The "radius" slider controls the threshold between large scale contrast, which will weakened and small scale contrast which will be enhanced.

• The "gain" slider controls the amplification of small scale contrast. • The "levels" sliders simply controls the black and white levels.

When this tab is selected, the image frame displays the processed image, and is updated to reflect any change.

Page 18: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

Use the menu "File->Save image..." to save your resulting image to a 16 bits RGB TIFF file. Preferences window

This window is used to control user preferences : • The "Align frequency cutoff" is a threshold used to avoid aligning on some

not so random noise. • The "align precision threshold" is the maximum amount of alignment

offset "indetermination". Above that threshold, the alignment is failed. • The "analysis lower frequency cutoff" is the "blur" frequency threshold. • The "analysis upper frequency threshold" is the "noise" frequency

threshold. • The "Image updating during process" checkbox, controls whether the

images are updated in the image frame during list processing. • It speeds a bit the lists processings (align, analyze, stack), when

unchecked. • The "Cancel" button closes the window without applying the changes. • The "Reset" button resets the values to their "factory defaults" values. • The "Apply" button saves the changes in the user preferences database. • The "OK" button saves the changes and closes the window.

Troubleshooting Known bugs When an image is offset from the reference image by more than half the align square side, the correlation reports an alignment offset of side - real offset . To avoid this, use an align square twice as large as the greatest alignment offset or choose a reference image "in the middle" of the offsets you can also use the option dragging to assign a dedicated align square to images which are too far from the reference.

Page 19: Introduction to Lynkeos - alchymy · That means that the pixel size must be less than half that of the Airy's disk on the resulting focal plane. In other words, you must use a focal/diameter

The "Revert" feature doesn't work. You shall instead, close the document without saving and reopen it. The bug list is mainitained up to date on SourceForge.net. Reporting a bug To report a bug, first make sure it isn't already known, and then use the preceding link. Please give clear and detailed description of the bug and its context (please mention the version of your operating system and what kind of Macintosh you run Lynkeos on) ; if you encounter a crash, attach the crash log to the report (it is situated in Library/Logs/CrashReporter/Lynkeos.crash.log under your home folder). If you would like to see some new feature added to Lynkeos or need some kind of support, please go to the project summary page and use the appropriate link in the "tracker" section.