cv3.create.empty_like

cv3.create.empty_like(img)[source]

Create an uninitialized array with the same shape and type as the input array.

Parameters:

img (numpy.ndarray) – Input array whose shape and type will be used to create the new array.

Returns:

Uninitialized array having the same shape and type

as the input array.

Return type:

numpy.ndarray

Note

The values in the returned array are uninitialized and may contain arbitrary data. For performance reasons, the array is not initialized to zero.

Example

>>> import cv3
>>> original = cv3.zeros(50, 50, 3)
>>> new_img = cv3.empty_like(original)  # Create uninitialized array with same shape
>>> print(new_img.shape)
(50, 50, 3)