Help! Opencv + Android, StereoCalibrate and HOGDescriptor

604 views
Skip to first unread message

Lurker

unread,
Apr 4, 2012, 2:02:23 AM4/4/12
to android-opencv
Hi guys,

I am currently working with opencv + android to deal with some vision
work.
I got stuck when trying to use StereoCalibrate method and
HOGDescriptor.

1.StereoCalibrate
I am working with htc EVO 3D, a android phone with a pair of stereo
cameras.
The first step I am using the stereo camera is calibration.
I use chessboard to do the calibration and called methods
org.opencv.calib3d.Calib3d.findChessboardCorners
and
org.opencv.calib3d.Calib3d.drawChessboardCorners

Both of above methods worked quite well. Then I use the points data I
got from findChessboardCorners method, and pass it to the:
org.opencv.calib3d.Calib3d.stereoCalibrate

All arguments are of the correct type, but the application quit
without popping out any error/exception information...
Does anyone has experience with this issue on android?

2.HOGDescriptor
I am also trying to use HOG descriptor that has already been
implemented in opencv to do object detection on android phone.
To initialize the HOG descriptor:
org.opencv.objdetect.HOGDescriptor hogDescriptor = new
org.opencv.objdetect.HOGDescriptor(winSize(128,64), blockSize(16,16),
blockStride(8,8), cellSize(8,8), 9, 0, -1, HOGDescriptor.L2Hys, 0.2,
false, HOGDescriptor.DEFAULT_NLEVELS);

This line works quite well.
Then I call:
hogDescriptor.compute(hog_mat_left, descriptors, winStride(16,16),
padding(0,0), locations);
where hog_mat_left is the input image, whose type is CvType.CV_8UC3.
descriptors is List<Float>, which stores the result of the
computation.
For a input image, the HOG feature should have some value. However,
after running this method, the descriptors' value are all ZERO, which
is really weird.


I am new to use opencv on android...
I really appreciate if anyone who has any ideas on these issues could
kindly give me some suggestions.

Thanks!

peppschmier

unread,
Apr 17, 2012, 3:37:17 AM4/17/12
to android...@googlegroups.com
Hi,

@calibration issue:
Did you try to calibrate each camera for its own first? with Calib3d.calibrateCamera(). If it runs without error
it will likely run for the stereoCalibration too. Moreover you can set the USE_INTRINSIC_GUESS flag as you
already computed some values for left/right camera matrices and distortion coefficients.

If you debug your application, you should see some cvError() Message in your LogCat. This error normally tells
you the line of code in the .cpp - File of the function, where an Exception is thrown. You can check this exception
to get a hint why your application breaks.
Reply all
Reply to author
Forward
0 new messages