Skip to content

Commit

Permalink
Merge pull request #20 from iriapantazi/gaussian
Browse files Browse the repository at this point in the history
add mean in gaussian function
  • Loading branch information
Hvitgar authored Apr 29, 2022
2 parents d4ce97e + c6dc004 commit c8c1828
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imagecorruptions/corruptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def getOptimalKernelWidth1D(radius, sigma):
return radius * 2 + 1

def gauss_function(x, mean, sigma):
return (np.exp(- x**2 / (2 * (sigma**2)))) / (np.sqrt(2 * np.pi) * sigma)
return (np.exp(- (x - mean)**2 / (2 * (sigma**2)))) / (np.sqrt(2 * np.pi) * sigma)

def getMotionBlurKernel(width, sigma):
k = gauss_function(np.arange(width), 0, sigma)
Expand Down

0 comments on commit c8c1828

Please sign in to comment.