Research Article

Performance Improvement for Two-Lens Panoramic Endoscopic System during Minimally Invasive Surgery

Algorithm 2

Increasing the stability of the stitched video.
Input: Inliers in two current frames, the homography matrix of the previous two frames (Hprev), the threshold value (μ), and the RANSAC threshold (α)
(1) Repeat for k iterations (RANSAC loop)(a)Select four random matching point pairs(b)Compute the exact homography matrix H for the four matching point pairs(c)Determine the number of inliers such that H:
(2) Choose the value of H with the largest number of inliers N
(3) Calculate the medium reprojection error for Hprev for the N inliers:
(4) If (4.1)Then the homography matrix is assigned as Hprev(4.2)Else recompute the homography matrix using the least-squares method and all of the N inliers and a minimum cost function
Output: Homography matrix for the two current frames