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

Home » Public Forums » archive » spots on image
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
spots on image [message #52246] Thu, 25 January 2007 13:03 Go to next message
rpertaub@gmail.com is currently offline  rpertaub@gmail.com
Messages: 43
Registered: January 2007
Member
Hello,
I am new to IDL so bear with me! I am analyzing an image with some
spots on them (from a few pinholes). I need to know where these spots
are and mark them and make a Gaussian fit. I have used the where
function to find where the spots are and have obtained the pixels where
the intensity is higher than a threshold. However, the spots are made
up of more than 1 pixel, therefore i need to group these pixels
together to make up one spot, and then fit a Gaussian...

Any ideas how to do that?

Thanks!

RP
Re: spots on image [message #52328 is a reply to message #52246] Fri, 26 January 2007 04:13 Go to previous message
Jo Klein is currently offline  Jo Klein
Messages: 54
Registered: January 2006
Member
Just a small caveat that I've stumbled over before: LABEL_REGION doesn't
like border pixels. This can easily be fixed by embedding your image in
a new one with an extra pixel's width added on each margin. See David's
goldmine:
http://www.dfanning.com/idl_way/avgseries.html

Jo

> Mike,
>
> Fantastic, it never fails that I learn something new everyday. I had
> never used label_region function before, Bravo!!!
> and the combination of
> mask = dat ge threshhold
> regions = label_region(mask)
> is pure gold.
> This will make my life a lot better in the future, this is why I read
> (and post) to this group.
>
>
> Brian
>
> ------------------------------------------------------------ ---------------
> Brian A. Larsen
> Dept. of Physics
> Space Science and Engineering Lab (SSEL)
> Montana State University - Bozeman
> Bozeman, MT 59717
>
>
> On Jan 25, 2:35 pm, "mgal...@gmail.com" <mgal...@gmail.com> wrote:
>
>> On Jan 25, 2:22 pm, "Brian Larsen" <balar...@gmail.com> wrote:
>>
>>
>>> I have done a bit of similar work. Just in quick pseudocode
>>
>>> dat = fltarr(256,256)
>>> ;; fill with an image
>>> ;; find one of the pinhole brightnesses using your method
>>> ;; call that center[2] [0]->x [1]->yFor this part, I would do something like:
>>
>> nColumns = 256 ; the number of columns in your image
>> mask = dat ge threshhold
>> regions = label_region(mask)
>> for r = 1L, max(regions) do begin
>> ind = where(regions eq r, count)
>> center = [mean(ind mod nColumns), mean(ind / nColumns)]
>> endfor
>>
>> then continue on with Brian's fitting code.
>>
>> Mike
>> --www.michaelgalloy.com
>
>
Re: spots on image [message #52334 is a reply to message #52246] Thu, 25 January 2007 15:00 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
Mike,

Fantastic, it never fails that I learn something new everyday. I had
never used label_region function before, Bravo!!!
and the combination of
mask = dat ge threshhold
regions = label_region(mask)
is pure gold.
This will make my life a lot better in the future, this is why I read
(and post) to this group.


Brian

------------------------------------------------------------ ---------------
Brian A. Larsen
Dept. of Physics
Space Science and Engineering Lab (SSEL)
Montana State University - Bozeman
Bozeman, MT 59717


On Jan 25, 2:35 pm, "mgal...@gmail.com" <mgal...@gmail.com> wrote:
> On Jan 25, 2:22 pm, "Brian Larsen" <balar...@gmail.com> wrote:
>
>> I have done a bit of similar work. Just in quick pseudocode
>
>> dat = fltarr(256,256)
>> ;; fill with an image
>> ;; find one of the pinhole brightnesses using your method
>> ;; call that center[2] [0]->x [1]->yFor this part, I would do something like:
>
> nColumns = 256 ; the number of columns in your image
> mask = dat ge threshhold
> regions = label_region(mask)
> for r = 1L, max(regions) do begin
> ind = where(regions eq r, count)
> center = [mean(ind mod nColumns), mean(ind / nColumns)]
> endfor
>
> then continue on with Brian's fitting code.
>
> Mike
> --www.michaelgalloy.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Write image to CDF file
Next Topic: plotting Ascii in bitmap

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

Current Time: Wed Oct 08 15:49:13 PDT 2025

Total time taken to generate the page: 0.00612 seconds