<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.9.1"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns:cv="clr-namespace:Bonsai.Vision;assembly=Bonsai.Vision"
                 xmlns:dsp="clr-namespace:Bonsai.Dsp;assembly=Bonsai.Dsp"
                 xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
                 xmlns="https://bonsai-rx.org/2018/workflow">
  <Workflow>
    <Nodes>
      <Expression xsi:type="SubscribeSubject">
        <Name>Image</Name>
      </Expression>
      <Expression xsi:type="Combinator">
        <Combinator xsi:type="cv:Grayscale" />
      </Expression>
      <Expression xsi:type="Combinator">
        <Combinator xsi:type="cv:BackgroundSubtraction">
          <cv:BackgroundFrames>1</cv:BackgroundFrames>
          <cv:AdaptationRate>0.1</cv:AdaptationRate>
          <cv:ThresholdValue>10</cv:ThresholdValue>
          <cv:ThresholdType>Binary</cv:ThresholdType>
          <cv:SubtractionMethod>Absolute</cv:SubtractionMethod>
        </Combinator>
      </Expression>
      <Expression xsi:type="Combinator">
        <Combinator xsi:type="dsp:Sum" />
      </Expression>
      <Expression xsi:type="MemberSelector">
        <Selector>Val0</Selector>
      </Expression>
      <Expression xsi:type="rx:PublishSubject">
        <Name>Motion</Name>
      </Expression>
    </Nodes>
    <Edges>
      <Edge From="0" To="1" Label="Source1" />
      <Edge From="1" To="2" Label="Source1" />
      <Edge From="2" To="3" Label="Source1" />
      <Edge From="3" To="4" Label="Source1" />
      <Edge From="4" To="5" Label="Source1" />
    </Edges>
  </Workflow>
</WorkflowBuilder>
