How to accomplish motion detection in C#

On the following webpage you will find more information on how to implement motion detection with your C# camera application using the Ozeki Camera SDK. With the help of this article you will be able to successfully set a threshold and detect motion events in the captured video stream. In order to succeed, OZEKI Camera SDK has to be installed and a reference to OzekiSDK.dll has to be added to your Visual Studio project.

motion detection
Figure 1 - Detected motion on the captured image

Important: you should study this article in order to find out how to setup your Windows Forms Application correctly.

Getting started

To get started it is recomended to Download and Install the latest version of Ozeki Camera SDK. After installation you can find the example code discussed in this page with full source code in the following location on your harddisk:

Download Ozeki Camera SDK:
Windows forms version: C:\Program Files\Ozeki\Ozeki SDK\\Examples\Other\Camera_Viewer_Connect_USB_WF\
WPF version: C:\Program Files\Ozeki\Ozeki SDK\\Examples\Other\Camera_Viewer_Connect_USB_WPF\

To compile this example you will need Microsoft Visual Studio installed on your computer.

Corporate use of motion detection

Motion detection became extremely popular in the filed of security systems. People like to use it for monitoring their home, their stores or public areas where it is needed to obtain security.

An example for the effective use of motion detection: you can benefit from this function if you wish to keep a track on the security of your home. In the case of night records it is possible that the quality of the recording will not be satisfactory. If you use the motion detection function of the Ozeki Camera SDK you will be able to detect motion events in the captured video stream even at night, which increases efficiently the security of your home or your business.


This lecture provides you detailed information on the useful motion detection function of the Ozeki Camera SDK. On this page you can find examples and implementation for setting a threshold and detect motion events in the captured video stream using your C# camera application.

Related pages


Below you can find the answers for the most frequently asked questions related to this topic:

  1. I have not managed to build the solution. How to solve it?

    • Please set the Target framework property of the project to .NET 4.0.
    • You should add the OzekiSDK.dll to the references of the solution.
    • Please import the missing classes.
  2. What are the hardware requirements?

    • 1 GHz or faster processor
    • 1GB RAM (32-bit) || 2GB RAM (64-bit)
  3. Which OS are supported? Does it work with Windows 10?

    Yes, the SDK works with Windows 10. The following Operating Systems are supported:.

    • Microsoft Windows XP
    • Microsoft Windows Vista
    • Microsoft Windows 7
    • Microsoft Windows 8
    • Microsoft Windows 10
    • Microsoft Windows Server 2003
    • Microsoft Windows Server 2008

More information