Sonic
Sonic

Reputation: 324

Is There A Opencv 2.3 Mat Pointer In C++

I'm new in opencv and use the version 2.3 in C++. My approach is to get a float** pointer to the values of a cv::Mat_ where I can also change values or get access via float[][]. I need it to use fftw3 and other stuff, where I usually need those pointers. The documentation of opencv is very nice, but I could just find the uchar* pointer "data". Reading images with this pointer is not a problem, but I also want to write floats or doubles in cv::Mats.

just for help: my final function should look like:

template <typename T> cv::Mat_<complex<T> > fft2 (cv::Mat_<T> input)

So has somebody a small code snippet for this problem?

Upvotes: 0

Views: 1873

Answers (1)

Sam
Sam

Reputation: 20056

use this:

float* matrixData = (float*)myMat.data;

Upvotes: 1

Related Questions