Parametric distance of a line in a grid (Line Integral Convolution)

  • #1
244
6

Main Question or Discussion Point

0favv.png

Hi, the above image is from the Line Integral Convolution paper by Cabral and Leedom. However, I am having a hard time implementing it, and I am quite certain I am misreading it. It is supposed to give me the distances of the lines like in the example below, but I am not sure how it can. First of all, it looks like sbottom=stopsbottom=stop and sright=sleftsright=sleft. Also, it looks like the answer will always be zero since ⌊Pi⌋−Pi⌊Pi⌋−Pi will always be negative for an image. Any advice on how I can make progress?
56NJY.png

My current implementation is:

def ds(x,y):
Vxy = V(x,y)
s_top=max((floor(y)-y)/Vxy[1],0)
s_bottom=max((floor(y)-y)/Vxy[1],0)
s_right= max((floor(x)-x)/Vxy[0],0)
s_left =max((floor(x)-x)/Vxy[0],0)
return(min([s_top,s_bottom,s_right,s_left]))


And, it always returns 0 (yes, I know I have ignored the instance in which V is parallel to e, but first I have to fix the issues I wrote about above).
 

Answers and Replies

Related Threads on Parametric distance of a line in a grid (Line Integral Convolution)

  • Last Post
Replies
5
Views
7K
  • Last Post
Replies
13
Views
18K
Replies
6
Views
2K
Replies
1
Views
6K
Replies
15
Views
30K
  • Last Post
Replies
3
Views
3K
Replies
2
Views
12K
Replies
3
Views
2K
Replies
1
Views
3K
Replies
21
Views
1K
Top