Software and Hardware Architectures for FPGA-based Image Processing