Correcting uneven lighting of macro photographs

Explorer ,
Nov 19, 2020

Copy link to clipboard

Copied

I am taking a sequence of macro photos with an identical setup (magnification, lighting etc) - scanning over a print surface in a book in order to composite them (~ 200 photos) into a single image. But the lighting achievable in the arrangement is not even (using LED lamps on goose-necks), creating artefacts in the image.  So I want to take an initial macro photo of a white sheet and divide that pixel by pixel into each macro photograph to normalise the lighting before compositing.

There is a lot of useful advice on doing this manually, but an automatic completely reproducable method is required for this application.

Advice gratefully received.

Thank you

Win10 64 bit Adobe Photoshop Version: 22.0.0 20201006.r.35 2020/10/06: 4587a1caa63 x64

TOPICS
How to, Windows

Views

63

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Correcting uneven lighting of macro photographs

Explorer ,
Nov 19, 2020

Copy link to clipboard

Copied

I am taking a sequence of macro photos with an identical setup (magnification, lighting etc) - scanning over a print surface in a book in order to composite them (~ 200 photos) into a single image. But the lighting achievable in the arrangement is not even (using LED lamps on goose-necks), creating artefacts in the image.  So I want to take an initial macro photo of a white sheet and divide that pixel by pixel into each macro photograph to normalise the lighting before compositing.

There is a lot of useful advice on doing this manually, but an automatic completely reproducable method is required for this application.

Advice gratefully received.

Thank you

Win10 64 bit Adobe Photoshop Version: 22.0.0 20201006.r.35 2020/10/06: 4587a1caa63 x64

TOPICS
How to, Windows

Views

64

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 19, 2020 0
Adobe Community Professional ,
Nov 19, 2020

Copy link to clipboard

Copied

Without seeing your exact setup, I can almost guarantee you that fixing the lights to begin with, will take you fractions of the time you'll spend fixing it later.

 

Yes, the "white sheet" inverse mask idea sounds intriguing, but it never works out in practice. There are too many nonlinearities and irregularities that will inevitably throw it off, and you'll end up correcting them individually in any case.

 

If you have uneven lighting, there are two things to do. First, move the lights further away. Second, diffuse the light.  Which one (or both) depends on the circumstances.

 

Assuming a book spread with spine, it often makes good visual sense to use diffused light from "above", that is to say, from the upper edge. That usually looks very natural and gives nice soft shadows. If you can't use flash and a large soft-box, a thin sheet of white fabric will work well. Set the light at approximately 45 degrees angle up.  Put a reflector at the bottom edge.

 

The point is that it always pays off to spend time setting up the lights. It will save you much more time later.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 19, 2020 0
Explorer ,
Nov 19, 2020

Copy link to clipboard

Copied

Thank you. 

I agree about the need to develop the best lighting arrangement to start with.  I spent about 2 days canabalising a ring flash by adding a light sleeve to achieve ca 5-10% variation of light distribution across the frame when photographing flat (+/- 0.2 mm the depth of focus required) prints.  But that still produces some banding. Unfortunately when dealing with these books which can be opened only ca 120 degrees, the light sleeve fouls the upstanding part of the volume.  If I try to open the volume wider, the print curves up and cannot be flattened  sufficiently with the magnetic supports I have constructed. Some of the significant data is within 2 mm of the binding. So I have been using the LED lamps at 45 degrees parallel with the spine which by careful placement produces ca 10% variation, but not good enough.

 

Apparently (as I found online) "More expensive dedicated microscopy cameras such as the Nikon DXM1200 and ProgRes C14 have a function in their image acquisition software known as “white shading correction” to reduce the problem of vignetting. This works by taking a photograph of a blank (white) image and subtracting or dividing it pixel by pixel from the image to be corrected."

You have made me think more laterally - to construct a translucent plate attached to the filter ring of the lens, then illuminated from above. But I still feel that the inability to get illumination through the upstanding cover will increase lighting variation, top to bottom of the frame.  So both physical and software adjustments may be needed.

Any ideas?

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 19, 2020 0
Adobe Community Professional ,
Nov 19, 2020

Copy link to clipboard

Copied

OK. Sounds like a quite tricky setup. My advice would still be to spend whatever time is needed to get the lights right. I'd probably still go for directional diffused soft light, which will also keep it out of the way of the lens (if you're getting really close).

 

A vignette is something quite different from uneven lighting. The vignette is in the camera/lens system, not outside it like the lighting is. It's orders of magnitude easier to correct. The problem with uneven lighting is that it's not necessarily a linear adjustment. Usually you need to apply a special curve, and getting that curve right, to cover all the various contrast ratios, is not easy. Not worth the effort, if you ask me.

 

If you can't open the book fully, you have an additional problem: reflections from the opposite page, now standing upright and acting like a reflector. In those cases I usually put a black cardboard over it, from the spine out.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 19, 2020 0
Adobe Community Professional ,
Nov 19, 2020

Copy link to clipboard

Copied

Just to add that it is possible - if the book doesn't get damaged - to keep it flat with a clean glass plate. Obviously that reflects like heck, so then you need to use cross-polarizing. That's a polarizer on the lens, and a sheet of polarizing film over the lights. When these are rotated at 90 degrees relative to each other, nearly 100% of surface reflections are killed, even from glass. This has max efficiency at a 60 degree angle from lights to object to lens.

 

Even so, you need to be careful and shield as much light as possible in the room. But it can work.

 

(polarizing film melts in the heat of tungsten lights, so flash is recommended)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 19, 2020 0
Explorer ,
Nov 19, 2020

Copy link to clipboard

Copied

Thank you.

The source of my quote is  https://jcp.bmj.com/content/56/8/619.full  They were trying to deal with all the sources of vignetting, from uneven filament in the bulb to inadequate sensors in the camera. Their method ended up with a short Photoshop macro, but assumed a random, but uniform, lightness of the original object, which mine is definitely not.

You are right, a curve doesn't hack it.  The method needs to identify all those irregularities in the illumination coverge across the frame and deal with them. 

Yes, stray reflections are a problem and a black non-reflector around the frame area certainly helps, which is what the light sleeve added to.

Presumably, there isn't a Photoshop "filter" that does this job at pixel level.

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 19, 2020 0
Explorer ,
Nov 20, 2020

Copy link to clipboard

Copied

I have found a method.

I photographed a white card with the standard lighting (rather distorted).

I then photographed the object, which I made the backgound layer in Ps.

I added the white card image as a layer and chose it.

Then I chose Blend> Divide, which removed the distorted lighting. When I calculated the division expected for each of R G B values at one pixel position in the Blended image, the numbers worked out right.

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 20, 2020 0