dlib

Usage of dlib library in Visual Studio 2010

半城伤御伤魂 提交于 2019-12-10 18:15:42
问题 I would like to ask for help in using dlib for my little thesis project. Specifically, I need to use the BOBYQA optimisation routine. I am writing the project in MS Visual Studio 2010 Express in C language. I have zero experience in using libraries such as dlib and I don't have any idea what a makefile is and how to write one. I have found a little hint here but due to my lack of experience in the matter, I just can't figure out how to compile and make use of dlib in my code. I would like to

Create a shared library for dlib

≯℡__Kan透↙ 提交于 2019-12-09 10:29:25
问题 Following the instructions to compile dlib using cmake (here) generates a static dlib library: cd examples mkdir build cd build cmake .. cmake --build . --config Release How can I instruct cmake to generate a shared (.so) library instead? 回答1: If you want to make a .so file then do this: cd dclib/dlib mkdir build cd build cmake -DBUILD_SHARED_LIBS=1 .. make sudo make install On a unix system, that will install dlib system wide. This means installing the .so file and also the header files so

Temperature is black after thresholding

谁说胖子不能爱 提交于 2019-12-08 11:52:22
问题 I want to show the temperature based on the density. Following are the function that Im using, def add_heat(heatmap, bbox_list): for i in range(len(bbox_list)): rect = trackers[i].get_position() heatmap[int(rect.left()):int(rect.top()), int(rect.right()):int(rect.bottom())] += 1 return heatmap def apply_threshold(heatmap, threshold): # Zero out pixels below the threshold heatmap[heatmap <= threshold] = 0 # Return thresholded map cv2.imwrite("heatmap.png",heatmap) return heatmap add_heat

Compiling dlib on OS X

早过忘川 提交于 2019-12-08 02:56:38
问题 I try to use dlib in Qt project on OS X. So, in this try I did following: In dlib root: cd examples mkdir build cd build cmake .. cmake --build . --config Release In dlib root: mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=/Users/user/dlib_build cmake --build . --config Release --target install .pro file: INCLUDEPATH += /Users/user/dlib_build/include LIBS += -L/Users/user/dlib_build/lib LIBS += -ldlib main.cpp: //... frontal_face_detector detector = get_frontal_face_detector(); //...

44 dlib鼠标指定目标跟踪

僤鯓⒐⒋嵵緔 提交于 2019-12-06 13:24:01
dlib提供了dlib.correlation_tracker()类用于跟踪目标。 官方文档入口: http://dlib.net/python/index.html#dlib.correlation_tracker 不复杂,就不介绍了,后面会直接给出两个程序,有注释。 # -*- coding: utf-8 -*- import sys import dlib import cv2 tracker = dlib.correlation_tracker() # 导入correlation_tracker()类 cap = cv2.VideoCapture(0) # OpenCV打开摄像头 start_flag = True # 标记,是否是第一帧,若在第一帧需要先初始化 selection = None # 实时跟踪鼠标的跟踪区域 track_window = None # 要检测的物体所在区域 drag_start = None # 标记,是否开始拖动鼠标 # 鼠标点击事件回调函数 def onMouseClicked(event, x, y, flags, param): global selection, track_window, drag_start # 定义全局变量 if event == cv2.EVENT_LBUTTONDOWN: # 鼠标左键按下 drag

Compiling dlib on OS X

落爺英雄遲暮 提交于 2019-12-06 10:24:55
I try to use dlib in Qt project on OS X. So, in this try I did following: In dlib root: cd examples mkdir build cd build cmake .. cmake --build . --config Release In dlib root: mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=/Users/user/dlib_build cmake --build . --config Release --target install .pro file: INCLUDEPATH += /Users/user/dlib_build/include LIBS += -L/Users/user/dlib_build/lib LIBS += -ldlib main.cpp: //... frontal_face_detector detector = get_frontal_face_detector(); //... Compile output: Undefined symbols for architecture x86_64: "_dgesvd_", referenced from: dlib::lapack:

Is it possible to load/read shape_predictor_68_face_landmarks.dat at compile time?

血红的双手。 提交于 2019-12-06 09:44:56
问题 I am trying to build a C++ application in Visual Studio using DLIB's face_landmark_detection_ex.cpp. The build application run from command promt and trained model and image file is passed as arguments. face_landmark_detection_ex.exe shape_predictor_68_face_landmarks.dat image.jpg this shape_predictor_68_face_landmarks.dat is the trained model for 68 landmarks to perform detection on input image and needs to load at run-time every time to perform any detection. I am trying to do following

OpenCV / Python : multi-threading for live facial recognition

不打扰是莪最后的温柔 提交于 2019-12-06 07:16:37
问题 I'm using OpenCv and Dlib to execute facial recognition w/ landmarks, live from the webcam stream . The language is Python . It works fine on my macbook laptop, but I need it to run from a desktop computer 24/7. The computer is a PC Intel® Core™2 Quad CPU Q6600 @ 2.40GHz 32bit running Debian Jessie. The drop in performance is drastic : there is a 10 seconds delay due to processing ! I therefore looked into multi-threading to gain performance : I first tried the sample code by OpenCv, and the

In Dlib how do I save image with overlay?

﹥>﹥吖頭↗ 提交于 2019-12-05 03:19:55
I'm trying to modify Dlib's face detection example to save an image with detections to a file since I'm using a server without GUI. So far I have only figured how to save the image but not the overlay. How do I save both to the same file? //win.add_overlay(dets, rgb_pixel(255,0,0)); save_png(img, "detected.png"); You can call draw_rectangle on the image before saving it. Dmitry Try this: dlib::draw_rectangle() Example: dlib::draw_rectangle(rect_image, rect, dlib::rgb_pixel(255, 0, 0), 1); 来源: https://stackoverflow.com/questions/29762785/in-dlib-how-do-i-save-image-with-overlay

Drawing fancy rectangle around face

喜欢而已 提交于 2019-12-04 20:47:52
问题 I am using the following code to detect face and draw rectangle on top of the face. while True: # get video frame ret, img = cap.read() input_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) img_h, img_w, _ = np.shape(input_img) detected = detector(input_img, 1) for i, d in enumerate(detected): x1, y1, x2, y2, w, h = d.left(), d.top(), d.right() + 1, d.bottom() + 1, d.width(), d.height() cv2.rectangle(img, (x1, y1), (x2, y2), (255, 0, 0), 2) cv2.imshow("result", img) key = cv2.waitKey(30) if key ==