Commit 6b03fe92 张士柳

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