adding opencv code for user interaction