C# Class Detector.Motion.MotionDetector

The engine in which detects the motion and put it in an easy to use format
Exibir arquivo Open project: AshleighAdams/Detector

Public Properties

Property Type Description
motionpic System.Drawing.Bitmap

Public Methods

Method Description
DoNextScanLine ( int x, int y, MotionHelper &motion ) : void

Recursave function for scanlines

GetBoundsFromMotion ( byte &motion, Point size, Point seed ) : MotionHelper

Uses a FloodFill scanline algorithm to get a targets bounds

GetTargets ( ) : IEnumerable
MotionDetector ( ) : System

The engine in which detects the motion and put it in an easy to use format

MotionDetector ( Image last_img, Image cur_img ) : System

Compare to images to one another

SetNextImages ( Image Last, Image Current ) : void

Set the next images to compare

SubtractPixels ( BitmapData curimg, BitmapData lastimg, byte &pixeldata ) : BitmapData

Subtract any pixels that havent changed, set those that have to 255

UpdateIgnoreMotion ( ) : void

Set the byte array up for fast access to thes pixels

Private Methods

Method Description
Distance ( int x, int y, int a, int b ) : int

Calculate the distance between to points

Error ( string error ) : void

Error without halting on release builds

GetAverage ( BitmapData bdata, int x, int y, int width, int height ) : int

Gets the average color in a cerain area

InRangeOfTarget ( Target &targs, int x, int y ) : int

Checks to see if movement pixels are in range of a target

IsInsideIgnoreArea ( int x, int y ) : bool

Is the pixel inside of the ignore position?

NotInsideOfTarget ( Target &targs, int x, int y ) : bool

Is the target inside of a specific X and Y

Method Details

DoNextScanLine() public method

Recursave function for scanlines
public DoNextScanLine ( int x, int y, MotionHelper &motion ) : void
x int
y int
motion MotionHelper
return void

GetBoundsFromMotion() public method

Uses a FloodFill scanline algorithm to get a targets bounds
public GetBoundsFromMotion ( byte &motion, Point size, Point seed ) : MotionHelper
motion byte
size Point
seed Point
return MotionHelper

GetTargets() public method

public GetTargets ( ) : IEnumerable
return IEnumerable

MotionDetector() public method

The engine in which detects the motion and put it in an easy to use format
public MotionDetector ( ) : System
return System

MotionDetector() public method

Compare to images to one another
public MotionDetector ( Image last_img, Image cur_img ) : System
last_img Image The previous image
cur_img Image The current image
return System

SetNextImages() public method

Set the next images to compare
public SetNextImages ( Image Last, Image Current ) : void
Last Image Image to compare to
Current Image Image at this moment in time
return void

SubtractPixels() public method

Subtract any pixels that havent changed, set those that have to 255
public SubtractPixels ( BitmapData curimg, BitmapData lastimg, byte &pixeldata ) : BitmapData
curimg System.Drawing.Imaging.BitmapData Current image
lastimg System.Drawing.Imaging.BitmapData Last image
pixeldata byte 2 Dem byte array to place movement
return System.Drawing.Imaging.BitmapData

UpdateIgnoreMotion() public method

Set the byte array up for fast access to thes pixels
public UpdateIgnoreMotion ( ) : void
return void

Property Details

motionpic public_oe property

public Bitmap,System.Drawing motionpic
return System.Drawing.Bitmap