def __threshold_moving(input, last_image):
"""Thresholds off parts of the image that have moved or changed between
the previous and next image.
Args:
input: A numpy.ndarray.
last_image: The previous value of the numpy.ndarray.
Returns:
A numpy.ndarray with the parts that are the same in black.
"""
if (last_image.shape == input.shape):
output = cv2.absdiff(input, last_image)
else:
output = numpy.ndarray(shape=input.shape, dtype=input.dtype)
return input, output
评论列表
文章目录