modified from opencv offical example
change frame obtain method from videocam to still jpg image