Converting CV::Mat to double *
Hi,
I am using C++ openCV-3.2.0 version.
I am also using a library for line segment detection,which takes only .pgm image of data type double *. I used
cv::Mat pgm_image;
pgm_image = cv::imread("image.pgm");
double *I = pgm_image.ptr<double>(0);
to read the image and to for getting pointer. And i tried parsing double * into the library that i am using. Is there any way around this? or Is there a way read .pgm file directly as double* ?
i doubt, that there is double data inside your PGM file .
can you show the file header ?
(then add to your question)
Hi, It looked like this
P2
820 615
255
188 188 188 190 .........