Re: CCD saturation [message #63022] |
Sat, 25 October 2008 06:33  |
Wox
Messages: 184 Registered: August 2006
|
Senior Member |
|
|
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. That's why I could only think of shape
detection to differ streaks from spots. However I'm not really able to
do that. I usually remove a lot of non-saturated spots too.
The problem I want to solve is illustrated here (X-ray Powder
Diffraction): http://www.datasqueezesoftware.com/screenbig.jpg
You see the so-called Debye rings in the image in the background and
the azimuthally integrated pattern in the front. Usually you don't see
this nice rings, but alot of spots forming a ring (or more rings).
Imagine azimuthally integrating this when some spots are saturated
with streaking. You don't end up with nice Gaussian peaks like in the
figure, but some strange ..euhm.. things... that may look like peaks.
If I could just detect the streaks and set these pixels to zero, I
solved the problem.
Since there are alot of astronomers here, I would think they also have
similar problems to solve, only their spots are not scattered X-ray
beams but stars :-).
|
|
|
|
Re: CCD saturation [message #63113 is a reply to message #63022] |
Mon, 27 October 2008 09:47  |
JMB
Messages: 13 Registered: January 2008
|
Junior Member |
|
|
Hi Wox,
If you haven't solved your problem yet, here are some ideas to help:
- If your streaks are vertical, you can try to search for them in the
columns of your image matrix.
First you need to identify a threshold to separate "active" pixels
from noisy background:
e.g. T1 = mean(image) x 4,
Then look for columns that are corrupted by streaks:
for i=0,Ncols-1 do column[i]=total(img[i,*] gt T1)
You get for each column the number of "active" pixels and if this
number is higher than a specific threshold this column contains a
streak and you can set the pixels of this column equal to zero (or
background value)
The problem is that by doing this you miss now the "good" pixels
from the center of your active spot/star.
A way to retrieve the center of your bright spots without taking
the streak is to use the median function:
e.g. median(img,5) GT T2
where T2 is a threshold on the image brigthness.
You can visualize the result of the median function by typing:
tvscl, median(img,5) GT T2 ; 0 < T2 < 255 for 8 bit images.
Playing around with the size of the median filter and the value of
T2, you may be able to create a mask that filter out the streaks and
let you only the large spots.
If it doesn't seem clear, please ask
Jérôme
|
|
|
Re: CCD saturation [message #63118 is a reply to message #63022] |
Mon, 27 October 2008 06:27  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
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?
Paolo
That's why I could only think of shape
> detection to differ streaks from spots. However I'm not really able to
> do that. I usually remove a lot of non-saturated spots too.
>
> The problem I want to solve is illustrated here (X-ray Powder
> Diffraction): http://www.datasqueezesoftware.com/screenbig.jpg
> You see the so-called Debye rings in the image in the background and
> the azimuthally integrated pattern in the front. Usually you don't see
> this nice rings, but alot of spots forming a ring (or more rings).
> Imagine azimuthally integrating this when some spots are saturated
> with streaking. You don't end up with nice Gaussian peaks like in the
> figure, but some strange ..euhm.. things... that may look like peaks.
> If I could just detect the streaks and set these pixels to zero, I
> solved the problem.
>
> Since there are alot of astronomers here, I would think they also have
> similar problems to solve, only their spots are not scattered X-ray
> beams but stars :-).
|
|
|