How to find the % APL of a particular scene? - AVS Forum
Forum Jump: 
 
Thread Tools
Old 12-09-2006, 07:47 AM - Thread Starter
AVS Special Member
 
Gary Lightfoot's Avatar
 
Join Date: Jun 2000
Location: Surrey, UK
Posts: 4,515
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 43 Post(s)
Liked: 47
It's said that that high on/off CR helps give better depth in lower APL scenes and that most average scenes are around 20% APL.

One of the most 3 dimensional images I've ever seen was on a Sim2 C3X and that was a scene from Gladiator when Maximus was in the forrest with a wounded shoulder (IIRC) after they had attempted to kill him.

I'll grab a capture form the DVD to show the scene and se if it can be calculated to find the APL of that particular scene.

I've also seen some very 3 dimensional images from CRTs but they appeared brighter than I would have thought a 20% APL would have returned, so I wonder if that's more related to other elements that make an image appear to have more depth.

Gary

Quote:
Originally Posted by elmalloc
Who says Cameron is "right" and why do we care about him so much - lol!

I trust Gary Lightfoot more than James Cameron.
Gary Lightfoot is offline  
Sponsored Links
Advertisement
 
Old 12-09-2006, 09:45 AM
AVS Club Gold
 
Bear5k's Avatar
 
Join Date: Feb 2006
Location: Houston, TX
Posts: 2,239
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
APL (average picture level) can be found by determining the picture level of each pixel, and then averaging across all pixels in an image. It is as tedious as it sounds, and I only do it when creating test patterns, but you can follow this recipe if you are a masochist, er, um, curious:

1) Convert Component video values into RGB values using the appropriate matrix for the standard your are using (e.g., 709 for HD) to eliminate out-of-gamut values
2) Normalize all RGB values for each pixel based upon the reference levels used (e.g., Video levels are 16 - 235).
3) Determine the white level contribution for each channel based upon the "mix" defined for that standard (e.g., for HD: red is 21.26%, Green is 71.52% and Blue is 7.22%).
4) Average across all pixels.

Thus, a 100% red image, with green and blue at reference black, would have an APL of ~21%.

Bill

Color accuracy evangelist and CalMAN insider
Bear5k is offline  
Old 12-09-2006, 10:02 AM - Thread Starter
AVS Special Member
 
Gary Lightfoot's Avatar
 
Join Date: Jun 2000
Location: Surrey, UK
Posts: 4,515
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 43 Post(s)
Liked: 47
Thanks for the reply Bill.

OK, so that's the easy way. Is there a program that can do it for you that will be a bit quicker using a .bmp from a screen capture (using PowerDVD for example)? It sounds like doing that for nearly a million pixles from a 720 image could be a tad time consuming!!



Gary

Quote:
Originally Posted by elmalloc
Who says Cameron is "right" and why do we care about him so much - lol!

I trust Gary Lightfoot more than James Cameron.
Gary Lightfoot is offline  
Old 12-09-2006, 12:18 PM
AVS Club Gold
 
Mark Petersen's Avatar
 
Join Date: Dec 2000
Posts: 4,671
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 11
You may want to PM Stacey Spears. He has posted images in the past with luminance histograms so I assume he has a program to do exactly what you describe. I'm too lazy to write a program to do something like this, so if you find a tool that does it please let us know.
Mark Petersen is offline  
Old 12-09-2006, 01:41 PM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Gary Lightfoot View Post

I'll grab a capture form the DVD to show the scene and se if it can be calculated to find the APL of that particular scene.

If you post the image, I will calculate not only its APL, but also its contrast ratio and average luminance as it would theoretically appear on any particular display, according to its on/off CR, ANSI CR, and gamma. I have done it before.
Erik Garci is offline  
Old 12-09-2006, 01:55 PM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Gary Lightfoot View Post

Is there a program that can do it for you that will be a bit quicker using a .bmp from a screen capture (using PowerDVD for example)?

Photoshop can show a histogram, and it includes the Mean value. To calculate the APL, just divide the Mean by 255.
Erik Garci is offline  
Old 12-09-2006, 04:41 PM - Thread Starter
AVS Special Member
 
Gary Lightfoot's Avatar
 
Join Date: Jun 2000
Location: Surrey, UK
Posts: 4,515
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 43 Post(s)
Liked: 47
Thanks guys you've been very helpfull.

I've enclosed a grab using PowerDVD, but I'm not convinced that all of the values will be correct. When I've tried to grab some images from Avia, the values appear stretched, so black is 0 rather than 16, and white is 255 rather than 235. Using TheaterTek and the print screen function tends to grab images more accuarately and return values that you'd expect.

On your suggestion Eric, I tried Paint Shop Pro and that has a similar function to Photoshop. The average lightness of this particular scene was 42%. The RGB mean values when added together and divided by 3 came to 40%.

If you can see what results you get, or if you can capture the same scene from the DVD and get more accurate results, that would be better though. Other than TT and the print screen function, are there any other programs that get accurate screen grabs?

Thanks again

Gary
LL

Quote:
Originally Posted by elmalloc
Who says Cameron is "right" and why do we care about him so much - lol!

I trust Gary Lightfoot more than James Cameron.
Gary Lightfoot is offline  
Old 12-09-2006, 05:48 PM
AVS Club Gold
 
Mark Petersen's Avatar
 
Join Date: Dec 2000
Posts: 4,671
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 11
Quote:
Originally Posted by Erik Garci View Post

If you post the image, I will calculate not only its APL, but also its contrast ratio and average luminance as it would theoretically appear on any particular display, according to its on/off CR, ANSI CR, and gamma. I have done it before.

Erik, this could be really useful for the low, mid and high apl test pattern that is discussed in this thread:

http://www.avsforum.com/avs-vb/showthread.php?t=761806

What we could do is find 3 images that we think are good repesentative examples of low, mid and high APL movie scenes. Then crunch the numbers to get specific APL values for each and then design 3 test patterns that achieve those APL values but do so by varying the size of the full white checkerbox(es).
Mark Petersen is offline  
Old 12-09-2006, 05:53 PM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
In Photoshop's histogram, I got...
38.30/255=15.02% Mean Luminosity
31.64/255=12.41% Mean Red
38.99/255=15.29% Mean Green
52.19/255=20.47% Mean Blue

Then I used Photoshop to convert it to a grayscale image, and I got...
39.99/255=15.68% Mean (which is slightly different from Mean Luminosity above)

The grayscale image's levels range from 0 to 237 (out of a maximum possible range of 0 to 255).

I exported the grayscale histogram values from Photoshop and copied them into a spreadsheet.

I entered the following display parameters into the spreadsheet.
4000:1 on/off CR
500:1 ANSI CR
2.5 gamma

The spreadsheet calculated the following values.
2.6% average luminance
0.0341% luminance for level 0
83.86% luminance for level 237
2460:1 CR (level 237's luminance to level 0's luminance)
Erik Garci is offline  
Old 12-09-2006, 10:26 PM
AVS Club Gold
 
Bear5k's Avatar
 
Join Date: Feb 2006
Location: Houston, TX
Posts: 2,239
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Erik Garci View Post

Photoshop can show a histogram, and it includes the Mean value. To calculate the APL, just divide the Mean by 255.

Since I tend to calibrate pretty tightly around 235, I use 235 for video levels for normalizing my data. However, 255 is absolutely correct for PC levels.

Bill

Color accuracy evangelist and CalMAN insider
Bear5k is offline  
Old 12-10-2006, 05:27 AM - Thread Starter
AVS Special Member
 
Gary Lightfoot's Avatar
 
Join Date: Jun 2000
Location: Surrey, UK
Posts: 4,515
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 43 Post(s)
Liked: 47
Hi Eric,

Interesting results. The photoshop and Paint Shop Pro results appear similar, so hopefully I should be able to extract similar info if I needed to in the future.

Is the spreadsheet you used in the public domain? I've recently been using your ANSI spreadsheet which I found very interesting and informative and a great tool to help with using my rooms measured ANSI to see what results I would get with other projectors in my room. Fascinating stuff!

And to bear with me, what is the overall APL of that scene? Is it around 15%? If so, then that's a lot lower than I expected to see considering the image was being projected by a C3X with similar ANSI and on/off to the display values you used. I would have expected it to be a lot higher since the depth of field I saw with it was what I would have expected to see in a high APL scene for a higher ANSI capable display. It looks like it was a scene more suited to a high on/off low ANSI display like a CRT for the amount of image depth I was seeing. At least that train of thought seems to be currently considered true, but these results seem to say the opposite, unless I'm missunderstanding the results.

Thoughts?

Thanks.

Gary

Quote:
Originally Posted by elmalloc
Who says Cameron is "right" and why do we care about him so much - lol!

I trust Gary Lightfoot more than James Cameron.
Gary Lightfoot is offline  
Old 12-10-2006, 10:09 AM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Gary Lightfoot View Post

Is the spreadsheet you used in the public domain? I've recently been using your ANSI spreadsheet which I found very interesting and informative and a great tool to help with using my rooms measured ANSI to see what results I would get with other projectors in my room. Fascinating stuff!

It's an Excel spreadsheet that I made. I might eventually convert it into a web page that includes a few sample images.
Quote:
Originally Posted by Gary Lightfoot View Post

And to bear with me, what is the overall APL of that scene? Is it around 15%?

Yes, its APL is around 15%. It varies somewhat depending on how red, green, and blue are weighed to convert it to a grayscale.
Quote:
Originally Posted by Gary Lightfoot View Post

If so, then that's a lot lower than I expected to see considering the image was being projected by a C3X with similar ANSI and on/off to the display values you used. I would have expected it to be a lot higher since the depth of field I saw with it was what I would have expected to see in a high APL scene for a higher ANSI capable display. It looks like it was a scene more suited to a high on/off low ANSI display like a CRT for the amount of image depth I was seeing. At least that train of thought seems to be currently considered true, but these results seem to say the opposite, unless I'm missunderstanding the results.

If I enter these CRT-like parameters...
Infinite on/off CR
120:1 ANSI CR
2.5 gamma

then the spreadsheet calculates...
2.06% average luminance
0.0346% luminance for level 0
83.31% luminance for level 237
2409:1 CR

These results are very similar to the ones with DLP-like parameters.
Erik Garci is offline  
Old 12-10-2006, 11:32 AM
AVS Club Gold
 
Mark Petersen's Avatar
 
Join Date: Dec 2000
Posts: 4,671
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 11
Quote:
Originally Posted by Erik Garci View Post

In Photoshop's histogram, I got...
38.30/255=15.02% Mean Luminosity
31.64/255=12.41% Mean Red
38.99/255=15.29% Mean Green
52.19/255=20.47% Mean Blue

Then I used Photoshop to convert it to a grayscale image, and I got...
39.99/255=15.68% Mean (which is slightly different from Mean Luminosity above)

Hi Erik, I'm getting tripped up by some of the definitions. So I looked up luminosity and luminance in Wikipedia and found that they are often used interchangeably which is actually incorrect. In fact Wikipdia said this:

"In Adobe Photoshop's imaging operations, luminosity is the term used incorrectly to refer to the luma component of a color image signal; that is, a weighted sum of the nonlinear red, green, and blue signals. It seems to be calculated with the Rec. 601 luma co-efficients (Rec. 601: Luma (Y') = 0.299 R' + 0.587 G' + 0.114 B')."
http://en.wikipedia.org/wiki/Luminosity

So I assume luminance is the proper term which also jives with the usage in the APL white paper referenced in the thread about test patterns. Do you agree?

I also have the same question as Gary - How is the APL calculated from this data? I had thought that a person needs to know the gamma to determine APL?

Quote:
The spreadsheet calculated the following values.
2.6% average luminance
0.0341% luminance for level 0
83.86% luminance for level 237
2460:1 CR (level 237's luminance to level 0's luminance)

I'm also confused by these numbers. Shouldn't luminance for level 0 also be 0? Particularly in your 2nd CRT example where on/off CR is infinite? How exactly are these luminance values derived?
Mark Petersen is offline  
Old 12-10-2006, 12:46 PM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Mark Petersen View Post

So I assume luminance is the proper term which also jives with the usage in the APL white paper referenced in the thread about test patterns. Do you agree?

Regarding APL, luminosity and luminance are not the proper terms. Luma is the proper term.
Quote:
I also have the same question as Gary - How is the APL calculated from this data? I had thought that a person needs to know the gamma to determine APL?

You don't need to know the display's gamma to calculate APL, since APL is calculated from the signal before the display's gamma comes into play.

However, to calculate average luminance (which is different from APL), you need to know the display's gamma, since the average luminance is calculated from the displayed image where the display's gamma comes into play.
Quote:
I'm also confused by these numbers. Shouldn't luminance for level 0 also be 0? Particularly in your 2nd CRT example where on/off CR is infinite? How exactly are these luminance values derived?

In these examples, luminance for level 0 pixels cannot be zero because the ANSI CR is not infinite, which means that the level 0 pixels are washed out by scattered light from other pixels, regardless of whether or not the on/off CR is infinite.

To show you exactly how these values are derived, I could post the mathematical formulas, but I'm not sure if that's what you had in mind.
Erik Garci is offline  
Old 12-10-2006, 01:06 PM - Thread Starter
AVS Special Member
 
Gary Lightfoot's Avatar
 
Join Date: Jun 2000
Location: Surrey, UK
Posts: 4,515
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 43 Post(s)
Liked: 47
As mark said 'Wow'.

Eric,

Would you say that it would be accceptable to use, as a rough guide to a scenes APL, the mean of the RGB values added together then divided by 235 for video levels, and 255 for PC levels (and multiply by 100 for %)?

It would certainly make things easier to calculate.

The other thing is that if scenes like that can have a lot of image depth, doesn't it disprove that high on/off CR displays create more depth of field in lower APL scenes and high ANSI ones in higher APL scenes, since this is a low APL scene with high depth of field when shown on a low (relatively speaking) contrast High ANSI projector (Sim2 C3X).

It also bears out some other things I've noticed regarding shadow detail in a DLP vs CRT comparison I did a while back, which os reassuring.

Gary.

Quote:
Originally Posted by elmalloc
Who says Cameron is "right" and why do we care about him so much - lol!

I trust Gary Lightfoot more than James Cameron.
Gary Lightfoot is offline  
Old 12-10-2006, 01:31 PM
AVS Club Gold
 
Mark Petersen's Avatar
 
Join Date: Dec 2000
Posts: 4,671
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 11
Quote:
Originally Posted by Erik Garci View Post

Regarding APL, luminosity and luminance are not the proper terms. Luma is the proper term.

Okay, let's use Luma then. Although, we have be careful because Wikipedia defines it as, "Luma is the weighted sum of (gamma corrected) R'G'B' components of a color video signal after gamma correction has been applied". Unfortunately gamma must be factored in when discussing Luma.

Quote:


You don't need to know the display's gamma to calculate APL, since APL is calculated from the signal before the display's gamma comes into play.

However, to calculate average luminance (which is different from APL), you need to know the display's gamma, since the average luminance is calculated from the displayed image where the display's gamma comes into play.

Okay here is the source of my confusion then. From the whitepaper they make the following definitions: "APL in TV terms is value of gamma coded signal. Average luminance is a non-gamma coded value - linear light". So from what I can gather they are using the opposite definitions???
http://www.etconsult.com/papers/Blac...tt%20Cowan.pdf

Quote:


In these examples, luminance for level 0 pixels cannot be zero because the ANSI CR is not infinite, which means that the level 0 pixels are washed out by scattered light from other pixels, regardless of whether or not the on/off CR is infinite.

Gotcha, yes that makes perfectly good sense because it's a mixed scene - sorry I was thinking of a full black (all level 0) scene, my bad. So my next question is why the luminance is only 83% for full white (237)? I can see how reflected light can raise perfect blacks, but why is full white not 100%. I suspect that this is because a projector is only capable of delivering 100% luminance with a full white test pattern and that non infinite ANSI CR is another way of saying that full white can't be achieved in a mixed scene. Is this pretty much the case?

Quote:


To show you exactly how these values are derived, I could post the mathematical formulas, but I'm not sure if that's what you had in mind.

If you don't mind I would be very curious to see how the mathematical relationship works. But don't post them if it is proprietary.
Mark Petersen is offline  
Old 12-10-2006, 03:44 PM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Gary Lightfoot View Post

Would you say that it would be accceptable to use, as a rough guide to a scenes APL, the mean of the RGB values added together then divided by 235 for video levels, and 255 for PC levels (and multiply by 100 for %)?

Almost. You use a weighted sum of the means, not merely adding them together. For video levels, you first subtract 16 (reference black) from the levels, then divide them by 219 (since 235-16=219).
Quote:
Originally Posted by Gary Lightfoot View Post

The other thing is that if scenes like that can have a lot of image depth, doesn't it disprove that high on/off CR displays create more depth of field in lower APL scenes and high ANSI ones in higher APL scenes, since this is a low APL scene with high depth of field when shown on a low (relatively speaking) contrast High ANSI projector (Sim2 C3X).

My calculations are based on theory. To actually prove anything, I would measure it, not just calculate it.

Anyway, this is just one example. It might be worthwhile to try more images and more display parameters.
Erik Garci is offline  
Old 12-10-2006, 04:07 PM - Thread Starter
AVS Special Member
 
Gary Lightfoot's Avatar
 
Join Date: Jun 2000
Location: Surrey, UK
Posts: 4,515
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 43 Post(s)
Liked: 47
OK.

I'll try and get another example of a scene I saw on a G90 that also had high depth of field and see what we find (I don't have that particular DVD but will try to get it).

Gary

Quote:
Originally Posted by elmalloc
Who says Cameron is "right" and why do we care about him so much - lol!

I trust Gary Lightfoot more than James Cameron.
Gary Lightfoot is offline  
Old 12-10-2006, 04:17 PM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Mark Petersen View Post

Okay, let's use Luma then. Although, we have be careful because Wikipedia defines it as, "Luma is the weighted sum of (gamma corrected) R'G'B' components of a color video signal after gamma correction has been applied". Unfortunately gamma must be factored in when discussing Luma.

In this context, gamma refers to the camera's gamma, not the display's gamma. The camera's gamma came into play when the camera (or whatever the device was that originally created the video signal) converted from RGB to R'G'B' while creating the signal. APL is calculated after the camera's gamma has already been applied, so you don't need to know what the camera's gamma is.
Quote:
Originally Posted by Mark Petersen View Post

Okay here is the source of my confusion then. From the whitepaper they make the following definitions: "APL in TV terms is value of gamma coded signal. Average luminance is a non-gamma coded value - linear light". So from what I can gather they are using the opposite definitions???
http://www.etconsult.com/papers/Blac...tt%20Cowan.pdf

I don't think they are using opposite definitions. "Gamma coded" refers to the signal that resulted from encoding by the camera's gamma, and APL is calculated from this signal. "Non-gamma coded" refers to the light that will result from decoding by the display's gamma, and average luminance is calculated from this light.

The source of your confusion seems to be that there are different kinds of gamma.
Quote:
Originally Posted by Mark Petersen View Post

So my next question is why the luminance is only 83% for full white (237)? I can see how reflected light can raise perfect blacks, but why is full white not 100%. I suspect that this is because a projector is only capable of delivering 100% luminance with a full white test pattern and that non infinite ANSI CR is another way of saying that full white can't be achieved in a mixed scene. Is this pretty much the case?

The posted image uses PC levels, which means that a full white pixel would be (Red=255, Green=255, Blue=255), but there are no such pixels in the image. After converting it to a grayscale image, there are still no pixels with level 255. The highest grayscale level is 237.

A full white test pattern, where every pixel is level 255, would have an average luminance of 100%, and the luminance for level 255 would be 100%. Since there are no darker pixels in it, its contrast ratio would be 1:1.
Quote:
Originally Posted by Mark Petersen View Post

If you don't mind I would be very curious to see how the mathematical relationship works. But don't post them if it is proprietary.

The issue isn't that they are proprietary, but rather that I would be trying to present them in a way that they could be understood.
Erik Garci is offline  
Old 12-10-2006, 10:46 PM
AVS Club Gold
 
Mark Petersen's Avatar
 
Join Date: Dec 2000
Posts: 4,671
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 11
Quote:
Originally Posted by Erik Garci View Post

In this context, gamma refers to the camera's gamma, not the display's gamma. The camera's gamma came into play when the camera (or whatever the device was that originally created the video signal) converted from RGB to R'G'B' while creating the signal. APL is calculated after the camera's gamma has already been applied, so you don't need to know what the camera's gamma is.

I don't think they are using opposite definitions. "Gamma coded" refers to the signal that resulted from encoding by the camera's gamma, and APL is calculated from this signal. "Non-gamma coded" refers to the light that will result from decoding by the display's gamma, and average luminance is calculated from this light.

The source of your confusion seems to be that there are different kinds of gamma.

Ahh, yup that is the source of the confusion. I was thinking display gamma and had forgotten about the gamma used to encode the video. Okay, I'm going to go back an reanalyze with this new context. Thanks.


Quote:


The posted image uses PC levels, which means that a full white pixel would be (Red=255, Green=255, Blue=255), but there are no such pixels in the image. After converting it to a grayscale image, there are still no pixels with level 255. The highest grayscale level is 237.

A full white test pattern, where every pixel is level 255, would have an average luminance of 100%, and the luminance for level 255 would be 100%. Since there are no darker pixels in it, its contrast ratio would be 1:1.

Okay, I was assuming video levels 16-235 and thought that the 237 was basically full white (235) which may have been moved to 237 due to roundoff error or something. In the context of PC levels the numbers make perfect sense, although it does seem a little odd in that image that not a single pixel was over 237.

Quote:


The issue isn't that they are proprietary, but rather that I would be trying to present them in a way that they could be understood.

We AVS junkies need the education. It would definitely be "illuminating"
Mark Petersen is offline  
Old 12-10-2006, 11:00 PM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Mark Petersen View Post

I also have the same question as Gary - How is the APL calculated from this data?

Going back to this question...

I posted two different APL values, which were calculated in different ways. The first one is the 15.02% mean "luminosity" (which is actually luma) of the color image. The second one is the 15.68% mean of the grayscale image.

In the first way, Photoshop calculates the means of the red, green, and blue channels, and mean "luminosity" can be calculated as follows:
Mean Luminosity = 0.299*[Mean Red] + 0.587*[Mean Green] + 0.114*[Mean Blue]
Mean Luminosity = 0.299*12.41% + 0.587*15.29% + 0.114*20.47% = 15.02%

In the second way, Photoshop converts the color image (R'G'B') into a grayscale image (Y') approximately as follows:
1. Convert from R'G'B' to RGB by using R = R'^2.2, G = G'^2.2, and B = B'^2.2
2. Convert from RGB to Y by using Y = 0.26*R + 0.63*G + 0.11*B
3. Convert from Y to Y' by using Y' = Y^(1/2.2)
After the conversion, Photoshop calculates the mean of the grayscale channel.

The main difference is that "luminosity" levels in the first way are not the same as grayscale levels in the second way.

By the way, I was using Photoshop version 4. Other versions may give different results.
Quote:
Originally Posted by Mark Petersen View Post

I had thought that a person needs to know the gamma to determine APL?

Photoshop uses gammas of 2.2 and 1/2.2 to convert the color image into a grayscale image, but it does not use any gammas to calculate the means.
Erik Garci is offline  
Old 12-10-2006, 11:16 PM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Mark Petersen View Post

In the context of PC levels the numbers make perfect sense, although it does seem a little odd in that image that not a single pixel was over 237.

In the grayscale image, level 237 is the highest level, and there is only one pixel with that level. In the color image, the pixel has a value of (R'=209,G'=245,B'=255). Its location is (X=561,Y=11) which is above Maximus's left shoulder.

Photoshop converted it as follows:
Y' = ((0.26*(R'^2.2) + 0.63*(G'^2.2) + 0.11*(B'^2.2))^(1/2.2)
Y' = ((0.26*(209^2.2) + 0.63*(245^2.2) + 0.11*(255^2.2))^(1/2.2)
Y' = 237
Erik Garci is offline  
Old 12-11-2006, 09:27 AM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
In general, the mean of a channel can be calculated as follows:
Mean = (0*[number of level 0 pixels] + 1*[number of level 1 pixels] + 2*[number of level 2 pixels] + ... + 255*[number of level 255 pixels]) / (255*[total number of pixels])

For example, if an image consists of 3 pixels, which have these (R',G',B') levels:
(0,200,120) (150,230,120) (255,200,120)
then the means are...
Mean Red = (0*1 + 150*1 + 255*1) / (255*3) = 135/255 = 52.94%
Mean Green = (200*2 + 230*1) / (255*3) = 210/255 = 82.35%
Mean Blue = (120*3) / (255*3) = 120/255 = 47.06%

In terms of Photoshop's "luminosity" (luma), the 3 pixels have these Y' levels:
131 194 208
so the mean is...
Mean Luminosity = (131*1 + 194*1 + 208*1) / (255*3) = 177.67/255 = 69.67%
Erik Garci is offline  
Old 12-13-2006, 11:34 AM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Mark Petersen View Post

We AVS junkies need the education. It would definitely be "illuminating"

I found an archived post that shows a formula for calculating the CR of any checkerboard. The formulas for calculating the CR of any scene are similar but more complex.
Erik Garci is offline  
Old 12-13-2006, 01:16 PM
AVS Club Gold
 
Mark Petersen's Avatar
 
Join Date: Dec 2000
Posts: 4,671
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 11
Quote:
Originally Posted by Erik Garci View Post

I found an archived post that shows a formula for calculating the CR of any checkerboard. The formulas for calculating the CR of any scene are similar but more complex.

Thanks for digging this up Erik. The whole thread looks to be an interesting read. I'm sorry I missed it when it was first making the rounds...
Mark Petersen is offline  
Old 12-14-2006, 12:03 PM - Thread Starter
AVS Special Member
 
Gary Lightfoot's Avatar
 
Join Date: Jun 2000
Location: Surrey, UK
Posts: 4,515
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 43 Post(s)
Liked: 47
Hi Erik,

Fascinating stuff! Some of the maths is a little hard going on the face of it, but at least you're showing us how things are done. I appreciate you taking the time you're putting into this for us.

Would I be fine in using the ballpark figure that my paint program gives me since it will be a quick way of getting the APL for a given scene, or will it be possible for it to be innacurate at times?

My main reason for wanting to be able to get the real APL for a scene is so that I can see if the premise that CRTs high on/off means more image depth in lower APL, and DLPs higher ANSI means more image depth in higher APL has real merit or not. Like I mentioned earlier, the Gladiator scene gave the impression of a lot of depth (the most I've seen from any image), yet seems to be a low APL which should have suited a CRT better when rendering the image.

So on the face of it and with this very small sample, it doesn't seem to be the case, so further study or a better overall theory of what gives good image depth may be needed.

Thanks

Gary

Quote:
Originally Posted by elmalloc
Who says Cameron is "right" and why do we care about him so much - lol!

I trust Gary Lightfoot more than James Cameron.
Gary Lightfoot is offline  
Old 12-14-2006, 01:17 PM
AVS Special Member
 
Erik Garci's Avatar
 
Join Date: Oct 1999
Location: Durham, NC, USA
Posts: 4,770
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by Gary Lightfoot View Post

Would I be fine in using the ballpark figure that my paint program gives me since it will be a quick way of getting the APL for a given scene, or will it be possible for it to be innacurate at times?

Your program seems to be accurate enough.

All programs should calculate the APL of each RGB channel the same way, so they should be equally accurate in that regard. However, there are different ways to calculate the overall APL, since there are different ways to combine the RGB channels (such as Rec601 luma, Rec709 luma, grayscale conversion, etc.), but it's unclear if one way is more accurate than another way.

It would be simpler to calculate the APL of an image from a black-and-white movie.
Erik Garci is offline  
Old 01-05-2007, 02:58 PM
AVS Addicted Member
 
stanger89's Avatar
 
Join Date: Nov 2002
Location: Marion, IA
Posts: 17,498
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 176 Post(s)
Liked: 157
I've been following this, and moreso the related threads, closely as this is very interesting. It's occured to me while watching this, that it should be possible to calculate APL of movie scenes on the fly with something like AVISynth. People do a lot of amazing stuff with AVISynth.

It might be worthwhile to look into if a simple AVISynth script could do this for a segment, or maybe a whole movie.

See what an anamorphoscopic lens can do, see movies the way they were meant to be seen
stanger89 is offline  
Old 01-05-2007, 04:04 PM - Thread Starter
AVS Special Member
 
Gary Lightfoot's Avatar
 
Join Date: Jun 2000
Location: Surrey, UK
Posts: 4,515
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 43 Post(s)
Liked: 47
Thanks for the info. I might look into that.

Gary

Quote:
Originally Posted by elmalloc
Who says Cameron is "right" and why do we care about him so much - lol!

I trust Gary Lightfoot more than James Cameron.
Gary Lightfoot is offline  
Old 01-06-2007, 03:21 PM
AVS Addicted Member
 
stanger89's Avatar
 
Join Date: Nov 2002
Location: Marion, IA
Posts: 17,498
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 176 Post(s)
Liked: 157
Gary,

I finally got a chance to play a bit. And before I post anything else, I want to say that I understand that this isn't 100% correct, but from some of the numbers posted above, I think it may represent a rather accurate rough approximation (how's that for an oxymoron).

I hacked out the following AVISynth script:
Code:
mpeg2source("D:\\\\video\\\\gladiator.d2v")
trim(0,100)
filename = "D:\\video\\gladiator_vob_2.txt"
# Crop the video so bars don't skew results
Crop(0,54,720,360)
# Convert to PC levels (16-235 > 0-255) to make life easier (this is already done for some reason)
#ColorYUV(levels="TV->PC")
# Open the file
colon = " : "
WriteFile(filename, "current_frame", "colon", "YPlaneMin", "colon", "YPlaneMax", "colon", "AverageLuma" )
WriteFileStart(filename, """ "AverageLuma for Gladiator VOB 2" """)
WriteFileStart(filename, """ "Frame : MinLuma : MaxLuma : AverageLuma" """ )
WriteFileEnd(filename, """ "End" """)
What it does is compute the average min Y, max Y, and (I think) average Y of each frame and print it to a file.

Couple caveats, Levels is commented out because I set DGIndex to convert "TV->PC", just make sure you're using the levels you think you are.

Oh, and I used trim to only take the first 100 frames.

From this you can easilly import the text file into excell and figure out % luma, and other nifty things, like average Y over a whole movie.

You could also do things like crop (in AVISynth) to eliminate the effect of bars.

See what an anamorphoscopic lens can do, see movies the way they were meant to be seen
stanger89 is offline  
 
Thread Tools


Forum Jump: 

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off