fifo - pointer [message #52946] |
Mon, 12 March 2007 10:58 |
tochaf
Messages: 6 Registered: February 2007
|
Junior Member |
|
|
I have a written routine, however this is very heavy and wanted it
becomes a little more faster (a lot more faster I hope) . As I have
some lack of time (to see this subject that is new for) ,meand I
think that many of you make this with closed eyes, without great
loses of time. This because I never worked with pointers and seems to
me a little late now to finish this work. So I really appreciated an
aid here.
I have this:
fifo_add(p) - puts the (pointer to) pixel p into the queue
fifo_first() - returns the (pointer to) pixel which is at the
beginning of the queue, and removes it
fifo_empty() - returns true if the queue is empty, false otherwise
(A classic fifo, I think)
J and I = arrays
Ng = an neighborhood of one pixel
BEGIN
-if there exists q in Ng(p) such that
J(q) lt J(p) and J(q) lt I(q)
- fifo_add(p)
-Propagation Step:
-while fifo_empty() =false
- p <--- fifo_first()
- for every pixel q in Ng(p):
- if J(q) lt J(p) and I(q) ne J(q)
- J(q) <--- min(J(p),I(q))
- fifo_add(q)
if write this is really simple all help is rreeaallyyyy welcome
bye
|
|
|