What is the standard way to access and modify individual Mat elements in OpenCV4Android?
A Mat is what we call a โmatrixโ in mathematics โ a rectangular array of values โโgiven by rows and columns. These "values" represent pixels in the case of a Mat image (for example, each matrix element may be the color of each pixel in a Mat image). From this tutorial:

in the above image you can see that the carโs mirror is nothing more than a matrix containing all the pixel intensities of the dots.
So, how would you go about iterating through the matrix? How about this:
for (int row=0; row<mat.rows(); row++) { for (int col=0; col<mat.cols(); col++ ) {
What is the standard way to access and modify individual Mat elements in OpenCV4Android?
You get the value of the Mat element using its get(x)(y) function, where x is the first coordinate (row number) and y is the second coordinate (column number) of the element. For example, to get the 4th element of the 7th row of a BGR Mat image called bgrImageMat , use the get Mat method to get an array of type double , which will be 3 size, each element of the array representing each of the Blue , Green and Red channels BGR image format.
double [] bgrColor = bgrImageMat.get();
Also, what is the data format for BGR (which, in my opinion, is the default) and shades of gray? edit: Let me make it more specific. mat.get (row, col) returns a double array. What is in this array?
You can read about the BGR color format and grayscale from the Internet. e.g. BGR and Grayscale .
In short, the BGR format has 3 channels: Blue , Green and Red . Thus, the double array returned by mat.get(row, col) when Mat is a BGR image is an array of size 3, and each of its elements contains the values โโof each of Blue , Green and Red respectively.
Similarly, the grayscale format is a 1-channel color format, so the returned double will be 1.