Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function minimum = get_min_raster(img, i, j)
- if j==1 || i==1
- topleft = intmax;
- else
- topleft = img(i-1, j-1);
- end
- if i==1
- top = intmax;
- else
- top = img(i-1, j);
- end
- if j==1
- left = intmax;
- else
- left = img(i, j-1);
- end
- if j == size(img, 2) || i == 1
- topright = intmax;
- else
- topright = img(i-1, j+1);
- end
- minimum = min([topleft, top, left, topright]);
- end
Add Comment
Please, Sign In to add comment