I have integers which I put in a matrix in order to use them in a specific function in openCV. The matrix that I created is only cvMat and I want to use this matrix in the function. I’m getting an error:
error: cannot convert ‘CvMat’ to ‘const CvMat*’
So how can I convert these ints to const in order to create that matrix as const CvMat i.e how to change CvMat to const CvMat?
The important thing there is the asterix at the end. That means the function you are calling wants a pointer. you can just take the address of your matrix and pass that, instead
somefunction(myMatrix)it needssomefunction(&myMatrix). Don’t worry about the const. A pointer can always be converted to a const pointer implicitly.