#70 scale2D of PDL::Image2D dont work

critical
closed-fixed
nobody
other (94)
5
2003-11-22
2003-08-22
Anonymous
No

The next program dont scale well the original image...

--
#!/usr/bin/perl -w

use PDL;
use PDL::Core ':Internal';
use PDL::Image2D;
use PDL::IO::FastRaw;

my $imagen="image";

$mask=mapfraw($imagen,{ReadOnly=>1,Datatype=>0,Dims=>[1536,1024]});
$newmask = zeroes($mask->type,6144,4096);
rescale2d($mask,$newmask);
writefraw($newmask,"${imagen}_e");

---

The image final have the widht scaled, but not the
height...

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Solved...

    Applie the next patch to image2d.pd and recompile.

    --- Lib/Image2D/image2d.pd 2003-08-24
    22:20:13.000000000 +0200
    +++ Lib/Image2D/image2d.pd.org 2003-08-24
    21:43:27.000000000 +0200
    @@ -1269,8 +1269,8 @@
    int ix,iy,ox,oy,i,j,lx,ly,cx,cy,xx,yy,num;
    double kx,ky,temp;

    -ix = $SIZE(m);
    -iy = $SIZE(n);
    +ix = $SIZE(n);
    +iy = $SIZE(m);
    ox = $SIZE(p);
    oy = $SIZE(q);

    @@ -1287,7 +1287,7 @@
    for(xx=lx;xx<=cx;xx++)
    for(yy=ly;yy<=cy;yy++) {
    /* fprintf(stderr,"i: %d, j: %d, xx: %d, yy:
    %d\n",i,j,xx,yy); */
    - $O(p=>xx,q=>yy) += $I(m=>i,n=>j);
    + $O(p=>xx,q=>yy) += $I(n=>j,m=>i);
    }
    ly = cy + 1;
    }

     
  • Craig DeForest

    Craig DeForest - 2003-11-22
    • status: open --> closed-fixed
     
  • Craig DeForest

    Craig DeForest - 2003-11-22

    Logged In: YES
    user_id=20200

    Bug fixed in CVS.
    Thanks for reporting the problem!

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks