machinevisiontoolbox.Image.contains
- Image.contains(p)[source]
Test if coordinate lies within image
- Parameters:
p (array_like(2), ndarray(2,N)) – pixel coordinate
- Returns:
whether pixel coordinate lies within image bounds
- Return type:
bool, ndarray(N)
Example:
>>> from machinevisiontoolbox import Image >>> import numpy as np >>> img = Image.Zeros(10) >>> img.contains((4,6)) True >>> img.contains((-1, 7)) False >>> img.contains(np.array([[4, 6], [-1, 7], [10, 10]]).T) array([ True, False, False])