2

I encountered a strange error- whenever I'm including #include <dlib/gui_widgets.h> to my projects and declaring a variable (for example dlib::image_window win) following errors appear:

'DLIB_NO_GUI_SUPPORT is defined so you can't use the GUI code. Turn DLIB_NO_GUI_SUPPORT off if you want to use it.' and 'Also make sure you have libx11-dev installed on your system' (from guy_core_kernel_2.h). I was searching and found some suggestions that the cmake of dlib could fail- but I really doubt so, I'm already doing a detection of landmarks.

The reason why I'm trying to include and declare one of the widgets is displaying values on the screen (there is no equivalent of opencv putText(), is there?.

I would be very grateful for any help. :)

Teresa Kozera
  • 232
  • 6
  • 12
  • 1
    Do you have libx11-dev installed? Are you able to compile and run dlib's examples? Do you need to display via dlib or opencv is acceptable too? – Evgeniy Jun 08 '16 at 06:59
  • Yes, I installed X11 and successfully ran the samples. I thought about using opencv as a support to print things on the screen but wanted to make sure it is not possible using dlib. :) – Teresa Kozera Jun 08 '16 at 08:16
  • Samples building process is slightly different from using installed dlib. You have three ways to run dlib: 1 - re-build dlib and ensure you have GUI support (mkdir build && cd build && cmake .. && cmake --build . --traget install) - check building messages for GUI support enabled 2 - use code from CMakeLists.txt in examples folder and include it in your project 3- include dlib/all/source.cpp into your project – Evgeniy Jun 08 '16 at 09:19
  • What I should have added- I already used features of dlib in my project. Everything builds and runs perfectly, but I am unable to use any of the widgets. I built the lib using instructions from here: http://stackoverflow.com/questions/34591254/how-to-build-dlib-for-ios/35058969#35058969 Do you think using `cmake --build . --target install` instead of `cmake --build . --config Release` will change anything? I am getting the error: `make: *** No rule to make target `install'. Stop` – Teresa Kozera Jun 08 '16 at 10:07
  • Additionally I don;t think I can include the .cpp file in my project- it has mostly swift files with .mm wrapper. – Teresa Kozera Jun 08 '16 at 10:23

1 Answers1

1

At the end I decided to use covertion from dlib::array2d to cv::Matrix (dlib::toMat(dlib::array2d) function) and use cv::putText() (as mentioned previousely). It turned out the Xcode didn't properly linked libraries from openCV- helpful were the following links: How can I create OpenCV framework?

and

http://blogs.wcode.org/2014/11/howto-setup-xcode-6-1-to-work-with-opencv-libraries/

Also if someone can't find Frameworks in Library:

https://discussions.apple.com/thread/4195808?tstart=0

Community
  • 1
  • 1
Teresa Kozera
  • 232
  • 6
  • 12