Before converting everything to cvmat