The purpose of the Data Processing & 3D Modelling Subsystem is to provide methods for frame registration, segmentation, 3D point cloud construction, and organ motion estimation.
Frame Registration
Camera-robot Registration:
The rigid body transformation between the camera-frame and the robot-frame was obtained using Horn’s method. An orange marker was stuck on the Blaser, as shown in Figure 1, with a known offset with respect to the robot’s wrist. The left and right images of the stereo camera were processed to find the centroid of the orange marker, which gave its coordinates in the camera’s frame. The robot was moved to a fixed set of six points that were chosen to cover a substantial amount of the robot’s workspace. Horn’s method was then used to optimize for the best homogeneous transformation matrix that relates the robot-frame and the camera-frame.
Figure 1: Camera-robot registration setup
The camera-frame and robot-frame were registered with a 4.085 mm RMSE.
Blaser-robot Registration
We used a checkerboard to register the Blaser-frame and the robot-frame. Sixty images of the checkerboard were obtained by manually moving the robot arm to different positions in the workspace and orienting the wrist in different directions to capture as much movement of the robot’s wrist as possible. Figure 2 shows the Blaser mounted on the robot arm and the checkerboard pattern that was used. The 6DOF pose of the Blaser that resulted in each image was estimated using the perspective-n-point (PnP) algorithm. Once the pose of the Blaser was estimated for each image, bundle adjustment was performed to obtain the transformation matrix between the robot’s frame and the Blaser’s frame.
Figure 2: Blaser mounted on dVRK arm and checkerboard pattern used
Segmentation
The segmentation algorithm will display only phantom liver pixels from the pixels of all visible abdominal organs such as the liver, kidneys, stomach, etc. This algorithm will take in the video stream images and output only points of the liver, in preparation for the searching & palpating subsystem. The method we implemented was an HSV-based segmentation. This method looks for pixels within the specified hue, saturation, and value ranges and classifies those as part of the liver. Though this method is sensitive to other similarly colored objects in the background, the environment that we test in and the body in general are pretty controlled environments that would not have similarly colored objects.
The segmentation algorithm is capable of segmenting the liver out from a live feed of data. This capability is shown in our Spring 2020 video.
3D Point Cloud Generation
We mounted the Blaser on PSM1 of the dVRK and programmed it to move across the phantom liver in a raster scan-like fashion. The Blaser sensor captured 2D line scans of the liver, which the stitching code used to generate a 3D point cloud. The stitching code converts 2D line scans obtained from the Blaser into 3D point clouds using the transformation matrix that relates the Blaser-frame and robot-frame.
The 4×4 transformation matrix of the Blaser-robot registration is loaded from a YAML file. A ROS tf broadcaster adds the Blaser frame to the robot arm tf tree. There is one subscriber to read the current Blaser-to-World transformation, and another to read the real-time points published by the Blaser. The dot product of these two subscribers’ input is stored in a list at each timestep. RVIZ provides real-time visualization of the 2D line scan obtained at each timestep being “stitched” into the growing 3D point cloud as can be seen in the video below.
Generation of Liver 3D Point Cloud
Motion Estimation
We set the phantom liver on the moving platform, which was oscillating at different frequencies. Using the Intel RealSense camera, we imaged the moving liver and ran the motion estimation algorithms(PCA and FFT) on this data. We tested on two frequencies- 0.3 Hz and 0.5 Hz and the algorithm’s estimate was 0.285 Hz and 0.445 Hz respectively.