| | |
| | | RectWrapper rw;
|
| | | rw.rect = iter->rect;
|
| | | rw.user_score_1 = ((90.0f - std::abs(iter->yaw)) + (90.0f - std::abs(iter->pitch)) + (90.0f - std::abs(iter->roll))) / 90.0f / 3 * iter->score;
|
| | | rw.userData = (void*)(iter->id);
|
| | | rects.push_back(rw);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | bool cw_pm_breaker_ptr_paint(const PipeMaterial* pm, void* args)
|
| | | {
|
| | | PLPLContext& plplContext(*(PLPLContext*)args);
|
| | | CameraWrapper& cameraWrapper = *(CameraWrapper*)args;
|
| | | PLPLContext& plplContext(cameraWrapper.plplContext);
|
| | | const st_ff_vect_t& faceFeatures(*(const st_ff_vect_t*)(pm->buffer));
|
| | |
|
| | | plplContext.cmds.clear();
|
| | |
| | | plplContext.params.push_back(iter->rect.rightBottom.X);
|
| | | plplContext.params.push_back(iter->rect.rightBottom.Y);
|
| | |
|
| | | plplContext.cmds.push_back(PLPLC_TEXT);
|
| | | plplContext.params.push_back(iter->rect.leftTop.X);
|
| | | plplContext.params.push_back(iter->rect.leftTop.Y);
|
| | | plplContext.params.push_back(PLPLType("abc"));
|
| | | std::map<int, std::string>::iterator iterFaceLabel = cameraWrapper.faceLabels.find(iter->id);
|
| | | if (iterFaceLabel != cameraWrapper.faceLabels.end())
|
| | | {
|
| | | plplContext.cmds.push_back(PLPLC_TEXT);
|
| | | plplContext.params.push_back(iter->rect.leftTop.X);
|
| | | plplContext.params.push_back(iter->rect.leftTop.Y);
|
| | | const char* label = iterFaceLabel->second.c_str();
|
| | | plplContext.params.push_back(PLPLType(label));
|
| | | }
|
| | | }
|
| | |
|
| | | return false;
|
| | |
| | |
|
| | | void test_paint(CameraWrapper& cameraWrapper)
|
| | | {
|
| | | cameraWrapper.setFaceLabel(0, "vip");
|
| | | cameraWrapper.setFaceLabel(1, "abc");
|
| | | cameraWrapper.setFaceLabel(2, "wrn");
|
| | |
|
| | | cameraWrapper.plplContext.cmds.push_back(PLPLC_COLOR);
|
| | | cameraWrapper.plplContext.params.push_back('F');
|
| | | cameraWrapper.plplContext.params.push_back(255);
|
| | |
| | | pmAnalizer.breake(PipeMaterial::PMT_PTR, MB_Frame::MBFT__FIRST, cw_pm_breaker_ptr_face, &(cameraWrapper));
|
| | | }
|
| | |
|
| | | pm.breake(PipeMaterial::PMT_PTR, MB_Frame::MBFT__FIRST, cw_pm_breaker_ptr_paint, &(cameraWrapper.plplContext));
|
| | | pm.breake(PipeMaterial::PMT_PTR, MB_Frame::MBFT__FIRST, cw_pm_breaker_ptr_paint, &(cameraWrapper));
|
| | |
|
| | | //#debug
|
| | | //test_paint(cameraWrapper);
|
| | |
| | | {
|
| | | faceCacheLocked = false;
|
| | | }
|
| | |
|
| | | void CameraWrapper::setFaceLabel(int st_track_id, const std::string& label)
|
| | | {
|
| | | if (faceLabels.size() > 32)
|
| | | faceLabels.clear();
|
| | |
|
| | | faceLabels.insert(std::make_pair(st_track_id, label));
|
| | | }
|