| | |
| | | leftJudgment(ruleMap[KeepRightSdk]), |
| | | rightJudgment(ruleMap[KeepRightSdk]), |
| | | bRecordVideoEnable(RecordVideoEnable), |
| | | m_sdkRuleMap(ruleMap) { |
| | | m_sdkRuleMap(ruleMap), |
| | | m_bSetWH(false) |
| | | { |
| | | DBG("camId" << camId); |
| | | init(); |
| | | initPerimeter(); |
| | |
| | | // int max=appPref.getIntData("n_cut_max_duration"); |
| | | // recordInit(40,100); |
| | | videoCaptureElement.registerConnector([&] { |
| | | // mutex.lock(); |
| | | |
| | | |
| | | // std::string tmp="camId="+m_camId+"videoCaptureElement"; |
| | | // ClockTimer cl(tmp); |
| | | cv::Mat imageTemp = videoCaptureElement.getImage(); |
| | | |
| | | if(!m_bSetWH) |
| | | { |
| | | appPref.setIntData(m_camId+"width",imageTemp.cols); |
| | | appPref.setIntData(m_camId+"height",imageTemp.rows); |
| | | m_bSetWH=true; |
| | | } |
| | | |
| | | std::string strNewTime = AppUtil::getTimeUSecString();; |
| | | |
| | | //DBG("m_camId="<<m_camId<<" strNewTime="<<strNewTime); |
| | |
| | | strNewTime = newDt.toString("yyyy-MM-dd hh:mm:ss").toStdString(); |
| | | |
| | | } |
| | | // mutex.unlock(); |
| | | |
| | | // DBG(strNewTime); |
| | | // std::string tmp1="camId="+m_camId+"strNewTime"+strNewTime; |
| | | // ClockTimer cl1(tmp1); |
| | |
| | | yoloRpcElement.submit(); |
| | | } |
| | | |
| | | if (!imageDrawElement.isBusy()) { |
| | | imageDrawElement.setImage(imageTemp); |
| | | imageDrawElement.submit(); |
| | | } |
| | | // if (!imageDrawElement.isBusy()) { |
| | | // imageDrawElement.setImage(imageTemp); |
| | | // imageDrawElement.submit(); |
| | | // } |
| | | |
| | | // if (bRecordVideoEnable) { |
| | | // registerElement(triggerElement); |
| | |
| | | |
| | | |
| | | yoloRpcElement.registerConnector([&] { |
| | | imageDrawElement.setYoloObjects(personElement.getLastScoreRects()); |
| | | // imageDrawElement.setYoloObjects(personElement.getLastScoreRects()); |
| | | if (!personElement.isBusy()) { |
| | | |
| | | personElement.setObjsResults(yoloRpcElement.getLastScoreRects()); |
| | |
| | | }); |
| | | |
| | | faceRpcElement.registerConnector([&] { |
| | | imageDrawElement.setFaces(faceRpcElement.getLastScoreRects()); |
| | | // imageDrawElement.setFaces(faceRpcElement.getLastScoreRects()); |
| | | }); |
| | | |
| | | yoloRpcElement.registerConnector("YoloTrigger", [&] { |
| | |
| | | |
| | | imageDrawElement.registerConnector([&] { |
| | | if (appPref.getIntData("show.image") == 1) { |
| | | ImageShowElement::showImage(to_string(this->m_index), *imageDrawElement.getImage()); |
| | | ImageShowElement::showImage(to_string(this->m_index), *imageDrawElement.getImage()); |
| | | } |
| | | }); |
| | | |
| | |
| | | registerElement(faceRpcElement); |
| | | registerElement(faceExtractElement); |
| | | } |
| | | registerElement(imageDrawElement); |
| | | // registerElement(imageDrawElement); |
| | | // registerElement(newRecordVideoElement); |
| | | videoCaptureElement.setOutPutInterval(3); |
| | | faceExtractElement.setProperty("index", to_string(m_index)); |