user1828449
user1828449

Reputation: 43

Android Aruco augmented reality

Since I want a simple augmented reality sample code, I found the Aruco in following website...

http://www.uco.es/investiga/grupos/ava/node/26

I followed steps in "How to start" to run the sample code

the first and second step seems ok, but I got error when I ran the applicationenter image description here

can somebody help me?

Thank you!

Upvotes: 0

Views: 1793

Answers (2)

Benoit
Benoit

Reputation: 31

You are missing the camera.xml file:

Take a look at the Aruco Description on the Web

The doc seems to be old. The calibration utility take a configuration file as parameter. You have an example in opencv.

Upvotes: 0

Martin Kubík
Martin Kubík

Reputation: 56

I solved the same error by creating camera.xml using "camera-calibration" project sample from OpenCV for Android SDK (2.4.8).

Follow instruction on top of "CameraCalibrationActivity.java" class.

After press "Calibrate" button you receive necessary calibration parameters in Log.cat concsole. For example:

03-12 15:46:35.639: I/OCVSample::CameraCalibrator(4348): Average re-projection error: 0,207973
03-12 15:46:35.679: I/OCVSample::CameraCalibrator(4348): Camera matrix: [498.8875537329555, 0, 239.5;
03-12 15:46:35.679: I/OCVSample::CameraCalibrator(4348):   0, 498.8875537329555, 159.5;
03-12 15:46:35.679: I/OCVSample::CameraCalibrator(4348):   0, 0, 1]
03-12 15:46:35.679: I/OCVSample::CameraCalibrator(4348): Distortion coefficients: [-0.03629159746850338; 2.011849786210916; 0; 0; -8.554278584838848]
03-12 15:46:35.759: I/OCVSample::CalibrationResult(4348): Saved camera matrix: [498.8875537329555, 0, 239.5;
03-12 15:46:35.759: I/OCVSample::CalibrationResult(4348):   0, 498.8875537329555, 159.5;
03-12 15:46:35.759: I/OCVSample::CalibrationResult(4348):   0, 0, 1]

Put this parameters to XML in this form:

<?xml version="1.0" encoding="windows-1250"?>
<Camera_Matrix type_id="opencv-matrix">
<rows>3</rows>
<cols>3</cols>
<dt>d</dt>
<data>
 498.8875537329555 0. 239.5 0.
 498.8875537329555 159.5 0. 0. 1.</data></Camera_Matrix>
<Distortion_Coefficients type_id="opencv-matrix">
<rows>5</rows>
<cols>1</cols>
<dt>d</dt>
<data>
-0.03629159746850338 2.011849786210916 0. 0.
 -8.554278584838848</data></Distortion_Coefficients>

Save it as camera.xml, create folder "calibration" on phone SD card and put there camera.xml. Now you can run Aruco sample aplication.

Upvotes: 1

Related Questions