Re: [ros-users] camera_calibration

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Patrick Beeson
Date:  
To: ros-users
Subject: Re: [ros-users] camera_calibration
It looks like the call to StereoRectify is at least partially the
culprit of my problems. First, the StereoRectify call in calibrator.py,
assumes the last parameters is alpha, but OpenCV2 has two more
parameters before alpha, so alpha is not getting set to 0, as expected,
but is defaulting to -1 because it is not being passed a value. Second,
I had to actually set the alpha to 1.0, not 0.0 to get reasonably focal
lengths in the rectified projection matrix. But, for some reason, it
keep rotating things by 45 degrees to produce the rectified stereo images.

Hope this helps someone out there diagnose my problems using this node.

Patrick Beeson wrote:
> Yes, I am using the correct checkerboard. I am doing everything
> correctly. I am knee deep in the calibrator.py source, and everything
> looks good after the StereoCalibrate() command -- the rotation and
> translation between the two cameras seems reasonable (rotation close to
> I, translation on the right scale). It seems to be after the
> set_alpha() call where the final projection matrices end up with HUGE
> numbers for focal length (tens of thousands), and the rotation matrices
> have unexpected off diagonal components.
>
> Vijay Pradeep wrote:
>> Hi Patrick,
>>
>> Is the checkerboard 8x6 corners? If so, make sure that you always
>> keep the target in a 'landscape' orientation. If the checkerboard
>> gets close to a 'portrait' orientation, the OpenCV detector may mess
>> up the correspondence between both cameras (thus, making the
>> calibration routine want to rotate one of the cameras 180 degrees).
>>
>> This rotational ambiguity can also be solved by using a checkerboard
>> with [odd]x[even] corners.
>>
>> Vijay
>>
>> On Tue, Apr 6, 2010 at 2:01 PM, Patrick Beeson <
>> <mailto:beeson.p@gmail.com>> wrote:
>>
>>     Sorry, I just checked and I am actually using the trunk, not latest.
>>     The problem is that I'm getting large rotational values, and I'm only
>>     ever seeing a horizontal offset in T (top right value in projection
>>     matrix) as non-zero, even though the cameras are at slightly 
>> different
>>     heights.  I can send the saved tar.gz file that contains the 
>> images used
>>     and the ost.txt created if it helps.

>>
>>     Patrick Beeson wrote:
>>      > I checked out latest and had to do a small bit of changes to 
>> sync the
>>      > timestamps of the two cameras whenever frames have very close
>>      > timestamps.  So they aren't EXACTLY synced, but VERY closely
>>     synced.  I
>>      > can try to send you a screen shot of the output.  Note, I am 
>> testing
>>      > this with a quite small checkerboard (your checkerboard, but with
>>     26mm
>>      > squares).  Maybe that's the problem?  Maybe I'm sampling a 
>> space too
>>      > close to the cameras?
>>      >
>>      > Eric Perko wrote:
>>      >> Patrick,

>>      >>
>>      >> What version of camera_calibration are you using? Boxturtle?

>>      >>
>>      >> - Eric

>>      >>
>>      >> On Tue, Apr 6, 2010 at 4:31 PM, Patrick Beeson
>>     < <mailto:beeson.p@gmail.com>>
>>      >> wrote:
>>      >>> I'm trying to calibrate two identical 1394 cameras that are
>>     sitting next
>>      >>> to each other.  The stereo calibration from camera_calibration
>>     converges
>>      >>> to VERY bad R and T matrices, rotating the frames and
>>      >>> the warping the images drastically.  I've tried several 
>> times, with
>>      >>> no luck.

>>      >>>
>>      >>> _______________________________________________
>>      >>> ros-users mailing list
>>      >>>  <mailto:ros-users@code.ros.org>
>>      >>> https://code.ros.org/mailman/listinfo/ros-users

>>      >>>
>>      >> _______________________________________________
>>      >> ros-users mailing list
>>      >>  <mailto:ros-users@code.ros.org>
>>      >> https://code.ros.org/mailman/listinfo/ros-users
>>     _______________________________________________
>>     ros-users mailing list
>>      <mailto:ros-users@code.ros.org>
>>     https://code.ros.org/mailman/listinfo/ros-users

>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> ros-users mailing list
>>
>> https://code.ros.org/mailman/listinfo/ros-users