The mask essentially calculates the derivative of the point in a certain direction. If the point has a large change in value in that direction, then we know it belongs to an edge. Areas with little or no change in value will average out by the mask to near 0. Get the edges detected from each mask and sum the result to get an image with all the edges enhanced (and the rest of the image de-hanced...).