Ask Your Question
0

calibrate-camera-charuco sample error

asked 2017-04-27 05:24:22 -0600

antithing gravatar image

I am trying to use the opencv calibrate-camera-charuco sample, from here:

https://github.com/opencv/opencv_contrib/blob/master/modules/aruco/samples/calibrate_camera_charuco.cpp

I have it building but cannot get it to run. When i launch it with the command line:

charuco-calibration.exe -t=charuco -pf=defaultConfig.xml -h=5 -w=8 -d=16 -sl=0.032 -ml=0.017 -ci=0 -dp=detector_params.yml

It gives me the error:

Missing parameter #0

This seems like a bug-error, as I cannot find anything matching that parameter anywhere. Has anyone used this sample successfully? or run across this error?

the expected commands, as listed in the code, are:

   "{w        |       | Number of squares in X direction }"
    "{h        |       | Number of squares in Y direction }"
    "{sl       |       | Square side length (in meters) }"
    "{ml       |       | Marker side length (in meters) }"
    "{d        |       | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2,"
    "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, "
    "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12,"
    "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}"
    "{@outfile |<none> | Output file with calibrated camera parameters }"
    "{v        |       | Input from video file, if ommited, input comes from camera }"
    "{ci       | 0     | Camera id if input doesnt come from video (-v) }"
    "{dp       |       | File of marker detector parameters }"
    "{rs       | false | Apply refind strategy }"
    "{zt       | false | Assume zero tangential distortion }"
    "{a        |       | Fix aspect ratio (fx/fy) to this value }"
    "{pc       | false | Fix the principal point at the center }"
    "{sc       | false | Show detected chessboard corners after calibration }";

thank you.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-04-27 07:40:16 -0600

LBerger gravatar image

updated 2017-04-27 08:02:51 -0600

You forgot output file :

charuco-calibration.exe -t=charuco -pf=defaultConfig.xml -h=5 -w=8 -d=16 -sl=0.032 -ml=0.017 -ci=0 -dp=detector_params.yml intrinsic.yml
edit flag offensive delete link more

Comments

thank you! that works for a live camera, but when i add -v=video.mov it jumps straight to not enough captures for calibration and does not load the file. The mov is in the same folder, do i need something else to run it from video? thanks again!

antithing gravatar imageantithing ( 2017-04-27 10:59:36 -0600 )edit

Can you read your video using opencv ? You have an example :to test it : cpp-example-lkdemo.exe or write a basic program :

VideoCapture v;

v.open("myvideo.mov");
if (v.isopened())
{
for(;;)
    {
        cap >> frame;
        if( frame.empty() )
            break;
        imshow("myvideo",frame);
       waitkey(1);
}

else cout <<"cannot opened video\n";

LBerger gravatar imageLBerger ( 2017-04-27 11:07:47 -0600 )edit

Ah, no I cannot! I have:

void main()
{

    VideoCapture v;
    cv::Mat frame;

    v.open("D:/VP/interactive-calibration/x64/Release/bmCalib.mov");
    if (v.isOpened())
    {
        for (;;)
        {
            v >> frame;
            if (frame.empty())
                break;
            cv::imshow("myvideo", frame);
            cv::waitKey(1);
        }
    }
}

and it will not open. the path is correct, I have tried the mov and the avi version of the file. What else could it be? Thanks again.

antithing gravatar imageantithing ( 2017-04-27 11:19:13 -0600 )edit

Have you got opencv_ffmpeg320_64.dll in path?

LBerger gravatar imageLBerger ( 2017-04-27 11:37:15 -0600 )edit

I copied it into the folder, it was named opencv_ffmpeg_64.dll, and I renamed it opencv_ffmpeg320_64.dll, (based on a stackoverflow post I found) is that correct?

antithing gravatar imageantithing ( 2017-04-27 11:48:00 -0600 )edit
1

Yes. original is here for opencv3.2

LBerger gravatar imageLBerger ( 2017-04-27 11:53:42 -0600 )edit
1

Thank you! I grabbed both those, renamed and copied to the folder with my exe. Still no video. I will go back and double check that I compiled openCv with ffmpeg support turned on in cmake, I assume I need it for this to work?

antithing gravatar imageantithing ( 2017-04-27 12:00:33 -0600 )edit
1

Good idea. I thought you use prebuilt version of opencv. If you use cmake to build opencv you don't need to rename opencv_dll. Don't forget to delete cmakecache.txt if you want to rebuild everything 'and clean solution if you use Visual studio)

LBerger gravatar imageLBerger ( 2017-04-27 12:04:39 -0600 )edit

That was indeed the issue, rebuilding all from scratch with ffmpeg support has solved this. thanks again for your time.

antithing gravatar imageantithing ( 2017-04-28 04:14:25 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-04-27 05:24:22 -0600

Seen: 1,490 times

Last updated: Apr 27 '17