Making Every Pixel Count
  • No tags were found...

Making Every Pixel Count - Advanced Imaging Conference

Making Every Pixel CountBy Adam BlockAdvanced Imaging Conference2007

Screen Stretch Basics1. Monitors are 8 bit devices showing only 256 brightness levels (0-255 inclusive).2. Original Data can be as much as 16bits of information- 65,536brightness levels- for most cameras.• After processing this data bit-space (range) can increase.3. The user defines a white point, black point, and range of databrightness values that will be mapped into 256 brightness levels.4. All programs have a way to define the above either bynumerically typing in values or by sliders.• Some programs even show a histogram (frequency ofbrightness values) simultaneously.5. All programs *should* have a way to assign/fix these values for aset of images.6. Many programs manage the white and black points (the range)by an internal algorithm using percentages of the (frequency of)data or by other means.

Fundamental Steps1. Calibrate Data using Biases, Darks andFlats.2. Remove Hot/Cold Pixels (and Debloom)3. Register Images4. Normalize Images5. Perform Data Rejection6. Combine Images

Calibration• The compensation of instrumental effects using bias images,dark frames, and flat field images.• Bias- The pedestal charge/counts applied to the chip/image.– Acquired by downloading information from chip without exposing.(or taking the shortest possible exposure)– Generally NOT (strongly) temperature dependent.• Dark Frames are a bias and a thermal signal from electrons thataccumulate in pixels during an exposure.– At a given temperature electrons accumulate at a fairly preciserate. However, like any measurement, the final count of electronshas an associated uncertainty (noise).– A dark frame minus a bias is a thermal frame.– Thermal frames can be scaled!• Flat Fields are images in which the same amount of lightentered the imaging system on its way to a pixel. Flats, like adata frame, contain a bias, a thermal signal, and a photonsignal.– Each pixel, under perfect conditions *should* record the samevalue. Thus, a flat is an image of the effective response of pixelsdue to anything that effects the amount of light a pixel detects.– Flats are usually created in such a way to minimize the thermalsignal since the light signal/exposure time can be controlled.

CalibrationThe Steps1. Subtract Bias Value2. Subtract (scaled) Thermal Value3. Divide by Flat Field Value (scale byaverage value of all pixel values in flatimage)

CalibrationCCDStackUser Matches Temperature, Binning, and Filter1. Select Dark Frame Data• Choose method to scale (determine factor) forthermal frame.2. Select Flat Frame• Choose to subtract bias if flat has negligiblethermal signal.• Otherwise calibrate flat ahead of time and load.3. Select Bias Frame

Maxim DLCalibrationProgram scans files and reads FITS headers.(access “Set Calibration” utility)1. Auto-Generate (Scan) a directory. Maxim DL will read the FITSheaders and create groups of like calibration data.• Can scan subdirectories.2. Remove any groups that are not related (for your sake as the user).3. If you wish to combine images that are in a group (on-the-fly)choose appropriate combine methods.4. Set your options (along the top, check means “yes”), they read asfollows:• Calibrate your images using Bias Frames?• Calibrate your images using Dark Frames?• Calibrate your images using Flat Frames?• Dark subtract your Flat Frames?• Bias subtract your Flat Frames?• Press “OK” and your parameters will be saved for later applicationsof “Calibrate.”• Make certain your Flats are labeled in your FITS headers. (not allprograms do this properly)

Deblooming• Must be done before image is resampledor any pixels are “smoothed.”• In Maxim DL, I prefer Wodaski’s plug-in.• In CCDStack Process Data RejectReject Blooms• Saturation level controls the identificationof blooms. The smaller the value the more“inclusive” the algorithm is.

Hot/Cold Pixels• Maxim DL: Use Command Sequencer to applyfilter to a set of files (open memory or on disk).– Hot Pixel threshold between 10-20%• CCDStack: Data Reject Reject Hot/ColdPixels.– I prefer to work on full range of data. Set upper limitaccordingly.– Strength of 2-3 is usually quite good.– Assuming dithered data, that requires only shifts toregister and combined with nearest neighborresampling…. You can technically skip this step. Butobviously you must think ahead during dataacquisition.

Registration• A reference image is chosen.• Fiducial points are selected. These are generally stars.• Transformation computed between reference image andall other images.• A new set of pixels is created, that once mapped into thenew space, corresponds to the transformed image.• New pixels are created through resampling algorithms.There are many algorithms to choose from (and theyhave different behaviors).– Resampling “messes up” pixel-like features. Perform anyprocessing that needs to identify single pixels before resampling(two examples?)• Always check your work! (blink, animate, overlay…etc)

Maxim DLRegistration• Automatic routines identify stars in the image.– Make certain you are aligning similar images. It is possible for MaximDL to fail if aligning different colors or images with wildly varying PSFs(star images via tracking/seeing).– AutoStar is the most common. Auto-correlation rarely (only for x/ydithered images)• Manual (1 and 2 star) are typically used as “brute force” solutions.– Well, there is technically “overlay” but this probably ranks with doingtaxes.– No scaling for any of the above!• Astrometric requires a “World Coordinate System” embedded in theFITS header. Transformation is calculated from it (not from PSFs inimage).• Planetary alignment assumes edges. (works very well)• Auto One Star assumes one bright PSF (generally in a croppedimage).

CCDStackRegistration• Uses Get Close First Philosophy1. Roughly align images‣ If images have no rotation, use FFT to align them (first) followed by the starsnap procedure. Alternatively, you can produce the rough alignment using theMANUAL option.‣ If images have a rotational term greater than ½ degree, roughly align themusing the MANUAL mode.‣ I recommend that a “rough” alignment is within a few degrees (1 or 2) and starsalign to within 10-20 pixels.2. Star Snap‣ For images without rotation, select reference stars either manually or using theauto selections feature. Then align this/all.‣ For images with rotation, select two stars near to one another (perhaps a 100pixel seaparation). The second star (and last star in the final star snap) definesapproximate center of rotation. Since this will generally be in the center of thefield, perform this procedure near the middle of the image. These two stars helpCCDStack determine the rotation. CCDStack will attempt to use the same roughanswer on other similar images to help you out.‣ Then, once they are close, do a final star snap (using more reference stars).3. Apply

Nearest Neighbor Aside• No new pixels are created! Instead pixels are“mapped” to the nearest whole pixel in thereference frame coordinate system.• Good for well sampled (stars larger than 2-3pixels) dithered images. It also helps to have arelatively large (at least 8-10) set of images.– Images must not have any rotational or magnificationterms.• Benefits include better rejection, better noisereduction through combine, and a natural“erosion” like effect.

Not a “Post It” Note(but a Value(able) reminder)• The 3M’s are Mean, Median, and Mode• Mean (Average) is the sum of all values dividedby the number of values.• Median is the middle value of the ordered set.– For large sets of values in a “normal distribution”, themedian approaches the mean- but rarely do we havethis with respect to our data.• Mode is the most frequent value in a set.• Median and mode are less sensitive to theinfluence of “outlier” values.

Normalization• Necessary preparation for pixel value analysis andcomparison.• Removal of pedestal sky value first.– Measure a sky value in each image and subtract so that youhave a “zero” point.– The Mode is usually a good value to choose as taken from apatch of “background” sky.• Scale each image to a reference image.– Multiply by whatever number is necessary.– The Mean value is usually taken from object signal.– In order to combine appropriately later, remember this value.(The inverse of the multiplier “undoes” things, it is therefore theweighting factor)

Rejection Techniques• Max/Min Clipping– To discard the high/low values from an ordered set.– Median is the maximum clipping possible.• Sigma (Standard Deviation) Rejection– Calculate Standard Deviation and see if any valuesfall outside of the user defined deviations from themean.• Can be done iteratively once outliers have been discarded- anew mean is computed and new outliers (if any) can beidentified/discarded.

Standard Deviation

Statistical Analysis (Excel)1. Register and Normalize your data.2. Put the pixel values (the same pixel) in Excel.3. “Sort” values in ascending order (easier to read).4. Below the list create a cell that calculates the mean.(=sum(begin:end)/count(begin:end)• Make a cell to hold N, the total number of values(count(begin:end). You will need this later.5. In the column next to the values create a new columnfor the residuals. (value-mean)6. Now calculate the residuals squared in the thirdcolumn.• Below the cell that holds the mean value, you can createanother cell that is the sum of the residuals squared column.Call it SumResSqrd.7. Finally create a cell that has the formula to calculateone standard deviation of your set of values.• =sqrt((N-1)*SumResSqrd)

Statistical Analysis (Excel)Making a Histogram1. From your ordered (ascending) set of values,create another column of bin values that gofrom just a little less than the smallest value ofyour data to just a few bins more than yourlargest value.2. Under “Tools” in Excel there is “Data Analysis”3. Find the “Histogram” option.4. Highlight and define the column for the valuesand then the column for the bins.5. Excel will do everything else to calculate thefrequency of values and create the graph.

Combine• Maxim normalizes, rejects and combines data (returningthe mean value) in one step (having selected theappropriate parameters).– The “Sigma Clip” option finds the most extreme value outside theuser define number of standard deviations (sigma) and rejects it.For more rejections, do more than one pass/iteration.– The “Sigma Mask” algorithm conditionally chooses whether toreject according to the user defined sigma value or just by takingthe median value of the set.• CCDStack creates pixel sets of data that are nowvarious sizes due to the rejection of values. The meanvalue of each set is taken when combining.– There are other types of operations and special combiningschemes you could employ at this point as well.

Threshold Rejection/Combine(CCDStack)• Used (by me) to combine data sets taken with different camerasand telescopes.1. Register, normalize, and reject values as normal.2. Choose the image with the noisiest “background” low-signalinformation.– This is generally the smaller set of data.3. For each image in the set with the background you want to reject….4. Measure the background and choose to “reject range” from theprocess data reject menu. (remember it may be a little differentfor each image)– Make certain the range goes from a large negative value to yourbackground value.– Make certain the “clear before apply” box is NOT checked. You will beadding pixels to be rejected.– Make certain your areas of background and regions of padding arecompletely rejected (but the bright signal of the object is not).• Combine using mean.

Star Erosion via Darken1. Create duplicate layer.2. Apply “Darken” blending mode to movablelayer.3. Zoom in to image before moving.4. Select “Move” tool and shift image.• Create more than one layer for multipledirections.• You can choose to “undo” the affect on yourobject by creating a layer with fixed stars andusing a layer mask over the original version ofthe image.– Use “Reveal All” and paint in black on objects.

Color Range Selections• Used to isolate particular parts or features of animage.– Especially useful for selecting everything but thebackground, and applying an inverse selection.• Can be feathered and faded to produce thedegree of the desired effect.• Can be used as a tool to minimize gradients inthe foreground sky.• Zooming in to select colors is usually the mosteffective way.

Color Rangean Example• Occasionally a bad dark will seeminglyruin an image by peppering the entireimage with black dots (where hot pixelsmay have been in the dark but not in thedata).• Isolating this pixels or pixel groups andapplying a 4 pixel median filter (verypowerful tool) is the solution.

Stellar De-emphasis(Minimum)1. Color Range Select(Highlights)2. Expand Selectionsignificantly to surroundstars.3. Feather by half this radius.4. Apply Minimum Filter5. Fade as necessary

DDP in Maxim DL• Set Background Parameter to 100counts below calculated number toprevent black clipping.• Select Mid-level for appropriateequalization value.– As a rule this is 3,000-12,000 countsabove the suggested value (which isthe absolute lower limit)– Can be determined from image orimage preview window based onhistogram or mouse click. Choose anisophote that characterizes theequalization value of interest.• The cutoff % controls the unsharpmask effect.– Generally this is a Custom value anddepends on the plate scale. Thesmaller the number the moreaggressive the effect.– The relationship between the Midlevelvalue and Cutoff % is one for whichmaking one more aggressive meansmaking the other more passive in orderto minimize deleterious artifacts.• You can turn off the Low-Pass kernelfilter by selecting the “User Filter”-however, I have found the best resultsare obtained by correctly choosing theCutoff %.

DDP Damage Control

DDP in CCDStack• Adjust using Display dialogue.• Check/Select the DDP option.• Algorithm is internal.– Adjust background for black level.– “Maximum” adjustments will not show largedifferences.• For the sharpen method, select the “Sharpen”dialogue.• All changes are screen stretches until the imageis scaled (and saved).

Multiplicative ContrastEnhancement• The “multiply” blending mode combines two colors. Theresulting color (the blended version) will always bedarker than the top layer.– If the base color is white- no change in color occurs.• Thus if the bottom layer is brightened using curves andtop layer is slightly transparent, very bright portions ofan image remain the same color and brighten a bit whilethe dark portions do not brighten very quickly.– This is a form of contrast enhancement and it is similar inbehavior to the “soft light” blending mode.1. Make a duplicate of the image.2. Use the Multiply blending mode3. Brighten the bottom layer using curves.4. Change the Opacity of the top layer.

High Pass Filtering Example1. Duplicate Layer2. Apply High Pass Filter totop layer• Use appropriate filter radius.3. Blend with “Overlay”4. Remove (feathered cut)bright stars for even betterresult.

Quick Saturation• Convert the image to the LAB color.• Adjust the “a” and “b” channels.– Use contrast (easiest).– “a” will affect REDs (green)– “b” will affect BLUEs (yellow)• Benefit is that it increases the saturationwithout as much color mottling (noise) and“flatness” that is often seen by just raisingthe saturation in the normal manner.

SCALINGHa Dataconsideration• After combining data (many files)and working with a mean imagescalingthe image by multiplyingevery pixel by a coefficient can behelpful.• Photoshop works with 16bitINTEGER data. Fractionalinformation is thrown away whenbringing files into Photoshop.• Scaling expresses fractionalvalues as whole integers- therebyincreasing the potential dynamicrange of brightness compressed(stretched) data.

Object Masks• The luminance of the object becomes athreshold selection with opacityadjustments for grayscales.• Often used to globally work on “bright” or“faint” aspects of image.• Mask can be inverted to choose bright orfaint.• Change the brightness/contrast of themask to modify thresholds.

More magazines by this user
Similar magazines