No Subject

Respected sir,

this is the code iam using but the required output is not coming properly...
see the attached image like that i required.....

[w, rect]=Screen('OpenWindow',0);
[xc,yc]=RectCenter(rect);
Screen ('FillRect',w,[128 128 128],[100 100 100 100]);
words ={'CAT','MAT','COOL'};
Screen('TextFont',w,'Times New Roman');Screen('TextSize',w,50);
Screen('Textstyle',w,1);
% noisemat = 0.5+0.5*rand(100,200);
% Screen('MakeTexture',w,noisemat*GrayIndex(w));

for i = 1:3
noisemat = 0.5+0.5*rand(100,300);
randTex = Screen('MakeTexture',w,noisemat*GrayIndex(w));
Screen('DrawTexture',w,randTex);
Screen('DrawText',w,char(words(i)),xc-80,yc-25,0);
Screen ('Flip',w);
pause(2);
end

Screen('CloseAll');

thanking you


yours sincerely
raghavendra


Thing you may improve:
0. The screen rect you fill is wrong.

1. rand ranges from [0 1], so it seems to me your code is not using it correctly.

2. you will need DrawTexture and DrawText to different locations. Check related subfunction for Screen for help

3. you will need to close textures which are created repeatedly

4. you may need alpha blending to mix noise and text.

5. you may need different noise pixel size and some kind of smoothing, as shown in your picture.

It may be good to start reading some demos in the demo folder.




--- In psychtoolbox@yahoogroups.com, raghavendra g <raghu_suntvs@...> wrote:
>
> Respected sir,
>
> this is the code iam using but the required output is not coming properly...
> see the attached image like that i required.....
>
>
> [w, rect]=Screen('OpenWindow',0);
> [xc,yc]=RectCenter(rect);
> Screen ('FillRect',w,[128 128 128],[100 100 100 100]);
> words ={'CAT','MAT','COOL'};
> Screen('TextFont',w,'Times New Roman');Screen('TextSize',w,50);
> Screen('Textstyle',w,1);
> % noisemat = 0.5+0.5*rand(100,200);
> % Screen('MakeTexture',w,noisemat*GrayIndex(w));
>
> for i = 1:3
> noisemat = 0.5+0.5*rand(100,300);
> randTex = Screen('MakeTexture',w,noisemat*GrayIndex(w));
> Screen('DrawTexture',w,randTex);
> Screen('DrawText',w,char(words(i)),xc-80,yc-25,0);
> Screen ('Flip',w);
> pause(2);
> end
>
> Screen('CloseAll');
>
> thanking you
>
>
> yours sincerely
>
> raghavendra
>