First time here? Check out the FAQ!
answered 2014-10-10 15:43:46 -0600
If you are at pixel x,y you could copy the rectangle into a new Mat as
cv::Mat foo = img.colRange(x-1,x+1).rowRange(y-1,y+1)