integrate

integrate

skimage.transform.integrate(ii, start, end, *args) [source]

Use an integral image to integrate over a given window.

Parameters:

ii : ndarray

Integral image.

start : List of tuples, each tuple of length equal to dimension of ii

Coordinates of top left corner of window(s). Each tuple in the list contains the starting row, col, ... index i.e [(row_win1, col_win1, ...), (row_win2, col_win2,...), ...].

end : List of tuples, each tuple of length equal to dimension of ii

Coordinates of bottom right corner of window(s). Each tuple in the list containing the end row, col, ... index i.e [(row_win1, col_win1, ...), (row_win2, col_win2, ...), ...].

args: optional

For backward compatibility with versions prior to 0.12. The earlier function signature was integrate(ii, r0, c0, r1, c1), where r0, c0 are int(lists) specifying start coordinates of window(s) to be integrated and r1, c1 the end coordinates.

Returns:

S : scalar or ndarray

Integral (sum) over the given window(s).

Examples

>>> arr = np.ones((5, 6), dtype=np.float)
>>> ii = integral_image(arr)
>>> integrate(ii, (1, 0), (1, 2))  # sum from (1, 0) to (1, 2)
array([ 3.])
>>> integrate(ii, [(3, 3)], [(4, 5)])  # sum from (3, 3) to (4, 5)
array([ 6.])
>>> # sum from (1, 0) to (1, 2) and from (3, 3) to (4, 5)
>>> integrate(ii, [(1, 0), (3, 3)], [(1, 2), (4, 5)])
array([ 3.,  6.])
doc_scikit_image
2017-01-12 17:21:37
Comments
Leave a Comment

Please login to continue.