7

What I mean by "true" resolution is the resolution at which the maximum available amount of real detail is present. For an ideal picture this resolution is the same as the resolution encoded in the image file. However, in other cases the actual true resolution may be less than the resolution of the image file:

  1. If the image file was digitally scaled - for instance, if the camera has a "digital zoom" feature where it upsamples the individual pixels.

  2. If the image is not completely sharp and in focus.

In either of these cases, it is useful to me to have some mechanical method of identifying what the actual true resolution of the image is independent of what the image file says. How can I do this? Is there some software or algorithm which can take an image and analyze it and tell me the highest resolution it can be displayed at while showing detail at the resolution?

My initial naive expectation that it should be "obvious" and easy to determine by some simple mechanism such as compressed sizes is thwarted in cases where the upscaled image has noticable artifacting or noise not present in the original.

Michael
  • 791
  • 1
  • 10
  • 20
  • 3
    I'm voting to close this question as off-topic because it seems to be a theoretical question without any true photographic application. – Philip Kendall Apr 28 '19 at 17:37
  • 1
    The question of, "Is this cropped from a larger picture?" comes up all the time in photography. The fact that it can't be reliably determined is an important point and very much on-topic. – user10216038 Apr 28 '19 at 17:58
  • 2
    @user10216038 whether or not something is cropped may be of use in making a photograph, but I’m failing to see the importance after the fact. If it’s a good clean photo, who cares if it was cropped to obtain the final composition? Isn’t that the advantage of high res sensors? – OnBreak. Apr 28 '19 at 18:58
  • 1
    @Hueco from a purely hypothetical standpoint, an example of "who cares" might be a judge/panel for a photo contest who requires images to not be cropped (for some strange reason). Also, off the top of my head, perhaps some sort of detection of whether an image is modified (for journalistic submission purposes). I'm not weighing in on the topicality of this question, just devilishly advocating conceivable reasons to care. – scottbb Apr 28 '19 at 19:22
  • 3
    This question assumes that OOF areas do not contribute to “true resolution”. Is a panned motion blur shot not “true”? How about a blurred photo shot through wet glass? What problem are you actually trying to solve? – OnBreak. Apr 28 '19 at 19:37
  • 1
    @scottbb I can agree on telling if an image was manipulated for the reasons you stated, but that has little to do with “true resolution”. Especially the second assumption in the question. – OnBreak. Apr 28 '19 at 19:41
  • @Hueco "... who cares if it was cropped ..." . One example off the top of my head would be an evidence photo. One could easily create a crop that implied something very different from the larger image. It would be nice if one could determine that an image was a significant crop. – user10216038 Apr 28 '19 at 21:09
  • @Hueco One case where "true resolution" is useful is when digitizing print scans or negatives. I realize this is a bit ill-defined, because analog film has a grain which doesn't exactly correspond to pixels. But suppose I have a scan which I suspect had issues. To get a rough idea of the true resolution could help me determine whether the scan is faulty or not. Or, suppose I scanned the same media at multiple dpi resolutions. If they are all above the actual film "resolution" they should converge to a lower dpi. – Michael Apr 28 '19 at 23:15
  • 1
    OP, please edit question to add what you have done/found to answer this question – aaaaa says reinstate Monica Apr 29 '19 at 00:41
  • 1
    Same question asked here. For those wondering why this would ever be useful, I can imagine some sort of standardized (imperfect) check that images contain adequate detail. If you are a designer requesting a bunch of people to submit 1 MP headshots for a publication, the files could be processed to automatically alert you if one of them appears to be upscaled from 0.1 MP, or significantly OOF (and therefore won't be of sufficient quality). Of course, there may be ways to fool an algorithm, but some quick check would be better than nothing. – nanoman Apr 29 '19 at 01:33
  • 1
    The question, despite sounding very reasonable, turns out to be not well defined.

    If you are able to pick your subject for purposes of the test, standard tests such as ISO 12233 will meet your needs. They were constructed with the explicit purpose of trying to quantify the actual resolution of cameras. However, if we consider any generic picture, consider the challenge of determining the resolution of a picture of a flat lit green screen. The subject lacks meaningful detail in that case.

    – Cort Ammon Apr 29 '19 at 06:16
  • This reads like an X→Y problem to me. there are legitimate photographic purposes for measuring resolution. But this question does not reveal what problem is supposed to be solved by measuring resolution. Why do you think you need to measure resolution? For what photographic problem do you think this would be a solution? – Michael C Apr 29 '19 at 08:39
  • @MichaelC For my purpose, I have a negative scanning service that has produced suspect results. I have a scan they made, and a scan of the same image from a print. Subjectively, the print scan seems to have more detail despite being lower resolution, but I want to put a number on it in order to decide whether to dump a substantial sum scanning the remaining images, or if I should pursue more expensive, inconvenient places to try to get a better scan. – Michael May 15 '19 at 19:07

3 Answers3

9

You could compute the Fourier transform of the picture and analyze it in frequency space. If the image was upsampled, higher frequencies will be missing in the transformed image.

Note that the absence of the high frequencies could also mean that the original image did not contain enough detail, or it was not sharp in the first place.

Related: How to analyze images with Fast Fourier Transform method?

bogl
  • 739
  • 6
  • 14
  • 3
    However there could also be fake high frequency components created by "sharpening" upscaler filters that try to trick naive users into thinking they're getting a better picture, while actually just making awful ringing all over the place. – R.. GitHub STOP HELPING ICE Apr 29 '19 at 04:43
  • I have done this but I'm not sure exactly what to do with the results. I have two test copies of images, one of which is known to be a higher resolution, and in the magnitude the FFT is slightly brighter especially around the center. However, in phase space, the higher resolution image has ""waves" which appear to be emanating from the axes which the lower res image does not have. Complicating matters, the third image I am trying to actually compare against the higher res image has more noise in the magnitude (higher brights, interspersed with lower lows) and fringing around the axes... – Michael May 15 '19 at 19:38
  • Whereas for the third image the phase space is much noisier (grainer) and also exhibits multiple even wave vertical patterns across the whole image, as well as a weird wave fringing pattern that follows both axes. – Michael May 15 '19 at 19:40
  • Difficult to say anything without seeing it. May I suggest that you open a new question, with the sample image in both resolutions and the respective FFTs? That should be interesting! – bogl May 15 '19 at 19:47
2

Assuming accurate meta data (EXIF) is present, it would be possible to determine possible camera model resolutions.

Without metadata it's a statistical guess from common available possibilities.

What you refer to as "True Resolution" is a difficult concept. To start with, digital cameras don't have pixels in the first place, they have sensors. The sensors in turn are processed to produce pixels, but many sensors produce one pixel and one sensor is part of many pixels.

There are image analysis/forensic tools for determining things like edited, cloned, recompressed, resized, and other alterations. Sometimes the JPG cosine compression tables or noise patterns can strongly indicate a particular camera.

In general, unless you can establish the camera model, I don't believe you can realistically get what you want.

user10216038
  • 2,241
  • 8
  • 10
1

What I mean by "true" resolution is the resolution at which the maximum available amount of real detail is present. For an ideal picture this resolution is the same as the resolution encoded in the image file.

To put that another way, you're trying to differentiate images where one pixel represents one pixel on the camera sensor (i.e., a 100% crop) from those that don't. So a shot taken with a full-frame lens on a full-frame SLR would be considered "true," as would one taken with a cropped-frame lens and cropped to just show what was in the image circle.

In either of these cases, it is useful to me to have some mechanical method of identifying what the actual true resolution of the image is independent of what the image file says. How can I do this?

Most cameras with digital zoom provide the DigitalZoomRatio EXIF tag which will tell you when scaling happened in-camera. You will not, of course, be able to tell if the image was scaled elsewhere or the metadata was tampered with unless you have some way to verify that the image and metadata were actually produced by the camera.

Assuming you trust the metadata, the ratio could be used to figure out that a 6000x4000 image that had a zoom ratio of 2.0 started life as 3000x2000. That doesn't mean the image can be scaled back down to that size and all will be well; any changes made during upscaling would have an effect on the downscaled version.

You can't do anything with the not-completely-sharp case for the simple reason that given just the image, there's no source of ground truth for what light fell on the sensor and no insight into the photographer's intent. Shooting with intentionally-small depth of field, putting a diffusing filter in front of the lens, producing motion blur or intentionally shooting out of focus would be captured at the camera's "true" resolution. Any algorithm trying to root out scaling would produce a wrong result.

The best you can do is read the metadata and decide whether or not you trust it.

Blrfl
  • 5,532
  • 21
  • 27