public Point getMotionCog ( ) { Point cog = algorithm . getCog ( ) ; if ( cog == null ) { // detectorAlgorithm hasn't been called so far - get image center int w = webcam . getViewSize ( ) . width ; int h = webcam . getViewSize ( ) . height ; cog = new Point ( w / 2 , h / 2 ) ; } return cog ; }
Get motion center of gravity . When no motion is detected this value points to the image center .