fix memory leak
use tuples for cvScalar