[ptx] where are PTStitcher layer masks computed?

Littlefields - Rik, Janis, Kyle & Peter rj.littlefield at computer.org
Mon May 3 16:48:05 BST 2004


Hi Pablo,

I will answer your questions in two separate emails.
This one is about increasing depth of focus.

Pablo d'Angelo wrote:

>>2. I do macro photography (insects at 1-10X on the film),
>>so I am interested in montaging for extended depth of focus.
>>    
>>
>
>Sounds interesting, but I haven't completely understood your application.
>
>So you're registring the images, and place the masks based on a focus
>estimate for each pixel? How do you estimate the focus?
>  
>
Yes, register first, then construct masks that expose the layer having
the best focus at each pixel.   I do not attempt to estimate focus,
only compare it.  That is, I do not ask "how out of focus is this
image?", but only "which image has the best focus (at this pixel
position)?"  I think the algorithm is not critical.  Right now I use
just variance in pixel values in small neighborhood.  One pass
over the images accumulates maximum variance and records the
image at which it occurs.  This works well in areas where some
image has good focus.  In background areas where no image has
good focus, this simple approach falls down because it systematically
selects the image with highest noise.  To attack that problem,
without doing too much damage in well-focused areas, it helps
to run a smoothing filter on the depth image.  It also helps to
feather the masks based on averaged depth.  No doubt more
sophisticated algorithms can do a better job, but I have the
impression that final image quality is determined much more by
source image quality & coverage than by algorithm.  I would
rather be faced with selecting a sharp image (from among many)
than fixing up a blurred one (the best of a few).

--Rik

>I know that some depth from defocus algorithms try to estimate the space
>variant PSF, that leads to the blurring, and try to reconstruct depth from
>it. Some algorithms can create superresolution images with less blur during
>this step as well.
>
>  
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.email-lists.org/pipermail/ptx/attachments/20040503/4947dcff/attachment.htm


More information about the ptX mailing list