public void SetVocabulary(Mat vocabulary) { if (IsDisposed) throw new ObjectDisposedException(GetType().Name); if (vocabulary == null) throw new ArgumentNullException(nameof(vocabulary)); NativeMethods.features2d_BOWImgDescriptorExtractor_setVocabulary(ptr, vocabulary.CvPtr); GC.KeepAlive(vocabulary); }