K
koperenkogel
Dear cpp-ians,
I am writing code for a image segmentation program. For this purpose I
want to make a list (or array) of all pixels and take a random pixel
out of the list. Once the pixel is handled, I want to remove it from
the list and take again a random pixel out of the new list (with the
previous pixel removed).
I have an image of 1450 x 1650 pixels. Every pixel is a pointer to a
structure:
struct group
{
float value; // the gray value of the original image
struct meta_group * group; // the image segment it belongs to
struct pixel * pixel_list; // the first pixel of a list of all pixels
of the image segment
struct pixel * edge_list; // the first pixel of a list of all border
pixels of the image segment
};
Now I want:
* to put all those pointers in a list
* take a random pointer out of the list and do some processing on it
* remove it from the list
* take a new random pointer from the list (with the previous pointer
removed).
Can anyone help me on how to program it? What function should I use to
remove the pointer from the list or array?
Thanx in advance!
Kind regards,
Stef
I am writing code for a image segmentation program. For this purpose I
want to make a list (or array) of all pixels and take a random pixel
out of the list. Once the pixel is handled, I want to remove it from
the list and take again a random pixel out of the new list (with the
previous pixel removed).
I have an image of 1450 x 1650 pixels. Every pixel is a pointer to a
structure:
struct group
{
float value; // the gray value of the original image
struct meta_group * group; // the image segment it belongs to
struct pixel * pixel_list; // the first pixel of a list of all pixels
of the image segment
struct pixel * edge_list; // the first pixel of a list of all border
pixels of the image segment
};
Now I want:
* to put all those pointers in a list
* take a random pointer out of the list and do some processing on it
* remove it from the list
* take a new random pointer from the list (with the previous pointer
removed).
Can anyone help me on how to program it? What function should I use to
remove the pointer from the list or array?
Thanx in advance!
Kind regards,
Stef