Ask Your Question
0

can readCalibrationIni function get ROI data parsing a file?

asked 2012-10-04 00:44:40 -0500

aldo85ita gravatar image

Hi everybody, I'm building a simple application that read a file .txt, parse it with

bool readCalibrationIni(const std::string& file_name, std::string& camera_name,
                        sensor_msgs::CameraInfo& cam_info)

of "camera_calibration_parsers" package and create an object "sensor_msgs::CameraInfo". This function seems don't parse ROI (Region Of Interest) info contained in the file, for example:

# Camera intrinsics
[image]

width
640

height
480

[TrusCamera]

camera matrix
782.015630 0.000000 347.626583
0.000000 785.621477 155.819230
0.000000 0.000000 1.000000

distortion
-0.153979 -0.023735 -0.002647 0.002344 0.000000

rectification
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000

projection
757.675406 0.000000 349.847926 0.000000
0.000000 765.347350 152.545843 0.000000
0.000000 0.000000 1.000000 0.000000

[roi]
x_offset
0

y_offset
0

height
0

width
0

do_rectify
False

parsing this file the following fields are filled in the CameraInfo object:

CameraInfo_()
  : header()
  , height(0)
  , width(0)
  , distortion_model()
  , D()
  , K()
  , R()
  , P()

but not the fields related to ROI and binning

, binning_x(0)
  , binning_y(0)
  , roi()
  {
    K.assign(0.0);
    R.assign(0.0);
    P.assign(0.0);
  }

How to set them?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-10-05 09:12:13 -0500

joq gravatar image

updated 2012-10-09 05:35:56 -0500

No. The ROI and binning are operational parameters, separate from the intrinsic calibration.

EDIT: Those fields are set to zeros by the CameraInfo constructor. Clients interpret that as "no binning" and "full resolution ROI".

If you want to set them yourself, store the desired values in the corresponding variables. REP 104 explains their semantics.

edit flag offensive delete link more

Comments

Thank you @joq, Is there any "readOperationalParameters" function available in another package?

aldo85ita gravatar image aldo85ita  ( 2012-10-08 23:58:55 -0500 )edit

Yes,it seems work. I did creating a sensor_msgs::CameraInfo camera_info by readCalibrationIni and I filled camera_info.roi.x_offset=... and all the others field. Kind regards.

aldo85ita gravatar image aldo85ita  ( 2012-10-09 06:53:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-10-04 00:44:40 -0500

Seen: 102 times

Last updated: Oct 09 '12