![]() |
|
|
#23 |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
29×3×7 Posts |
I started from first principles, using ImageMagick to perform basic image manipulations to snip out a 21x21 pixel star image for an experimental PSF (psf.png), to select a 256x256 region near Capella (dportion.png) and then to convert each of these to text format for subsequent custom code.
I then implemented CLEAN (if it's good enough for the HST before corrective optics were installed, it's good enough for me) and then ran 400 iterations with a lambda of 0.2. (Roughly speaking, CLEAN removes lambda * the PSF from the maximum intensity in each iteration.) The code is very from from optimal. It works on each of the RGB planes independently and took 4.5 minutes for the complete process to produce an RGB clean map. The code is very crude (I'm very much a novice in this field) and doesn't estimate remaining noise levels. Examination of the output, clean.png, suggests that some noise crept in. Examination of the residue map, residue.png, suggests that only noise now remains though that's undoubtedly arguable. In retrospect, I should either have converted to grey scale first (immediately making the CLEAN process three times faster) or generated three separate single-colour images. The PSF could almost certainly have been estimated better by removing noise from it. Further speed improvements could come from using a smaller PSF (run time is proportional to its area) and subtracting lambda * PSF from several independent maxima at each iteration before recalculating the maxima from the residue map. Fiddling with the value of lambda might also be productive. The clean map almost always looks a mess and is traditionally blurred with a Gaussian. The clean1 image is clean.png converted to grey scale and then blurred (by ImageMagick) with a kernel of radius 3 pixels and standard deviation of 1.5 pixels. You might want to play with IM and/or the GIMP to perform colour map manipulations to show finer detail (and the noise) in the images. I claim that clean1.png is in some sense better than dportion.png. Capella itself is at least as nasty when cleaned as in the original (contrast stretch both to see this particularly clearly) but Capella C is much more easily visible as the center of the three stars in an arc below Capella. The cepstrum of dportion.png is given in cep.png. It shows a very clear ellipse with major axis aligned along the coma in the original image. If it were a circle, its radius would be the size of the defocussing PSF; if it were a straight line its length would be the size of the motion blur. I do not (yet) know how to transform an elliptical cepstrum into a smooth PSF. No doubt the computed images would look nicer if I could. Fun stuff. CLEAN code and the text-format files available on request. It took me about three days work from a standing start. Cleaning the source (pun intended) may happen if I get enough round tuits. |
|
|
|
|
|
#24 | |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
29·3·7 Posts |
Quote:
![]() I just realized that I should have converted to HSV, CLEANed the V component and then used the original H and S components to colourize the restored image because very little information is in the latter pair. Proving I'm just a novice ... |
|
|
|
|
|
|
#25 | |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
29×3×7 Posts |
Quote:
There's a discussion going on in the ImageMagick forum where several more good ideas for experimentation have been produced. |
|
|
|
|
|
|
#26 |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
101010000000002 Posts |
Now trying to find a much better PSF, primarily by co-adding the images of N stars to reduce the noise by sqrt(N). Sub-problem: find the stars.
![]() Next phase is to find connected components of the thresholded image, locate the centroid of each component and co-add a region of the original image around the centroid to form an aggregate PSF. Removing all isolated single pixels from the thresholded image will remove noise peaks and the stuck pixels. Big problem with Capella because it is saturated. Propose removing that one by hand or, perhaps, dropping all connected components which are "too large" in some sense. However, something should be done about the stuck pixels. Perhaps replace by 3x3 median for all pixels set at maximum value? Do this in each colour separately of course. Currently working on the original image converted to grey-scale for simplicity and ease of computation. Comments and suggestions welcomed. |
|
|
|
|
|
#27 |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
29×3×7 Posts |
Stilll having fun with this stuff, especially with colour processing.
According to ImageMagick the .nef image claims to be in the sRGB colourspace with gamma 0.45455. Displaying the images with gamma=2.2 (1/.45455) certainly gives a visually more pleasing result on my monitor. Attached are versions of a 256x256 region near Capella. color2_2.png is the full RGB with a gamma correction of 2.2 applied; gray2_2.png is converted first to grey scale and gamma applied. The others are the respective red, green and blue channels extracted and then gamma corrected. The full colour image shows a strong red cast. I've already noted the stuck pixels (not shown in the portion of the full image attached here) and I suspect that the cyan area of Capella may be dead red pixels. Careful examination of enlargements of the rest of the image also indicates suspiciously large number of zero or very small pixel values in the red channel. Contrast is highest in the green channel and lowest in the red. Perhaps thats because the camera is designed for human vision where sensitivity is greatest in the green region. Note the diffraction halo around Capella is almost entirely in the green channel and essentially invisible in red. Not sure what to conclude from this, other than perhaps I should concentrate on the green channel for the time being. |
|
|
|
|
|
#28 |
|
(loop (#_fork))
Feb 2006
Cambridge, England
72·131 Posts |
Would you like some more images? I cannot guarantee consistency of point spread function, but it was a nice clear night on Thursday and I can make available any of:
* Five exposures of the Pleiades, in which you can definitely see the surrounding nebulosity if you stack them and look in the blue channel * 24 exposures of the region around the M33 galaxy in Triangulum, which probably say something interesting about the lens properties when you try to line them up by moving integer numbers of pixels and minimising sum-of-absolute-difference-over-bright-pixels in a region around the galaxy * Three exposures with a wider-angle lens of a region from Auriga across to Gemini with the four rich star clusters M35-M38 * Twelve exposures (nine seconds f/4) of the reasonably rich cluster M41 in Canis Major, though it was near enough the horizon that there are tree branches and bits of house in the full frames and probably cropping to the cluster is the way to start. These are 70MB per exposure so I don't really want to upload them all on spec. What I would really like is some kind of plausible approach to subtracting out the light-pollution background - it's a uniform shape between images, because light pollution is uniform on a ten-degree scale and all I'm seeing is a measurement of the vignetting of the lens/detector combination, but it's bright enough that it leaves the images very unsatisfying if I just do a gentle high-pass filter by subtracting an Gaussian-blur-with-100-pixel-diameter of the image from the image. I need some kind of (PSF-driven?) kludge for working out when to try subtracting from a saturated pixel and when to leave the pixel saturated ... my inclination would be to subtract from saturated pixels whose neighbours are not all saturated, and leave the middles of saturated blobs as saturated. |
|
|
|
|
|
#29 |
|
(loop (#_fork))
Feb 2006
Cambridge, England
641910 Posts |
Remember the CCD has a Bayer mosaic of colour filters in front of it, so one hot red pixel is going to have its hotness propagated to at least its eight neighbours and probably a bit further during the demosaicing phase; I think there are two adjacent hot red pixels and the rest of that region is a processing artefact.
|
|
|
|
|
|
#30 | |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
29×3×7 Posts |
Quote:
Note that there is also evidence of a dead red pixel (or few) in the Capella region where there is a pronounced cyan edge to the disk. Images of a uniform black (or almost black) and a uniform white (or almost white) field should nicely characterize pepper and salt noise in each channel. I don't know if you've tried this. These would allow you to compensate for dark field and stuck pixels as the first two steps in the data processing pipeline. It would be interesting to find out the results. |
|
|
|
|
|
|
#31 |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
2A0016 Posts |
Curious.
I've been working on the original NEF image converted to PNG format with ImageMagic thus convert capella.full.nef -colorspace rgb -quality 00 -define png:format=48 capella.png and that image shows a smattering of stuck red (and only red) pixels in the south east corner. Your .jpg conversion doesn't show those artefacts so it looks like we may have been talking to cross porpoises. I'm now wondering which if either is "correct". The old adage about always work with the originals is why I went down the chosen route --- I didn't know what artefacts JPEG conversion may have created whereas PNG quality 0 should preserve everything. Added in edit: convert capella.full.nef foo.jpg pcl@anubis ~/Pictures/process/save $ display !$ display foo.jpg shows the same red artefacts. Is one of our .NEF images corrupted in some way? The md5sum of the one I downloaded is 58204a0ff0f903e0f6b27fd9c7e87030 capella.full.nef Last fiddled with by xilman on 2016-11-27 at 22:13 Reason: Fix tag |
|
|
|
|
|
#32 | |||
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
29×3×7 Posts |
Quote:
Quote:
Hmm, perhaps I should have done that one the Capella image before any further processing. Quote:
|
|||
|
|
|
|
|
#33 |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
29·3·7 Posts |
A light dawns, figuratively and literally. I bet you live in an area with a large amount of low-pressure sodium street lighting.
Last fiddled with by xilman on 2016-11-27 at 22:20 |
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can't add assignments manually | dragonbud20 | Information & Answers | 5 | 2015-11-18 09:39 |
| Why factoring is single-core designed? | otutusaus | Software | 33 | 2010-11-20 21:05 |
| Oil immersion lens | davieddy | Puzzles | 17 | 2010-06-26 10:47 |
| How fast is your internet connection? (focus on dial-up) | eepiccolo | Lounge | 8 | 2003-05-11 06:04 |
| Manually adding primes | Dærk | Software | 5 | 2002-11-01 14:01 |