Does anyone have any experience with luminance changes in a visual display?

I am a visual cognitive psychologist and I use Matlab and PsychToolBox for some visual search experiments. I am attempting to change the luminance of black stimuli at random intervals. I have considered using a grey as the baseline and then changing the color to make it darker or lighter randomly but have been unable to get the color to change. Any suggestions on how I should think about this?

1 Comment

When you mean "color" you mean the brightness (intensity) of a gray scale image, right? Not the color like a non-gray/tinted RGB image?
Also, when you say "random intervals" do you mean intervals of gray level, or time intervals?

Sign in to comment.

Answers (2)

'Value' is, I believe, the same as 'luminance' in your case. If so, you could create images based on HSV values and change the value variable dynamically.
h = zeros(200,200);
s = zeros(200,200);
v = ones(200,200);
RGB1 = hsv2rgb(h,s,v*0.3);
RGB2 = hsv2rgb(h,s,v*0.5);
RGB3 = hsv2rgb(h,s,v*0.8);
close all
montage({RGB1,RGB2,RGB3},'Size',[1,3]);

6 Comments

Do you think something like this may work?
Lum1 = [000 000 000]; % starting luminance * 0
Lum2 = [32 32 32]; % starting luminance * 0.5
Lum3 = [63.75 63.75 63.75]; % starting luminance * 1
Lum4 = [95 95 95]; % starting luminance * 1.5
Lum5 = [124 124 124]; % starting luminance * 1.95
multiList = [Lum1 Lum2 Lum3 Lum4 Lum5];
if BlockRec(trial,3)==1
ovalColors = [63.75 63.75 63.75; 63.75 63.75 63.75; 63.75 63.75 63.75];
elseif BlockRec(trial,3)==2
ovalColors = [multiList(randi(5)); multiList(randi(5)); multiList(randi(5))];
end
Not sure, because you never answered my question above if you want a gray scale image or a true color RGB image. The above code puts the red, green, and blue channels of an RGB color image side by side. Is that what you want? Again, even if it's what you want your results could be meaningless unless you follow the ASTM guidelines and calibrate your monitor with a device like I referred you to. If you submit a paper to a psych or color journal, if the reviewer knows the subject matter, he'll call you out on it if you didn't.
Sorry, I didn't see your first comment. Basic overview, I have 4 circles that are "black" on a light grey (127.5 127.5 127.5) background. Since you can't get any darker than 000, 000, 000, I split the difference between the background and black (63.75 63.75 63.75) for the initial color of the circles. Then I was thinking that I could change the colors to varrying shades of grey to make them darker and lighter (closer to black and closer to the grey background). And yes, time intervals.
LumMid = repmat(63.75, [5,3]);
LumMult = [0; 0.5;1;1.5;1.95];
multiList = LumMult .* LumMid;
if thing1
ovalColors = LumMid(1:3,:);
elseif thing2
ovalColors = multiList(randi([1,5],3,1),:);
else
% cover other cases here
end
I mean, totally agree this will need calibration, but if it's just concepting a paradigm... Could also just initialize ovalColors and cover remaining cases.
ovalColors = LumMid(1:3,:);
if thing2
ovalColors = multiList(randi([1,5],3,1),:);
else
% cover other cases here
end

Sign in to comment.

You should probably calibrate your displays with this device:
In addition, there are ASTM guidelines for viewing (target brightesses, surround brightness, clothing, room brightness, etc.) that you may want to look at.

Products

Release

R2018a

Commented:

on 15 Dec 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!