cv3.create.ones

cv3.create.ones(*args)[source]

Create an array filled with ones.

Parameters:

*args – Dimensions of the array. Can be passed as separate arguments (e.g., ones(100, 100, 3)) or as a tuple (e.g., ones((100, 100, 3))).

Returns:

Array filled with ones of type uint8.

Return type:

numpy.ndarray

Example

>>> import cv3
>>> img = cv3.ones(100, 100, 3)  # Create a 100x100x3 image filled with ones
>>> print(img.shape)
(100, 100, 3)