Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

step 1: use the builtin help:

>>> help(np.ones)

step 2: it needs a shape and a type here, so something like:

a = np.ones((h,w,c),np.uint8)

caveat: with multi-channel (c>1) Mat's opencv will only fill the 1st channel with 1, the others are left at 0 (to be compliant with complex data), while numpy will fill all of them with 1