replaced libnetpbm with opencv