Click here to Skip to main content
15,881,852 members
Articles / Multimedia / GDI+

Motion Detection Algorithms

Rate me:
Please Sign up or sign in to vote.
4.95/5 (683 votes)
27 Mar 2007GPL39 min read 9.1M   128K   1.4K  
Some approaches to detect motion in a video stream.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ProjectType>Local</ProjectType>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{F4799C73-DEE9-48F2-B626-32149CC30976}</ProjectGuid>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ApplicationIcon>App.ico</ApplicationIcon>
    <AssemblyKeyContainerName>
    </AssemblyKeyContainerName>
    <AssemblyName>motion</AssemblyName>
    <AssemblyOriginatorKeyFile>
    </AssemblyOriginatorKeyFile>
    <DefaultClientScript>JScript</DefaultClientScript>
    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
    <DefaultTargetSchema>IE50</DefaultTargetSchema>
    <DelaySign>false</DelaySign>
    <OutputType>WinExe</OutputType>
    <RootNamespace>motion</RootNamespace>
    <StartupObject>
    </StartupObject>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <OutputPath>bin\Debug\</OutputPath>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <BaseAddress>285212672</BaseAddress>
    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
    <ConfigurationOverrideFile>
    </ConfigurationOverrideFile>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DocumentationFile>
    </DocumentationFile>
    <DebugSymbols>true</DebugSymbols>
    <FileAlignment>4096</FileAlignment>
    <Optimize>false</Optimize>
    <RegisterForComInterop>false</RegisterForComInterop>
    <RemoveIntegerChecks>false</RemoveIntegerChecks>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <WarningLevel>4</WarningLevel>
    <DebugType>full</DebugType>
    <ErrorReport>prompt</ErrorReport>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <OutputPath>bin\Release\</OutputPath>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <BaseAddress>285212672</BaseAddress>
    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
    <ConfigurationOverrideFile>
    </ConfigurationOverrideFile>
    <DefineConstants>TRACE</DefineConstants>
    <DocumentationFile>
    </DocumentationFile>
    <DebugSymbols>false</DebugSymbols>
    <FileAlignment>4096</FileAlignment>
    <Optimize>true</Optimize>
    <RegisterForComInterop>false</RegisterForComInterop>
    <RemoveIntegerChecks>false</RemoveIntegerChecks>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <WarningLevel>4</WarningLevel>
    <DebugType>none</DebugType>
    <ErrorReport>prompt</ErrorReport>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="AForge.Imaging">
      <Name>AForge.Imaging</Name>
      <HintPath>..\references\AForge.Imaging.dll</HintPath>
    </Reference>
    <Reference Include="AForge.Math">
      <Name>AForge.Math</Name>
      <HintPath>..\references\AForge.Math.dll</HintPath>
    </Reference>
    <Reference Include="System">
      <Name>System</Name>
    </Reference>
    <Reference Include="System.Data">
      <Name>System.Data</Name>
    </Reference>
    <Reference Include="System.Drawing">
      <Name>System.Drawing</Name>
    </Reference>
    <Reference Include="System.Windows.Forms">
      <Name>System.Windows.Forms</Name>
    </Reference>
    <Reference Include="System.Xml">
      <Name>System.XML</Name>
    </Reference>
    <ProjectReference Include="..\dshow\dshow.csproj">
      <Name>dshow</Name>
      <Project>{37B08AFD-F4BC-4E13-9119-537BA6A12CCB}</Project>
      <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
    </ProjectReference>
    <ProjectReference Include="..\vfw\vfw.csproj">
      <Name>vfw</Name>
      <Project>{ECAA3D55-19AB-440B-B82E-221AE06C4A5B}</Project>
      <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="AboutForm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="AssemblyInfo.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="Camera.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="CameraWindow.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="CaptureDeviceForm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="IMotionDetector.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="MainForm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="MotionDetector1.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="MotionDetector2.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="MotionDetector3.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="MotionDetector3Optimized.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="MotionDetector4.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="URLForm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="VideoSource\ByteArrayUtils.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="VideoSource\CameraEvents.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="VideoSource\CaptureDevice.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="VideoSource\IVideoSource.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="VideoSource\JPEGStream.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="VideoSource\MJPEGStream.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="VideoSource\VideoFileSource.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="VideoSource\VideoStream.cs">
      <SubType>Code</SubType>
    </Compile>
    <EmbeddedResource Include="AboutForm.resx">
      <DependentUpon>AboutForm.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="CameraWindow.resx">
      <DependentUpon>CameraWindow.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="CaptureDeviceForm.resx">
      <DependentUpon>CaptureDeviceForm.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="MainForm.resx">
      <DependentUpon>MainForm.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\1.gif" />
    <EmbeddedResource Include="Resources\2.gif" />
    <EmbeddedResource Include="Resources\3.gif" />
    <EmbeddedResource Include="Resources\4.gif" />
    <EmbeddedResource Include="Resources\5.gif" />
    <EmbeddedResource Include="Resources\6.gif" />
    <EmbeddedResource Include="Resources\7.gif" />
    <EmbeddedResource Include="Resources\8.gif" />
    <EmbeddedResource Include="Resources\9.gif" />
    <EmbeddedResource Include="URLForm.resx">
      <DependentUpon>URLForm.cs</DependentUpon>
    </EmbeddedResource>
    <Content Include="App.ico" />
    <None Include="Copyright.txt" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <PropertyGroup>
    <PreBuildEvent>
    </PreBuildEvent>
    <PostBuildEvent>
    </PostBuildEvent>
  </PropertyGroup>
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer IBM
United Kingdom United Kingdom
Started software development at about 15 years old and it seems like now it lasts most part of my life. Fortunately did not spend too much time with Z80 and BK0010 and switched to 8086 and further. Similar with programming languages – luckily managed to get away from BASIC and Pascal to things like Assembler, C, C++ and then C#. Apart from daily programming for food, do it also for hobby, where mostly enjoy areas like Computer Vision, Robotics and AI. This led to some open source stuff like AForge.NET, Computer Vision Sandbox, cam2web, ANNT, etc.

Comments and Discussions