mirror of
https://github.com/correl/dejavu.git
synced 2024-11-23 19:19:53 +00:00
[comments-only] Update fingerprint.py
type at line #97. FINGERPRINT_REDUCTION is actually being used to slice generated hash from 0th to FINGERPRINT_REDUCTION(th) position, updated the comment accordingly
This commit is contained in:
parent
7f53f2ab68
commit
7268ce0a78
1 changed files with 4 additions and 4 deletions
|
@ -56,9 +56,9 @@ MAX_HASH_TIME_DELTA = 200
|
||||||
PEAK_SORT = True
|
PEAK_SORT = True
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Number of bits to throw away from the front of the SHA1 hash in the
|
# Number of bits to grab from the front of the SHA1 hash in the
|
||||||
# fingerprint calculation. The more you throw away, the less storage, but
|
# fingerprint calculation. The more you grab, the more memory storage,
|
||||||
# potentially higher collisions and misclassifications when identifying songs.
|
# with potentially lesser collisions of matches.
|
||||||
FINGERPRINT_REDUCTION = 20
|
FINGERPRINT_REDUCTION = 20
|
||||||
|
|
||||||
def fingerprint(channel_samples, Fs=DEFAULT_FS,
|
def fingerprint(channel_samples, Fs=DEFAULT_FS,
|
||||||
|
@ -94,7 +94,7 @@ def get_2D_peaks(arr2D, plot=False, amp_min=DEFAULT_AMP_MIN):
|
||||||
struct = generate_binary_structure(2, 1)
|
struct = generate_binary_structure(2, 1)
|
||||||
neighborhood = iterate_structure(struct, PEAK_NEIGHBORHOOD_SIZE)
|
neighborhood = iterate_structure(struct, PEAK_NEIGHBORHOOD_SIZE)
|
||||||
|
|
||||||
# find local maxima using our fliter shape
|
# find local maxima using our filter shape
|
||||||
local_max = maximum_filter(arr2D, footprint=neighborhood) == arr2D
|
local_max = maximum_filter(arr2D, footprint=neighborhood) == arr2D
|
||||||
background = (arr2D == 0)
|
background = (arr2D == 0)
|
||||||
eroded_background = binary_erosion(background, structure=neighborhood,
|
eroded_background = binary_erosion(background, structure=neighborhood,
|
||||||
|
|
Loading…
Reference in a new issue