Convert cv2 image to mxnet image

When trying to operated on an image from opencv (cv2), in mxne, I got errors in _cvimresize that say “Argument src must have NDArray type, but got …”.

The key is it convert the object using mx.nd.array, like so:

newImage = mx.nd.array(src)

Interested in Python? I send out weekly, personalized emails with articles and conference talks. Click here to see an example and subscribe.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *