515779763f9412e3863f279e0862a74cd3672ac9,mahotas/lbp.py,,lbp,#,31

Before Change


        coordinates[0][i] += dy
        coordinates[1][i] += dx
    data = map_coordinates(image, coordinates.reshape((2,-1)), order=1).reshape((image.size, -1))
    codes = (data.T > image.ravel()).sum(0)
    mahotas._lbp.map(codes.astype(np.uint32), points)
    final = fullhistogram(codes.astype(np.uint32))

    codes = np.arange(2**points, dtype=np.uint32)
    iters = codes.copy()
    mahotas._lbp.map(codes.astype(np.uint32), points)
    pivots = (codes == iters)
    npivots = np.sum(pivots)
    compressed = final[pivots[:len(final)]]
    compressed = np.concatenate((compressed, [0]*(npivots - len(compressed))))
    return compressed

After Change


        pixels = image[Y,X].ravel()
    else:
        Y,X = np.indices(image.shape)
        pixels = image.ravel()
    angles = np.linspace(0, 2*np.pi, points+1)[:-1]
    coordinates = np.empty((2, points, Y.size), float)
    for i,(dy,dx) in enumerate(zip(radius * np.sin(angles), radius * np.cos(angles))):
        coordinates[0][i] = Y.ravel()
        coordinates[1][i] = X.ravel()
        coordinates[0][i] += dy
        coordinates[1][i] += dx
    data = map_coordinates(image, coordinates.reshape((2,-1)), order=1).reshape((Y.size, -1))
    codes = (data.T > pixels).sum(0)
    codes = mahotas._lbp.map(codes.astype(np.uint32), points)
    final = fullhistogram(codes.astype(np.uint32))

    codes = np.arange(2**points, dtype=np.uint32)
    iters = codes.copy()
    codes = mahotas._lbp.map(codes.astype(np.uint32), points)
    pivots = (codes == iters)
    npivots = np.sum(pivots)
    compressed = final[pivots[:len(final)]]
    compressed = np.concatenate((compressed, [0]*(npivots - len(compressed))))
    return compressed
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 2

Instances


Project Name: luispedro/mahotas
Commit Name: 515779763f9412e3863f279e0862a74cd3672ac9
Time: 2010-12-03
Author: lpc@cmu.edu
File Name: mahotas/lbp.py
Class Name:
Method Name: lbp


Project Name: luispedro/mahotas
Commit Name: 3035cc365d6a2d4a379212b158eb577cdd2bd39c
Time: 2012-11-28
Author: luis@luispedro.org
File Name: mahotas/tests/test_median_filter.py
Class Name:
Method Name: _slow_rank_filter


Project Name: statsmodels/statsmodels
Commit Name: 3b2de5dd3d440db884271ddf36fd3b55ddbffb05
Time: 2020-02-10
Author: chad@chadfulton.com
File Name: statsmodels/tsa/statespace/cfa_simulation_smoother.py
Class Name: CFASimulationSmoother
Method Name: simulate


Project Name: scikit-learn/scikit-learn
Commit Name: f685547f801b13afc0874ed348e3a46600113136
Time: 2020-06-17
Author: alexhenrie24@gmail.com
File Name: sklearn/neural_network/_multilayer_perceptron.py
Class Name: BaseMultilayerPerceptron
Method Name: _backprop