Commit 1352ebcf 张士柳

1 个父辈 81920d8b
......@@ -653,15 +653,17 @@ namespace eyemLib_Sharp
#region 结构转内存指针
public static IntPtr teStructArray2IntPtr(EyemOcsDXY[] cvPoint2D32f, int iLength)
public static IntPtr teStructArray2IntPtr(EyemOcsDXY[] tpPoints, int iLength)
{
if (tpPoints == null)
throw new ArgumentNullException("cvPoint2D32f");
//分配结构体需要的内存
IntPtr ptrTemp = (IntPtr)Marshal.AllocHGlobal(Marshal.SizeOf(typeof(EyemOcsDXY)) * iLength);
for (int j = 0, addr = (int)ptrTemp; j < iLength; j++, addr += Marshal.SizeOf(typeof(EyemOcsDXY)))
IntPtr memory = (IntPtr)Marshal.AllocHGlobal(checked(Marshal.SizeOf(typeof(EyemOcsDXY)) * iLength));
for (int index = 0; index < iLength; index++)
{
Marshal.StructureToPtr(cvPoint2D32f[j], (IntPtr)addr, false);
Marshal.StructureToPtr(tpPoints[index], (IntPtr)(checked((long)memory + index * Marshal.SizeOf(typeof(EyemOcsDXY)))), false);
}
return ptrTemp;
return memory;
}
#endregion
......
......@@ -605,11 +605,6 @@ int eyemDetectAndDecode(EyemImage tpImage, EyemRect tpRoi, const char *ccFileNam
//cv::Mat background(Y, X, CV_8UC1, max);
//src.copyTo(background, binary4);
cv::Mat edge;
cv::Canny(mphyEx, edge, 100, 200);
src = edge;
//计算角点响应
cv::Mat harMap;
cv::cornerHarris(src, harMap, cvRound(iBlockSize*dScaleUpAndDown), 3, 0.04);//对二维码效果比较好
......@@ -647,6 +642,9 @@ int eyemDetectAndDecode(EyemImage tpImage, EyemRect tpRoi, const char *ccFileNam
//测试用
return FUNC_OK;
//确定识别类型
std::vector<std::string> hints_;
......@@ -663,6 +661,9 @@ int eyemDetectAndDecode(EyemImage tpImage, EyemRect tpRoi, const char *ccFileNam
std::find(hints_.begin(), hints_.end(), "ITF") != hints_.end() ||
std::find(hints_.begin(), hints_.end(), "RSS_14") != hints_.end() ||
std::find(hints_.begin(), hints_.end(), "RSS_EXPANDED") != hints_.end();
//是否添加二维码检测
bool addTwoDReader = std::find(hints_.begin(), hints_.end(), "QR_CODE") != hints_.end() ||
std::find(hints_.begin(), hints_.end(), "DATA_MATRIX") != hints_.end() ||
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!