| | |
| | | } |
| | | |
| | | for (auto &item : faceResults) { |
| | | //#todo 去重 |
| | | |
| | | feature_base64 = base64.Encode(item.feature.data(), item.feature.size()); |
| | | int x = item.left; |
| | | int y = item.top; |
| | | int w = item.width; |
| | | int h = item.height; |
| | | cv::Rect t_rect = {x, y, w, h}; |
| | | auto t_image = image(CvUtil::zoomRect(t_rect, 1.5, 1.5) & cv::Rect(0, 0, image.cols, image.rows)).clone(); |
| | | auto t_image = image(CvUtil::zoomRect(t_rect, 2, 2) & cv::Rect(0, 0, image.cols, image.rows)).clone(); |
| | | std::vector<uchar> buffer; |
| | | cvutil.cvMat2Buffer(t_image, buffer); |
| | | img_url = "http://"; |
| | |
| | | |
| | | if (UploadFlag == "1") { |
| | | // #todo db queue upload to server |
| | | std::thread sendPerson(uploadPersonToServer, this, strUUID, img_url, idcard, feature_base64); |
| | | |
| | | std::string str_serIp = GET_STR_CONFIG("mainServerIp"); |
| | | std::string str_serPort = GET_STR_CONFIG("mainServerPort"); |
| | | |
| | | // string sendUrl = "192.168.1.203:3697/addPerson/uploadToTemporary"; |
| | | string sendUrl = str_serIp; |
| | | sendUrl.append(":").append(str_serPort).append("/addPerson/uploadToTemporary"); |
| | | |
| | | std::thread sendPerson(uploadPersonToServer, this, sendUrl, strUUID, img_url, idcard, feature_base64); |
| | | sendPerson.detach(); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | void devHttpServer_c::uploadPersonToServer(devHttpServer_c *t_ptrThis, std::string parm_uuid, std::string parm_img_url, |
| | | std::string parm_idcard, |
| | | std::string parm_fea) { |
| | | void devHttpServer_c::uploadPersonToServer(devHttpServer_c *t_ptrThis, std::string sendUrl, std::string parm_uuid, |
| | | std::string parm_img_url, std::string parm_idcard, std::string parm_fea) { |
| | | HttpRequestWithCrul m_requestWithCrul; |
| | | Json::Value perInfos; |
| | | Json::Value perInfo; |
| | |
| | | perInfo["cardId"] = parm_idcard;//图片描述 |
| | | perInfos.append(perInfo); |
| | | |
| | | std::string str_serIp = GET_STR_CONFIG("mainServerIp"); |
| | | std::string str_serPort = GET_STR_CONFIG("mainServerPort"); |
| | | |
| | | // string sendUrl = "192.168.1.203:3697/addPerson/uploadToTemporary"; |
| | | string sendUrl = str_serIp; |
| | | sendUrl.append(":").append(str_serPort).append("/addPerson/uploadToTemporary"); |
| | | string postParams = perInfos.toStyledString(); |
| | | string str_addRes; |
| | | |