Commit 6b03fe92 张士柳

1 个父辈 84029fbf
......@@ -912,9 +912,9 @@ namespace eyemLib_Sharp
EyemRect tpRoi = new EyemRect();
tpRoi.iXs = 200; tpRoi.iYs = 200;
tpRoi.iWidth = image.iWidth - 400;
tpRoi.iHeight = image.iHeight - 400;
tpRoi.iXs = 20; tpRoi.iYs = 20;
tpRoi.iWidth = image.iWidth - 40;
tpRoi.iHeight = image.iHeight - 40;
//
string pNumObj = "";
......@@ -932,12 +932,12 @@ namespace eyemLib_Sharp
//创建模板匹配模型
EyemRect tpRoi2 = new EyemRect();
tpRoi2.iXs = 1026; tpRoi2.iYs = 513;
tpRoi2.iWidth = 41;
tpRoi2.iHeight = 14;
tpRoi2.iXs = 0; tpRoi2.iYs = 0;
tpRoi2.iWidth = image.iWidth;
tpRoi2.iHeight = image.iHeight;
double matchDeg = 0.75;
//flag = eyemCreateTemplateModel(tpDstImg, tpRoi2, matchDeg, "D:\\模板文件\\" + file.Replace(".png", ".tpl"));
//flag = eyemCreateTemplateModel(image, tpRoi2, matchDeg, "D:\\模板文件\\" + file.Replace(".png", ".tpl"));
//string selectModel = "";
//flag = eyemMatchTemplateModel(tpDstImg, "D:\\模板文件", ref selectModel);
......@@ -952,7 +952,7 @@ namespace eyemLib_Sharp
//eyemCountObjectIrregularPartsE(image, tpRoi, file.Replace(".png", ""), selectModel, ref pNumObj, out tpDstImg);
eyemCountObjectIrregularPartsE(image, tpRoi, file.Replace(".png", ""), "D:\\模板文件\\" + file.Replace(".png", ".tpl"), ref pNumObj, out tpDstImg);
Bitmap bitmap = eyemCvtToBitmap(tpDstImg);
//Bitmap bitmap = eyemCvtToBitmap(tpDstImg);
//if (bitmap != null)
//{
......
此文件类型无法预览
......@@ -4470,15 +4470,17 @@ int eyemCountObjectIrregularPartsE(EyemImage tpImage, EyemRect tpRoi, const char
//偏移角度(元件尺寸)
const double dOffset = (2 * asin(2 * trackLength / (2 * startRadius))) * 180. / PI;
//优化开关
#define OPTIMAL_ON true
#if OPTIMAL_ON
//考虑作并行处理
tbb::parallel_invoke(
[&]
#endif
{
std::cout << tbb::this_tbb_thread::get_id() << std::endl;
#pragma region //(顺时针)
{
///< 顺时针追踪
//追踪中心
cv::Point2f trackCenter = cv::Point2f(startCenter.x, startCenter.y);
//追踪角度、半径
......@@ -4636,17 +4638,14 @@ int eyemCountObjectIrregularPartsE(EyemImage tpImage, EyemRect tpRoi, const char
trackEnd = (!found);
} while (!trackEnd);
}
#pragma endregion
},
}
#if OPTIMAL_ON
,
[&]
#endif
{
std::cout << tbb::this_tbb_thread::get_id() << std::endl;
#pragma region //(逆时针)
{
///< 逆时针追踪
//追踪起点
cv::Point2f trackCenter(startCenter.x, startCenter.y);
//起始扫描角度、半径
......@@ -4800,9 +4799,9 @@ int eyemCountObjectIrregularPartsE(EyemImage tpImage, EyemRect tpRoi, const char
trackEnd = (!found);
} while (!trackEnd);
}
#pragma endregion
});
#if OPTIMAL_ON
);
#endif
}
//计数
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!