Image processing and subpixel edge detection