Search code examples
javaopencvreplacedeprecatedfeature-detection

How should I replace FeatureDetector function in new OpenCV?


I have downloaded a sample code of Java OpenCV. In few lines of the code there is FeatureDetectore() method that the compiler says it's deprecated.

    FeatureDetector detector = FeatureDetector.create(FeatureDetector.MSER);
    detector.detect(mGrey, keypoint);
    listpoint = keypoint.toList();

So, How should I replace this part of code? Are there any new alternative for this? or can I continue use of the deprecated function?


Solution

  • You can continue with this and this will work. Deprecation means that there is new recommended alternative, but off course old code will still work. The new way of doing that would be using FastFeatureDetector or AgastFeatureDetector depending on your use case. I am not familiar with OpenCV so unfortunately I can't recommend which exact implementation you need, you need to read JavaDoc/other docs and find out which would fit your code.