Guest User

Untitled

a guest
Apr 23rd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. function minimum = get_min_raster(img, i, j)
  2. if j==1 || i==1
  3. topleft = intmax;
  4. else
  5. topleft = img(i-1, j-1);
  6. end
  7. if i==1
  8. top = intmax;
  9. else
  10. top = img(i-1, j);
  11. end
  12. if j==1
  13. left = intmax;
  14. else
  15. left = img(i, j-1);
  16. end
  17. if j == size(img, 2) || i == 1
  18. topright = intmax;
  19. else
  20. topright = img(i-1, j+1);
  21. end
  22. minimum = min([topleft, top, left, topright]);
  23. end
Add Comment
Please, Sign In to add comment