提交 0d4722f2 authored 作者: blu's avatar blu

evmlmotion: resize image

上级 eb53a9f1
......@@ -50,6 +50,7 @@ struct DetectParam {
float entropy;
int maxDuration; // max event video length in minutes
float resize; //
float size;
cv::Point2f region[2];
};
......@@ -69,7 +70,7 @@ private:
int iid;
AVFormatContext *pAVFormatInput = nullptr;
AVCodecContext *pCodecCtx = nullptr;
DetectParam detPara = {25, 500, -1, 3, 3, 30, 0.3, 25, 0,{{0,0},{0,0}}};
DetectParam detPara = {25, 500, -1, 3, 3, 30, 0.3, 25, 0, 540, {{0,0},{0,0}}};
EventState evtState = EventState::NONE;
// chrono::system_clock::time_point packetTm, evtStartTmLast, evtStartTmOrig;
long long packetTm = 0, evtStartTmLast = 0, evtStartTmOrig = 0, evtStartTmPre = 0;
......@@ -328,6 +329,13 @@ private:
}
}
if(evmlmotion.count("size") == 0|| !evmlmotion["size"].is_number_integer() ||evmlmotion["size"] < 100 || evmlmotion["size"] > 540) {
spdlog::info("{} invalid size value. should be in [100, 540] as int value, default to {}", selfId, detPara.size);
}
else {
detPara.size = evmlmotion["size"];
}
if(evmlmotion.count("region") != 0) {
json &region = evmlmotion["region"];
if(region.count("minX") == 0|| !region["minX"].is_number() ||
......@@ -609,7 +617,7 @@ private:
// auto config
if(detPara.resize == 0) {
detPara.resize = 540*1.0/h;
detPara.resize = detPara.size*1.0/h;
}
if(detPara.resize > 0 && detPara.resize < 1){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论