comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » CCD saturation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
CCD saturation [message #63031] Fri, 24 October 2008 02:54 Go to next message
Wox is currently offline  Wox
Messages: 184
Registered: August 2006
Senior Member
Hi all,

Does anyone have any experience in correcting images for saturation
streaking? See image b in
http://learn.hamamatsu.com/articles/images/bloomingfigure1.j pg

I tried to do something with IDL's sobel+contour but it seems hard to
preserve the spots without streaking while removing the saturated ones
along with its stripes. Any ideas?

Thanks,

Wout
Re: CCD saturation [message #63099 is a reply to message #63031] Tue, 28 October 2008 02:42 Go to previous messageGo to next message
Wout De Nolf is currently offline  Wout De Nolf
Messages: 194
Registered: October 2008
Senior Member
Thanks guys. Michael's code does the trick. I will also check J�r�me's
suggestion to preserve the spot center.
Re: CCD saturation [message #63101 is a reply to message #63031] Tue, 28 October 2008 01:56 Go to previous messageGo to next message
Wout De Nolf is currently offline  Wout De Nolf
Messages: 194
Registered: October 2008
Senior Member
On Mon, 27 Oct 2008 06:27:03 -0700 (PDT), pgrigis@gmail.com wrote:

>
>
> Wox wrote:
>> Marshall Perrin wrote:
>>
>>> Shape detection is not the way to go here, versus detecting the level
>>> at which pixels saturate. There should be some characteristic number of
>>> counts per pixel below which you know data is not saturated.
>>
>> Yes, but this only works for the inner part of a saturated spot +
>> streaks. The edges don't have a value of 65535 (it's a 16bit CCD
>> camera) and can in fact have a lower value than non-saturated spots
>> which I want to preserve.
>
> Does the CCD really behaves this way? Seems pretty bad if
> saturation is spread around that way... Are you sure it is not stray
> light?

I'm sure. And yes it's bad and should be avoided (by lowering
acquisition time, putting absorbers in the beam, etc.), but in
automated measurements it can happen you only notice it after the
experiment.
Re: CCD saturation [message #63117 is a reply to message #63031] Mon, 27 October 2008 06:43 Go to previous messageGo to next message
MichaelT is currently offline  MichaelT
Messages: 52
Registered: May 2006
Member
A couple of years ago I did something like this to remove the streaks
(can't find the program any more, though...):

First label all stars in your image (img) which have pixel values
above a threshold value

lab = Label_Region(img gt threshold)
h = (histogram(lab))[1: *] ;[1: *] removes background pixel count

dims = Size(img, /Dimensions) ;image dimensions


So h now contains the pixel count for each identified area. Saturated
stars with streaks usually have a pixel count above a certain value
(their area is larger). In a loop I then checked which area is larger
than other_threshold and then determined the aspect ratio of each of
these areas:

;Areas larger than 100 pixels probably have streaks (or whatever
threshold is best in your case)
other_threshold = 100

w = Where(h gt other_threshold, n_areas)

;limiting aspect ratio, example: 1.2 (or whatever you like) considered
to be a streaked star
a_threshold = 1.2

For i = 1, n_areas - 1 Do Begin

wa = Where(lab EQ w[i] + 1) ;+1 to compensate for the removed
background count

wx = wa Mod Dim[0] ;Find the x- and y-locations of the pixels
wy = wa / Mod[0]

;If your streaks are vertical, otherwise reverse wx and wy
aspect_ratio = (Max(wy) - Min(wy) + 1.0) / (Max(wx) - Min(wx) + 1.0)

If aspect_ration GT a_threshold Then Begin
;Do something to remove the streaks
EndIf

EndFor

I can't remember exactly how I removed the streaks. I think I
substituted the streak's pixels by pixel values that were found just
adjacent to the streak (left and right). I also added some random
noise to the pixels to make them less obvious.

I hope it helps.

Michael
Re: CCD saturation [message #63123 is a reply to message #63099] Wed, 29 October 2008 08:07 Go to previous messageGo to next message
MichaelT is currently offline  MichaelT
Messages: 52
Registered: May 2006
Member
I just noticed two typos in my example code that you will likely
already have discovered:

For i = 1, n_areas - 1 Do Begin
Change this to
For i = 0, n_areas - 1 Do Begin

Mod[0] certainly should be Dim[0]

Michael
Re: CCD saturation [message #63246 is a reply to message #63123] Thu, 30 October 2008 01:31 Go to previous message
Wout De Nolf is currently offline  Wout De Nolf
Messages: 194
Registered: October 2008
Senior Member
On Wed, 29 Oct 2008 08:07:54 -0700 (PDT), MichaelT
<michael.theusner@googlemail.com> wrote:

> I just noticed two typos in my example code that you will likely
> already have discovered:
>
> For i = 1, n_areas - 1 Do Begin
> Change this to
> For i = 0, n_areas - 1 Do Begin
>
> Mod[0] certainly should be Dim[0]
>
> Michael

I noticed already, but thanks for your concern :-).
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: why the variable become -NaN?
Next Topic: Re: why the variable become -NaN?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:26:19 PDT 2025

Total time taken to generate the page: 0.00898 seconds