converted to opencv 3.0
added option parsing and tvd1