PIXNET Logo登入

天天向上

跳到主文

程式外包服務  E-mail: me1237guy@yahoo.com.tw 歡迎來信洽談, 請附上相關文件或問題說明, 謝謝

專長:  ※自動光學檢測 ※人臉辨識 ※車牌辨識 ※錄影監控系統 ※自動控制I/O相關 
      ※演算法開發 ※基因演算法 ※類神經網路 
      ※MATLAB  ※VISUAL C++/C# ※Xamarin ※OpenCV ※Emgu ※Unity ※QT4/5
-----------------------------------------------------------------------------------------------
   SA (模擬退火法)     GA (基因演算法)    ACO (蟻群演算法)    PSO (粒子最佳化演算法)   
   排列組合問題最佳化   TSP  Scheduling  K-means, Fuzzy C-means, KNN, DBSCAN分群  
   Fuzzy Control (模糊控制)  Neural Networks (類神經網路) Object Tracking (Kalman Filter, Optical Flow)  
   Object Recognition (Pattern Match, Haar-Like Features, EigenFace)  Human Pose Recognition
   人臉偵測     移動物偵測   車牌辨識    智慧型監控攝影  XBOX Kinect影像處理及應用 體感互動應用  
   自動光學檢測(AOI) 玻璃檢測  NVIDIA CUDA平行運算處理
   TI-DSP 6xxx系列 雙影像輸入   / Raspberry PI 樹莓派 / Arduino控制  自走車避障礙物(GPS/機器視覺)

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 8月 13 週四 201502:28
  • C# 如何創建, 暫停, 繼續, 終止一個執行緒(Thread)

image
今天來複習一下執行緒, 先前有一些觀念錯誤: 關於暫停/關閉執行緒Suspend, Terminate不該踩到地雷, 我一個都沒錯過@@ 1. 本範例示範如何開一個worker執行緒, 呼叫Start開始不斷執行Job內容, 且不影響原本的主執行緒2. 要暫停一個執行緒不建議使用Thread.Suspend,  這會讓你不曉得在你呼叫Suspend    當下該執行緒在幹甚麼;更準確地說, 你會不曉得worker在Job中已經    完成多少(停在Job中的哪個階段)3. 不要使用Terminate, 建議使用Join3. 透過ManualResetEvent搭配WaitOne 方法, 可以讓你更精準控制: 暫停, 繼續, 以及停止執行緒
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(2) 人氣(25,025)

  • 個人分類:C#
▲top
  • 8月 12 週三 201510:17
  • 安裝ActiViz.NET-5.8.0.607-win64-OpenSource

image
安裝64位元版本的VTK for .NET
C:\Program Files\ActiViz.NET 5.8.0 OpenSource Edition
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(296)

  • 個人分類:C#
▲top
  • 8月 11 週二 201511:20
  • VTK/Examples/Cxx/Plotting/LinePlot

image
include目錄設定C:\VTK 5.6\VTK\Views;C:\VTK 5.6\VTK\Charts;C:\VTK 5.6\VTK\Widgets;C:\VTK 5.6\VTK\Rendering;C:\VTK 5.6\VTK\IO;C:\VTK 5.6\VTK\Imaging;C:\VTK 5.6\VTK\Graphics;C:\VTK 5.6\VTK\Geovis;C:\VTK 5.6\VTK\GenericFiltering;C:\VTK 5.6\VTK\Filtering;C:\VTK 5.6\VTK\Common;C:\VTK 5.6\release加入下列函式庫vtkCharts.lib
vtkViews.lib
vtkWidgets.lib
vtkHybrid.lib
vtkRendering.lib
vtkGraphics.lib
vtkImaging.lib
vtkIO.lib
vtkFiltering.lib
vtkCommon.lib
vtksys.lib
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(148)

  • 個人分類:C#
▲top
  • 8月 11 週二 201509:44
  • VTK/Examples/Cxx/IO/ReadSTL

image

將C:\VTK 5.6\vtkdata\Data\42400-IDGH.stl加入專案
 1: // ReadSTLEx.cpp : 定義主控台應用程式的進入點。
 2: //
 3:  
 4: #include "stdafx.h"
 5: #include <vtkPolyData.h>
 6: #include <vtkSTLReader.h>
 7: #include <vtkSmartPointer.h>
 8: #include <vtkPolyDataMapper.h>
 9: #include <vtkActor.h>
 10: #include <vtkRenderWindow.h>
 11: #include <vtkRenderer.h>
 12: #include <vtkRenderWindowInteractor.h>
 13: int _tmain(int argc, _TCHAR* argv[])
 14: {
 15: std::string inputFilename = "42400-IDGH.stl";
 16: 
 17: vtkSmartPointer<vtkSTLReader> reader = vtkSmartPointer<vtkSTLReader>::New();
 18: reader->SetFileName(inputFilename.c_str());
 19: reader->Update();
 20: 
 21: // Visualize
 22: vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
 23: mapper->SetInputConnection(reader->GetOutputPort());
 24: 
 25: vtkSmartPointer<vtkActor> actor =
 26: vtkSmartPointer<vtkActor>::New();
 27: actor->SetMapper(mapper);
 28: 
 29: vtkSmartPointer<vtkRenderer> renderer =
 30: vtkSmartPointer<vtkRenderer>::New();
 31: vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
 32: renderWindow->AddRenderer(renderer);
 33: vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
 34: renderWindowInteractor->SetRenderWindow(renderWindow);
 35: 
 36: renderer->AddActor(actor);
 37: renderer->SetBackground(.0, .0, .6); // Background color green
 38: 
 39: renderWindow->Render();
 40: renderWindowInteractor->Start();
 41: return 0;
 42: }
 43:  
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(135)

  • 個人分類:C#
▲top
  • 8月 11 週二 201504:08
  • VTK/Examples/Cxx/Rendering/Cylinder

image


 1: renWin->SetSize(300, 200);
C:\VTK 5.6\VTK\Widgets;C:\VTK 5.6\VTK\Rendering;C:\VTK 5.6\VTK\IO;C:\VTK 5.6\VTK\Imaging;C:\VTK 5.6\VTK\Graphics;C:\VTK 5.6\VTK\Geovis;C:\VTK 5.6\VTK\GenericFiltering;C:\VTK 5.6\VTK\Filtering;C:\VTK 5.6\VTK\Common;C:\VTK 5.6\release;C:\VTK 5.6\libvtkWidgets.lib
vtkHybrid.lib
vtkRendering.lib
vtkGraphics.lib
vtkImaging.lib
vtkIO.lib
vtkFiltering.lib
vtkCommon.lib
vtksys.lib
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(133)

  • 個人分類:C#
▲top
  • 8月 10 週一 201511:42
  • VTK 5.6安裝

image

(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(114)

  • 個人分類:C#
▲top
  • 8月 08 週六 201515:26
  • Emgu CV: 搜尋資料夾特定副檔名進行影像處理

image
在進行影像處理工作時, 經常需要批次處理, 處理的對象可能是某個目錄夾下的一序列影像 {0.bmp, 1.bmp, 2.bmp,….},可以存放在一個List<string>的容器內, 紀錄該目錄夾特定附檔名的檔案名稱
 1: public static List<string> searchFileNames(string sDirPath, string fileExtension)
 2: {
 3: List<string> list = new List<string>();
 4: if (!Directory.Exists(sDirPath)) return null;
 5: foreach (string filePath in System.IO.Directory.GetFiles(sDirPath, fileExtension))
 6: {
 7: list.Add(System.IO.Path.GetFileName(filePath));
 8: }
 9: return list;
 10: }
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(632)

  • 個人分類:Emgu CV
▲top
  • 8月 07 週五 201512:46
  • 執行緒如何更新windows form control?

image
之前有寫過一篇關於如何將執行緒運算結果顯示於人機介面上?, 今天剛好找到一個不錯的範例How to: Make Thread-Safe Calls to Windows Forms Controls, Let’s cut to the chase and get started!======================================================================Access to Windows Forms controls is not inherently thread safe. If you have two or more threads manipulating the state of a control, it is possible to force the control into an inconsistent state. Other thread-related bugs are possible as well, including race conditions and deadlocks. It is important to ensure that access to your controls is done in a thread-safe way.更新控制元件與threrad safe觀念: 如果有兩個執行緒, 一個UI(主執行緒), 另一個或更多個使用者開的執行緒要更新控制元件上(windows Form, TextBox, Label,…), 有可能造成不相容狀況
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(2,327)

  • 個人分類:C#
▲top
  • 8月 06 週四 201503:04
  • Emgu CV: BGR上下限篩選感興趣區域及BLOB運算

image
載入一張照片, 利用 InRange參數lower和higher顏色BGR上下限篩選感興趣區域, 得到一張遮罩m_img_inRange,再利用CvBlobDetector 進行Blob運算
 1: using Emgu.CV;
 2: using Emgu.CV.Cvb;
 3: using Emgu.CV.CvEnum;
 4: using Emgu.CV.Structure;
 5: using Emgu.CV.VideoSurveillance;
 6: using System.Diagnostics;
 7: using System.Threading;
 8:  
 9: private void CalInRange()
 10: {
 11: if (m_img_color == null) return;
 12: m_img_inRange = m_img_color.InRange(lower, higher);
 13: m_img_inRange_not = m_img_inRange.Not();
 14: using (CvBlobs blobs = new CvBlobs())
 15: {
 16: m_blobDetector.Detect(m_img_inRange, blobs);
 17: m_img_color_copy = m_img_color.Copy();
 18: foreach (var pair in blobs)
 19: {
 20: CvBlob b = pair.Value;
 21: CvInvoke.Rectangle(m_img_color_copy, b.BoundingBox, new MCvScalar(255.255, 255, 0), 5);
 22: //CvInvoke.PutText(frame, blob.ID.ToString(), Point.Round(blob.Center), FontFace.HersheyPlain, 1.0, new MCvScalar(255.0, 255.0, 255.0));
 23: }
 24:  
 25: imageBox1.Image = m_img_color_copy;
 26: imageBox2.Image = m_img_inRange;
 27: imageBox3.Image = m_img_inRange_not;
 28: }
 29: }
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(2) 人氣(4,446)

  • 個人分類:Emgu CV
▲top
  • 8月 05 週三 201518:56
  • Emgu CV: 計算線段內角(Interior Angle)與外角(Exterior Angle)

image
1. 利用Canny Method 直線偵測2. 利用Hough Transform(霍夫轉換)來找線段候選人3. 利用 GetExteriorAngleDegree 計算目前線段(line)與自訂義水平線(otherline)的夾角
 1: private void CalExteriorAngles()
 2: {
 3: LineSegment2D[] lines = CvInvoke.HoughLinesP(
 4: m_img_thresh_gauss.Canny(100, 64),
 5: 1, //Distance resolution in pixel-related units
 6: Math.PI / 360.0, //Angle resolution measured in radians.
 7: 90, //threshold
 8: 140, //min Line width
 9: 120); //gap between lines
 10:  
 11: 
 12: Color[] colorArray = new Color[13] { Color.Red, Color.Green, Color.Blue, Color.Honeydew, Color.AliceBlue, 
 13: Color.AliceBlue, Color.Pink, Color.Indigo, Color.IndianRed, Color.GreenYellow,
 14: Color.Lavender, Color.LemonChiffon, Color.LightBlue};
 15: Random r = new Random();
 16: int ind;
 17: //double ramp;
 18: double theta = -1;
 19: int cnt = 0;
 20: m_img_copy = m_img_color.Copy();
 21: imageBox11.Image = m_img_copy;
 22: listBox1.Items.Clear();
 23: LineSegment2D otherline = new LineSegment2D();
 24: otherline.P1 = new Point(0, 0);
 25: otherline.P2 = new Point(m_img_gray.Width, 0);
 26: foreach (LineSegment2D line in lines)
 27: {
 28: ind = r.Next() % 11 +1;
 29: theta = line.GetExteriorAngleDegree(otherline);
 30:  
 31:  
 32: //this.Text = theta.ToString();
 33: //if (theta > 0)
 34: {
 35: m_img_copy.Draw(line, new Bgr(colorArray[ind]), 12);
 36: imageBox11.Image = m_img_copy;
 37: cnt++;
 38: listBox1.Items.Add(string.Format("#{0} Angle = {1:###.##}",cnt, theta));
 39: //imageBox11.Image = m_img_copy;
 40: Application.DoEvents();
 41: Thread.Sleep(2000);
 42: //if (cnt > 0) break;
 43: }
 44:  
 45: 
 46:  
 47:  
 48: }
 49: imageBox11.Image = m_img_copy;
 50: 
 51: //MessageBox.Show("Done");
 52: }
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(2,238)

  • 個人分類:Emgu CV
▲top
«1...54555689»

個人資訊

me1237guy
暱稱:
me1237guy
分類:
數位生活
好友:
累積中
地區:

熱門文章

  • (8,482)分水嶺影像分割Marker-based Image Segmentation Algorithm Using OpenCV2.4.7 with Visual Studio 2010
  • (4,000)Pylon Live View C# Sample Code Review
  • (14,172)網路上提供測試 RTSP 的伺服器
  • (23,895)Adding Something to DataGridView
  • (2,908)C# 在憑證存放區中找不到資訊清單簽署憑證
  • (4,394)安裝PLC學習軟體 FX-TRN-BEG-T
  • (7,367)建立和使用 C# 的 DLL
  • (3,660)安裝Open eVision 1.2.5.8549
  • (12,907)EmguCV : 圈選感興趣區域
  • (25,025)C# 如何創建, 暫停, 繼續, 終止一個執行緒(Thread)

文章分類

  • wordpress (2)
  • 雲端計算 (1)
  • 邊緣運算 (5)
  • MPI (2)
  • Git & Github (6)
  • Unity (2)
  • Android Studio (10)
  • Deep Leraning (35)
  • LaTex (2)
  • Linux (6)
  • jetson nano (3)
  • Qt (20)
  • Docker (4)
  • Office (1)
  • OpenTK (1)
  • WPF (8)
  • SQL (4)
  • Revit (6)
  • MATLAB (13)
  • R Language (8)
  • Design Pattern & Implementation by Using C# (48)
  • RaspberryPI (5)
  • Python (77)
  • 其他語言 (40)
  • 攝影機 (45)
  • 工業應用 (50)
  • 家庭 (12)
  • Mobile (31)
  • 工作日誌 (2)
  • Linux (5)
  • C/C++ (15)
  • AOI (41)
  • Emgu CV (42)
  • C# (147)
  • Visual Studio (48)
  • OpenCV (118)
  • 未分類文章 (1)

最新文章

  • git開分支測試完成後整併回原本的分支
  • Gemini API Key 低成本 Nano Banana Pro作圖
  • DMK 37AUX226
  • wafer基礎術語
  • 將資料夾中多個mp4影片合併成一個mp4檔案
  • 如何用沙子制造芯片:从冶炼硅锭到晶圆打磨|芯片工艺合集
  • yolov9安裝
  • ActionEngine, ActionTask and ActionWorker
  • @dataclass裝飾子
  • IO控制卡安裝驅動器後無法在此裝置載入驅動程式

動態訂閱

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: