Menu

face_detection_ex.cpp - jpeg_loader: error while reading /Users/.../lena.jpg

Help
Matthew
2014-10-16
2014-10-20
  • Matthew

    Matthew - 2014-10-16

    Hey,

    I've happily managed to compile and run all examples via MacOs Terminal (with both g++ and Cmake) but still no luck with Xcode when it comes to face_detection_ex.cpp and .jpg files (png are just fine). It seems like there is some issue with my libjpeg.dylib but I quite don't get it since it is probably the same library wich was used during g++/cmake compilation. Frankly speaking I am just stuck with it and really tired with all this Xcode issues.

    Any help is really appreciated!

    Cheers,
    Matthew

     
    • Davis

      Davis - 2014-10-16

      I haven't used XCode in a long time so I don't know how exactly to
      configure it from scratch. It should be easy but maybe it does something
      odd to libjpeg. Have you tried telling CMake to generate your XCode
      project? You can select different project outputs from CMake by using
      CMake's -G switch. That should create a correctly configured project.

      Also, what happens specifically when you try to read jpeg files in XCode?

      Cheers,
      Davis

       
  • Matthew

    Matthew - 2014-10-20

    Sorry for such late reply but I was out of town.

    -G "Xcode" was really handy - frankly speaking I am newbie to Cmake and didn't know that there is such an option. It works flawlessly and super fast right now (almost 2x faster than regular Unix build). Please find screenshot of thrown exception (from previous build from scratch) in attachment. If you really want I could try to debug it to find out what is the main reason of exception although reluctantly since I got project working :P

    I wonder if there is any easy way of fetching video feed from camera and processing it with some dlib features (face detection / pose estimation). What do you recommend? I was thinking about using OpenCV VideoCapture but if there is some other way of doing it please let me know.

    Thank you very much for help!
    Cheers,
    Matthew

     
    • Davis

      Davis - 2014-10-20

      No worries.

      The XCode project creation wizard is notoriously hard to use. I used to
      use it at work years ago and it would very frequently result in
      inappropriate switches being given to g++ that cause things to break. From
      the emails I get that seems to still be the case. So I wouldn't worry
      about it and just let CMake configure it for you.

      Yeah, definitely use VideoCapture in OpenCV. That's the way to go. You
      just have to do something like this:

      cv::VideoCapture cap(0);
      while(true)    {
          cv::Mat temp;
          cap >> temp;
          dlib::cv_image<bgr_pixel> img(temp);
          // do something with img like face detection or whatever.
      }
      

      Cheers,
      Davis

       

      Last edit: Davis 2014-10-20

Log in to post a comment.