# libfacecut **Repository Path**: apchy_ll/libfacecut ## Basic Information - **Project Name**: libfacecut - **Description**: 基于libfacedetection和opencv实现的jpg 人脸口库; - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-03-16 - **Last Updated**: 2021-03-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 一、项目说明 1.项目主要基于libfacedetection实现的 linux x86下面单张人脸抠图库封装; 代码仓库来自于https://github.com/ShiqiYu/libfacedetection # 二、基础环境搭建 ## 1.Build opencv 4.5.1 ## step1 download opencv source ```shell wget -q https://github.com/opencv/opencv/archive/4.5.1.zip -O opencv-4.5.1.zip unzip -q opencv-4.5.1.zip cd opencv-4.5.1 ``` ## step2 build your opencv package with cmake ```shell mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=install \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=NO \ -DBUILD_opencv_world=OFF .. make -j8 make install ``` ## step3 cp opencv to project ```shell 最外层目录 git clone https://gitee.com/apchy_ll/libfacecut.git cp opencv4.5.1/build/install/* libfacecut/comm/platform/x86/opencv/ ``` ## 2.Build libfacedetect ```shell mkdir build cd build cmake .. make make install ``` ## 3.run demo ```shell cd bin/x86 ./detect_image test.jpg ``` ## 4.Use API ```shell include "facedetect.h" target_link_libraries(app facedetect) 接口说明 /* RETURN VALUE: -1:Decode img error other:face count if return 1,face img fill into imgData,and imglen */ int FaceDetect(unsigned char* imgData, long& imglen); ``` # 三、其他 ```shell 如有问题可以咨询:1658988725@qq.com LL @2021 ``` # 四、Web 接口使用协议 URL: http://127.0.0.1:12345/facecut_base ```json { "image": "base64,不带 'data:image/jpeg;base64,' " } ``` ![1.png](image/1.png) URL: http://127.0.0.1:12345/facecut_binary ![2.png](image/2.png)