Papers with code. Sorted by stars. Updated weekly.
In this paper, we develop a modified differential Structure from Motion (SfM) algorithm that can estimate relative pose from two consecutive frames despite of Rolling Shutter (RS) artifacts. In particular, we show that under constant velocity assumption, the errors induced by the rolling shutter effect can be easily rectified by a linear scaling operation on each optical flow. We further propose a 9-point algorithm to recover the relative pose of a rolling shutter camera that undergoes constant acceleration motion. We demonstrate that the dense depth maps recovered from the relative pose of the RS camera can be used in a RS-aware warping for image rectification to recover high-quality Global Shutter (GS) images. Experiments on both synthetic and real RS images show that our RS-aware differential SfM algorithm produces more accurate results on relative pose estimation and 3D reconstruction from images distorted by RS effect compared to standard SfM algorithms that assume a GS camera model. We also demonstrate that our RS-aware warping for image rectification method outperforms state-of-the-art commercial software products, i.e. Adobe After Effects and Apple Imovie, at removing RS artifacts.READ FULL TEXT VIEW PDF
In this paper, we present a novel linear algorithm to estimate the 6 DoF...
In this paper, we derive a new differential homography that can account ...
Two-view structure-from-motion (SfM) is the cornerstone of 3D reconstruc...
This paper addresses the task of relative camera pose estimation from ra...
In this paper we consider critical motion sequences (CMSs) of rolling-sh...
We present an approximate inference method, based on a synergistic
An algorithm for pose and motion estimation using corresponding features...
Papers with code. Sorted by stars. Updated weekly.
In comparison with its global shutter (GS) counterpart, rolling shutter (RS) cameras are more widely used in commercial products due to its low cost. Despite this, the use of RS cameras in computer vision such as motion/pose estimation is significantly limited compared to the GS cameras. This is largely due to the fact that most existing computer vision algorithms such as epipolar geometry and SfM [26, 6]
make use of the global shutter pinhole camera model which does not account for the so-called rolling shutter effect caused by camera motion. Unlike a GS camera where the photo-sensor is exposed fully at the same moment, the photo-sensor of a RS camera is exposed in a scanline-by-scanline fashion due to the exposure/readout modes of the low-cost CMOS sensor. As a result, the image taken from a moving RS camera is distorted as each scanline possesses a different optical center. An example is shown in Fig.1(a), where the vertical tree trunk in the image captured by a RS camera moving from right to left appears to be slanted.
Due to the price advantage of the RS camera, many researchers began to propose 3D computer vision algorithms that aim to mitigate the RS effect over the recent years. Although several works have successfully demonstrated stereo , sparse and dense 3D reconstruction [15, 23] and absolute pose estimation [1, 22, 17] using RS images, most of these works completely bypassed the initial relative pose estimation, e.g. by substituting it with GPS/INS readings. This is because the additional linear and angular velocities of the camera that need to be estimated due to the RS effect significantly increases the number of unknowns, making the problem intractable. Thus, despite the efforts from  to solve the RS relative pose estimation problem under discrete motion, the proposed solution is unsuitable for practical use due to the need for high number of image correspondences that prohibits robust estimation with RANSAC.
In this paper, we aim to correct the RS induced inaccuracies in SfM across two consecutive images under continuous motion by using a differential formulation. In contrast to the discrete formulation where 12 additional motion parameters from the velocities of the camera need to be solved, we show that in the differential case, the poses of each scanline can be related to the relative pose of two consecutive images under suitable motion models, thus obviating the need for additional motion parameters. Specifically, we show that under a constant velocity assumption, the errors induced by the RS effect can be easily rectified by a linear scaling operation on each optical flow, with the scaling factor being dependent on the scanline position of the optical flow vector. To relax the restriction on the motion, we further propose a nonlinear 9-point algorithm for a camera that undergoes constant acceleration motion. We then apply a RS-aware non-linear refinement step that jointly improves the initial structure and motion estimates by minimizing the geometric errors. Besides resulting in tractable algorithms, another advantage of adopting the differential SfM formulation lies in the recovery of dense depth map, which we leverage to design a RS-aware warping to remove RS distortion and recover high-quality GS images. Our algorithm is illustrated in Fig.1. Fig. 1(a) shows an example of the input RS image pair where a vertical tree trunk appears slanted (red line) from the RS effect, and Fig. 1(d) shows the vertical tree trunk (red line) restored by our RS rectification. Fig. 1(b) illustrates the scanline-dependent camera poses for a moving RS camera. denotes the optical center of the scanline in camera . Fig. 1(c) shows the RS-aware depth map recovered after motion estimation. Experiments on both synthetic and real RS images validate the utility of our RS-aware differential SfM algorithm. Moreover, we demonstrate that our RS-aware warping produces rectified images that are superior to popular image/video editing software.
Meingast  was one of the pioneers to study the geometric model of a rolling shutter camera. Following this work, many 3D computer vision algorithms have been proposed in the context of RS cameras. Saurer  demonstrated large-scale sparse to dense 3D reconstruction using images taken from a RS camera mounted on a moving car. In another work , Saurer showed stereo results from a pair of RS images.  showed high-quality 3D reconstruction from a RS video under small motion. Hedborg  proposed a bundle adjustment algorithm for RS cameras. In , a large-scale bundle adjustment with a generalized camera model is proposed and applied to 3D reconstructions from images collected with a rig of RS cameras. Several works [1, 22, 17] were introduced to solve the absolute pose estimation problem using RS cameras. All these efforts demonstrated the potential of applying 3D algorithms to RS cameras. However, most of them avoided the initial relative pose estimation problem by taking the information directly from other sensors such as GPS/INS, relying on the global shutter model to initialize the relative pose or assuming known 3D structure.
Recently, Dai  presented the first work to solve the relative pose estimation problem for RS cameras. They tackled the discrete two-frame relative pose estimation problem by introducing the concept of generalized essential matrix to account for camera velocities. However, 44 point correspondences are needed to linearly solve for the full motion. This makes the algorithm intractable when robust estimation via the RANSAC framework is desired for real-world data. In contrast, we look at the differential motion for two-frame pose estimation where we show that the RS effect can be compensated in a tractable way. This model permits a simpler derivation that can be viewed as an extension of conventional optical flow-based differential pose estimation algorithms [16, 24, 27] designed for GS cameras. Another favorable point for the optical flow-based differential formulation is that unlike the region-based discrete feature descriptors used in the aforementioned correspondence-based methods, the brightness constancy assumption used to compute optical flow is not affected by RS distortion as observed in .
Several other research attempted to rectify distortions in images caused by the RS effect. Forssén  reduced the RS distortion by compensating for 3D camera rotation, which is assumed to be the dominant motion for hand-held cameras. Some later works [14, 8] further exploited the gyroscope on mobile devices to improve the measurement of camera rotation. Grundmann  proposed the use of homography mixtures to remove the RS artifacts. Baker 
posed the rectification as a temporal super-resolution problem to remove RS wobble. Nonetheless, the distortion is modeled only in the 2D image plane. To the best of our knowledge, our rectification method is the first that is based on full motion estimation and 3D reconstruction. This enables us to perform RS-aware warping which returns high-quality rectified images as shown in Sec.6.
In this section, we give a brief description of the differential epipolar constraint that relates the infinitesimal motion between two global shutter camera frames. Since this section does not contain our contributions, we give only the necessary details to follow the rest of this paper. More details of the algorithm can be found in [16, 27]. Let us denote the linear and angular velocities of the camera by and . The velocity field on the image plane induced by is given by:
is the normalized image coordinate and is the corresponding depth of each pixel. In practice, is approximated by optical flow under brightness constancy assumption. Given a pair of image position and optical flow vector , Z can be eliminated from Eq. (1) to yield the differential epipolar constraint 111Note that our version is slightly different from  by the sign in the second term due to the difference on how we define the motion.:
where is a symmetric matrix. and
represent the skew-symmetric matrices associated withand respectively. The space of all the matrices having the same form as is called the symmetric epipolar space. The 9 unknowns from and (3 + 6 respectively) can be solved linearly from at least 8 measurements . The solution returned by the linear algorithm is then projected onto the symmetric epipolar space, followed by the recovery of (,) as described in . Note that can only be recovered up to scale.
It is well to remember here that in actual computation, assuming small motion between two frames, all the instantaneous velocity terms will be approximated by displacement over time. Removing the common factor of time, the optical flow vector now indicates the displacement of pixel over two consecutive frames, and the camera velocities indicate the relative pose of the two camera positions. The requisite mapping between the relative orientation and the angular velocity is given by the well-known mapping . Henceforth, we will call relative motion/pose for the rest of this paper. We utilize Deepflow  to compute the optical flow for all our experiments due to its robust performance in practice.
The differential epipolar constraint shown in the previous section works only on images taken with a GS camera and would fail if the images were taken with a RS camera. The main difference between the RS and GS camera is that we can no longer regard each image as having one single camera pose. Instead we have to introduce a new camera pose for each scanline on a RS image as shown in Fig. 1(b) due to the readout and delay times as illustrated in Fig. 2.
Consider three consecutive image frames and . Let and represent the translation and rotation of the first scanlines on the respective images as shown in Fig. 2. Frame is set as the reference frame, i.e. . Now consider an optical flow which maps an image point from in frame to in frame . Assuming constant instantaneous velocity of the camera across these three frames under small motion, we can compute the translation and rotation of scanline on frame
as a linear interpolation between the poses of the first scanlines from framesand :
is the total number of scanlines in the image. is the readout time ratio which can be obtained a priori from calibration . Similar interpolation for the pose of the scanline on frame can be done between the first scanlines from frames and :
is the dimensionless scaling factor of the relative pose made up of , , and . It was mentioned in the previous section that under small motion, in the differential epipolar constraint can be regarded as the relative pose of the camera in practice. We can thus substitute from Eq. (3) with the relative pose from Eq. (6). Consequently, we get the rolling shutter differential epipolar constraint
where , and . and describe the relative pose between the first scanlines of two rolling shutter frames, and can be taken to be the same as and from the global shutter case. It can be seen from Eq. (7) that our differential epipolar constraint for rolling shutter cameras differs from the differential epipolar constraint for global shutter cameras (Eq. (3)) by just the scaling factor on the optical flow vector . Here, we can make the interpretation that the rolling shutter optical flow vector when scaled by is equivalent to the global shutter optical flow vector. Collecting all optical flow vectors, and rectifying each of them with its own (dependent on the scanlines involved in the optical flow), we can now solve for the RS relative motion using conventional linear 8-point algorithm .
Despite the simplicity of compensating for the RS effect by scaling the measured optical flow vector, the constant velocity assumption can be too restrictive for real image sequences captured by a moving RS camera. To enhance the generality of our model, we relax the constant velocity assumption to the more realistic constant acceleration motion. More specifically, we assume constant direction of translational and rotational velocity, but allow its magnitude to either increase or decrease gradually. Experimental results on real data show that this relaxation on motion assumption improves the performance significantly.
The constant acceleration model slightly complicates the interpolation for the pose of each scanline, compared to the constant velocity model. We show only the derivations for the translation of the scanlines since similar derivations apply to the rotation. Suppose the initial translational velocity of the camera at is and it maintains a constant acceleration such that at time the velocity increases or decreases to , and the translation is
Let us re-parameterize and as and , where is an auxiliary variable introduced to represent a translation, is the time period between two first scanlines, and is a scalar factor that needs to be estimated. Putting , back into Eq. (8) and let , we get the translation for the first scanline of frame as
Denoting the time stamp of scanline (or ) on image (or ) by (or ), we have
Similar to Eq. (6), we get the relative translation and rotation between scanline and as follows:
where . Making use of the small motion assumption, we plug , into Eq. (3) and the RS differential epipolar constraint can now be written as
In comparison to the constant velocity model, we have one additional unknown motion parameter to be estimated, making Eq. (13) a polynomial equation. In what follows, we show that Eq. (13) can be solved by a 9-point algorithm with the hidden variable resultant method . Rewriting as and the symmetrical matrix as
Eq. (13) can be rearranged to
where is a vector made up of the known variables and , and the unknown variable . is a unknown vector as follows:
We need 9 image position and optical flow vectors to determine the 10 unknown variables and up to a scale. Each point yields one constraint in the form of Eq. (14). Collecting these constraints from all the points, we get a polynomial system:
where is a matrix. For Eq. (16) to have a non-trivial solution, must be rank-deficient which implies a vanishing determinant:
. Next, the Singular Value Decomposition (SVD) is applied to, and the singular vector associated with the least singular value is taken to be . Following , we extract from by a projection onto the symmetric epipolar space. The minimal solver takes less than 0.02s using our unoptimized MATLAB code.
It is clear that the above algorithm minimizes the algebraic errors and thus yields a biased solution. To obtain more accurate solution, this should be followed by one more step of non-linear refinement that minimizes the geometric errors. In the same spirit of re-projection error in the discrete case and combining Eq. (1) and (12), we write the differential re-projection error and non-linear refinement as
which minimizes the errors between the measured and predicted optical flows for all points in the pixel set over the estimated parameters , , , . is the depths associated with all the image points in . is the total number of points. Note that in the case of constant velocity model, is kept fixed as zero in this step. Also note that (18) reduces to the traditional non-linear refinement for GS model [3, 28, 12] when the readout time ratio is set as 0. RANSAC is used to obtain a robust initial estimate. For each RANSAC iteration, we apply our minimal solver to obtain , , and then compute the optimal depth for each pixel by minimizing (18) over ; the inlier set is identified by checking the resultant differential re-projection error on each pixel. The threshold is set as 0.001 on the normalized image plane for all experiments. We then minimize (18) for all points in the largest inlier set from RANSAC to improve the initial estimates by block coordinate descent over , , and , whereby each subproblem block admits a closed-form solution. Finally, is recovered for all pixels which gives the dense depth map.
Having obtained the camera pose for each scanline and the depth map of the first RS image frame, a natural extension is to take advantage of these information to rectify the image distortion caused by the RS effect. From Eq. (11a) we know that the relative poses between the first and other scanlines in the same image are as follow:
Combining the pose of each scanline with the depth map, warping can be done by back-projecting each pixel on each scanline into the 3D space, which gives the point cloud, followed by a projection onto the image plane that corresponds to the first scanline. Alternatively, the warping displacement can be computed from Eq. (1) by small motion approximation as .
Since the camera positions of each scanline within the same image are fairly close to that of the first scanline, the displacement caused by the warping is small compared to the optical flow between two consecutive frames. Thus warping-induced gaps are negligible and we do not need to use any pixel from the next frame (i.e. image ) for the rectification. This in turn means that the warping introduces no ghosting artifacts caused by misalignment, allowing the resulting image to retain the sharpness of the original image while removing the geometric RS distortion, as shown by the experimental results in Sec. 6.
In this section, we show the experimental results of our proposed algorithm on both synthetic and real image data.
We generate synthetic but realistic RS images by making use of two textured 3D mesh—the Old Town and Castle provided by  for our experiments. To simulate the RS effect, we first use the 3D Renderer software  to render the GS images according to the pose of scanlines. From these GS images, we extract the pixel values for each scanline to generate the RS images. As such, we can fully control all the ground truth camera and motion parameters including the readout time ratio , camera relative translation and rotation , and acceleration parameter in the case of constant acceleration motion. The image size is set as with a 810 pixels focal length. Examples of the rendered RS images from both datasets are shown in the first row of Fig. 3. For the relative motion estimate , we measure the translational error as and the rotational error as the norm of the Euler angles from , where . Since the translation is ambiguous in its magnitude, the amount of translation is always represented as the ratio between the absolute translation magnitude and average scene depth in the rest of this paper. We term this ratio as normalized translation.
Quantitative Evaluation: We compare the accuracy of our RS-aware motion estimation to the conventional GS-based model. We avoid forward motion which is well-known to be challenging for SfM even for traditional GS cameras. WLOG, all the motions that we synthesize have equal vertical and horizontal translation components, and equal yaw, pitch and roll rotation components. To fully understand the behavior of our proposed algorithm, we investigate the performance under various settings. To get statistically meaningful result, all the errors are obtained from an average of 100 trials, each with 300 iterations of RANSAC. Both the results from the minimal solver and the non-linear refinement are reported to study their respective contribution to the performance.
We plot the translational and rotational error under the constant velocity motion in Fig. 5. We first investigate how the value of the readout time ratio would affect the performance in Fig. 5(a)-(b) by increasing from to , while the normalized translation and magnitude of are fixed at 0.025 and respectively. We can see that the accuracy of the RS model (both minimal solver and non-linear refinement) is insensitive to the variation of , while the GS model tends to give higher errors with increasing . This result is expected because a larger readout time ratio leads to larger RS distortion in the image. Next, we fixed the value of to 0.8 for the following two settings: (1) We fix the magnitude of to and increase the normalized translation from 0.02 to 0.06 as shown in Fig. 5(c)-(d). (2) The normalized translation is fixed as 0.025 and the magnitude of is increased from to as shown in Fig. 5(e)-(f). Overall, the accuracies of the RS and GS model have a common trend determined by the type of motion. However, the RS model has higher accuracies in general, especially in the challenging cases where the rotation is relatively large compared to translation. This implies that our RS-aware algorithm has compensated for the RS effect in pose estimation. We note that in some cases, especially in Old Town, the non-linear refinement gives marginal improvement or even increases the error slightly. We reckon this is because the RANSAC criterion we used is exactly the individual term that forms the non-linear cost function, and it can happen that the initial solution is already close to a local minimum, hence the effect of non-linear refinement can become dubious given that Eq.(1) is only an approximation for small discrete motion in practice, as mentioned in Sec.3.
Similarly, we conduct quantitative evaluations under the constant acceleration motion. To save space, only the results from Old Town are reported here. See supplementary material for the similar results from Castle. First, we investigate how the variation of acceleration by increasing from to would influence the performance of both the GS and RS model in Fig. 6(a). We can see that the accuracy of the GS model degrades dramatically under large acceleration, while the RS model maintains almost consistent accuracies regardless of the amount of acceleration. For Fig. 6(b)-(d), we fix to 0.1 and set other motion or camera parameters to be the same as that for the constant velocity motion. As can be observed, the RS model in general yields higher accuracies than the GS model, especially for the translation. For example, the GS model gives significantly larger error () on translation under strong rotation as shown in Fig. 6(d). We observe that the non-linear refinement tends to improve the translation estimate but degrade the rotation estimate for the GS model. For the RS model, the impact is marginal. We observe larger improvement when the RANSAC threshold is increased, but this leads to a drop of overall accuracy. See our supplementary material for more analyses on the quantitative results.
For qualitative results, two examples under constant acceleration motion are shown in Fig.3&4. Fig. 3(a)&(b) show the original synthetic RS images, the estimated depth maps using the GS model, and the estimated depth maps and rectified images using our RS model. In Fig. 3(c), we compare the original RS images and rectified images to the ground truth GS images, which are rendered according to the poses of the first scanlines, via overlaying. The red and blue color regions indicate high differences. Compared to the original RS images, one can see that the rectified images from our RS-aware warping are closer to the ground truth GS images, except in the few regions near the image edges where the optical flow computation may not be reliable. In Fig. 4, we show the point clouds reconstructed by the GS model, our RS model, and the ground truth respectively. As highlighted by the boxes, the point clouds returned by the GS model are distorted compared to the ground truth. In comparison, our RS model successfully rectifies these artifacts to obtain visually more appealing results.
In this section, we show the results of applying the proposed RS algorithm to images collected by real RS cameras. First, we show the results on pairs of consecutive images from the public RS images dataset released by . The sequence was collected by an Iphone 4 camera at resolution with 96% readout time ratio. Despite having a GS camera that is rigidly mounted near the Iphone for ground truth comparison over long trajectories as shown in , the accuracy is insufficient for the images from the GS camera to be used as ground truth for two-frame differential relative pose estimation. Instead, we rely on the visual quality of the reconstructed point clouds to evaluate our algorithms. We show the point clouds of three different scenes by the GS and our RS models—both constant velocity and acceleration in Fig. 7. More results are shown in supplementary material. As highlighted by the red ellipses in Fig. 7(a), we can see from the top-down view that the wall is significantly skewed under the GS model. This distortion is corrected to a certain extent and almost completely removed by our constant velocity and acceleration RS models respectively. Similar performance of our RS models can also be observed in the examples shown in Fig. 7(b) and Fig. 7(c) from front and top-down view respectively.
The RS effect from the above mentioned dataset is significant enough to introduce bias in SfM algorithm, but it is not strong enough to generate noticeable image distortions. To demonstrate our image rectification algorithm, we collected a few image sequences with an Iphone 4 camera under larger motions that lead to obvious RS distortions on the images. We compare the results of our proposed method with those of Rolling Shutter Repair in two image/video editing software products—Adobe After Effect and Apple Imovie on pairs of the collected images, as shown in Fig. 8. We feed the image sequences along with camera parameters into the software products. We tried different advanced settings provided by After Effect to get the best result for each scene. Since we observe that both our RS models with constant velocity or acceleration give similar results, we only report the rectified images using the accelerated motion model. It can be seen that our method works consistently better than the two commercial software products in removing the RS artifacts such as skew and wobble in the images (highlighted by the red boxes). For example, the slanted window on the original RS image shown on the top row of Fig. 8 becomes most close to vertical in our result.
In this paper, we proposed two tractable algorithms to
correct the inaccuracies in differential SfM caused by the RS effect in images collected from a RS camera moving under constant velocity and acceleration respectively.
In addition, we proposed the use of a RS-aware warping for image rectification that removes the RS distortion on images.
Quantitative and qualitative experimental results on both synthetic and real RS images demonstrated the effectiveness of our algorithm.
Acknowledgements. This work was partially supported by the Singapore PSF grant 1521200082 and Singapore MOE Tier 1 grant R-252-000-636-133.
IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2292–2300, 2015.