Generate a normalized square Gaussian blur kernel. For every position, measure offsets x and y from the center and compute:
G(x,y)=exp(−2σ2x2+y2)Here, σ is the supplied standard deviation. Divide every weight by the sum of all unnormalized weights so the final kernel sums to one. Return the kernel as a two-dimensional list of floats.
Input: size = 3, sigma = 1
Output: [[0.075114, 0.123841, 0.075114], [0.123841, 0.20418, 0.123841], [0.075114, 0.123841, 0.075114]]
Explanation: The center receives the largest weight, the kernel is symmetric, and all weights sum to one.
Input: size = 1, sigma = 1
Output: [[1]]
Use size // 2 as the center coordinate.
Accumulate all unnormalized weights before dividing each value by their total.
Sign in to take notes on this problem
Accepts: number
Accepts: number
Generate a normalized square Gaussian blur kernel. For every position, measure offsets x and y from the center and compute:
G(x,y)=exp(−2σ2x2+y2)Here, σ is the supplied standard deviation. Divide every weight by the sum of all unnormalized weights so the final kernel sums to one. Return the kernel as a two-dimensional list of floats.
Input: size = 3, sigma = 1
Output: [[0.075114, 0.123841, 0.075114], [0.123841, 0.20418, 0.123841], [0.075114, 0.123841, 0.075114]]
Explanation: The center receives the largest weight, the kernel is symmetric, and all weights sum to one.
Input: size = 1, sigma = 1
Output: [[1]]
Use size // 2 as the center coordinate.
Accumulate all unnormalized weights before dividing each value by their total.
Sign in to take notes on this problem
Accepts: number
Accepts: number