Can pixels be used in determining optimum focus?

Discussion in 'Photoshop' started by Peter Jason, Feb 5, 2007.

  1. Peter Jason

    Peter Jason Guest

    I photograph buildings with an Olympus E500
    and I use autobracketing with the focusing.

    This works OK and normally I have no trouble
    choosing the best focused shot.

    But some times it is hard to choose the
    better of two photos on the screen, and I
    wonder that if I enlarge the photos up to
    pixel level, I can rapidly choose the
    sharpest shot.

    I have done some tests in comparing two
    bracketed-focus tests and it seems that for
    the sharpest focus the pixels making up, say,
    a small highlight has fewer and brighter

    Is this always true, and has anyone else had
    this experience?

    Peter Jason, Feb 5, 2007
    1. Advertisements

  2. Peter Jason

    Mike Russell Guest

    Yes, this works because the spot will be brighter if it is focused more
    sharply. Use a dark pixel for an even more sensitive test - the darker the
    pixel the sharper the focus, because less extraneous light is spilling over
    into the dark area.
    Mike Russell, Feb 5, 2007
    1. Advertisements

  3. Peter Jason

    Alex Guest

    If I may join in: this is a subject I have been interested in for some time.

    I have been wondering how digital camera's determine the best focus: they don't
    have more information than is present in an image. Is there a way to do that on
    the computer? I have found some articles about it but they weren't fit for an
    amateur like me.

    My idea was to find a filter that you can apply to an image in Photoshop and
    that results in (for example) highest contrast for the sharpest image. As if
    you look at the derivative of a function and you want to find the steepest
    slope by looking for the highest value in the derivative. But I don't have a
    solution to this...

    Someone have an idea?

    Greetings, Alex
    Alex, Feb 6, 2007
  4. Peter Jason

    Mike Russell Guest

    [re determining focus via pixel values]
    No problem.
    Yes, computers are very good at this sort of thing. First, it's worth
    mentioning that SLR's solved this problem many years ago. It was my
    pleasure to sit next to one of the early engineers involved in Honeywell's
    development of the first SLR autofocus circuitry, and the technical details
    are quite interesting. Digital SLR's inherit this technology, and are
    lightning fast compared to the point and shoot cameras, which rely, as you
    say, on pixel data.
    Of course computers have a large number of options.

    One solution is to use a subset of the Unsharp Mask algorithm. Subtract the
    image from a blurred version of itself. A sharply focused pixel will result
    in a larger result. Run auto-levels on it, and voila, you have a mask that
    is brighter where the image is sharpest. This can be used, for example, to
    generate a mask for each layer of a multi-focused set of images, and mask
    for the sharpest portion of each. The result is an image that contains the
    sharpest parts of each, for a wide depth of field effect.

    Another is to calculate the standard deviation of a finite area around each
    pixel. The larger the standard deviation, the sharper the image. A
    variation of this is used to calculate the Modulation Transfer Function, or
    MTF, which is a numeric characterization of the resolution of an imaging

    FFT's are probably the best method of all for determining sharpness, since
    it is a direct measure of the spatial frequency component of the image, but
    now I'm starting to see what you mean about all these articles getting too
    technical - heh.
    Mike Russell, Feb 6, 2007
  5. Peter Jason

    Alex Guest


    Many thanks for your response - I have something to think about now !
    Greetings, Alex
    Alex, Feb 7, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.