public static void process ( GrayU8 orig , GrayS16 derivX , GrayS16 derivY ) { final byte [ ] data = orig . data ; final short [ ] imgX = derivX . data ; final short [ ] imgY = derivY . data ; final int width = orig . getWidth ( ) ; final int height = orig . getHeight ( ) - 1 ; //CONCURRENT_BELOW BoofConcurrency.loopFor(1,height,y->{ for ( int y = 1 ; y < height ; y ++ ) { int endX = width * y + width - 1 ; for ( int index = width * y + 1 ; index < endX ; index ++ ) { int v = ( data [ index + width + 1 ] & 0xFF ) - ( data [ index - width - 1 ] & 0xFF ) ; int w = ( data [ index + width - 1 ] & 0xFF ) - ( data [ index - width + 1 ] & 0xFF ) ; imgY [ index ] = ( short ) ( ( ( data [ index + width ] & 0xFF ) - ( data [ index - width ] & 0xFF ) ) * 2 + v + w ) ; imgX [ index ] = ( short ) ( ( ( data [ index + 1 ] & 0xFF ) - ( data [ index - 1 ] & 0xFF ) ) * 2 + v - w ) ; } } //CONCURRENT_ABOVE }); }
Computes derivative of GrayU8 . None of the images can be sub - images .