image rectification

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

image rectification

Jürgen Sturm
Hi all,

I am currently implementing a camera driver that plays back AVI
videos. I have also implemented a service that accepts the camera info
(such that I can calibrate the "fake" cam). However, for some reason
that I do not understand, image_proc fails to produce rectified
images. The conversion to grayscale works (/image_mono), but for the
rectified images all pixels seem to have the same value (except for a
small black triangle in the top left of the rectified image). I guess
that I'm missing an important detail somewhere. This is one of my
camera_info messages (after calibration):

header:
  seq: 727
  stamp: 1263921689830446000
  frame_id:
height: 576
width: 720
roi:
  x_offset: 0
  y_offset: 0
  height: 576
  width: 720
D: [-0.10031900000000001, 0.55244800000000005, 0.013651399999999999,
-0.019613999999999999, 0.0]
K: [10.0, 0.0, 280.04599999999999, 0.0, 10.0, 333.86099999999999, 0.0, 0.0, 1.0]
R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0]

I have put a bag file with this problem here (containing a few
/camera/image_raw and /camera/camera_info messages), for easier
reproduction:

http://www.informatik.uni-freiburg.de/~sturm/testvid.bag

Then run
$> ROS_NAMESPACE=camera rosrun image_proc image_proc
$> rosrun image_view image_view image:=/camera/image_rect
$> rosplay testvid.bag

Any hints are greatly appreciated!

Cheers
Jürgen

PS: the so-far not working avi-camera-package is located in
alufr-ros-pkg/sandbox/avicam

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
ros-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: image rectification

Patrick Mihelich
Thanks for the report. I've opened a ticket at https://code.ros.org/trac/ros-pkg/ticket/3684 (feel free to cc yourself) and will look into it.

Cheers,
Patrick

On Tue, Jan 19, 2010 at 9:39 AM, Jürgen Sturm <[hidden email]> wrote:
Hi all,

I am currently implementing a camera driver that plays back AVI
videos. I have also implemented a service that accepts the camera info
(such that I can calibrate the "fake" cam). However, for some reason
that I do not understand, image_proc fails to produce rectified
images. The conversion to grayscale works (/image_mono), but for the
rectified images all pixels seem to have the same value (except for a
small black triangle in the top left of the rectified image). I guess
that I'm missing an important detail somewhere. This is one of my
camera_info messages (after calibration):

header:
 seq: 727
 stamp: 1263921689830446000
 frame_id:
height: 576
width: 720
roi:
 x_offset: 0
 y_offset: 0
 height: 576
 width: 720
D: [-0.10031900000000001, 0.55244800000000005, 0.013651399999999999,
-0.019613999999999999, 0.0]
K: [10.0, 0.0, 280.04599999999999, 0.0, 10.0, 333.86099999999999, 0.0, 0.0, 1.0]
R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0]

I have put a bag file with this problem here (containing a few
/camera/image_raw and /camera/camera_info messages), for easier
reproduction:

http://www.informatik.uni-freiburg.de/~sturm/testvid.bag

Then run
$> ROS_NAMESPACE=camera rosrun image_proc image_proc
$> rosrun image_view image_view image:=/camera/image_rect
$> rosplay testvid.bag

Any hints are greatly appreciated!

Cheers
Jürgen

PS: the so-far not working avi-camera-package is located in
alufr-ros-pkg/sandbox/avicam

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
ros-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ros-users


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
ros-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: image rectification

Patrick Mihelich
Hi Jürgen,

The calibration procedure mistakenly set the projection matrix P to the identity. In the monocular case it should simply be the camera matrix K with a column of zeros appended. (In the stereo case, the left and right P are rotated to make the scanlines of the two rectified images match up.) So you can fix the problem by instead setting P to:

P: [10.0, 0.0, 280.04599999999999, 0.0,
    0.0, 10.0, 333.86099999999999, 0.0,
    0.0, 0.0, 1.0, 0.0]

Alternatively I've attached a script fill_P.py to the ticket that will fix bag files with P set improperly.

Thanks for the report - this will be fixed in the next patch release.

Cheers,
Patrick

On Tue, Jan 19, 2010 at 2:24 PM, Patrick Mihelich <[hidden email]> wrote:
Thanks for the report. I've opened a ticket at https://code.ros.org/trac/ros-pkg/ticket/3684 (feel free to cc yourself) and will look into it.

Cheers,
Patrick


On Tue, Jan 19, 2010 at 9:39 AM, Jürgen Sturm <[hidden email]> wrote:
Hi all,

I am currently implementing a camera driver that plays back AVI
videos. I have also implemented a service that accepts the camera info
(such that I can calibrate the "fake" cam). However, for some reason
that I do not understand, image_proc fails to produce rectified
images. The conversion to grayscale works (/image_mono), but for the
rectified images all pixels seem to have the same value (except for a
small black triangle in the top left of the rectified image). I guess
that I'm missing an important detail somewhere. This is one of my
camera_info messages (after calibration):

header:
 seq: 727
 stamp: 1263921689830446000
 frame_id:
height: 576
width: 720
roi:
 x_offset: 0
 y_offset: 0
 height: 576
 width: 720
D: [-0.10031900000000001, 0.55244800000000005, 0.013651399999999999,
-0.019613999999999999, 0.0]
K: [10.0, 0.0, 280.04599999999999, 0.0, 10.0, 333.86099999999999, 0.0, 0.0, 1.0]
R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0]

I have put a bag file with this problem here (containing a few
/camera/image_raw and /camera/camera_info messages), for easier
reproduction:

http://www.informatik.uni-freiburg.de/~sturm/testvid.bag

Then run
$> ROS_NAMESPACE=camera rosrun image_proc image_proc
$> rosrun image_view image_view image:=/camera/image_rect
$> rosplay testvid.bag

Any hints are greatly appreciated!

Cheers
Jürgen

PS: the so-far not working avi-camera-package is located in
alufr-ros-pkg/sandbox/avicam

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
ros-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ros-users



------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
ros-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ros-users