added implementation for reading image

Signed-off-by: Tianyu Geng <g.tyu90@gmail.com>
amended main.cpp