Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

error: cannot convert ‘float*’ to ‘double*’ for argument ‘4’ to ‘int flandmark_detect(IplImage*, int*, FLANDMARK_Model*, double*, int*)

I will study CMake later. For now I will use everything in the same directory.
I git clone the repo and put the example which I copy the website, name it as 'sarit.cpp'.
My questions is :
1. Do you think the developer confuses his own function? If he does. How can I fix it?

$ g++ sarit.cpp `pkg-config --cflags --libs opencv`
sarit.cpp: In function ‘int main(int, char**)’:
sarit.cpp:22:57: error: cannot convert ‘float*’ to ‘double*’ for argument ‘4’ to ‘int flandmark_detect(IplImage*, int*, FLANDMARK_Model*, double*, int*)’
   flandmark_detect(img_grayscale, bbox, model, landmarks);

And here is is my pkg-config

$ pkg-config --libs --cflags opencv
-I/usr/include/opencv /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so -lopencv_calib3d /usr/lib/x86_64-linux-gnu/libopencv_contrib.so -lopencv_contrib /usr/lib/x86_64-linux-gnu/libopencv_core.so -lopencv_core /usr/lib/x86_64-linux-gnu/libopencv_features2d.so -lopencv_features2d /usr/lib/x86_64-linux-gnu/libopencv_flann.so -lopencv_flann /usr/lib/x86_64-linux-gnu/libopencv_gpu.so -lopencv_gpu /usr/lib/x86_64-linux-gnu/libopencv_highgui.so -lopencv_highgui /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so -lopencv_imgproc /usr/lib/x86_64-linux-gnu/libopencv_legacy.so -lopencv_legacy /usr/lib/x86_64-linux-gnu/libopencv_ml.so -lopencv_ml /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so -lopencv_objdetect /usr/lib/x86_64-linux-gnu/libopencv_ocl.so -lopencv_ocl /usr/lib/x86_64-linux-gnu/libopencv_photo.so -lopencv_photo /usr/lib/x86_64-linux-gnu/libopencv_stitching.so -lopencv_stitching /usr/lib/x86_64-linux-gnu/libopencv_superres.so -lopencv_superres /usr/lib/x86_64-linux-gnu/libopencv_ts.so -lopencv_ts /usr/lib/x86_64-linux-gnu/libopencv_video.so -lopencv_video /usr/lib/x86_64-linux-gnu/libopencv_videostab.so -lopencv_videostab

My file :

#include "flandmark_detector.h"
#include "cv.h"
#include "opencv/highgui.h"

int main(int argc, char * argv[])
{
  // load flandmark model structure and initialize
  FLANDMARK_Model * model = flandmark_init("flandmark_model.dat");

  // load input image
  IplImage *img = cvLoadImage("photo.jpg");

  // convert image to grayscale
  IplImage *img_grayscale = cvCreateImage(cvSize(img->width, img->height), IPL_DEPTH_8U, 1);
  cvCvtColor(img, img_grayscale, CV_BGR2GRAY);

  // bbox with detected face (format: top_left_col top_left_row bottom_right_col bottom_right_row)
  int bbox[] = {72, 72, 183, 183};

  // detect facial landmarks (output are x, y coordinates of detected landmarks)
  float * landmarks = (float*)malloc(2*model->data.options.M*sizeof(float));
  flandmark_detect(img_grayscale, bbox, model, landmarks);
}