Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how could I make a larger kernel for motion blur? #1

Open
HoiweCheng opened this issue May 7, 2017 · 2 comments
Open

how could I make a larger kernel for motion blur? #1

HoiweCheng opened this issue May 7, 2017 · 2 comments

Comments

@HoiweCheng
Copy link

I read the code of linedictionary, but failed to figure out what it means? is there anything to support it?

@lospooky
Copy link
Owner

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

@wiibrew
Copy link

wiibrew commented May 11, 2018

@HoiweCheng Hope this help

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants