Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contrast and Brightness as Visual-attribute #135

Closed
neuromechanist opened this issue Jan 24, 2024 · 16 comments
Closed

Contrast and Brightness as Visual-attribute #135

neuromechanist opened this issue Jan 24, 2024 · 16 comments

Comments

@neuromechanist
Copy link
Member

While annotating the Healthy Brain Network project's Surround Suppression task, I found that Opacity and Lunminence, Hue and Saturation, but I can't find Contrast and Brightness. While these values are potentially dependent, having the full range of definitions helps describe the events.

@neuromechanist
Copy link
Member Author

neuromechanist commented Jan 29, 2024

Upon further investigation, it seems that Luminance is the correct word to use instead of brightness:
Here is the definition of Luminance and Brightness, as described in a blog post by x.rite, the color calibration tool from Pantone:

Luminance: Luminance is the luminous intensity projected on a given area and direction. Luminance typically describes the intensity of emitted light.

Brightness: We perceive brightness when lumens fall on the rods and cones of our retina. When we speak of brightness, we use subjective words like “dim” or “brilliant” because brightness cannot be measured like luminance but can be scaled in percentages.

Here, I am not sure if we want to differentiate the difference between the two. My current take is to keep the luminance and not to include Brightness in the schema.

@neuromechanist
Copy link
Member Author

neuromechanist commented Jan 29, 2024

Here is the definition of Contrast:

Contrast is the difference between the luminance of two objects. Either of the following equations can formalize the definition of contrast:

  1. Micbelson contrast = (Lmax - Lmin) / (Lmax + Lmin)
    where Lmax and Lmin are the maximum and minimum luminance of an image.

  2. Weber contrast = (L - Lback) / Lback
    where L is the luminance of the object and Lback is the luminance of the background

Source:

  1. Legge, G. E., D. H. Parish, A. Luebker, and L. H. Wurm. 1990. “Psychophysics of Reading. XI. Comparing Color Contrast and Luminance Contrast.” Journal of the Optical Society of America. A, Optics and Image Science 7 (10): 2002–10.
  2. Rosa, Claudio, and Carlo Aleci. 2022. “Psychophysics in the Ophthalmological Practice—II. Contrast Sensitivity.” Annals of Eye Science 7 (1): 35–35.

@VisLab
Copy link
Member

VisLab commented Jan 31, 2024

After HWG discussion --- it was agreed we should put in Contrast but not Brightness in the next release. What should the parent node be?

Also, formula 1 is a relative difference ... should that be in the description? The definition also indicates two objects. Should this be a Relation such as "Contrast-between".

Do the two references both give both of these definitions?

@dorahermes
Copy link
Member

Contrast should be a Visual-attribute (not a Relation).

Some examples:

  1. An image of e.g. a grating can have a certain contrast.
  2. One image can have multiple contrasts, as contrast can be calculated in different ways (like those noted above, or in other ways) for a certain spatial resolution at different locations.

@neuromechanist
Copy link
Member Author

Thanks a lot, @VisLab and @dorahermes, for your support.

What should the parent node be?

I agree with @dorahermes that it should be under Visual-attribute.

Formula 1 is a relative difference

Both formulas talk about differences in luminance. Contrast needs two objects to be defined. However, I think that Contrast-between would cause unnecessary repetition. For example, for a foreground gray circle and a white background, the short HED tag will look like:

(Visual-presentation, ((Foreground-view, (Circle, Gray)), (Background-view, White), Contrast/0.5))

Do the two references both give both of these definitions?
No, the Weber contrast is listed only in the second source. However, the first source is well-cited and clearly describes the effect of contrast on the subject performance. The second source covers how the contrast can be manipulated for psychophysical experiments.

@neuromechanist
Copy link
Member Author

neuromechanist commented Feb 9, 2024

Talking to @smakeig, he emphasized that there are many contrasts, and what we are referring to here is luminance contrast. The first source also emphasizes this point by comparing the attributes of color contrast and luminance contrast.

So, I wonder if it would be better to have Luminance-contrast under Visual-attribute to clarify the tag.

@dorahermes
Copy link
Member

I agree that Luminance-contrast is clear and contrast-between does not work. Note that contrast can also be calculated using sets of filters in visual encoding models.

@smakeig
Copy link
Member

smakeig commented Feb 11, 2024 via email

@smakeig
Copy link
Member

smakeig commented Feb 11, 2024 via email

@neuromechanist
Copy link
Member Author

@smakeig, we are not using), at least currently, Luminance-contrast for the Present movie. A good example of the use of this tag is the contrast between foreground and background in a couple of the Healthy Brain Network Project. Here is an example of the exemplary analysis of the Surround Suppression Paradigm from Langer et.al., Sci Data 2017:
image

The Luminance Ratio for the Present Movie (as briefly described under BIDS issue 153 does not seem to be able to benefit from Luminance-contrast, because Log Luminance Ratio (LLR) is relating two separate frames (which is different from the Luminance-contrast, which requires the elements to be in the same scene).

This is not to discount the importance of annotating temporal context; I just don't think that Luminance-contrast can be extended for that 😊.

@neuromechanist
Copy link
Member Author

To summarize, here is what we have discussed so far

Suggestion to include Luminance-contrast in the base schema:

Tag: Luminance-contrast

Parent: Property/Sensory-property/Sensory-attribute/Visual-attribute

Definition: Luminance contrast is the difference between the luminance of two objects. The suggested quantification method is the relative difference measure of luminance: Contrast-luminance = (Lmax - Lmin) / (Lmax + Lmin), where Lmax and Lmin are the maximum and minimum luminance of [specific portions of] an image.

Source: Legge, G. E., D. H. Parish, A. Luebker, and L. H. Wurm. 1990. “Psychophysics of Reading. XI. Comparing Color Contrast and Luminance Contrast.” Journal of the Optical Society of America. A, Optics and Image Science 7 (10): 2002–10.

Accept-value: Yes, Type = (Non-negative, Fraction), Range = 0 to 1.

Example: Represent a gray circle over a white background with a contrast of 0.5.

    (Visual-presentation,
        (
            (Foreground-view, (Circle, Gray)), (Background-view, White), (Luminance-Contrast, Fraction/0.5)
        )
    )

@dorahermes
Copy link
Member

This definition is incorrect in many cases and only applies to a subset of luminance contrast measurements (you are suggesting Michelson) and it can be calculated in multiple ways as mentioned above. I would therefore not give a 'suggested method for quantification', as there are many methods (Michelson, Weber, RMS, and other filtering approaches). Also note that the RMS contrast is not a fraction. I think the definition should be more general and allow future sub-tree extension with such specifics, e.g:

Definition: Luminance contrast is the difference in luminance in [specific portions of] a scene or image.

Accept-value: Yes, Type = (Non-negative), Range = 0 to 1.

@neuromechanist
Copy link
Member Author

Thanks, @dorahermes,
Comparing the two definitions,

  1. Luminance contrast is the difference between the luminance of two objects.
  2. Luminance contrast is the difference in luminance in [specific portions of] a scene or image.

I don't think either of the definitions is incorrect. However, definition 1 is more general since it does not constrain Luminance-contrast to a scene or image.

There are indeed several ways for quantification of contrast (see Wikipedia page on contrast). We should encourage the inclusion of the quantification method in the definition somehow. Also, in my opinion, providing a recommended method to quantify Luminance-contrast would encourage users to either use that definition or explicitly mention their quantification method. @VisLab, I wonder how we could recommend including the quantification method in the tag?

With a quick literature search, I observed that the Michelson definition seemed to be used often, so I added that as the suggested quantification method.

I agree that the type should not be Fraction, to include the RMS method for contrast quantification.

@dorahermes
Copy link
Member

I have calculated contrast before in encoding models using sets of Gabor filters, and while it would be useful to have some suggestions, I do not think we should recommend any one in particular. Specific recommendations/luminance contrast types should be reserved for a level deeper.

@VisLab
Copy link
Member

VisLab commented Feb 21, 2024

Type of value would be done with SuggestedTag. Added as part of PR #140.

VisLab added a commit that referenced this issue Feb 26, 2024
@VisLab
Copy link
Member

VisLab commented Mar 22, 2024

Addressed in PR#149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants