public void configure ( int width , int height , int gridRows , int gridCols ) { // need to maintain the same ratio of pixels in the grid as in the regular image for similarity and rigid // to work correctly int s = Math . max ( width , height ) ; scaleX = s / ( float ) ( gridCols - 1 ) ; scaleY = s / ( float ) ( gridRows - 1 ) ; if ( gridRows > gridCols ) { scaleY /= ( gridCols - 1 ) / ( float ) ( gridRows - 1 ) ; } else { scaleX /= ( gridRows - 1 ) / ( float ) ( gridCols - 1 ) ; } this . gridRows = gridRows ; this . gridCols = gridCols ; grid . resize ( gridCols * gridRows ) ; reset ( ) ; }
Specifies the input image size and the size of the grid it will use to approximate the idea solution . All control points are discarded