We propose a filter that selectively responds to vessels and that we call B-COSFIRE with B standing for bar which is an abstraction for a vessel. It is based on the existing COSFIRE (Combination Of Shifted Filter Responses) approach.
A B-COSFIRE filter achieves orientation selectivity by computing the weighted geometric mean of the output of a pool of Difference-of-Gaussians filters, whose supports are aligned in a collinear manner. It achieves rotation invariance efficiently by simple shifting operations.
The proposed filter is versatile as its selectivity is determined from any given vessel-like prototype pattern in an automatic configuration process. We configure two B-COSFIRE filters, namely symmetric and asymmetric, that are selective for bars and bar-endings, respectively. We achieve vessel segmentation by summing up the responses of the two rotation-invariant B-COSFIRE filters followed by thresholding.
The B-COSFIRE filters can be used for detection of any elongated patterns in images:
- blood vessels in medical images
- roads and rivers in aerial images
- leaf nerves in natural images
- tiles in mosaics and textured images
The code is continuosly updated in the GitLab repository https://gitlab.com/nicstrisc/B-COSFIRE-MATLAB
If you use this script please cite the following papers:
[1] "George Azzopardi, Nicola Strisciuglio, Mario Vento, Nicolai Petkov, Trainable COSFIRE filters for vessel delineation with application to retinal images, Medical Image Analysis, Available online 3 September 2014, ISSN 1361-8415, http://dx.doi.org/10.1016/j.media.2014.08.002"
[2] "N. Strisciuglio, G. Azzopardi, M. Vento, and N. Petkov" - Supervised vessel delineation in retinal fundus images with the automatic selection of B-cosfire filters. Machine Vision and Applications, doi:10.1007/s00138-016-0781-7
CHANGELOG
V1.4: Added CrackDetectionCluster.m - Experimental code (and data) to replicate results in the CAIP17 paper.
V1.3: Examples added, which are in the paper "N. Strisciuglio, N.Petkov - Delineation of line patterns in images using B-COSFIRE filters, IWOBI 2017". Correction of the approximated computation of the shifting vectors.
V1.2: Visualize B-COSFIRE output response and segmented image when Application() is called without output parameters.
V1.1: Computation of the orientation map added.
1.4.0.0 | Added CrackDetectionCluster.m - Experimental code (and data) to replicate results in the CAIP17 paper. |
|
1.3.0.0 | Examples added, which are in the paper "N. Strisciuglio, N.Petkov - Delineation of line patterns in images using B-COSFIRE filters, IWOBI 2017". Correction of the approximated computation of the shifting vectors.
|
|
1.2.0.0 | V1.2: Visualize B-COSFIRE output response and segmented image when Application() is called without output parameters. |
|
1.1.0.0 | Changelog
|
|
1.0.0.0 | this is not a toolbox |
Inspired by: Trainable COSFIRE filters for keypoint detection and pattern recognition
Create scripts with code, output, and formatted text in a single executable document.
Dhimas Arief Dharmawan (view profile)
Dear Dr. Nicola Strisciuglio,
Thank you for your clear answer.
Best regards,
Dhimas
Nicola Strisciuglio (view profile)
Dear Dhimas,
your observations are correct. In our experiments we selected a value of sigma that is a 'good' value for the average size of the vessels in one image. It gives a feeling of the scale at which you are working.
Of course, you can setup different values (i.e. a list of values). This implementation will compute the response of separate COSFIRE filters and the final response as the pixel-wise maximum across scale responses (similarly to the orientation tolerance implementation).
Cheers
Dhimas Arief Dharmawan (view profile)
Dear Dr. Nicola Strisciuglio,
Thank you for answering my previous questions.
Now I would like to know why the code uses only one value of sigma for each of symmetric and assymetric filters (i.e. 2.4 and 1.8 for the drive database). I think the image from the database contains vessels with some diameters (2-10 pixels). Is it beneficial to use some sigma values and further combine the responses? A brief explanation on the above matter will be much appreciated.
Best regards,
Dhimas
Noa Shkedi (view profile)
Dear Dr. Nicola Strisciuglio,
Thanks for the quick answer, I download the last version and still got the same error.
input is not defined in case the inputfilter=DoG:
from 'configureCOSFIRE.m' function -
if strcmp(params.inputfilter.name,'Gabor')
% Get responses of a Bank of Gabor filters
input =
getGaborResponse(prototypePattern,params.inputfilter.Gabor,params.inputfilter.Gabor.lambdalist,params.inputfilter.Gabor.thetalist);
end
%Suppress the responses that are lower than a given threshold t1 from the maximum response
input(input < params.COSFIRE.t1*max(input(:))) = 0;
again the error is -
>> ExampleBloodVesselSegmentation
Compiling...
Building with 'MinGW64 Compiler (C)'.
MEX completed successfully.
Compiling done.
Enjoy using B-COSFIRE filters!!!
Undefined function or variable 'input'.
Error in configureCOSFIRE (line 23)
input(input < params.COSFIRE.t1*max(input(:))) = 0;
Error in BCOSFIRE_media15 (line 90)
symmfilter{1} = configureCOSFIRE(line1, round([y x]), symm_params);
Error in ExampleBloodVesselSegmentation (line 62)
[output.respimage] = BCOSFIRE_media15(image, symmfilter, asymmfilter, 0.5);
Nicola Strisciuglio (view profile)
Hi Noa,
for blood vessel segmentation you should use DoG.
I'm not able to reproduce the error. Please refer at the very last version of the code on GitLab https://gitlab.com/nicstrisc/B-COSFIRE-MATLAB and let me know.
Nicola
Noa Shkedi (view profile)
Dear Dr. Nicola Strisciuglio,
I am trying to run the blood vessel example and immediantly got errors.
For the blood vessel example, should I change the filter to Gabor (default is DoG)?
If the filter is DoG the error is -
Undefined function or variable 'input'.
Error in configureCOSFIRE (line 23)
input(input < params.COSFIRE.t1*max(input(:))) = 0;
input is not defined if the filter is DoG
Thanks in advanced,
Noa
Nicola Strisciuglio (view profile)
Hello Dhimas,
here the answers:
1. In the parameters of the function blurshift there are shift values for the blurring kernel itself (which we do not use in this implementation, that's why they are set to 0). The shift operation you are referring at is done in computation of the response of the COSFIRE filter in the file applyCOSFIRE.m at the line number 292 (tupleoutput = circshift(tuple.hashtable(hashkey),[round(row),-round(col)]);) using the function circshift.
2. The max operation is done inside blurshift (that calls maxgaussianfilter, which is a gaussian dilation operation (or max-blurring)).
Regards,
Nicola
Dhimas Arief Dharmawan (view profile)
Dear Dr. Nicola Strisciuglio,
Thank you for the submission. The code is very useful.
However, I have some concerns regarding the code as follows:
1. In the paper, you obtained the blurred and shifted DoG filter response using equation (5). If I am not mistaken, you performed blurring and shifting to the DoG filter response using a subcode called 'blurshift' in the 'computeTuples' subcode. As described in the paper, 'blurshift' was used with some sigma values. Also, it was mentioned that several values of u and v were used in the shifting process. Nevertheless, I am curious why 'blurshift' was only used with 'shiftrow' and 'shiftcol' equal to 0.
2. In addition to the point (1), I am not able to find in the 'computeTuples' subcode, a syntax or subcode which maximizes the blurred and shifted DoG filter responses as in equation 5 of the paper. Is the maximization process performed in 'blurshift'?
Thank you very much.
Adrian Kind (view profile)
lidia Talavera (view profile)
Laura Fernandez Robles (view profile)
Excellent work!
remaoun salim (view profile)
Nicola Strisciuglio (view profile)
Xingtian dong,
you can find instructions in the README file, where it says that you have to run the script BeforeRunning.m in order to compile a MEX file required by COSFIRE filters.
xingtian dong (view profile)
I can't run it. It says you haven't define 'dilate'.
blurshift>maxgaussianfilter (line 44)
Z = dilate(dilate(Z1,gauss1D,f1(1)-1,f1(end),f2(1)-1,f2(end)),gauss1D',f1(1)-1,f1(end),f2(1)-1,f2(end));
Nicola Strisciuglio (view profile)
Dear Haolin,
the problem was that you tried to call Application() without an output parameter.
If you wanted the B-COSFIRE response only, you could call
resp = Application();
If you wanted also the orientation map you could type
[resp, oriensmap] = Application();
Anyway, I corrected this bug and if you download the actual code, MATLAB will visualize the B-COSFIRE response image and the binary vessel map in two different windows when Application() is called without output parameters.
haolin (view profile)
Dear Muhammad, ‘Reference to non-existent field 'respimage'.
Error in Application (line 56)
output.segmented = (output.respimage > 37);’,i don't know what cuase that, please tell me , thank you
haolin (view profile)
Dear Muhammad, ‘Reference to non-existent field 'respimage'.
Error in Application (line 56)
output.segmented = (output.respimage > 37);’,i don't know what cuase that, please tell me , thank you
haolin (view profile)
Thanks for your research, it's extremely promote my work!!!
Pavel Vostatek (view profile)
lei ru (view profile)
good jop!
Ciro Mascolo (view profile)
Nicola Strisciuglio (view profile)
Dear Muhammad,
L is a parameter whose value has to be chosen by you. It should be the average width (in terms of pixels) of the vessels you want to detect in your images.
Muhammad Usman khan (view profile)
Hello Nicola,
can you please provide details that how to estimate a reasonable value of sigma. I have funds images having size of 2 MB. I got a lot of noise. I found an equation in section 3.6 to estimate sigma automatically but I don't understand that how to compute the value of "L" in that equation.
ting su (view profile)
Philipp (view profile)
Thanks for the submission, works great!
One comment/tip: the quality of the result improves significantly when applying illumination correction, i.e. subtracting from the grayscale image the median filtered image with large region size (I use 25 pixels).
Nicola Strisciuglio (view profile)
Dear Michal,
The parameters of the filter, especially the sigma and the rho, are specific for the characteristics of the vessel-like structures that you want to detect. For high-resolution images, I would expect thicker vessels, so I would use lager values for "sigma". It is the same (more or less) if you reduce the resolution of the images: in this case the vessels become thinner and you can use lower values of sigma. By the way, in Section 3.4 of the paper "Trainable COSFIRE filters for vessel delineation with application to retinal images" there is a suggestion about how to estimate a reasonable value of sigma. Hope it was helpful.
Michal (view profile)
quick follow up on my previous comment. high resolution of picture causes the algorithm to break and pick up a lot of noise, upon re sizing <1000px works like charm and is super fast
Michal (view profile)
How should I select the symmfilter and asymmfilter parameters ? when i try to use the same as in demo for my fundus image the segmentation pick up a lot of noise. Or I'm missing some pre-processing step ? Any advice on how to segment this image will be appreciatted.
https://goo.gl/0A4pSe
Thank you
Michal
peppeweb dalessio (view profile)
Very fast algorithm!
Astone (view profile)
ESTEFANÍA (view profile)
Ugo Moschini (view profile)
Shahab Aslani (view profile)
Nicola Strisciuglio (view profile)
Hi zoaia asif, in the zip package you find a README file with the instructions.
zoaia asif (view profile)
how to run these codes? and which m file to run initially?
Nicola Strisciuglio (view profile)
We use a vector of the type 0:255 (so 256 values) in Matlab. It indicates the interval for the scaling of the response image and the set of thresholds to use for the evaluation of the algorithm.
Sana Alam (view profile)
What is the value of span in getStatsData function?