I can handle this one
p is the x-coordinate and p is the y-coordinate. The point of the line
gradient = ops.image().equation(ops.create().img(dims), "p+p")
is to create an image with low intensity on the top left and high intensity on the bottom right.
I guess you're referring to:
// execute an op on every pixel of an image
addOp = ops.op("math.add", DoubleType.class, new DoubleType(10000.0))
compositePlus = ops.create().img(composite)
ops.run("map", compositePlus, composite, addOp)
The main point of that is to show what
ops.run("map" ... does, in this case, its another way to add a constant (10000) to the image.
One of the inputs to
map is a function (here,
addOp). Map takes that function and applies it to every value it finds in the input image.
You should not use it to add (since there is an op for that already), but if you had some complicated function that you wanted to apply to every pixel, then the
map op is the way to go!