you need a difference filter:
1) you calc the horizontal difference (here you'll have vertical segments)
2) you calc the vertical difference (here, horizontal segments)
3) you OR the two maps, finding the outlines
4) recreate a Bitmap object, if you wish to do so
something like (EDITED):
int[] pixels;
int width = yourbitmap.getWidth();
int height = yourbitmap.getHeight();
yourbitmap.getPixels(pixels, 0, width, 0, 0, width, height);
// transform grayscale
int[] image = new int[width*height];
for (int y=0; y THRESHOLD || dy[y*width + x] > THRESHOLD);
Bitmap result = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
for (int y=0; y