44
\$\begingroup\$

If you focus on a focal plane that is sufficiently in front of your subject, or past it (relative to depth of field), the subject will appear blurry. Is there some way of telling purely from the resulting blur if focus was too near or far?

EDIT: the original question has now gotten some good answers, but I noticed it got misinterpreted a couple of times. That indicates it wasn't posed clearly enough, so I edited it a bit. Furthermore I'll illustrate the point a bit more below.

Take this setup with subject, lens and film or sensor in which the subject is sharply focused (the focal plane intersects with it).

focal_plane_on_subject

Now imagine if the focus is placed behind the subject. This is called "back-focus". The projection of the subject onto the film/sensor becomes blurry, with the actual convergence point for light from the subject being behind it. Light point sources from the subject become discs (or a bokeh shape specific to the aperture).

focal_plane_behind_subject

Next, put the focus in front of the subject. This is called "front-focus". The projection again becomes blurry, but this time because the convergence point for light from the subject is in front of the film/sensor. So the blurred projection is actually inverted.

focal_plane_in_front_of_subject

The question was then, is this difference in blur in some way identifiable through nothing but the resulting picture?

As for the reason for asking, I shoot film so I don't have immediate feedback regarding the result. I keep notes of my shots but I don't have EXIF data, so things such as focal length and distance to subject are an approximation at best. Sometimes I shoot in low light and have to rely on manual focus. Things look sharp in the viewfinder but after development I find out focus has been slightly missed. Being able to figure out if it was too near or too far is then very useful, and can teach me whether it was user error and how to pay attention to it, or whether a specific camera or lens seems to have slight focusing issues and how I might compensate for that.

\$\endgroup\$
5
  • 2
    \$\begingroup\$ panasonic says they can imaging-resource.com/PRODS/panasonic-gh4/panasonic-gh4TECH.HTM \$\endgroup\$
    – szulat
    Feb 26, 2019 at 11:18
  • \$\begingroup\$ Edited a bit to make it clearer what I'm asking (and this this isn't about airplanes). If I got the convergence point for back or front focus wrong, please let me know! I don't have much knowledge regarding the physics behind optics. \$\endgroup\$
    – G_H
    Feb 27, 2019 at 14:58
  • \$\begingroup\$ Editing Questions to improve them (e.g. clarification, adding additional information, etc.) is encouraged. However, editing a Question to change it into a different question which results in invalidating one or more Answers, is against Stack Exchange policy (even when your original question wasn't what you intended). Your most recent edit here (e.g. changing "picture" to "blur") did invalidate an answer. In such cases, you are encouraged to ask a new Question instead, perhaps with a link to this one for additional context. \$\endgroup\$
    – Makyen
    Mar 1, 2019 at 8:00
  • \$\begingroup\$ @Makyen Although those answers are useful and I have upvoted them, the ones that provided the answer for the intended question made the least amount of assumptions (i.e. there's other elements at different distances than the subjects). Unfortunately it seems that there can't be one definite answer anyway because any method to attempt this will depend one some factors that may or may not be found in the picture. \$\endgroup\$
    – G_H
    Mar 1, 2019 at 13:42
  • \$\begingroup\$ Relevantish article from the author of SmartDeblur, with examples: yuzhikov.com/articles/BlurredImagesRestoration2.htm \$\endgroup\$
    – biziclop
    Mar 3, 2019 at 16:25

8 Answers 8

40
\$\begingroup\$

It depends. In many cases, it may actually be possible without any further visual aids in the picture.

Many lenses, if not most, will show different longitudinal chromatic aberration in front of and behind the focus plane. If you scroll down just a little bit on the linked page, you will see this demonstrated with a picture of a focus test chart. With this lens, the blur in front of the focus point will have purple colour fringing, while the blur behind the focus point will seem greenish.

If you know the characteristics of this lens, you could look at just a very small part of the image like e.g:

enter image description here

... and say for sure that this out-of-focus area is behind the focus plane.

\$\endgroup\$
8
  • 6
    \$\begingroup\$ so, you can't determine it from the blur (which this question is asking about). you need additional information about the lens and other abberations. \$\endgroup\$
    – ths
    Feb 26, 2019 at 17:32
  • 6
    \$\begingroup\$ @ths i don't see it asking if you can tell from the blur itself. Can you quote that section? I only see "from a blurry photo" (which is different than just from the blur itself. Rather, it is the photo as a whole, which happens to be blurry), and "from the resulting picture" (which further broadens what the OP is asking for). But maybe I missed it, or the question was edited \$\endgroup\$ Feb 26, 2019 at 21:51
  • 2
    \$\begingroup\$ @Aethenosity OP's mother tongue is probably not English, but that is also how I read the question: If you have an out-of-focus area in an image, can you determine if it is in front of or behind the actual focus plane? \$\endgroup\$
    – jarnbjo
    Feb 26, 2019 at 22:26
  • 2
    \$\begingroup\$ @Aethenosity Like you said and like how I tried to rephrase the question with my own words, as I understand it: If you have an out-of-focus area in an image, can you determine if it is in front of or behind the actual focus plane? \$\endgroup\$
    – jarnbjo
    Feb 26, 2019 at 22:32
  • 4
    \$\begingroup\$ @jarnbjo I'm indeed not a native English speaker, but if the question is unclear it is more likely due to a lack of knowledge regarding the proper terms to phrase it in. Your interpretation is correct. Blur will result either from the convergence point of light rays being behind the film/sensor (subject between camera and focal plane) or being in front of it (subject further than focal plane). In the latter case the a point light source is blurred "inverted". This answer cleverly makes use of that due to the difference in refraction for different wavelengths. \$\endgroup\$
    – G_H
    Feb 27, 2019 at 12:57
21
\$\begingroup\$

When the aperture is positioned to minimize vignetting, the bokeh shapes for objects that are too far is rotated by 180° compared with objects that are too near. (The aperture image is reflected through its center point.) If the arrangement of your aperture blades is not symmetric around the center point, you can try finding "reference bokeh" that are clearly nearer or farther than the focus plane to compare with highlights on the subject to see whether the bokeh shapes match those that are near or far.

too near too far

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Very clever! And independent of color or black and white. \$\endgroup\$
    – G_H
    Feb 27, 2019 at 12:52
  • 2
    \$\begingroup\$ @G_H Yes, but remember that the edges of the aperture, and therefore also the edges of the shape of the boke, rotate as you adjust the aperture. You will either have to know the exact aperture setting, or have other reference points in the same image to compare with. \$\endgroup\$
    – jarnbjo
    Feb 27, 2019 at 13:03
  • \$\begingroup\$ I wonder whether there's a camera which uses such an odd-shaped aperture to do autofocus? \$\endgroup\$
    – Ed Avis
    Feb 27, 2019 at 17:22
  • \$\begingroup\$ @jarnbjo - Knowing exact aperture setting on lens not needed because method involves using "reference bokeh" within the same image. \$\endgroup\$
    – xiota
    Feb 27, 2019 at 19:40
  • \$\begingroup\$ @EdAvis - Unlikely any camera uses orientation of bokeh to focus because – The camera would have to hunt for bokeh. The lens would have to be pretty far out of focus for shapes to be discernible. (How many pixels to show the points of a heptagon vs simple contrast.) Many lenses have an even number of aperture blades. The aperture rotates, as jarnbjo notes. \$\endgroup\$
    – xiota
    Feb 27, 2019 at 19:47
7
\$\begingroup\$

My answer only deals with "human" ways in differentiation - that is: No software, only your eyes and hands.

If I have no reference (as in: you blind me, you set the focus distance, and then I can only look through the viewfinder, but cannot change a thing), the answer is: it depends on what I can see.

Take, for example, an alley of trees: one in front, one where the subject stands, and one in the distance. When I see that the subject is not sharp, I can try to tell whether the tree in the foreground or the one in the background is more in focus.

If I have no reference - e.g., as Yaba mentioned, when taking a photo of a aeroplane with blue sky in the background and no foreground, then I have no way to know exactly (my guess would be that focus is too close, however, as planes tend to be somewhere near infinity).


The easiest way to find out usually is to slightly change the focus and see where it is (again, this works better with a reference than without).

But generally speaking, there is no sure way to differentiate - too short a focus distance does not lead to (significantly) different blur compared to a focus distance that is too long.

\$\endgroup\$
6
\$\begingroup\$

If the plane is too far or to close is just from the blur hard to say. the easiest way is to have objects in front and behind and see which one is sharp and so you could determine if it is too far or too close... this is the same way as it is done by calibrating the autofocus of a lens with a lenscal tool like this.

without such objects its hard to tell it.

\$\endgroup\$
1
\$\begingroup\$

No

it is technically not possible to detect from the blur alone how far or in which direction the image is out of focus.

This is the reason why contrast-detection autofocus systems have to "hunt" for focus by repeatedly changing the focus distance and checking whether the image got better or worse.

In contrast, phase-detection AF systems know (theoretically) exactly how far and in which direction they have to change focus to achieve optimal sharpness.

Of course the image changes if you take context clues from other objects in the picture into account (i.e. "guessing"), but that is something which currently ony organic viewers can do. This might change with AI algorithms in-camera, but i suspect other advances will improve on pure CD-AF before that. (see @szulat 's link from acomment:https://www.imaging-resource.com/PRODS/panasonic-gh4/panasonic-gh4TECH.HTM)

\$\endgroup\$
6
  • 6
    \$\begingroup\$ In certain cases, software could determine this from other artifacts/aberrations that are a result of being out of focus - eg spherochromatism.... \$\endgroup\$ Feb 26, 2019 at 17:08
  • 1
    \$\begingroup\$ So, actually, yes? \$\endgroup\$ Feb 27, 2019 at 13:23
  • 4
    \$\begingroup\$ @EricDuminil Yes. This answer is simply wrong. An answer is not necessarily more correct, just because the text is in bold, large letters. \$\endgroup\$
    – jarnbjo
    Feb 27, 2019 at 15:47
  • \$\begingroup\$ the question that was asked when i was answeing it was :"can you detect from blur whether it was back-focus or front-focus?" from blur. so not from any other effects. please prove me wrong. \$\endgroup\$
    – ths
    Feb 27, 2019 at 20:26
  • 2
    \$\begingroup\$ @jarnbjo: It's common practice (moreso on some stackexchange sites than others) to start an answer with a bolded TL:DR heading and then support the conclusion. I'm going to hope you're joking, because this looks like a legit attempt to give a good answer (not bolding for the sake of convincing anyone), but simply didn't think of some of the effects mentioned in the top 2 answers (yours and user82310) which let you gain information from the blurring itself, without phase information. +1 this answer because the point about phase-detection AF is interesting. \$\endgroup\$ Feb 27, 2019 at 20:26
1
\$\begingroup\$

Yes, if the content includes edges at different distances.

If you can tell that a further object is more blurred than a nearer one, then it's further from the plane of focus. That means that the focus is too short.

Conversely, if the distant objects are less blurred than those in the foreground, the focus is too long.

\$\endgroup\$
0
\$\begingroup\$

With a plane in the sky it gets hard. Unlike other objects at different distances available (birds, blouds,…) you cannot compare it easily visually.

Some lens/camera combinations can track the focus distance and will write it into the EXIF. However this is not very reliable, but could give you a hint. When you know the plane type and therefore can look up its real size you can calculate its approximate distance and compare this to the focus distance.

This page with its calculator can help you with this: https://www.scantips.com/lights/subjectdistance.html

\$\endgroup\$
6
  • 6
    \$\begingroup\$ Geometric plane not Aeroplane \$\endgroup\$
    – Tetsujin
    Feb 26, 2019 at 10:44
  • \$\begingroup\$ Well, then the question was not clear. In this case it's easy. Look for other elements either in the front or behind that are in focus. However if it that's what has been asked I wonder why it was asked as this is obvious, isn't it? \$\endgroup\$
    – Yaba
    Feb 26, 2019 at 11:18
  • 8
    \$\begingroup\$ @Yaba "a plane that is too much in front of your subject". I think if an aeroplane is too close in front of what you're trying to shoot and in a state of movement that makes it hard to focus on, you have more urgent issues than getting a good photo. \$\endgroup\$
    – G_H
    Feb 26, 2019 at 11:27
  • 1
    \$\begingroup\$ @Yaba The question is if there are aspects to the blurred part of an image that can tell you if it's a result of back-focus or front-focus. You may not have anything in front or back of the subject to tell. Back-focusing would put the intended image "behind" the film/sensor plane, front focusing in front of it. Meaning front-focusing also inverts it. I thought this might affect the appearance of the blur in some noticeable way. I'm asking out of interest. \$\endgroup\$
    – G_H
    Feb 26, 2019 at 13:43
  • \$\begingroup\$ OK, understood. However still what I wrote applies. As long as you know the actual size of the subject you can calculate it's real distance (in case you do not know it) and compare it to the EXIF focal distance data to get a hint. \$\endgroup\$
    – Yaba
    Feb 27, 2019 at 12:39
0
\$\begingroup\$

Yes Spherochromatism.

You dont haave anything in the plane of focus You dont have option to move focal distance or multiple images to conpare life a focus system does. You dont have subjects st varying distances thus varying degrees out of focus. You have one subject at one distance and its out of focus, the wuestion is near or far?

Light doesnt converge / focus exactly the same. Green light different than magenta light. In the lens formula not only fo you have a focus distance AND depth of field and diffraction. You also have a depth of focus at the sensor/film. In a long tele fast lens shot wide open. You will have FAR whites have a green edge outline and near oit if focus whites have a magenta edge outline. This can be blue yellow spherochromatism also. But green magenta is most common. It occurs mostly in fast WIDE open lenses (more loght hitting bad curve on outer edge of lens) so i can be seen even in a wide FAST lens wide open. Shutting the shutter tighter, eliminated this.

Knowing more about the focal length, the focus distance and the aperture size would help define how to tell if you are near or far focused. The basic answer is YES yo could figure it out fromnvarious chromatic abberations Axial and lateral and primary/srcomdary Non apochromatic lenses (any non $$$ lens) has this. Apochromatic lenses just limit the range of the lens/aperture to where the light color coincide

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.