Detection and Coding of Edges Using Directional Masks