How 'Focus Peaking' works

Started Jul 28, 2011 | Discussions
_GUI_ Regular Member • Posts: 386
How 'Focus Peaking' works
1

Focus Peaking ( http://www.youtube.com/watch?v=HGPF375-2rA ) is a real time facility of current Sony mirrorless NEX cameras that shows the user the areas in focus in the scene currently being displayed. To illustrate how 'Focus Peaking' works I tried to reproduce the process in Photoshop. It is quite simple, so I see no reason why any mirrorless camera could not implement it, like the M4/3 system cameras .

To detect in-focus areas in an image is just a matter of detecting microcontrast (i.e. fine detail), something these cameras already need to do in their AF system.

Starting from any real time capture:

The simplest way to detect microcontrast is through a high pass filter (HPF). In the areas in focus, the detail will trigger a threshold set in the HPF, while out of focus areas wont's do so for being totally blurred in terms of high spatial frequencies.

I desaturated the previous image (this makes things simpler, but it's in fact the way to work on undemosaiced data) and applied a simple HPF inside Photoshop (Filter -> Others -> Custom):

By applying an adequate boolean threshold over the result of this filtering, we can detect the borders in focused areas, and this information can be overlayed on the original image as NEX cameras do. Out of focus areas were very far from reaching the HPF output threshold:

Only the borders of in-focus areas are marked since we are strictly detecting microcontrast (a plain colour area won't display any microcontrast, no matter if it is in focus or not). But perhaps for the photographer it is more adequate to see areas in focus rather than borders or isolated pixels, like Capture One does for instance. These areas can be displayed over the image without needing to animate. So we could have a real time view of the scene of this kind:

We determined that in the neighbourhood of the pixels in focus, there should exist some area in focus of a reasonable radius of influence. This over simplified algorithm can be improved a lot, but the concept remains clear.

Another example here:

Would result in the following focus display:

Adjustable parameters for the Focus Peaking would be needed to control sensitivity (according to aperture used, sharpness of the lens,...):

  • HPF (more complex kernels can be used)

  • Detection threshold applied to HPF output

  • Radius of influence to determine the [i]areas in focus[ i] in the second type of view

  • Cleaning of false focused pixels (in the first image, some pixels are classified as focused in the pitcher; or that's the referee?), useful for instante in noisy images

Regards

-- hide signature --
Poweruser Contributing Member • Posts: 516
Re: How 'Focus Peaking' works

Heres a video of focus peaking in action:

http://www.youtube.com/watch?v=HGPF375-2rA

I tried it on the NEX and did not find it that useful. Critical focus with a fast lens still needed manual magnification and fine tuning. For slower lenses it might work well enough though.

deniz erdem Regular Member • Posts: 283
Re: How 'Focus Peaking' works

i also tried in nex. its fine on things with noticeable edges but not very effective when things get a little smoother. for example i tried to take a portrait focusing on the eye and it just doesnt work.

OP _GUI_ Regular Member • Posts: 386
Re: How 'Focus Peaking' works

deniz erdem wrote:

i also tried in nex. its fine on things with noticeable edges but not very effective when things get a little smoother. for example i tried to take a portrait focusing on the eye and it just doesnt work.

Agreed. The primary algoritm is basically an edge detector. If there are no edges, it won't be able to say something is in focus or not (just look at the plain areas in the pants and jacket of the boy).

The algorithm needs to be given more intelligence in scenes not populated by edges.

Regards

-- hide signature --
millsart Senior Member • Posts: 2,771
Found the same thing, cool, but not good enough for crtical focus

I was real exciting to load FW 4 on my NEX5 but while cool, peaking really didn't blow me away

It works, but overall its a bit vague judging just whats in focus as too much usually lights up.

Found I still had to zoom in 7x view to judge true point of focus.

Others milage my vary but it wasn't the revolution I was hoping. Wasn't like using a RF patch in terms of speed

Poweruser wrote:

Heres a video of focus peaking in action:

http://www.youtube.com/watch?v=HGPF375-2rA

I tried it on the NEX and did not find it that useful. Critical focus with a fast lens still needed manual magnification and fine tuning. For slower lenses it might work well enough though.

bgalb
bgalb Senior Member • Posts: 2,179
Re: How 'Focus Peaking' works

Your demo of the use of photoshop to illustrate the basics of "peaking" was much more interesting than any interest I have in the Nex implementation.

I reminds me how woefully limited my use and understanding of Photoshop capabilities is. Thanks for the demo.

 bgalb's gear list:bgalb's gear list
Panasonic Lumix DMC-GM5 Olympus E-M1 II Panasonic Lumix G X Vario PZ 45-175mm F4.0-5.6 ASPH OIS Panasonic 20mm F1.7 II Panasonic Lumix G Vario HD 12-32mm F3.5-5.6 Mega OIS +4 more
OP _GUI_ Regular Member • Posts: 386
Re: How 'Focus Peaking' works

bgalb wrote:

Your demo of the use of photoshop to illustrate the basics of "peaking" was much more interesting than any interest I have in the Nex implementation.

Thanks for your words. Too many times people rely on a particular implementation's performance to judge some new system/device/technology/software, instead of trying to look at the possibilities beyond.

Present M4/3 cameras themselves, are a mediocre implementation (because they are 1st generation) of a camera concept that didn't exist before and will surely delight thoroughly many of us in the near future, once the implementation (maybe M4/3, maybe NEX, maybe XXX) gets mature.

-- hide signature --
robertro Regular Member • Posts: 212
Re: How 'Focus Peaking' works

I have found peaking to be as accurate as any manual focus method and substantially faster and more convenient. As I've said before, it's a game-changer for anyone who's serious about manual focus lenses.

Since I bought a NEX, I no longer use manual focus lenses on my M4/3 cameras, there's that much of a difference. The experience is much more similar to using a 35mm SLR with split screen in terms of speed and accuracy. Beyond that, there is the benefit that the entire in-focus depth of field is clear at a glance, allowing far more controlled composition when using selective focus.

I'd guess that every liveview camera will have peaking in a year or two.

Jogger
Jogger Veteran Member • Posts: 8,441
m43 users arent missing much

For still image capture or planned single focus point video, the manual focus with xx zoom is still far superior in speed and accuracy.

The only time is useful is video capture and refocusing during a shot with a manual lens... with video, you have 8x less resolution (more margin for error) and if its a ENG type scenario, you dont need to be dead accurate as long as you get the shot.

 Jogger's gear list:Jogger's gear list
Sony RX100 Sony Cyber-shot DSC-RX10 Nikon D700 Nikon Df Nikon AF-S Nikkor 70-200mm f/2.8G ED VR +4 more
leafinsectman Contributing Member • Posts: 763
Re: How 'Focus Peaking' works

I can understand if it doesn't have a significant advantage for some people but it can't hurt to have an extra option.

I wonder if it will eventually be possible for the camera to take a shot once it detects focus on your selected area. For example, you specify an area (someone's face) and once the peaking mode detects focus on that area, the camera takes a shot.

-- hide signature --
Bernard Carns Senior Member • Posts: 1,228
I just bought a Marshall monitor to use with my GH2s and peaking

was one of the reasons I bought it.

Would be nice if Panasonic put it in a firmware update.

(But Panasonic doesn't seem to do that much).

Was nice when Canon added features to the 5d2 that users liked.

BC

 Bernard Carns's gear list:Bernard Carns's gear list
Canon EOS 5D Mark II Panasonic Lumix DMC-GH2 Canon EF-S 10-22mm F3.5-4.5 USM Canon EF-S 17-55mm f/2.8 IS USM Nikon AF Micro-Nikkor 60mm f/2.8D +3 more
TsfM Forum Member • Posts: 69
Re: How 'Focus Peaking' works

Thanks a lot for your explanation!

Bizzarrini Contributing Member • Posts: 521
Re: How 'Focus Peaking' works

That's the best explanation I've seen by far, thanks a lot! Do you think it would be possible to implement peaking in a FW hack, like the tester13 software? Perhaps we should ask Vitaly!

 Bizzarrini's gear list:Bizzarrini's gear list
Panasonic Lumix DMC-ZS7 Fujifilm FinePix X100 Panasonic Lumix DMC-GF1 Olympus PEN E-P2 Fujifilm X-Pro1 +23 more
OP _GUI_ Regular Member • Posts: 386
Which type of Focus Peaking marker do you like best?

Another example with the 2 type of Peakl Focus. As a user, which one would you prefer on your camera?

Edges

Zones

-- hide signature --
Michael J Davis
Michael J Davis Veteran Member • Posts: 3,675
Re: How 'Focus Peaking' works

TsfM wrote:

Thanks a lot for your explanation!

Yeah, me too!

It's a technology I hadn't been aware of being implemented, though it's a fairly obvious extension of the contrast AF system.

I use Hi-pass sharpening wih Photoshop, and you've just made me realise that I can use the technique to help beginners look at their approach to focussing - many thanks!!

Mike
--
Mike Davis
Photographing the public for over 50 years
http://www.flickr.com/photos/watchman

 Michael J Davis's gear list:Michael J Davis's gear list
Panasonic Lumix DMC-G1 Olympus OM-D E-M5 Panasonic Lumix DMC-GX85 Panasonic Lumix G Vario 14-45mm F3.5-5.6 ASPH OIS Panasonic Lumix G Vario 7-14mm F4 ASPH +5 more
Bilgy_no1
Bilgy_no1 Veteran Member • Posts: 4,880
Re: Which type of Focus Peaking marker do you like best?

Good stuff! I would prefer the 'edges' technology.

I saw some example videos that did not always convince me of the usefulness of the application in the NEX. The area of focus may be very large and cover up details, or there may be areas that are clearly at different distances to the camera both showing the focus confirmation (like the ball in your first post). But as another aid/tool, it's very welcome.

I believe you're right: it should be very easy to implement. The camera makes the calculations anyway, it's just a matter of displaying it.

GUI wrote:

Another example with the 2 type of Peakl Focus. As a user, which one would you prefer on your camera?

Edges

Zones

Andy Crowe Senior Member • Posts: 1,587
I vote for edge

I'd prefer edge to zones as it gives you a better idea of the points in focus. The Picture-in-Picture focus assist of the G3 also looks good, tho haven't had a chance to actually try it myself yet.

dennis tennis Veteran Member • Posts: 3,783
Re: I vote for edge

Peaking featuer in nex is handy. Some people here may forget about depth of field preview but it is basically DOF preview. IF you DOF is large, things other than your subject will be in forcus. Peaking will show you just that. Also, if your subject has no edges but you know that something is equal distance you can peak focus on the reference object. Again, nice to have it so you can decide if you want it to use it or not, instead of having the decision made for you. Unless of course, you believe that everything Oly and Pany do are in your best interest.

I have a different request for Oly. add the option to turn on IS as you are MF'ing. Oly DSLR have this option but of course they hide the IS button so that you can't use it easily AND you have to keep on pressing it. Make it a toggle.

duartix Veteran Member • Posts: 3,612
Re: How 'Focus Peaking' works

GUI wrote:

To illustrate how 'Focus Peaking' works I tried to reproduce the process in Photoshop. It is quite simple, so I see no reason why any mirrorless camera could not implement it, like the M4/3 system cameras .

Neither did I, 2 years ago.

http://forums.dpreview.com/forums/readflat.asp?forum=1041&thread=32667860&page=1

I did it in GIMP though.
--
Duarte Bruno

 duartix's gear list:duartix's gear list
Fujifilm FinePix F40fd Olympus PEN E-P1 Panasonic Lumix DMC-GH2 Olympus M.Zuiko Digital ED 14-42mm 1:3.5-5.6 Panasonic Lumix G Vario 14-42mm F3.5-5.6 ASPH OIS +4 more
duartix Veteran Member • Posts: 3,612
Re: How 'Focus Peaking' works

robertro wrote:

Beyond that, there is the benefit that the entire in-focus depth of field is clear at a glance, allowing far more controlled composition when using selective focus.

Yup, that's one that Photo people forget about. DOF control.
And anyone doing video would praise it!
--
Duarte Bruno

 duartix's gear list:duartix's gear list
Fujifilm FinePix F40fd Olympus PEN E-P1 Panasonic Lumix DMC-GH2 Olympus M.Zuiko Digital ED 14-42mm 1:3.5-5.6 Panasonic Lumix G Vario 14-42mm F3.5-5.6 ASPH OIS +4 more
Keyboard shortcuts:
FForum MMy threads