C++ to python, numpy-OpenCv
How can i convert this line into python code
Mat out = Mat::ones(src.rows+maxYOffset, src.cols+maxXOffset, src.type());
i have tried using np.zeros() and np.ones.
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
Asked: 2018-10-23 03:22:54 -0600
Seen: 953 times
Last updated: Oct 23 '18
and the problem is ?
also, please do NOT delete your previous questions, and ask a new one.
it does not solve the "duplicate question" problem, as you're deleteing previous comments / answers, too.
I saw [Deleted], so i del it.
The error i get
leave anything as is now, but take the advice for future posts, please.
Will do that.
and how do you get to that error ?
https://pastebin.com/d6EC2rQD
Line 43