0

I am developing an android text recognition app in java with Opencv 4.0.1 and tests-two(tesseract). I am doing with downloaded source code. they have used OpenCV version 3.2.0 But the Issue is when I was trying to import FeatureDetector for MSER unable to import that but they did it on version 3.2.0

My Android Studio version is 4.0.1

Is there any alternative way?? How can I replace

Here is the code

  FeatureDetector detector = FeatureDetector.create(FeatureDetector.MSER);
            detector.detect(mGray, keyPoint);  

this is the import I could not call

import org.opencv.features2d.FeatureDetector;
Nusry KR
  • 85
  • 1
  • 12

1 Answers1

1

This link says it is deprecated and suggests to directly instantiate Feature2D classes.

https://docs.opencv.org/3.4/javadoc/org/opencv/features2d/FeatureDetector.html

In this link below there is no FeatureDetector in features2d package for 4.0.1. It has a FastFeatureDetector class in this package.

https://docs.opencv.org/4.0.1/javadoc/org/opencv/features2d/package-summary.html https://docs.opencv.org/4.0.1/javadoc/org/opencv/features2d/FastFeatureDetector.html

You can try import with, org.opencv.features2d.MSER and follow something like this. Another option is to downgrade.

https://docs.opencv.org/4.0.1/javadoc/org/opencv/features2d/MSER.html

B200011011
  • 2,874
  • 18
  • 30
  • if I downgrade, will there is any problems occur? It mean I am doing with latest Android studion version – Nusry KR Nov 11 '20 at 12:40
  • 1
    You should first try without downgrading. In case of downgrade, if your app requires additions from newer opencv versions then you may face problems. Android studio version is not directly related with this. – B200011011 Nov 11 '20 at 13:11