public void ContinueInComputingSFM(IFeatureDetector detector, IFeatureDescriptor descriptor, IFeatureMatcher matcher, List <InputFileModel> listOfInput) { var iterMatches = FoundedMatches.Count; countInputFile = DetectedKeyPoints.Count; StartDetectingKeyPoint(countInputFile, listOfInput, detector); StartComputingDescriptor(countInputFile, descriptor); StartMatching(countInputFile, matcher); WriteAddedImages(listOfInput); AppendMatches(FoundedMatches, iterMatches); ContinueVisualSFM(); }
private void StartComputingDescriptor(int countOfExistedKeyPoint, IFeatureDescriptor descriptor) { _winForm.SetMaximumProgressBar("Computing descriptors", DetectedKeyPoints.Count - countInputFile); if (_useParallel) { Parallel.For(countOfExistedKeyPoint, DetectedKeyPoints.Count, x => ComputeDescriptor(DetectedKeyPoints[x], descriptor)); } else { for (int i = countOfExistedKeyPoint; i < DetectedKeyPoints.Count; i++) { ComputeDescriptor(DetectedKeyPoints[i], descriptor); } } _winForm.IncrementValueProgressBar(); }
public void ComputeSfM(IFeatureDetector detector, IFeatureDescriptor descriptor, IFeatureMatcher matcher, List <InputFileModel> listOfInput) { countInputFile = 0; DetectedKeyPoints.Clear(); ComputedDescriptors.Clear(); FoundedMatches.Clear(); switch (fileManager._inputType) { case EInput.ListView: StartDetectingKeyPoint(0, listOfInput, detector); StartComputingDescriptor(0, descriptor); StartMatching(0, matcher); break; case EInput.ConnectedStereoCamera: countInputFile = DetectedKeyPoints.Count; listOfInput = GetInputFromStereoCamera(countInputFile); StartDetectingKeyPoint(countInputFile, listOfInput, detector); StartComputingDescriptor(countInputFile, descriptor); while (!stopSFM) { countInputFile = DetectedKeyPoints.Count; listOfInput = GetInputFromStereoCamera(countInputFile); StartDetectingKeyPoint(countInputFile, listOfInput, detector); StartComputingDescriptor(countInputFile, descriptor); StartStereoMatching(countInputFile, matcher); } break; } WriteAllMatches(FoundedMatches); RunVisualSFM(); }
public void SetFeatureDescriptor(object sender, EventArgs e) { var currentItem = sender as ToolStripComboBox; var enumItem = EnumExtension.ReturnEnumValue <EFeaturesDescriptor>(currentItem.SelectedItem.ToString()); IFeatureDescriptor tempItem = null; switch (enumItem) { case EFeaturesDescriptor.ORB: tempItem = new OrientedFastAndRotatedBrief(); break; case EFeaturesDescriptor.FAST: tempItem = new FAST(); break; case EFeaturesDescriptor.FREAK: tempItem = new FREAK(); break; case EFeaturesDescriptor.BRIEF: tempItem = new BRIEF(); break; case EFeaturesDescriptor.CudaORB: tempItem = new CudaOrientedFastAndRotatedBrief(); break; } _sfmManager._descriptor = tempItem; }
private void ComputeDescriptor(KeyPointModel keypoint, IFeatureDescriptor descriptor, bool AddToList = true, bool SaveOnDisk = true) { WindowsFormHelper.AddLogToConsole($"Start computing descriptor for: {keypoint.InputFile.fileInfo.Name.ToString()}\n"); var computedDescriptor = descriptor.ComputeDescriptor(keypoint); var descriptorNode = new DescriptorModel() { Descriptors = computedDescriptor, KeyPoint = keypoint }; WindowsFormHelper.AddLogToConsole($"FINISH computing descriptor for: {keypoint.InputFile.fileInfo.Name.ToString()}\n"); if (AddToList) { ComputedDescriptors.Add(keypoint.ID, descriptorNode); } if (SaveOnDisk) { SaveSiftFile(descriptorNode); } }