Lens correction filter when using microscope objectives

A forum to ask questions, post setups, and generally discuss anything having to do with photomacrography and photomicroscopy.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

santiago
Posts: 109
Joined: Tue Sep 25, 2018 5:56 am
Location: Nijmegen, The Netherlands

Lens correction filter when using microscope objectives

Post by santiago »

How to correctly apply lens correction to an image that was produced with a microscope objective?

For example, Photoshop features a "Lens correction" filter that allows you to choose from several predefined lens profiles, camera make, model, etc. As expected, there are no profiles for my two microscope objectives (Mitutoyo 20x/0.42 and Nikon 10x/0.25). Does anybody know if there are profiles that "come close" to these two objectives, used on a Canon 5DII?

There's also a "Custom" tab where you can manually correct geometric distortion, CA, vignetting, vertical & horizontal perspective, etc. using sliders. Which would be the parameters to be taken into account when using these controls?

Lastly, if I apply lens correction to a series of images before stacking them, will the correction survive the stack? (For example, settings like x/y/scale alignment impact the final image noticeably.) Or should the correction be applied after a stack? Or maybe there's no point in applying lens correction at all for stacks?

(Just asking out of sheer curiosity.)

Thanks in advance!

EDIT: my question is more about geometric correction (i.e. perspective distortion) and not so much about color correction.
Santiago
Flickr

santiago
Posts: 109
Joined: Tue Sep 25, 2018 5:56 am
Location: Nijmegen, The Netherlands

Post by santiago »

I can also shoot a grid and then tweak the distiortion manually...
Santiago
Flickr

rjlittlefield
Site Admin
Posts: 23599
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

santiago wrote:I can also shoot a grid and then tweak the distiortion manually...
I would do it that way.

As for correcting before versus after stacking, in theory it's better to do before. The stacking procedure assumes that images can be aligned by a linear transform: scale/rotate/shift. If the underlying images are distorted, and two images are significantly misaligned to start, then in fact they cannot be re-aligned by linear transform so the assumption is violated.

In practice, I suspect that it does not matter much. This is because (A) the question is very seldom asked which suggests to me that people are not having problems, and (B) I have personally processed stacks where the amount of barrel distortion changed significantly from one end of the stack to the other, and the resulting stack came out fine with no special handling. I expect the reason is that most stacks have only mild misalignments so that the distortions have only very small second-order effects.

--Rik

santiago
Posts: 109
Joined: Tue Sep 25, 2018 5:56 am
Location: Nijmegen, The Netherlands

Post by santiago »

Ok, thanks for the information. I would have thought that in theory it would be better to correct after stacking. Since applying correction prior to stacking will not improve the alignment of the frames nor make the stack any "better", and the images still need to get stacked, resulting in some more distortion, why bother?

I would think that if I was to apply lens correction it could only be after the image has experienced all the necessary transformations needed for stacking. Once I know that the image will not change anymore, then I could do a final "distortion check".

rjlittlefield wrote:I expect the reason is that most stacks have only mild misalignments so that the distortions have only very small second-order effects.
Completely agree. These distortions are almost negligible (for me at least they are!). My original question was just out of curiosity...
Santiago
Flickr

rjlittlefield
Site Admin
Posts: 23599
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

santiago wrote:Since applying correction prior to stacking will not improve the alignment of the frames
Now I'm curious -- where did you get the idea that it would not improve the alignment?

As a thought experiment, consider a lens with barrel distortion, and two frames that are severely misaligned so a straight line on the subject runs through the center of one frame but near the edge of the other. In the first frame, the line that runs through the center of the frame still images as straight. But in the second frame, the line that runs near the edge of the frame gets imaged as curved. Without correcting for the distortion before stacking, you're asking the stacking software to match a straight line against a curved one. It's not going to do that job! But with correction, the curved line near the edge becomes straight also, and then the stacking software can do what it's designed to do.
rjlittlefield wrote:I expect the reason is that most stacks have only mild misalignments so that the distortions have only very small second-order effects.
As an example of this reason, now consider the above situation where the misalignment is minor, so that the straight line on the subject runs near the edges of both frames. Then in both frames it will render as curved, but the curves will be slightly different. If the minor misalignment leads to an insignificant difference in shape, then you're still good to go with stacking before correction.

--Rik

santiago
Posts: 109
Joined: Tue Sep 25, 2018 5:56 am
Location: Nijmegen, The Netherlands

Post by santiago »

rjlittlefield wrote:you're asking the stacking software to match a straight line against a curved one. It's not going to do that job! But with correction, the curved line near the edge becomes straight also, and then the stacking software can do what it's designed to do
Sure, no doubt about that, it should definitely improve the alignment!
rjlittlefield wrote:If the minor misalignment leads to an insignificant difference in shape, then you're still good to go with stacking before correction
This is what I was referring to. In practice, the misalignments are so minor that no correction prior to stacking is ever needed...
Santiago
Flickr

Post Reply Previous topicNext topic