All problems
Noise Estimate (MAD)
Problem
Estimate the noise standard deviation from horizontal neighbor differences.
Take the median of abs(I[i][j+1] - I[i][j]) over all adjacent pairs and divide it by 0.6745, rounding to 4 decimal places. An image with no horizontal pairs returns 0.0.
Test cases
case 1
in: [[[0,10,0],[10,0,10]]]
expected: 14.8258
case 2
in: [[[0,2,4]]]
expected: 2.9652
case 3
in: [[[5]]]
expected: 0
case 4
in: [[[7,7],[7,7]]]
expected: 0
Starter codePython
def noise_mad(image):
# Your code here
pass4 test cases · run your code against them in the editor