Only released in EOL distros:
Provides a node for calibrating a projector to a camera with a known TF frame.
- Author: Daniel Lazewatsky
- License: BSD
- Source: git https://github.com/OSUrobotics/ros-3d-interaction.git (branch: groovy-devel)
gridThis node takes in a camera image and computes the homography between a detect grid and the idealized grid that it is projecting.
Subscribed Topicsimage (sensor_msgs/Image)
- A camera image containing the projected grid to be detected.
Published Topicsgrid (sensor_msgs/Image)
- The grid which is being projected
- The homography, mapping points in the camera image to projector pixels.
- Defaults to 5x7
Using the Calibration
Transform p into the same frame as the camera used to find H (call the new point pimg).
Project pimg onto the image plane (call the new point pproj).
Transform p2d to projector pixels using H
In python this looks something like
1 import image_geometry, tf, cv2 2 3 # get camera_info_msg and H from somewhere 4 # create a tf listener 5 6 model = image_geometry.PinholeCameraModel(camera_info_msg) 7 p_img = tf_listener.transformPoint(model.tf_frame, p) 8 p_2d = model.project3dToPixel((p_img.x, p_img.y, p_img.z)) 9 p_proj = cv2.perspectiveTransform(H, [p_2d])