Skip to main content

Python Image Feature Detection

This package implements a small assortment of (currently, three) algorithms related to computer vision and image feature detection:

The code was originally developed using the EPD free Python 2.7.3 distribution (now offered as Enthought Canopy Express) and has most recently been tested on Python 2.7.10 and 3.6.4.

Screen Shots

Typical output of the three algorithms looks like this:

Blocks

screenshots/blocksTest_screenshot.png

House

screenshots/house_screenshot.png

Package Contents

The package is organized into four modules, briefly described below:

features

Contains the top-level end user functions which actually return the image features

.wangbrady(): Implements Wang-Brady corner detection

.susanEdge(): Implements SUSAN edge detection

.susanCorner(): Implements SUSAN corner detection

masks

Generates footprints and eventually passes them down into fast compiled DLL code in scipy.ndimage._ndimage.pyd, via functions in scipy.ndimage.filters module

.getDeriv() Calculates first and second partial derivatives with respect to image grayscale brightness

.circFootprint() Calculates pixel membership (within a square array) of pixels inside a circular footprint

.usan() Calculates USAN response of each pixel in the image (see [SB1995] [SB1997] for details)

cleanedges

Contains several functions to refine and remove noise from the raw response returned by edge detection algorithms

.roundAngle() Rounds edge normal direction angle to one of four major directions: horizontal, vertical, diagonal (positive slope) or diagonal (negative slope)

.nonMaxSuppEdge() Suppresses edge responses from pixels which are not local maxima on a line segment along their local edge normal direction

.hystThresh() Implements Canny style dual level hysteresis thresholding

.listEdge() Assigns pixels with non-zero edge response into discrete groups based upon contiguity and also provides a list of member pixels of each group

.minMembership() Rejects edges that consist of fewer than a minimum number of contiguous pixels

example

Demonstrates proper usage of the functions in the features module

.demo() Runs the algorithms in the features module on a couple of standard test images (or user-supplied image files, if desired) using default parameter settings

Dependencies

There are four external dependencies, all of which are very popular and widely used, and may be expected to install with no issues on practically any OS:

Install

The recommended way to the install the ftdetect package is from a universal wheel, using pip:

pip install ftdetect

If desired, the ftdetect package can also support distribution via Python’s older legacy distribution system, setuptools. After downloading and unzipping the package, open a command line shell, change directory to the package folder that contains setup.py, and simply type:

python setup.py install

Example

A demo script has been provided in order to illustrate usage. It reproduces the screen shots shown above. To run it from the command line, type:

python -c "import ftdetect.example; ftdetect.example.demo()"

To run it from an interactive Python session (IDLE, IPython, Enthought Canopy GUI, etc.), type:

import ftdetect.example
ftdetect.example.demo()

The demo script is also capable of running on user-selected figures, like so:

ftdetect.example.demo(['filea.jpg', 'fileb.gif', 'filec.png'])

however, execution speed may vary widely. The SUSAN algorithms in particular are prone to running very slowly on some images, particularly those with large dimensions, textured surfaces, or complicated fine structure. If that happens, choose another image which is both smaller and doesn’t contain as much fine detail. Another more advanced option is to vary the algorithm input parameters so as to decrease the sensitivity. However, the code in the example module is intended to be introductory, and therefore it simply accepts the default input settings for all algorithms. If you want to modify the defaults, drill down further into the features module and read the docstrings, in order to understand what the parameters mean.

References

[WB1995]

Han Wang and Michael Brady, “Real-time corner detection algorithm for motion estimation”, Image and Vision Computing 13(9): 695-703 (Nov 1995). doi: 10.1016/0262-8856(95)98864-P

[SB1995] (1,2,3)
    1. Smith and J. M. Brady, “SUSAN–A New Approach to Low Level Image Processing”, Technical Report TR95SMSIc (1995).

[SB1997] (1,2,3)
    1. Smith and J. M. Brady, “SUSAN–A New Approach to Low Level Image Processing”, International Journal of Computer Vision 23(1): 45-78 (May 1997). doi: 10.1023/A:1007963824710

Package Maintenance Information

Version: 1.0.1

Date: 2018-01-18

URL: https://github.com/stachyra/ftdetect

Author: Andrew L. Stachyra

Contact: andrewlstachyra@gmail.com

Metadata

Release files for ftdetect 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ftdetect 1.0.1
File Size Uploaded
ftdetect-1.0.1.tar.gz 108.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ftdetect 1.0.1
File Interpreter ABI Platform
ftdetect-1.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 220.3 kB

Release files / ftdetect-1.0.1.tar.gz

Download URL ftdetect-1.0.1.tar.gz
Size 108.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4b51e28faa26101835c95ba6e05ad67e5f4eccede0f4c4381687e60bfe4fc58b
BLAKE2b-256 checksum
How to use checksums
6ab515561d7be35e750fdac2840d197fa43bd34f268ed4a73b6a66911087adb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ftdetect-1.0.1-py2.py3-none-any.whl

Download URL ftdetect-1.0.1-py2.py3-none-any.whl
Size 112.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
30be4f7aab66b0a1312e16c0bf79501f86f51a16a1469ad6e941cf077b13ebf8
BLAKE2b-256 checksum
How to use checksums
daa1e8740f3e93f12c6b58d53d39af0b401341dc34a0c874649a5d55187cd31e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page