Ask Your Question
0

Pass SimpleBlobDetector object to findCirclesGrid in Android

asked 2017-06-29 04:12:16 -0600

HolyMoly gravatar image

updated 2017-06-29 04:15:46 -0600

Hi y'all, I am using OpenCV 3.2.0 on Android to detect an asymmetrical circle grid. I want to modify the default parameters of SimpleBlobDetector and pass it on findCircleGrid() to improve the detection rate. I can get as far as modifying the params but I am unable to pass this object to findCirclesGrid. In fact, findCirclesGrid does not take in a fourth parameter in the Android version. I am able to do it successfully in C++ like this:

SimpleBlobDetector::Params params;

params.filterByConvexity = false;

Ptr<FeatureDetector> blobDetector = SimpleBlobDetector::create(params);

findCirclesGrid(image, boardsize, centers, CALIB_CB_ASYMMETRIC_GRID, blobDetector);

Is there any way to do this in Android version of OpenCV? Thanks in advance!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-06-29 05:01:29 -0600

berak gravatar image

unfortunately, you're out of luck here.

the java version of findCirclesGrid won't let you pass an instance of any blob detector.

also, you can't construct a blob detector from java, it is not wrapped into the api.

edit flag offensive delete link more

Comments

Ah! Is there any reason why you can't do that only in the java version? Will mucking about the source code help? Thanks!

HolyMoly gravatar imageHolyMoly ( 2017-06-29 05:56:06 -0600 )edit

if i had to guess, it is because of the "Params" structure (which would have to be manually added somewhere to the wrapping code)

the "proper fix" would be: adding getters/setters to the SimpleBlobDetector (in the c++ api already), but you won't be allowed to do so, since it will break ABI consistancy.

maybe you can write that part of your app using jni ? (no such limitations from c++ ..)

berak gravatar imageberak ( 2017-06-29 06:07:23 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-06-29 04:12:16 -0600

Seen: 1,470 times

Last updated: Jun 29 '17