public void process ( T image1 , T image2 ) { // declare image data structures if ( pyr1 == null || pyr1 . getInputWidth ( ) != image1 . width || pyr1 . getInputHeight ( ) != image1 . height ) { pyr1 = UtilDenseOpticalFlow . standardPyramid ( image1 . width , image1 . height , scale , sigma , 5 , maxLayers , GrayF32 . class ) ; pyr2 = UtilDenseOpticalFlow . standardPyramid ( image1 . width , image1 . height , scale , sigma , 5 , maxLayers , GrayF32 . class ) ; pyr1 . initialize ( image1 . width , image1 . height ) ; pyr2 . initialize ( image1 . width , image1 . height ) ; } norm1 . reshape ( image1 . width , image1 . height ) ; norm2 . reshape ( image1 . width , image1 . height ) ; // normalize input image to make sure alpha is image independent imageNormalization ( image1 , image2 , norm1 , norm2 ) ; // create image pyramid pyr1 . process ( norm1 ) ; pyr2 . process ( norm2 ) ; // compute flow from pyramid process ( pyr1 , pyr2 ) ; }
Processes the raw input images . Normalizes them and creates image pyramids from them .