3

I have a unsigned short array which I would like to median filter using opencv (it seems to have one of the most efficient filters around)

However I can't seem to create a matrix from the array. I've tried the Mat(int _rows, int _cols, int _type, void* _data, size_t _step=AUTO_STEP) constructor using:

Mat(rows,cols,IPL_DEPTH_16U,myShortArray,2);

But it doesn't seem to work. What am I doing wrong?

1 Answer 1

7

Try

Mat m(rows, cols, CV_16U, myShortArray);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.