Memorandums

知覚・認知心理学の研究と教育をめぐる凡庸な日々の覚書

Screen 補足:Psychtoolbox/Matlab

2006-11-05 | PsychToolBox
% Draw lines and solids (on- or off- screen):
Screen(windowPtr,'FillArc',[color],[rect],startAngle,arcAngle)
Screen(windowPtr,'FillOval',[color],[rect])
Screen(windowPtr,'FillPoly',[color],pointList)
Screen(windowPtr,'FillRect',[color],[rect])
Screen(windowPtr,'DrawLine',[color],fromH,fromV,toH,toV,[penWidth],[penHeight],[penMode])
Screen(windowPtr,'FrameArc',[color],[rect],startAngle,arcAngle,[penWidth],[penHeight],[penMode])
Screen(windowPtr,'FrameOval',[color],[rect],[penWidth],[penHeight],[penMode])
Screen(windowPtr,'FrameRect',[color],[rect],[penWidth],[penHeight],[penMode])

cf. >>screen

FillPolyのpointListは、行列形式で指定。
例)[x1 y1; x2 y2; x3 y3]

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

GratingDemo: PsychToolBox

2006-11-05 | PsychToolBox
簡単なGrating作成デモ

% window
whichScreen=0;
window=Screen(whichScreen,'OpenWindow');
white=WhiteIndex(window);
black=BlackIndex(window);
gray=(white+black)/2;
if round(gray)==white
gray=black;
end
inc=white-gray;
Screen(window,'FillRect',gray);

% grating
[x,y]=meshgrid(-100:100,-100:100);
orientation=17; % tilt (deg)
f=0.03; % spatial frequency (cycles/pixel)
lambda=1.5/f; % gaussian space constant (pixels); "1.5/f" yields 1.5 cycle
a=cos(orientation*pi/180)*2*pi*f;
b=sin(orientation*pi/180)*2*pi*f;
m=exp(-((x/lambda).^2)-((y/lambda).^2)).*sin(a*x+b*y);
Screen(window,'PutImage',gray+inc*m);

% pause
Screen(window,'TextFont','Arial');
Screen(window,'TextSize',18);
Ask(window,'Done. Hit return to quit.',black,gray,'GetString');
Screen(window,'Close');
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

PhaseDistortDemo: PsychToolBox

2006-11-05 | PsychToolBox
PhaseDistortDemo : Measure phase-distort. thresh. for face recognition.

cf. >>help psychdemos

See for example:
Badcock, D. R. (1990) "Phase- or energy-based face discrimination: some problems." JEP:HPP, 16 (1), 217-20.
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする