コード例 #1
0
def test_haardetector():
    """
    Asserts that at-least one feature is detected in the "camera-man" image,
    which should contain many features.
    """

    path = os.path.dirname(__file__)

    image = plt.imread('{0}/../examples/data/cameraman.png'.format(path))

    options = {'levels': 5, 'threshold': 0.2, 'locality': 5}

    features = detector.detect(image, detector.HaarDetector, options)

    # Asserts that there are features present:

    assert len(features['points'].items()) > 0
コード例 #2
0
ファイル: test_detectors.py プロジェクト: janrito/imreg
def test_haardetector():
    """
    Asserts that at-least one feature is detected in the "camera-man" image,
    which should contain many features.
    """

    path = os.path.dirname(__file__)

    image = plt.imread('{0}/../examples/data/cameraman.png'.format(path))

    options = {
        'levels': 5,
        'threshold': 0.2,
        'locality': 5
        }

    features = detector.detect(image, detector.HaarDetector, options)

    # Asserts that there are features present:

    assert len(features['points'].items()) > 0
コード例 #3
0
""" 
Detects haar salient features in an image - 
    
"""

import scipy.ndimage as nd
from matplotlib.pyplot import imread, plot, imshow, show

from imreg.features.detector import detect, HaarDetector

# Load the image.
image = imread('data/cameraman.png')
#image = nd.zoom(image, 0.50)

options = {}
options['levels'] = 5  # number of wavelet levels
options[
    'threshold'] = 0.2  # threshold between 0.0 and 1.0 to filter out weak features (0.0 includes all features)
options['locality'] = 5  # minimum (approx) distance between two features

features = detect(image, HaarDetector, options)

imshow(image, cmap='gray')

for id, point in features['points'].items():
    plot(point[1], point[0], 'or')

show()
コード例 #4
0
ファイル: haar_features.py プロジェクト: janrito/imreg
""" 
Detects haar salient features in an image - 
    
"""

import scipy.ndimage as nd
from matplotlib.pyplot import imread, plot, imshow, show

from imreg.features.detector import detect, HaarDetector

# Load the image.
image = imread("data/cameraman.png")
# image = nd.zoom(image, 0.50)

options = {}
options["levels"] = 5  # number of wavelet levels
options["threshold"] = 0.2  # threshold between 0.0 and 1.0 to filter out weak features (0.0 includes all features)
options["locality"] = 5  # minimum (approx) distance between two features

features = detect(image, HaarDetector, options)

imshow(image, cmap="gray")

for id, point in features["points"].items():
    plot(point[1], point[0], "or")

show()