A General Purpose Image Processing Chip: Orientation Detection