protected void initialize ( T input , GrayS32 output ) { this . graph = output ; final int N = input . width * input . height ; regionSize . resize ( N ) ; threshold . resize ( N ) ; for ( int i = 0 ; i < N ; i ++ ) { regionSize . data [ i ] = 1 ; threshold . data [ i ] = K ; graph . data [ i ] = i ; // assign a unique label to each pixel since they are all their own region initially } edges . reset ( ) ; edgesNotMatched . reset ( ) ; }
Predeclares all memory required and sets data structures to their initial values