Jump to content

Towards an explanation of the Italian Flag Phenomenon


Lindolfi

Recommended Posts

Advertisement (gone after registration)

Several threads have been produced concerning the italian flag phenomenon, but none have been able to give a satisfying explanation of this effect.

 

I'm starting this thread with the only purpose of finding such an explanation. Other discussions in this thread should be avoided in order to keep momentum in the direction of an explanation.

 

Let's first look at the cleanest example possible: images taken with a non-shiny opaque white sheet of plastic in front of a wide angle lens. Both presented here are from the 21/2.8 Elmarit ASPH at f/16. The first one is not coded and the second one is coded as an 21/2.8 Elmarit ASPH. The images are taken at 160 ISO and with an exposure compensation of +2 stops, lens distance ring turned to infinity. No postpressing other than loading in LightRoom 3.4.1. Light from overcast clouded sky.

 

21at16nocode.jpg

not coded

 

21at16coded.jpg

coded

 

First you can see the excellent job this firmware (1.138) does in correcting the italian flag phenomenon and it takes care of some (fortunately not all) vignetting.

 

Secondly, you can see that the italian flag phenomenon is not red-white-green from left to right, but from left lower corner to right upper corner.

 

Thirdly the true discolouration is not red, but magenta (lack of green) lower left corner and cyan/green (lack of red) upper right corner.

 

Now what we know is the following (looking along the path of the light rays):

 

1] Any colour change from the optics (lens only) should be rotational symmetric around the optical axis, so although the lens produces the angle of incidence on the sensor, it does not produce the change in colour we see in the italian flag phenomenon.

 

2] There is a cover glass on the sensor that takes care of IR filtering, which is quite thick (1 mm). This cover glass disperses a white ray of light consisting of different wavelengths (colours) to slightly different positions on the sensor. This effect increases at an increasing obliqueness of the rays. However, this effect also is rotational symmetric around the optical axis. Moreover, rays that are neighbours of the rays we look at simply add up to the full spectrum of white light. So the chromatic dispersion of the cover glass on its own (!) can not be responsible for the observed discolouration.

 

3] There are microlenses on top of the pixels of the sensor that are shifted (increasingly towards the edge of the sensor) relative to the pixels in the direction of the center of the sensor, to be able to catch sufficient lightrays from wide angle lenses. When it is assumed that this shift is rotational symmetric around the optical axis, this shift can also not be responsible for the oberved phenomenon. This is even true when these microlenses themselves have chromatic aberration.

 

4] The sensor consists of pixels that are sensitive to three different overlapping bands of the visible spectrum: red, green and blue. These pixels are arranged in a Bayer pattern in which there are two times as many green pixels than either blue or red sensitive pixels. In principle when you have an even number of pixels along the length of a sensor, the pattern is asymmetric, since you may start with a red/green pair at the left edge and you end up with a green/blue pair at the right edge of the sensor. But this asymmetry extends only over 1 only one pixel and so the changes of colour over larger distances can not be explained with it. Moreover, the algorithm that calculates the rgb components of one image pixel in the produced image uses a weighted combination of red, green and blue sensor pixels.

 

 

So we are left without an explanation. The effect may be produced by a combination of properties of the cover glass, micro lenses, sensor and algorithm. But how exactly?

 

 

So let us look at some observations:

 

a] According to some observers, the italian flag phenomenon is known from sensors without micro lenses, so perhaps we can exclude them from an explanation.

 

b] There is a relation with focal length and not with the place on the sensor, so the angle of incidence of the lightrays is certainly a necessary condition of the phenomenon.

 

 

Some observations I would like to see filled in:

 

i] If you take the area covered by the M8 sensor out of an M9 image, using the same lens, and you use no coding, do you get the same amount of colour change? I have no M8, so can not do the test. I'm asking this to see what the effect is of the thickness of the cover glass.

 

ii] What are clear examples of italian flag phenomenon in other digital sensors than M9 and M8. What do these sensors have in common?

 

Michael J. Hußmann (user mjh) has repeatedly stated that no explanation has been given. So can we do better?

Edited by Lindolfi
  • Like 1
Link to post
Share on other sites

I briefly recall my own hypotesis about the italian flag pattern, exposed (4th of june) in the firmware thread:

 

http://www.l-camera-forum.com/leica-forum/leica-m9-forum/180157-m9-firmware-upgrade-few-days-3.html#post1724372

 

I'm not sure about the thesis that, given the asymmetrical (anisotropical in some sense) Bayer pattern tipical of the sensor, it does matter only at the local pixel level and, such, can not be responsible for the Italian Flag Pattern, which seems to be an integral effect.

 

The fact that the image pixel RGB assignment algorithm, applied to raw sensor data, uses a weighted sum can't do much if a large incidence angle wrt normal-to-sensor-surface vector is implied. Weights are presumably calculated wrt certain angles coming from the lens, which are different for different lenses. The fact that a much better correction in color shift is obtainable, e.g. for the CV UWHeliar 12mm / ZM distagon 15mm if You set up their correction as a 21mm (old type) Leica WA, than that obtainable coosing the 16mm Tri-Elmar, (may be) can say something.

 

A demonstration about these observed facts is welcome, but I would expect the use of Fourier Optics and Vector Field Analysis to a significant extent

  • Like 1
Link to post
Share on other sites

Thanks sydkugelmass. Indeed you expect that the needed correction is not only related to focal length, but also to the optical design, more specifically to the location of the back principal plane: if it is located further from the sensor, less correction is needed.

 

This effect has nothing to do with the Bayer pattern and its asymmetry, only with the angle of incidence of the light rays.

Link to post
Share on other sites

This effect has nothing to do with the Bayer pattern and its asymmetry, only with the angle of incidence of the light rays.

I like this thesis.

 

I would like its mathematical demonstration even more than the thesis itself.

 

May be this demonstration can be given in detail so that apodyptical assumptions can be thoroughly excluded?

 

Why no vertical median plan symmetry exists in the phenomenon?

 

Why the phenomenon presents itself with a lower-left-magenta/upper-right-cyan shift character?

 

By the way: on the M6, using film, no problem exists about color shift with the same optics cited before. Why?

 

Is out there something wrong not in structural facts about using a Bayer pattern sensor, but, much more simply, in a trickier-than-desirable implementation of the correction algorithm as given by the M9?

Link to post
Share on other sites

You lifted that sentence out of its context, sydkugelmass, so let me clarify: This effect (the fact that you need correction not quite in line with focal length only) has nothing to do with the Bayer pattern and its asymmetry, only with the angle of incidence of the light rays.

 

But so far I agree with the direction in which you point when looking for an explanation of the Italian Flag Phenomenon: a combination of the algorithm and the Bayer pattern. But we still have no explanation.

 

The fact that the flag is oriented along a diagonal as I have shown (rather than left-right) may be meaningful as well as the wavelengths missing from the white light in both diagonal corners.

Link to post
Share on other sites

I have written software to simulate any optical design as long as I have the glass type per element, both radii of curvature and location. (click for a dutch article on that), but I lack the data and software for the sensor, microlenses and cover glass.

Link to post
Share on other sites

Advertisement (gone after registration)

The experimental setup is very nice in that it appears to be repeatable and in that it reduces the image in question to a very simple case. However, one instance of the defect might be a bit difficult to debug. I would like to suggest some further experimentation with the original setup:

 

- Is the defect repeatable if you unmount and remount the same lens to the same body?

- How does it change with different apertures?

- How does it change with different distances between lens and sensor?

- How does it change with different instances of the same camera type?

- How does it change with different instances of the same lens type?

 

Also, a way of quantitatively discussing the defect would be nice. For instance, you could take profile lines of different cross sections using a tool such as the ImageAnalyzer.

Link to post
Share on other sites

I have written software to simulate any optical design as long as I have the glass type per element, both radii of curvature and location. (click for a dutch article on that), but I lack the data and software for the sensor, microlenses and cover glass.

 

We are starting our considerations from not so different points. The conclusions could be coincident. I completely agree with your observation about the morphology of the distribution of the phenomenon wrt the image color content. Having a good simulation program for the optical part, in our problem, may be very good but could require a model-level integration of the 'sensor' structure, taking in account the observational fact that what happens on film is different from what happens on the sensor, using the same lens.

Link to post
Share on other sites

 

- Is the defect repeatable if you unmount and remount the same lens to the same body?

- How does it change with different apertures?

- How does it change with different distances between lens and sensor?

- How does it change with different instances of the same camera type?

- How does it change with different instances of the same lens type?

 

Also, a way of quantitatively discussing the defect would be nice. For instance, you could take profile lines of different cross sections using a tool such as the ImageAnalyzer.

 

Thanks Pop. I will handle the first three items and produce tint and brightness curves over the diagonal. Can't handle the 4th and 5th item due to the fact that I have only one M9 and one 21/2.8 asph here...

 

Hopefully such data is useful for coming up with an explanation of the Italian Flag Phenomenon.

Link to post
Share on other sites

Sydkugelmass,

 

"apodyptical": I thought I had a decent vocabulary, but this beats not only me but also every dictionary I have access to. Google found me only one instance, in a message clearly written by someone who wasn't a native speaker of English.

 

Did you make it up, or what word did you really mean?

Link to post
Share on other sites

Sydkugelmass,

 

"apodyptical": I thought I had a decent vocabulary, but this beats not only me but also every dictionary I have access to. Google found me only one instance, in a message clearly written by someone who wasn't a native speaker of English.

 

Did you make it up, or what word did you really mean?

 

Comes from ancient Greek: apò-deiknumi. An unproofed statement given as soundly proven. I hadn't to use Google nor Wikipedia. It comes from the far past. Have found many mistakes in my English? Please help to correct.

 

Btw: We are Off Topic.

 

Errata corrige: apodictical. Greek verb deiknumi does not generate any 'y' when transposed in English. You're right.

Edited by sydkugelmass
  • Like 1
Link to post
Share on other sites

Here are the graphs of the two test images I placed in the first post, with luminance and cyan-magenta content along the diagonal from lower left corner to upper right corner: luminance of 1 is maximum, a cyan-magenta of 0 is no discolouration.

+1 is only magenta, -1 is only cyan.

 

L1017614.png uncoded

 

L1017613.png coded

 

Software was written in MatLab, calculated over 16 bit images. You can see that the magenta-cyan discolouration in the uncoded image is very pronounced and steady changing from magenta to cyan. With coded lens there is some magenta residue in the both diagonal corners. Vignetting is about halved.

 

Next step: variation in f-stop to see what it does with the Italian Flag Phenomenon.

Edited by Lindolfi
  • Like 1
Link to post
Share on other sites

Here is the series of analyses of the uncoded images with the 21/2.8 asph mounted on the M9 set to infinity at various apertures and uncoded

 

L1017616.png at f/16

 

L1017617.png at f/11

 

L1017618.png at f/8

 

L1017619.png at f/5.6

 

L1017620.png at f/4

 

L1017621.png at f/2.8

 

And here is the analysis of the coded series

 

L1017622.png at f/16

 

L1017623.png at f/11

 

L1017624.png at f/8

 

L1017625.png at f/5.6

 

L1017626.png at f/4

 

L1017627.png at f/2.8

 

Conclusion: The Italian Flag Phenomenon becomes slightly stronger when aperture is openened. The corrected image shows a similar trend, which could mean that the firmware does not use the estimated aperture as a variable for the correction, but a standard correction is applied separately for each coded lens, but independent of aperture.

Edited by Lindolfi
Link to post
Share on other sites

Here's a set of graphs on the very first uncoded sample in post 1. Each graph shows the brightness of each color along a straight line in the image:

 

Along the vertical middle axis:

Welcome, dear visitor! As registered member you'd see an image here…

Simply register for free here – We are always happy to welcome new members!

 

Along the horizontal middle axis:

 

Diagonal from top left to bottom right:

 

Diagonal from bottom left to top right:

Edited by pop
  • Like 1
Link to post
Share on other sites

Interesting Pop, but from the RGB values it is hard to see the discolouration, since it is the relation between the colours. Therefore I decided to derive the luminance and the magenta-cyan axis from the rgb data. From your graphs you can see it from the way rgb curves cross each other. You also show that the left bottom to top right effect is the largest. Left bottom green curve below and top right red curve below the others. Interesting.

Edited by Lindolfi
Link to post
Share on other sites

Since the image is supposed to be a neutral and featureless grey area, I personally find it much easier to see the behavior of the three components across the image when graphed this way. Where all three lines coincide, you have a neutral grey. You can see that each color "vignettes" with its own peculiar gradation and that the gradations do not share a common center; however, the curves are quite similar in shape.

 

@the more mathematically savvy members: Can anyone discuss the individual lines in those graphs? Are those circle segments or what, and what are their apparent parameters?

Edited by pop
Link to post
Share on other sites

Several comments (none should be taken as really negative or critical):

 

1. Red edge. I'm just including that term since it is the one most commonly used on this forum for this problem, and now this thread will show up in a search for "red edge." ;)

 

2. The one thing (almost) certain about this problem is that it is variable. Some cameras show it, others don't; some show it with some susceptible lenses and not with others. Your results look very similar to what I get with a coded NON-ASPH 21 f/2.8 - but I've tried at least one ASPH 21 f/2.8 that showed a lot less color shift that your example. And my M9 tends to NOT show the cyan shift top and right in most cases.

 

That raises the question of how much we can tell from an analysis of ONE lens on ONE camera.

 

3. I'm glad you point out that it is really a magenta/cyan issue - although obviously the exact color shift varies with subject matter and/or WB. I see it most often in blue sky, and since sky already contains blue, the blue component of the magenta shift tends to be less obvious (blue + blue = blue), and the "red" part of the magenta is what remains as noticeable.

 

4. You quote mjh as saying no explanation has been given. True, in terms of a final and definitive explanation. However, many theories have been proposed - most of them not yet absolutely ruled out. The inherent asymmetry of the Bayer pattern (which Leica themselves mentioned in passing as something they were looking into); imperfect centering of sensors on installation, or of some lenses - and so on.

 

At first, I wasn't fully persuaded that the Bayer pattern, with just a one-pixel physical separation of red/green or red/blue (diagonally) could produce a color shift area over a hundred pixels wide. With more thought, I see that it would work as a cumulative bias towards one color or the other. And expect it is at least part of the explanation.

 

At this point, I've decided to quit worrying about it. It isn't something I can fix on my own (in terms of hardware and the original image - yes, I can fix it after the fact). I'm just waiting to see how well the upcoming firmware improves things.

Edited by adan
  • Like 1
Link to post
Share on other sites

Andy,

You do understand I was just joking….. but, as for myself, I have never seen it.

I have seen what I would call ‘’normal’’ red edge with some lenses and not with

others of the same focal length. Why, I dunno why, but I create a profile for those

that do and It’s fine. Beats me! Cheers.

Link to post
Share on other sites

What I gather from the above is that it seems that something is gradually diminishing red in the upper right corner, causing a shift to cyan, and something is gradually diminishing green in the lower left corner, causing a shift to magenta. That something isn't present in film cameras, so it has to be present in or on the digital sensor. It may be the structure of the pixels or some aspect of the cover glass or both. It may be an unavoidable consequence of trying to correct for worse problems, i.e. a necessary design by-product. Or it may be an unfortunate design flaw. Without an official explanation, we can only guess at the cause. I suspect that engineers who are responsible for the sensor have a pretty good understanding of the cause.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...