You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LineDictionary defines the coordinates wrt the kernel matrix of the two points identifying each possible line, these are then used in LinearMotionBlur.LineKernel to "draw" the line on the kernel matrix, setting the relevant values to 1. The keys of the different dict values are the angles of the lines each set of point coordinates refers to
If you want to make a larger linear blur kernel, just follow this logic and add what you need to LineDictionary
def createNxNLines(self,n):
lines={}
assert: (n-1)%2==0,"n must be a odd number!!!"
Num=2*n-2
angle_unit=180.0/Num
cnt=0
for i in range((n-1)/2,n):
j=0
lines[cnt*angle_unit]=[i, j, n-1-i, n-1-j]
cnt+=1
for j in range(1,(n+1)/2):
i=n-1
lines[cnt*angle_unit]=[i,j,n-1-i,n-1-j]
cnt+=1
for j in range((n+1)/2,n):
i=n-1
lines[cnt*angle_unit]=[n-1-i, n-1-j, i, j]
cnt+=1
for i in range(1, (n-1)/2):
j=0
lines[cnt*angle_unit]=[i,j,n-1-i,n-1-j]
cnt+=1
self.lines[n]=lines
return
I read the code of linedictionary, but failed to figure out what it means? is there anything to support it?
The text was updated successfully, but these errors were encountered: