fscanf error (can't find cornerInfo.txt) when doing auto corner-extraction

351 views
Skip to first unread message

zheng rong

unread,
Jun 15, 2015, 1:37:56 PM6/15/15
to ocamcali...@googlegroups.com
Dear Prof. Davide,

At first thanks for your Ocam calibration toolbox.

I am working on Ubuntu 14.04 and Matlab-2014a.
when I try to use it to calibrate fisheye camera, I encountered an error:

Processing image 1...
./FindCorners.exe -w 9 -h 7 -m 63 pictures.txt: Signal 126
Error using fscanf
Invalid file identifier. Use fopen to generate a valid file
identifier.

Error in click_ima_calib_rufli (line 120)
cornerInfo = fscanf(fid, '%g %g', [1 2]);
Error in click_calib (line 276)
click_ima_calib_rufli(kk,use_corner_find,calib_data);

Error while evaluating uicontrol Callback

So I check the code:

%Open the corner size information file
filename = 'autoCornerFinder/cToMatlab/cornerInfo.txt';
fid = fopen(filename, 'r');
cornerInfo = fscanf(fid, '%g %g', [1 2]);

and go to the directory but can not find the file cornerInfo.txt. I think this is the reason of the error. But I kon't know why there is no this file.

Can you help me with this problem?

Thank you in advance,

Best regards,

Zheng

soumy...@gmail.com

unread,
Aug 23, 2015, 1:25:58 PM8/23/15
to OCamCalib Toolbox
Could you solve this? I am facing the same error.

Jesper Taxbøl

unread,
Aug 24, 2015, 5:57:27 PM8/24/15
to OCamCalib Toolbox
I am not sure, but I think I am experiencing a related problem. I am not able to use the toolbox on OSX Yosemite + Matlab R2014a. 

I get "Error using fgets"
Invalid file identifier 

It seems file handling is problematic in a similar way.

The toolbox works fine in its windows form.

Kind regards

Jesper

Zheng Rong

unread,
Aug 25, 2015, 12:49:29 PM8/25/15
to ocamcali...@googlegroups.com
Hi,

I haven't solve this error. Did you get any clue about it?

Best,

Zheng

jonathan.co...@gmail.com

unread,
Sep 11, 2015, 5:10:28 AM9/11/15
to OCamCalib Toolbox
Hey,

the error is most probably related to this one:
http://de.mathworks.com/matlabcentral/answers/241799-system-call-results-in-signal-126

fscanf fails because "FindCorners.exe" is not executed and in turn does not create the file read by fscanf. The referred thread does not provide a solution though :-/

jo.eich...@gmail.com

unread,
Oct 20, 2015, 11:38:49 PM10/20/15
to OCamCalib Toolbox
Hi,

The solution which worked for me was posted in the forum which jonathan already pointed out (http://de.mathworks.com/matlabcentral/answers/241799#answer_192042)

Execute >> setenv('LD_LIBRARY_PATH', ''); << in Matlab and the FindCorner.exe gets executed and the files are created which were not available and caused the error.

Cheers, Jonas

juand...@gmail.com

unread,
Oct 30, 2015, 9:14:23 PM10/30/15
to OCamCalib Toolbox
Hi Jonas,

Your solution works on my system. Ubuntu 14.04 + Matlab R2014b

Cheers,
Juan

Reply all
Reply to author
Forward
0 new messages