Monday, March 17, 2014

Computer Vision (CV) and PLC for Object Detection with C#

This application use computer vision to object detection with shape detection. This application also use computer vision software from Emgu CV. Emgu CV is C# wrapper for OpenCV image processing library.

Emgu CV and C # provide a signal to the PLC, if circle shape then PLC Output is ON, and if box/rectangle shape then PLC Output is OFF.

See the video below:
Computer Vision and PLC to detect the top and the bottom of the bottle packaging.

Computer Vision Work and ON/OFF of PLC Output:
PLC Output is ON:
Computer Vision Work : PLC Output is ON

PLC Output is OFF:
Computer Vision Work : PLC Output is OFF

This Application use Hardware and Software:
Hardware of PLC and Computer Vision

A. Computer Vision Hardware :
1. Computer
2. WebCam
B. PLC Hardware :
1. I use Step 7 Siemens PLC : S7-200
2. PLC Cable (RS-232 detection in computer, no USB detection)
C. Object:
1. bottle packaging with circle and box shape
bottle packaging with circle and box shape

1. Computer Vision Software
- Download Link:
2. Visual Studio 2010 C# Express

Project File and Microsoft Visual C#:
Project File :
1. Download Project File, click here
2. Extract and copy-paste into C:\Emgu\ ... \Emgu.CV.Example
project file to emgu cv

3. Open Project with Microsoft Visual C#
open project with c#

Microsoft Visual C# :
1. Serial Port Number Setting
Serial Port Number Setting

2. Camera Number Setting
Camera Number Setting

3. Click Run in Microsoft Visual C#
4. Click Start Capture, Set Object Color. See Video:

Thank you for reading my article, this article as a basis of computer vision.


Newer Post Older Post Home

You may also like these ebook:

Get Free PLC eBook directly sent to your email,
and email subscription to

We hate SPAM. Your information is never sold or shared with anyone.

Your Email Will Be 100% Secured !