Alternatively you can directly use the 2D versions of the functions, since image is a 2D signal :
mean2(I) and std2(I) where I is the ROI
The ROI can be computed from an entire image J by specifying a range of pixel values, say 100 pixels horizontally and vertically from origin : I = J(1:100, 1:100)
if you wanna do it rolling over the entire image you can get the mean quickly by convolving the rawimage by a 2D rectangular pulse (weights = 1/N^2) in fourier-domain.