Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/pure-cfg/test/rsmp2d.diderot
ViewVC logotype

Annotation of /branches/pure-cfg/test/rsmp2d.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 698 - (view) (download)

1 : glk 698 // rsmp2d
2 :     //
3 :     // demos 2D convolution, when it is implemented
4 :    
5 :     string dataFile = "../data/pix1-11.nrrd";
6 :     int dataSize = 11;
7 :     int imgSize = 200;
8 :     image(2)[] img = load (dataFile);
9 :     field#2(2)[] F = img ⊛ bspln3;
10 :    
11 :     strand sample (int ui, int vi)
12 :     {
13 :     real uu = real(dataSize)*(real(ui)+0.5)/real(imgSize) - 0.5;
14 :     real vv = real(dataSize)*(real(vi)+0.5)/real(imgSize) - 0.5;
15 :     vec2 pos = [uu,vv];
16 :     output real val = 0.0;
17 :    
18 :     update
19 :     {
20 :     val = F@pos if inside(pos,F)
21 :     else -∞;
22 :     stabilize;
23 :     }
24 :     }
25 :    
26 :     initially [ sample(ui, vi) | vi in 0..(imgSize-1), ui in 0..(imgSize-1) ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0