Skip to content

vicimikul/bcosfire_python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python implementation of BCOSFIRE

Sample image Sample image output

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

This is a Python implementation of the B-COSFIRE algorithm, which was originally implemented in MATLAB by Nicola Strisciuglio et. al. Please find the B-COSFIRE paper here (2015).

The B-COSFIRE filter aims to segment elongated patterns in images such as blood vessels in retinal images. It is based on an existing filter, so-called Combination Of Shifted FIlter Responses (COSFIRE). While the COSFIRE filters are used to detect bifurcations in the retinal images, the B-COSFIRE filters (as B stands for bar) are used to detect bar-like structures (e.g. vessels) in the images. Please check the COSFIRE paper (2013) to understand the basics of the algorithm.

The core of the B-COSFIRE algorithm relies on the Difference-of-Gaussians (DoG) filters which are used for detecting lines and edges. Since the vessels in the retinal images vary in orientation and thickness, it is a challenging task to define convenient filters for such a complexity. The B-COSFIRE algorithm comes up with a smart idea for this challenge:

  1. The user provides a vessel-like prototype pattern, e.g., a bar.
  2. The pattern is filtered with a DoG filter followed by a blur operation in order to reduce the noise.
  3. The positions of the maximum points on the bar are marked by using a circle strategy.
  4. A DoG filter is defined for each position.
  5. The input image (e.g. retinal image) is filtered with the shifted DoG filters, and this results in the DoG responses.
  6. The weighted geometric mean of the DoG responses give the output of the B-COSFIRE filter.

Built With

You need python3 for this project.

Getting Started

To get a local copy, you can follow the following steps.

Installation

You can install the repository and required Python packages by following the steps below.

  1. Clone the repo
git clone https://github.com/Brains-for-hire/diabetic-retinopathy/tree/master/cosfire
  1. Install required packages
pip3 install -r requirements.txt

Usage

To run the BCOSFIRE algorithm on the sample image ./data/sample_0.tif, you can run the following command in the terminal.

python3 BCOSFIRE.py ./data/sample_0.tif

Roadmap

See the open issues for a list of known issues.

Contributing

Any contributions are greatly appreciated.

Contributions might include anything which make the code being more efficient and yielding better results.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the BSD-3-Clause License. See LICENSE for more information.

Contact

Project Link: https://github.com/Brains-for-hire/diabetic-retinopathy

About

Python implementation of the BCOSFIRE algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%