POV-Ray : Newsgroups : povray.binaries.images : Autofocus macro *almost* done... : Re: Autofocus macro *almost* done... Server Time
1 Aug 2024 00:16:59 EDT (-0400)
  Re: Autofocus macro *almost* done...  
From: Edouard Poor
Date: 4 Mar 2009 03:30:01
Message: <web.49ae3b5b62bb2823bd47b0730@news.povray.org>
"triple_r" <nomail@nomail> wrote:
> "Edouard Poor" <pov### [at] edouardinfo> wrote:
> > I've been working on updating my 35mm Camera macros, and I had the idea to make
> > an autofocus version of the macro to help with complex objects and narrow
> > depths of field, and any other situations where choosing, say, the center of
> > the objects bounding box would give the wrong results.
>
> I like the idea.  My usual method is trial and error.  How does it choose?  Does
> it trace?  What happens if the object has holes?  What if there is no central
> subject?

Yeah - I work in a spiral from the center of the image outwards, doing a trace
at each point. The ones that hit the object get stored in an array. After I've
finished the spiral, I sort the array based on distance from the camera and
choose the value at 25% (the, umm, median of the first half - which I presume
has some statistical name that I either never knew, or long since forgot...).

I need to add some fallback code for when the spiral and the object don't
connect. Something involving the same trick, but aimed at the center of the
objects bounding box. Or something like that.

I'm now much more impressed by my point-and-shoot camera with it's auto-focus
face detection stuff. It all sounds easy until you actually have to write the
code... :-)

Attached is another couple of images that were rendering in the background. On
this model at least, I'm pretty happy with the results so far.

Cheers,
Edouard.


Post a reply to this message


Attachments:
Download 'autofocus-2.jpg' (101 KB)

Preview of image 'autofocus-2.jpg'
autofocus-2.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.