How to use the aotools.image_processing.centreOfGravity function in aotools

To help you get started, we’ve selected a few aotools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AOtools / aotools / test / test_centroiders.py View on Github external
def test_centreOfGravity_single():
    img = numpy.random.random((10, 10))
    com = image_processing.centreOfGravity(img, 0.1)
    assert(com.shape[0]) == 2
github AOtools / aotools / test / test_centroiders.py View on Github external
def test_centreOfGravity_many():
    img = numpy.random.random((5, 10, 10))
    com = image_processing.centreOfGravity(img, 0.1)
    assert(com.shape[0] == 2)
    assert(com.shape[1] == 5)
github AOtools / aotools / test / test_centroiders.py View on Github external
def test_centreOfGravity_value():
    img = numpy.zeros((1, 5, 5))
    img[0, 1:3, 2:4] = 1.
    centroid = image_processing.centreOfGravity(img)
    numpy.testing.assert_almost_equal(centroid, numpy.array([[2.5], [1.5]]))