1 | function fun=faisceau(nbpixelsx,nbpixelsy,sigmax,sigmay,centrex,centrey,pourc) |
---|
2 | |
---|
3 | |
---|
4 | Y=(meshgrid(1:nbpixelsx+1,1:nbpixelsy+1))'; |
---|
5 | %Y=(1:nbpixelsy+1)'; |
---|
6 | X=meshgrid(1:nbpixelsy+1,1:nbpixelsx+1); |
---|
7 | %X=(1:nbpixelsx+1)'; |
---|
8 | p=pourc*0.01; |
---|
9 | sigx=1*((1-p)*sigmax+2*p*sigmax*rand(1)); |
---|
10 | sigy=1*((1-p)*sigmay+2*p*sigmay*rand(1)); |
---|
11 | cx=1*((1-p)*centrex+2*p*centrex*rand(1)); |
---|
12 | cy=1*((1-p)*centrey+2*p*centrey*rand(1)); |
---|
13 | |
---|
14 | a=bigauss_bruit(X,Y,sigx,sigy,cx,cy,pourc/4); |
---|
15 | % on enleve le bruit de bigauss car redondant |
---|
16 | %a=bigauss(X,Y,sigx,sigy,cx,cy); |
---|
17 | |
---|
18 | %s=1*((1-pourc)*se+2*pourc*se.*rand(1,length(se))); |
---|
19 | |
---|
20 | b = p*rand(nbpixelsx+1,nbpixelsy+1); |
---|
21 | |
---|
22 | % % pixels morts |
---|
23 | % n=size(a); |
---|
24 | % d=gallery('rando',n,1); |
---|
25 | % |
---|
26 | % for i=1:10 |
---|
27 | % c(i,:,:)=gallery('rando',n,1); |
---|
28 | % d=d.*squeeze(c(i,:,:)); |
---|
29 | % end |
---|
30 | %fun=a+b+d; |
---|
31 | |
---|
32 | fun=a+b; |
---|
33 | %fun=a; |
---|
34 | % figure(4) |
---|
35 | % |
---|
36 | %image(a+b+d,'CDataMapping','scaled') |
---|
37 | %image(fun,'CDataMapping','scaled') |
---|