removed extra conversion to mat during createObject