Re: Collection of different sized arrays [message #69515] |
Sun, 17 January 2010 08:57  |
Mort Canty
Messages: 134 Registered: March 2003
|
Senior Member |
|
|
Am 17.01.2010 13:37, schrieb Robin Wilson:
> Hi,
>
> I have a suspicion that this question may have been asked before, but I
> can't seem to find the answer in the achives of this group. Possibly I'm
> not searching using the right keywords...
>
> Basically, I need to keep a collection of different sized arrays. I am
> writing an image segmentation routine, which will take an image and
> split it into segments. I need to keep track of which pixels in the
> image are in each segment. My thought is that I'll have an array for
> each segment which will contain the indices of the pixels within that
> segment. However, I can't work out how to store this collection of
> arrays in IDL, as each array will be a different length, and I won't
> know the number of segments or the lengths of the arrays at
> compile-time. Also, to add to the fun, the pixels in each segment are
> likely to change during the segmentation process...
>
> I have a suspicion the answer may involve pointers, or objects
> (possibly?) or something like that, but I'm not really sure.
>
> Any ideas would be much appreciated,
>
> Thanks,
>
> Robin Wilson
> University of Southampton, UK
Alternatively, you can maintain a label array (of integer) with the same
spatial dimension as your image and simply update the labels as your
segmentation algorithm proceeds.
-Mort
|
|
|