Ask Your Question
1

How to set Parameters for StereoBM in Android/Java?

asked 2013-03-21 23:41:22 -0600

I am trying to make disparity map of two images that I took from the phone's camera. I have written the code in Android/Java (not using C++). I'm using stereoBM to calculate the disparity map but I am unable to set the parameters.

In C++, it can be done by

StereoBM sbm;
sbm.state->SADWindowSize 
sbm.state->numberOfDisparities
sbm.state->preFilterSize 
sbm.state->preFilterCap 
sbm.state->minDisparity 
sbm.state->textureThreshold 
sbm.state->uniquenessRatio 
sbm.state->speckleWindowSize 
sbm.state->speckleRange 
sbm.state->disp12MaxDiff

but in Android/Java, I can only set PRESET, SADWindowSize, and nDisparities using the constructor. Is there any way in which I can set these parameters?

And I also once tried StereoSGBM (the parameters can be set in that), but during USB debugging, while computing the disparity map, the application took too long and hung. So I am trying to stick to StereoBM.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-03-22 00:41:20 -0600

It looks like this functionality is not wrapped to Java. The only solution for now is to wrap state processing manually or set it using C++ code. I create ticket on OpenCV issue tracker.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-21 23:41:22 -0600

Seen: 1,072 times

Last updated: Mar 22 '13