What process do astrophysicists use to count the stars in the sky?The astro physicsists do observation on the certain patch of the sky with a CCD camera, in most cases. The obtained image is essentailly a big array with its elements being the light (flux) that received at that pixel.
A source on the sky (could be stars or galaxies) will result in a blob of pixels with excessive flux. A detection algorithm will be excised to the image to "group" the different blobs of pixels, so that in each group the flux contribution of an astronomical source is believed to be dominant over that of other objects.
A catalog of objects will be generated and from there on we can perform photometry to get how bright the objects are. And of course with the catalog we can `count` the number of stars in the sky.
The detection process needs to be however sophisticated enough to be able to:
1. Determine the background accurately.
2. Deal with noise. Some filtering adapted to the characteristics of the image has to be applied prior to detection, to reduce the contamination by noise peaks.
3. Deal with overlapped objects.
A number of software have been designed to perform the task and nowadays it is actually quite "standard", such as SExtractor (E. Bertin). Other than these general tools, for large telescopes, it is common to have their specifically designed image processing pipelines to do the source detection, especially in the cases of observations in longer wavelength, where the images usually are more sophisticated.
On the other hand, it is not very interesting to "count the stars in the sky" for an astronomer in general. What we see on the sky is the whole story of our universe being projected to our celestial sphere. A good measure of the third dimension, the distance, is usually required to make all the statistics more meaningful, including "the number of the stars".