private static int[] computeDiffLine(ImageLineInt l1,ImageLineInt l2){
  double maxDif=-1;
  int maxDifCol=-1;
  double dif;
  int channels=l1.imgInfo.channels;
  int[] scanline1=l1.getScanline();
  int[] scanline2=l2.getScanline();
  for (int col=0; col < l1.imgInfo.cols; col++) {
    dif=Math.abs(scanline1[col * channels] - scanline2[col * channels]) + Math.abs(scanline1[col * channels + 1] - scanline2[col * channels + 1]) + Math.abs(scanline1[col * channels + 2] - scanline2[col * channels + 2]);
    if (channels == 4)     dif+=Math.abs(scanline1[col * channels + 3] - scanline2[col * channels + 3]);
    if (dif > maxDif) {
      maxDif=dif;
      maxDifCol=col;
    }
  }
  return new int[]{(int)(maxDif + 0.5),maxDifCol};
}

private static int [ ] computeDiffLine ( ImageLineInt l1 , ImageLineInt l2 ) { double maxDif = - 1 ; int maxDifCol = - 1 ; double dif ; int channels = l1 . imgInfo . channels ; int [ ] scanline1 = l1 . getScanline ( ) ; int [ ] scanline2 = l2 . getScanline ( ) ; for ( int col = 0 ; col < l1 . imgInfo . cols ; col ++ ) { dif = Math . abs ( scanline1 [ col * channels ] - scanline2 [ col * channels ] ) + Math . abs ( scanline1 [ col * channels + 1 ] - scanline2 [ col * channels + 1 ] ) + Math . abs ( scanline1 [ col * channels + 2 ] - scanline2 [ col * channels + 2 ] ) ; if ( channels == 4 ) dif += Math . abs ( scanline1 [ col * channels + 3 ] - scanline2 [ col * channels + 3 ] ) ; if ( dif > maxDif ) { maxDif = dif ; maxDifCol = col ; } } return new int [ ] { ( int ) ( maxDif + 0.5 ) , maxDifCol } ; }
asume que las imagenes son equivalentes res [ 0 ] = maxima diferencia ( suma valores absoluto sobre todos los canales ) res [ 1 ] = columna en que se produce ignores alpha
