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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 698 - (download) (annotate)
Fri Mar 25 18:53:13 2011 UTC (8 years, 6 months ago) by glk
File size: 613 byte(s)
demos 2D convolution, when it is implemented
// rsmp2d
//
// demos 2D convolution, when it is implemented

string dataFile = "../data/pix1-11.nrrd";
int dataSize = 11;
int imgSize = 200;
image(2)[] img = load (dataFile);
field#2(2)[] F = img ⊛ bspln3;

strand sample (int ui, int vi)
{
    real uu = real(dataSize)*(real(ui)+0.5)/real(imgSize) - 0.5;
    real vv = real(dataSize)*(real(vi)+0.5)/real(imgSize) - 0.5;
    vec2 pos = [uu,vv];
    output real val = 0.0;

    update
    {
        val = F@pos if inside(pos,F)
                    else -∞;
        stabilize;
    }
}

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