Skip to main content

A multi-scale ridge detector for identifying curvilinear structures in images

Project description

Multi-Scale Ridge Detector

If you find this project useful, please consider giving it a star so that more people can discover and benefit from it!

Overview

This repository contains the Python implementation of a multi-scale ridge detector designed for identifying and measuring curvilinear structures in images across various fields including medical imaging and remote sensing. For more detailed information, please refer to the following literature:

[1] Steger, Carsten. "An unbiased detector of curvilinear structures." IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(2), pp. 113-125, 1998.

[2] Lindeberg, Tony. "Edge detection and ridge detection with automatic scale selection." International Journal of Computer Vision, 30, pp. 117-156, 1998.

[3] Sato, Yoshinobu, et. al. "Three-dimensional multi-scale line filter for segmentation and visualization of curvilinear structures in medical images." Medical Image Analysis, 2(2), pp. 143-168, 1998.

This Python implementation offers a multi-scale adaptation of the ImageJ ridge detection plugin. The detection is more accuracy compared to the ImageJ plugin (in almost all cases we have tested :)) and faster than another Python implementation ridge-detection.

Installation

Prerequisites

  • Python 3.9 or higher
  • Opencv & scikit-image

Install via pip:

pip install ridge-detector

or

 pip install git+https://github.com/lxfhfut/ridge-detector.git

Usage:

from ridge_detector import RidgeDetector
det = RidgeDetector(line_widths=[1, 2, 3],  # Line widths to detect (default: [1, 2])
                    low_contrast=100,  # Lower bound of intensity contrast (default: 100)
                    high_contrast=200,  # Higher bound of intensity contrast (default: 200)
                    min_len=5, # Ignore ridges shorter than this length (default: 5)
                    max_len=0, # Ignore ridges longer than this length, set to 0 for no limit (default: 0)
                    dark_line=True, # Set to True if detecting black ridges in white background, False otherwise (default: True)
                    estimate_width=True, # Estimate width for each detected ridge point (default: True)
                    extend_line=False, # Tend to preserve ridges near junctions if set to True (default: False)
                    correct_pos=False,  # Correct ridge positions with asymmetric widths if set to True (default: False)
                    )
det.detect_lines("path_to_image_or_image_data_in_numpy_array")
det.show_results()
det.save_results("directory_to_store_results")  # Save the detection results to the specified directory

Demonstrations

Original Ridges & Widths Binary Ridges Binary Widths

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ridge_detector-0.1.4.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ridge_detector-0.1.4-py3-none-any.whl (43.0 kB view details)

Uploaded Python 3

File details

Details for the file ridge_detector-0.1.4.tar.gz.

File metadata

  • Download URL: ridge_detector-0.1.4.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for ridge_detector-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f72c47bc456cd0df1777219bd7193bd65868143858882abda1356b9afb0df7bb
MD5 3567a56ac66f0585839df7e9c07ae2db
BLAKE2b-256 b56dbc93e561e4fb83a2e12ca0b0de59105b3ee0eaf88a90871361c057bff0ed

See more details on using hashes here.

File details

Details for the file ridge_detector-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: ridge_detector-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 43.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for ridge_detector-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 596af9a107d5cb3eccd237cbccb100fcc8476e4e41ef276be5d35b582061f984
MD5 a2deaa97ca6f6d1dd53212b748ff5274
BLAKE2b-256 b1b4c978db1c99aab0cf78beb83f92ab7bbf8528b96e1e902e09590f9e9475ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page