resize earlier; avoids a memcpy and slight improves opencv rate