Ask Your Question
-1

Why FeatureDetector is deprecated on OpenCV 3.42 ??

asked 2018-12-03 02:36:07 -0500

bern_007 gravatar image

updated 2018-12-05 01:16:06 -0500

berak gravatar image

I am using OpenCV 3.42 on Android Studio and I am using Android 9.0(Pie) Compile SDK version. When i am using FeatureDetector it is in strikethrough format and if i run it the application crashes..

FeatureDetector featureDetector = FeatureDetector.create(FeatureDetector.SIFT);

and this is displayed on warning..

uses or overrides a deprecated API.
Recompile with -Xlint:deprecation for details.

How can I fix this?? Thank you.

edit retag flag offensive close merge delete

Comments

please, no screenshots of TEXT here. remove them, and add a TEXT version, so we can quote you properly, it can be indexed, etc. thank you.

berak gravatar imageberak ( 2018-12-03 03:07:02 -0500 )edit
1

ok.. thank you..

bern_007 gravatar imagebern_007 ( 2018-12-05 01:12:14 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-12-03 03:36:24 -0500

berak gravatar image

updated 2018-12-03 04:00:11 -0500

  • why is it deprecated ? -- because it is a leftover from the outdated 2.4 api.
  • why does it crash ? -- because the opencv android sdk you downloaded does not have any support for SIFT or SURF builtin (they were moved to opencv_contrib long ago.)
  • what should i do ? -- first, have a look at the docs. you should avoid those deprecated interfaces, and use code like ORB orb = ORB.create() instead.

  • how do i get SIFT ? -- you'll have to (re)build your opencv android sdk locally from src, with the opencv contrib modules.

    git clone -b 3.4 https://github.com/opencv/opencv

    git clone -b 3.4 https://github.com/opencv/opencv_contrib

    have a look here for further build instructions (you'll also need some tools, like python, cmake and ninja)

edit flag offensive delete link more

Comments

thanks for answer

bern_007 gravatar imagebern_007 ( 2018-12-05 01:17:48 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-12-03 02:36:07 -0500

Seen: 263 times

Last updated: Dec 05 '18