python Programming Glossary: sig1
Python code for Earth mover's Distance http://stackoverflow.com/questions/5101004/python-code-for-earth-movers-distance h_bins s_bins #Define number of rows numRows h_bins s_bins sig1 cv.CreateMat numRows 3 cv.CV_32FC1 sig2 cv.CreateMat numRows.. s_bins bin_val cv.QueryHistValue_2D hist1 h s cv.Set2D sig1 h s_bins s 0 cv.Scalar bin_val cv.Set2D sig1 h s_bins s 1 cv.Scalar.. h s cv.Set2D sig1 h s_bins s 0 cv.Scalar bin_val cv.Set2D sig1 h s_bins s 1 cv.Scalar h cv.Set2D sig1 h s_bins s 2 cv.Scalar..
Convolution computations in Numpy/Scipy http://stackoverflow.com/questions/6855169/convolution-computations-in-numpy-scipy signal2 idx mode 'same' return outputs def test num chans sig1 np.random.randn chans num sig2 np.random.randn chans num res1.. chans num sig2 np.random.randn chans num res1 mix1 sig1 sig2 res2 mix2 sig1 sig2 np.testing.assert_almost_equal res1.. np.random.randn chans num res1 mix1 sig1 sig2 res2 mix2 sig1 sig2 np.testing.assert_almost_equal res1 res2 if __name__ __main__..
|