Hello Arjun,
We suggest the following solution that assumes the use of numpy module:
Using the following code you can get unmasked pixels:
import PhotoScan, numpy
camera = PhotoScan.app.document.chunk.cameras[0]
mask = camera.mask.image()
bytes = mask.tostring()
pixels = numpy.fromstring(values, dtype=numpy.uint8)
(unmasked,) = numpy.nonzero(a == 255)
so now in unmasked array you would have the indices of the "white" pixels, but to get the coordinates you need to perform a conversion, like:
pix = unmasked[-1] #last white pixel
x, y = pix % camera.sensor.width, pix // camera.sensor.width