function and test for roi mean value extraction