A real-time FPGA-based solution for binary image thinning