| | |
| | | stface_ctx_map_t& dbContext(*(stface_ctx_map_t*)_dbContext); |
| | | STFaceCacheContext& cacheContext(*(STFaceCacheContext*)_cacheContext); |
| | | |
| | | /* |
| | | |
| | | for(stface_ctx_map_t::iterator iterCtx = dbContext.begin(); iterCtx != dbContext.end(); ++iterCtx) |
| | | { |
| | | STFaceDBContext& ctx(iterCtx->second); |
| | |
| | | |
| | | for(top_idx_score_vect_t::iterator it = result.begin(); it != result.end(); ++it) |
| | | { |
| | | if(topResult.empty()) |
| | | topResult.push_back(FDP_FaceDetectResult(ctx.dbid, it->idx, it->score * 1000)); |
| | | |
| | | int16_t new_confidence = it->score * 1000; |
| | | |
| | | if(topResult.empty()) |
| | | topResult.push_back(FDP_FaceDetectResult(ctx.dbid, it->idx, new_confidence)); |
| | | |
| | | |
| | | else if(new_confidence > topResult.rbegin()->confidence) |
| | | { |
| | | while(topResult.size() > 4) |
| | |
| | | for(fdr_vec_t::reverse_iterator rtTR = topResult.rbegin() + 1; rtTR != topResult.rend(); ++rtTR) |
| | | { |
| | | if(new_confidence < rtTR->confidence) |
| | | topResult.insert(rtTR, FDP_FaceDetectResult(ctx.dbid, it->idx, new_confidence)); |
| | | { |
| | | fdr_vec_t::iterator itTR(rtTR.base()); |
| | | topResult.insert(itTR, FDP_FaceDetectResult(ctx.dbid, it->idx, new_confidence)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //LOGP(INFO, "stface_search_db return dbid=%d, idx=%d, score=%f", img.db_id, result[0].idx, result[0].score); |
| | | } |
| | | */ |
| | | |
| | | /* |
| | | topResult.push_back(FDP_FaceDetectResult(1, 2, 3)); |
| | | topResult.push_back(FDP_FaceDetectResult(-1, 2, 4)); |
| | | topResult.push_back(FDP_FaceDetectResult(1, 6, 5)); |
| | | */ |
| | | } |