C#+WPF+Opencv模块化开发视觉对位系统
csharp
// 加载图像
Mat image = CvInvoke.Imread('image_path', ImreadModes.Color);
// 灰度化
Mat grayImage = new Mat();
CvInvoke.CvtColor(image, grayImage, ColorConversion.Bgr2Gray);
// 高斯模糊
Mat blurredImage = new Mat();
CvInvoke.GaussianBlur(grayImage, blurredImage, new Size(5, 5), 0);