關於我自己

我的相片
累計超過15年的工作經驗,包括10年的設備製造業經驗,超過6年的光電零組件製造業經驗;10年的海外工作經驗,其中至今有5年以上的派駐經驗。 1.專注AOI檢測於10年以上(從光機設計、圖像分析、設備挑選、處理速度) 2.機器學習推論-onnx整合傳統演算法從瑕疵抓取、分析、分類 3.遷移式機器學習模式(工業應用、醫療應用) 4.整合:Python推論引擎、C++運算能力、C#友善介面 彈性使用 5.擅長利用專家模型推進專案,並熟悉使用OpenVINO、TensorRT、ONNXRUNTIME框架進行有效的實作與測試。

2011年10月7日 星期五

[轉貼]邊緣檢測-Laplace 算子

http://blog.csdn.net/wqvbjhc/article/details/6065504

 Laplace 算子可以卷積模板表示:



010
1-41
010



  1. // Laplace 算子  
  2. // 1. pImageData   圖像數據  
  3. // 2. nWidth       圖像寬度  
  4. // 3. nHeight      圖像高度  
  5. // 4. nWidthStep   圖像行大小  
  6. bool Laplace(unsigned char *pImageData, int nWidth, int nHeight, int nWidthStep)  
  7. {  
  8.     int i = 0;  
  9.     int j = 0;  
  10.     int nValue = 0;  
  11.     unsigned char *pLine[3] = { NULL, NULL, NULL };  
  12.     for (j = 1; j < nHeight - 1; j++)  
  13.     {  
  14.         pLine[0]  = pImageData + nWidthStep * (j - 1);  
  15.         pLine[1]  = pImageData + nWidthStep * j;  
  16.         pLine[2]  = pImageData + nWidthStep * (j + 1);  
  17.         for (i = 1; i < nWidth - 1; i++)  
  18.         {  
  19.             nValue =  
  20.                 pLine[0][i] + pLine[1][i-1] + pLine[1][i+1] + pLine[2][i] -  
  21.                 pLine[1][i] * 4;  
  22.             if (nValue < 0) pLine[0][i-1] = 0;  
  23.             else pLine[0][i-1] = (unsigned char) nValue;  
  24.         }  
  25.     }  
  26.     return true;  
  27. }  

沒有留言: