Ask Your Question
0

What is equivalent of cvCreateMat function in OpenCV2 using python3

asked 2019-02-15 05:25:49 -0600

I am converting an old piece of code written in c/cpp into python. It uses cvCreateMat function. I believe that cvCreateMat function is not supported in OpenCV2. I dont know how to do it using OpenCV2/numpy. OR all I need is the equivalent of the following line in python.

cv::Mat a = cvCreateMat(3*numberOfMatrices, 6,CV_64FC1);

I have seen the link but I cant get it in my case.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-02-15 05:34:50 -0600

berak gravatar image

updated 2019-02-15 05:35:28 -0600

there is no such thing. cv2 is using numpy arrays all the way down.

and please, throw away any c-based opencv code immediately, it'll be more a hindrance, than helpful.

please take a good look at the python docs

edit flag offensive delete link more

Comments

1

Okay, is this equivalent to above code img = np.zeros((3*numberOfMatrices, 6), dtype=np.float64)

mianasbat gravatar imagemianasbat ( 2019-02-15 05:39:55 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-02-15 05:25:49 -0600

Seen: 987 times

Last updated: Feb 15 '19