Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tangent images #1814

Open
wants to merge 29 commits into
base: develop
Choose a base branch
from
Open

Tangent images #1814

wants to merge 29 commits into from

Conversation

meder411
Copy link

@meder411 meder411 commented Oct 17, 2020

  • Added class for creating and working with tangent images as proposed in "Tangent Images for Mitigating Spherical Distortion", CVPR 2020.
  • Class exposes 3 primary functions:
    1. Creating tangent images (with associated valid-region masks) from an input equirectangular image
    2. Converting pixel coordinates on a given tangent image back to pixel coordinates on the input equirectangular image
    3. Detecting and describing equirectangular image features using tangent images (supports SIFT, AKAZE_binary, AKAZE_float, and AKAZE_liop).

The first function is, obviously, to create the tangent image set. It also produces masks designating which part of the tangent image maps directly to the face of the icosahedron. The valid regions are given the value 255 and the invalid (padding) region is 0. These masks should be provided via the mask parameter to sparse feature detection functions to avoid redundant feature computation across the tangent image set.

The second function is for converting the detected feature coordinates from the tangent image grid back to the equirectangular grid. The benefits of tangent images are their low-distortion representation. As such we ought to compute the descriptor on the tangent image, but we often want to then transfer those keypoints and descriptors back to the original equirectangular image before running our correspondence search with a spherical camera model.

The third function accepts an Image_describer instance, a grayscale equirectangular image, and, optionally, a feature mask. Internally, the function converts the inputs to tangent images, computes features on the tangent images, and converts the coordinates of the detected features back to the original equirectangular image. It returns the detected features in terms of equirectangular coordinates.

A unit test is provided demonstrating how to create the tangent images and masks. A second unit test demonstrated detecting SIFT features on tangent images.

@lgtm-com
Copy link

lgtm-com bot commented Oct 18, 2020

This pull request introduces 8 alerts when merging d4f78b8 into 427fd14 - view on LGTM.com

new alerts:

  • 6 for Constant return type on member
  • 1 for Constant return type
  • 1 for Multiplication result converted to larger type

@meder411
Copy link
Author

meder411 commented Nov 1, 2020

CodeFactor doesn't seem to like my usage of dynamic_cast to disambiguate the Regions object in ComputeFeaturesOnTangentImages. Any alternative solutions come to mind?

@meder411
Copy link
Author

meder411 commented Nov 2, 2020

I exposes a few additional functions (mainly coordinate conversion operations) and fixed a bug with the coordinate conversions used for image description. I also added a bunch of unit tests for different components as well as a image resampling from tangent images back to an equirectangular image.

Probably should pause on merging the PR for a bit though as there seems to be something odd with the SIFT detection on the tangent images themselves. In the paper, I used OpenCV's SIFT via Python for detection and didn't have these issues. All the coordinate conversions match up fine, but simply running the SIFT_image_describer on a tangent images in OpenMVG looks off:

image

I'm working on figuring out what's up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants