Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

You could try to estimate the homography with a Ransac approach to try to not take into account the inliers.

These are my results (not as good as yours) using calcOpticalFlowPyrLK, findHomography (with CV_RANSAC) and warpPerspective.

Optical flow:

Optical Flow

Inliers:

Inliers

Warp perspective:

Warp

Final image:

Final image

The mean estimated motion:

Mean x = 80.03 ; Mean y = 2.18

By the way, when you said:

Remap every image in new image by cylindrical equations (as shown in "Image Alignment and Stitching: A Tutorial" by Richard Szeliski).

Is it the section 2.3 Cylindrical and Spherical Coordinates page 15 ?

Hi,

You could try to estimate the homography with a Ransac approach to try to not take into account the inliers.

These are my results (not as good as yours) using calcOpticalFlowPyrLK, findHomography (with CV_RANSAC) and warpPerspective.

Optical flow:__Optical flow__:

Optical Flow

Inliers:__Inliers__:

Inliers

Warp perspective:__Warp perspective__:

Warp

Final image:__Final image__:

Final image

The mean estimated motion:

Mean x = 80.03 ; Mean y = 2.18

By the way, when you said:

Remap every image in new image by cylindrical equations (as shown in "Image Alignment and Stitching: A Tutorial" by Richard Szeliski).

Is it the section 2.3 Cylindrical and Spherical Coordinates page 15 ?

__Edit__:

This time I only display the second image with the displacement estimated (no warping).

It is a little bit better I think:

image description

Hi,

You could try to estimate the homography with a Ransac approach to try to not take into account the inliers.

These are my results (not as good as yours) using calcOpticalFlowPyrLK, findHomography (with CV_RANSAC) and warpPerspective.

__Optical flow__:Optical flow:

Optical Flow

__Inliers__:Inliers:

Inliers

__Warp perspective__:Warp perspective:

Warp

__Final image__:Final image:

Final image

The mean estimated motion:

Mean x = 80.03 ; Mean y = 2.18

By the way, when you said:

Remap every image in new image by cylindrical equations (as shown in "Image Alignment and Stitching: A Tutorial" by Richard Szeliski).

Is it the section 2.3 Cylindrical and Spherical Coordinates page 15 ?

__Edit__:Edit:

This time I only display the second image with the displacement estimated (no warping).

It is a little bit better I think:

image description

Hi,

You could It is not clear for me if you use findHomography + Ransac or if you try to estimate the homography with a Ransac approach to try to not take into account the inliers.the two approaches independently.

These are my results (not as good as yours) using calcOpticalFlowPyrLK, findHomography (with CV_RANSAC) and warpPerspective.

Optical flow:

Optical Flow

Inliers:

Inliers

Warp perspective:

Warp

Final image:

Final image

The mean estimated motion:motion (I use the inliers returned by findHomography and I just average the corresponding motion vectors):

Mean x = 80.03 px ; Mean y = 2.18
2.18 px

By the way, when you said:

Remap every image in new image by cylindrical equations (as shown in "Image Alignment and Stitching: A Tutorial" by Richard Szeliski).

Is it the section 2.3 Cylindrical and Spherical Coordinates page 15 ?

Edit:

This time I only display the second image with the displacement estimated (no warping).

It is a little bit better I think:

image description

Hi,

It is not clear for me if you use findHomography + Ransac or if you try the two approaches independently.

These are my results (not as good as yours) yours but I don't need to threshold the vectors manually, in fact I use the result of findHomography+Ransac to keep the inliers) using calcOpticalFlowPyrLK, findHomography (with CV_RANSAC) and warpPerspective.

Optical flow:

Optical Flow

Inliers:

Inliers

Warp perspective:

Warp

Final image:

Final image

The mean estimated motion (I use the inliers returned by findHomography and I just average the corresponding motion vectors):

Mean x = 80.03 px ; Mean y = 2.18 px

By the way, when you said:

Remap every image in new image by cylindrical equations (as shown in "Image Alignment and Stitching: A Tutorial" by Richard Szeliski).

Is it the section 2.3 Cylindrical and Spherical Coordinates page 15 ?

Edit:

This time I only display the second image with the displacement estimated (no warping).

It is a little bit better I think:

image description

Concat image with displacement vector

Edit2:

I think I made a mistake with warpPerspective: I forgot to inverse the homography H when I applied it to the second image.

The result:

Final image 2

Hi,

It is not clear for me if you use findHomography + Ransac or if you try the two approaches independently.

These are my results (not as good as yours but I don't need to threshold the vectors manually, in fact I use the result of findHomography+Ransac to keep the inliers) using calcOpticalFlowPyrLK, findHomography (with CV_RANSAC) and warpPerspective.

Optical flow:

Optical Flow

Inliers:

Inliers

Warp perspective:

Warp

Final image:

Final image

The mean estimated motion (I use the inliers returned by findHomography and I just average the corresponding motion vectors):

Mean x = 80.03 px ; Mean y = 2.18 px

By the way, when you said:

Remap every image in new image by cylindrical equations (as shown in "Image Alignment and Stitching: A Tutorial" by Richard Szeliski).

Is it the section 2.3 Cylindrical and Spherical Coordinates page 15 ?

Edit:

This time I only display the second image with the displacement estimated (no warping).

It is a little bit better I think:

Concat image with displacement vector

Edit2:

I think I made a mistake with warpPerspective: I forgot to inverse the homography H when I applied it to the second image.

The result:

Final image 2

Final image 2