I am trying to implement a structuring element in MATLAB (disk of radius 2.5).
I'm using the strel function in MATLAB, but by definition the radius must be a positive integer.
Is there any other function that would allow me to do it?
It is quite simple to build an image with a disk in it. This image you can use directly as a strel in MATLAB:
r = 2.5;
d = ceil(r);
x = (-d:d).^2;
se = (x + x.') < r.^2; % same as sqrt(x + x.') < r, but cheaper
img = imread('cameraman.tif');
out = imdilate(img,se);
In my PhD thesis I discussed ways to more precisely create disk structuring elements of arbitrary size.
strelworks on pixels (matrix elements). Those are, by definition, in integers, as there's no such thing as half a pixel or half of a matrix element. Could you please edit the question to elaborate on why you need a radius of 2.5? Perhaps we can then see whether there might be another solution. The first thing that springs to mind for this specific case is to multiply everything by 2, and divide the results by 2 at the end.