You could use a sobel filter, which is just a convolution with another small image (or matrix). This also goes for prewitt or whatever differentiator you find adequate.
These edge-detector's aren't very andvanced and typically need some preprocession, such as noisereduction. If you want to do a fast test, you could reduce noise by applying a gaussian (i.e. convolution with a Gaussian 'hat') if it needs to be better use a set-opening/closing (Two doctors on my university have something quite interresting: "A comparison of algorithms for connected set openings and closings", which preserves shape (gaussian doesn't, and shape is important if you detect edges I guess) see: http://www.cs.rug.nl/~michael/ ).
I have written a fft-convolution algorithm (for cimg, but it won't be included for a few months as I am still coding around it and it may slightly change) which is a bit faster then a normal convolution, but in your case where the kernel isn't too big I wouldn't really care
Another thing: edge detection can of course be seen as the amount of change between neighbor pixels.
enjoy your life!
foo-nix