Пример #1
0
 public Repository(IPermutations permutations, DatabaseService dbService, FingerprintService fingerprintService)
 {
     this.permutations = permutations;
     this.minHash = new MinHash(this.permutations);
     this.dbService = dbService;
     this.fingerprintService = fingerprintService;
 }
Пример #2
0
        public static FingerprintService GetSoundfingerprintingService()
        {
            // Audio service
            IAudioService audioService = new AudioService();

            // Fingerprint Descriptor
            FingerprintDescriptor fingerprintDescriptor = new FingerprintDescriptor();

            // SpectrumService
            SpectrumService spectrumService = new SpectrumService();

            // Wavelet Service
            IWaveletDecomposition waveletDecomposition = new Soundfingerprinting.Fingerprinting.Wavelets.StandardHaarWaveletDecomposition();
            IWaveletService waveletService = new WaveletService(waveletDecomposition);

            // Fingerprint Service
            FingerprintService fingerprintService = new FingerprintService(audioService,
                                                                           fingerprintDescriptor,
                                                                           spectrumService,
                                                                           waveletService);

            return fingerprintService;
        }
Пример #3
0
        private static List<bool[]> GetFingerprintSignatures(FingerprintService fingerprintService, float[] samples, string name)
        {
            Mirage.DbgTimer t = new Mirage.DbgTimer();
            t.Start();

            // work config
            WorkUnitParameterObject param = new WorkUnitParameterObject();
            param.FingerprintingConfiguration = fingerprintingConfigCreation;

            // Get fingerprints
            double[][] LogSpectrogram;
            List<double[][]> spectralImages;
            List<bool[]> fingerprints = fingerprintService.CreateFingerprintsFromAudioSamples(samples, param, out LogSpectrogram, out spectralImages);

            #if DEBUG
            if (Analyzer.DEBUG_INFO_VERBOSE) {
                // Image Service
                ImageService imageService =
                    new ImageService(fingerprintService.SpectrumService, fingerprintService.WaveletService);

                int width = param.FingerprintingConfiguration.FingerprintLength;
                int height = param.FingerprintingConfiguration.LogBins;
                imageService.GetImageForFingerprints(fingerprints, width, height, 2).Save(name + "_fingerprints.png");
            }
            #endif

            Mirage.Dbg.WriteLine("GetFingerprintSignatures Execution Time: " + t.Stop().TotalMilliseconds + " ms");
            return fingerprints;
        }
Пример #4
0
		public static void SaveFingerprintingDebugImages(string fileName, double[][] logSpectrogram, List<bool[]> fingerprints, FingerprintService fingerprintService, IFingerprintingConfiguration fingerprintConfig) {
			
			ImageService imageService = new ImageService(fingerprintService.SpectrumService, fingerprintService.WaveletService);
			
			int fingerprintsPerRow = 2;
			imageService.GetSpectrogramImage(logSpectrogram, logSpectrogram.Length, logSpectrogram[0].Length).Save(fileName + "_spectrogram.png");
			imageService.GetWaveletsImages(logSpectrogram, fingerprintConfig.Stride, fingerprintConfig.FingerprintLength, fingerprintConfig.Overlap, fingerprintsPerRow).Save(fileName + "_wavelets.png");
			imageService.GetLogSpectralImages(logSpectrogram, fingerprintConfig.Stride, fingerprintConfig.FingerprintLength, fingerprintConfig.Overlap, fingerprintsPerRow).Save(fileName + "_spectrograms.png");
			imageService.GetImageForFingerprints(fingerprints, fingerprintConfig.FingerprintLength, fingerprintConfig.LogBins, fingerprintsPerRow).Save(fileName + "_fingerprints.png");
		}