added adaptive size for roi