rearranged interface to opencv, and refined batch processing