Learn aboutTrue resolution
The answer is a resounding no, the megapixel rating on a digital camera is a poor measure of a cameras ability to resolve detail and therefore is a poor spec to compare. Unfortunately most consumers don't know this, no surprise: this is not how cameras are marketed to the public. That's why we calculate true resolution so you can understand how many megapixels a camera really has. True resolution provides an estimate of the maximum resolution a camera can resolve based on average shooting conditions and some fancy physics.
These digital cameras excel against all others in their ability to resolve detail. If resolution is important to you should consider these but should also read our study: How much resolution do I really need to fully understand how much resolution is necessary.
Because of the way light works (it's actually a wave) it can only be focused to so small a point. The size of that point dictates that there is a maximum resolution that can be projected on a given surface area.
Sensors on cameras range drastically in size, for example a 864mm² full frame sensor has 30x the surface area of a 28.5mm² digicam sensor. That means the digicam's pixels are going to take up a lot less space on the sensor. In fact with most digicams the pixels are so small that they are essentially wasted - the smallest point that the light can be focused being many times larger than the pixels.
The smallest points are called Airy Disks, it's difficult to see them in an image because you're focusing an entire scene so it just ends up looking like blur, here's a example of Airy Disks @ f/20 with 4.65 micron square pixels used to capture them.
You can see the Airy Disks because only 4 light sources are being focused onto the sensor. The dots show the maximum physical resolution and demonstrate how the pixels are basically wasted. The size of the Airy Disks depends on the focal length - the higher the focal length the bigger the Airy Disks and at f/20 those are some big disks - the 4.65 micron pixels are just a little smaller than you'd see in a full frame sensor SLR. There is no way to make those green, red and blue dots the size of a single pixel, in fact in this example 25 pixels are being used to capture the brightest spot in the Airy Disk ( the puddle effect is the result of lights wave nature. This example is using fairly large pixels (4.56 micron), many digicams have pixels around 1.5 microns or 1/3 smaller can, that means a digicam (if it could shoot at f/20) would be using over 200 pixels to capture a single Airy Disk.
It can be argued that a ratio of 1 pixel to Airy Disk is insufficient to capture the bleeding and gradients, which do represent some level of extra information. We feel that 4 pixels per Airy Disk is more than sufficient to capture that detail and permit some extra sharpening either by the camera or post process. The illustration indicates that the hypotenuse of each pixel will be 1/2 the diameter of the airy disk. For calculating true resolution we use an f-stop of 5.6 which is happy medium and fairly typical. The true resolution represents the maximum you can expect to achieve with the camera you're using. That being said achievable resolution will be less given imperfect lenses, jpeg compression, noise reduction routines, imperfect operators, etc.
The following cameras from the last two years have the biggest pixels, that means they are the least likely to be wasting pixels.
We've analyzed a 21 megapixel photo taken with a Canon 5d MkII - full frame SLR and used this to illustrate the difference between a full frame and typical digicam sensor. We calculated the true resolution of a 6.2mm x 4.6mm sensor @ f/4 and used that to illustrate how big the airy disks are relative to the true resolution. The true resolution of the full frame camera is the same as the rated megapixels, but with pixels bigger than the airy disks. Conversely, the digicam's tiny pixels are so small that it takes about 8.5 pixels to make up an airy disk - a complete waste of those little itsy bitsy pixels.
You can immediately see the difference between the two sensors that belies the rated resolution. At an f-stop of 4 the 14MP digicam has a true resolution of 7.8MP vs 21MP for the full frame SLR (which is limited by the lens and operator at such high resolutions not the airy disks or sensor).
We're showing a 2nd crop within the crop above represented by the black square. The first thing to notice is how much total sensor area is used to capture the detail - about 46 microns across, hardly any at all, the camera is trying to focus the scene on too small an area and the limitations of the airy discs are presenting themselves. You can see that a digicam sensor packed with 14 megapixels is simply capturing detail that just is not there, a suitable scaling algorithm on much larger pixels would accomplish the same.
Relative to the digicam the SLR is attempting to focus this portion of the scene on 212 microns width of sensor (almost 5x the width), because of this the airy disks are much smaller relative to the sensor area. Put another way the full frame has such a large sensor that it has relatively ginormous pixels, actually larger than the airy disks - no waste. You can see that a full frame sensor packed with 21 megapixels is a very reasonable proposition. The benefit of focusing the scene on a larger area means more detail is being capture.