public void process ( GrayF32 input ) { constructPyramid ( input ) ; corners . reset ( ) ; // top to bottom. This way the intensity image is at the input image's scale. Which is useful // for visualiztion purposes double scale = Math . pow ( 2.0 , pyramid . size ( ) - 1 ) ; for ( int level = pyramid . size ( ) - 1 ; level >= 0 ; level -- ) { // find the corners detector . process ( pyramid . get ( level ) ) ; // Add found corners to this level's list PyramidLevel featsLevel = featureLevels . get ( level ) ; FastQueue < ChessboardCorner > corners = detector . getCorners ( ) ; featsLevel . corners . reset ( ) ; for ( int i = 0 ; i < corners . size ; i ++ ) { ChessboardCorner cf = corners . get ( i ) ; // convert the coordinate into input image coordinates double x = cf . x * scale ; double y = cf . y * scale ; // Compensate for how the pyramid was computed using an average down sample. It shifts // the coordinate system. // if( scale > 1 ) { // x += 0.5*scale; // y += 0.5*scale; // } ChessboardCorner cl = featsLevel . corners . grow ( ) ; cl . first = true ; cl . set ( x , y , cf . orientation , cf . intensity ) ; } scale /= 2.0 ; } // Create a combined set of features from all the levels. Only add each feature once by searching // for it in the next level down for ( int levelIdx = 0 ; levelIdx < pyramid . size ( ) ; levelIdx ++ ) { PyramidLevel level0 = featureLevels . get ( levelIdx ) ; // mark features in the next level as seen if they match ones in this level if ( levelIdx + 1 < pyramid . size ( ) ) { PyramidLevel level1 = featureLevels . get ( levelIdx + 1 ) ; markSeenAsFalse ( level0 . corners , level1 . corners ) ; } } for ( int levelIdx = 0 ; levelIdx < pyramid . size ( ) ; levelIdx ++ ) { PyramidLevel level = featureLevels . get ( levelIdx ) ; // only add corners if they were first seen in this level for ( int i = 0 ; i < level . corners . size ; i ++ ) { ChessboardCorner c = level . corners . get ( i ) ; if ( c . first ) corners . grow ( ) . set ( c ) ; } } }
Detects corner features inside the input gray scale image .