In case of digital images, what is the relationship between sampling and number of pixels? For upsampling, the number of pixels increass, and for down sampling, the number of pixels decrease??
Yes. With upsampling, the number of pixels increase. But it is not just an arbitrary addition of pixels. Generally, the idea is to end up with a higher resolution version of the original image. So certain algorithms may need to be used to interpolate, etc.
With downsampling, on the other hand, the number of pixels decrease, and it would end up with a lower resolution version of the original image.
Yes, that's correct. It's a natural extension of one dimensional up and down Sampling. However, one can define lattices (arbitary shapes) for sampling images, so one could downsample more in a particular axis than the other. Essentially instead of a sampling period, we have a sampling grid. There are benefits of using different freqeuency grids. Of course all of this holds without aliasing only when the sampling theorem holds. Otherwise you get aliasing.