Finding a specific index in a binary image in linear time?
The centroid's coordinates are arithmetic means of coordinates of the points.
If you want the linear solution, just go pixel by pixel, and count means of each coordinates, where the pixels are white, and that's the centroid.
There is probably no way you can make it better than linear in general case, however, if your circular object is much smaller than the image, you can speed it up, by searching for it first (sampling a number of random pixels, or a grid of pixels, if you know the blob is big enough) and then using BFS or DFS to find all the white points.
I've got a 640x480 binary image (0s and 255s). There is a single white blob in the image (nearly circular) and I want to find the centroid of the blob (it's always convex). Essentially, what we're dealing with is a 2D boolean matrix. I'd like the runtime to be linear or better if possible - is this possible? 
Two lines of thought so far:

Make use of the numpy.where() function 
Sum the values in each column and row, then find where the max value is based on those numbers... but is there a quick and efficient way to do this? This might just be a case of me being relatively new to python.