Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.45 KB | None | 0 0
  1. %% dwuliniowa
  2. img = double(img);
  3. nImg = double(nImg);
  4. for y=0:(nYY-1)
  5.    y1 = floor(y*yStep);
  6.    y2 = y1 + 1;
  7.    yy = y*yStep - y1;
  8.    if y2 > (YY-1)
  9.     y2 = YY-1;
  10.    end
  11.    
  12.    for x=0:(nXX-1)
  13.        x1 = floor(x*xStep);
  14.        x2 = x1 + 1;
  15.        xx = x*xStep - x1;
  16.        if x2 > (XX-1)
  17.         x2 = XX-1;
  18.        end
  19.        nImg(y+1,x+1) = [1-xx xx]*[img(y1+1, x1+1) img(y2+1, x1+1); img(y1+1, x2+1) img(y2+1, x2+1)] * [1-yy; yy];
  20.    end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement