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

Unable to create equirectangular/ 360x180 panorama #111

Open
kumar-jitendra opened this issue Dec 4, 2020 · 3 comments
Open

Unable to create equirectangular/ 360x180 panorama #111

kumar-jitendra opened this issue Dec 4, 2020 · 3 comments

Comments

@kumar-jitendra
Copy link

If you met an unexpected problem using the code, please include the following information:

  1. I tried to stitch two rows of images vertically (means overlapping region is first image's bottom side and second image's top side) but result were distorted image.

  2. i have also attached the example for the same along with its distorted output.
    cb1
    ct1
    out

  3. please try to resolve my issue asap , and also tell me, is it possible to 360x180 images from this repo or not ? if possible how

  4. run the code on mac in vs code on images taken from the phone

@sisco0
Copy link
Contributor

sisco0 commented Dec 24, 2020

Have a good day @kumar-jitendra , as it could be seen by running ./image-stitching match image1.jpg image2.jpg the match.jpg shows that the method is confused because of the repeated pattern shown at the curtains, where left curtain pattern points are matched to the right curtain pattern points. I am trying to arrive to a solution for your problem.

When using ./image-stitching inlier image1.jpg image2.jpg things get better but some details appear, as an slope appears at the top-part image perspective distortion frame (attaching image with marked frame). That slope needs to be diminished in order to accomplish the task. I would try with new parameters and would let you know.

image

@sisco0
Copy link
Contributor

sisco0 commented Dec 24, 2020

I adjusted some settings in the configuration file in order to have some results. I attach the configuration file and the solution here.
image


Configuration file

# [general modes]: if no modes is set, will use naive mode
CYLINDER 0
ESTIMATE_CAMERA 1
TRANS 0
# if no modes above is set, use naive mode

ORDERED_INPUT 0				# set this option when input is ordered
CROP 1								# crop the result to a rectangle
MAX_OUTPUT_SIZE 8000	# maximum possible width/height of output image
LAZY_READ	1						# use images lazily and release when not needed.
											# save memory in feature stage, but slower in blending

# focal length in 35mm format. used in CYLINDER mode
#FOCAL_LENGTH 37 # from jk's camera
#FOCAL_LENGTH 40
FOCAL_LENGTH 15
#FOCAL_LENGTH 24 # my sony camera
#FOCAL_LENGTH 25.83 # for Mi3 phone, focal length * 7.38

# [keypoint related parameters]:
SIFT_WORKING_SIZE 800	# working resolution for sift
NUM_OCTAVE 4
NUM_SCALE 7
SCALE_FACTOR 1.4142135623
GAUSS_SIGMA 1.4142135623
GAUSS_WINDOW_FACTOR 7	# larger value gives less feature

# These parameters are tuned for images of about 0.7 megapixel
# For smaller images, you may need to change parameters for more features
CONTRAST_THRES 8e-2  #Lowe: 3e-2. smaller value gives more feature

JUDGE_EXTREMA_DIFF_THRES 2e-3 # smaller value gives more feature
#!! making it small could result in low-quality keypoint

EDGE_RATIO 6  #lowe: 10. larger value gives more feature

PRE_COLOR_THRES 5e-2
CALC_OFFSET_DEPTH 4
OFFSET_THRES 0.3 # 0.3 is still good, this settings has big impact
# lowe used 0.5. smaller value gives more feature
# ----

# [descriptor and matching related]:
ORI_RADIUS 4.5 # this radius might be large?

ORI_HIST_SMOOTH_COUNT 2
DESC_HIST_SCALE_FACTOR 3
DESC_INT_FACTOR 512

MATCH_REJECT_NEXT_RATIO 0.8

# use more iteration if hard to find match
RANSAC_ITERATIONS 4000 # lowe: 500
RANSAC_INLIER_THRES 5.0 #3.5 # inlier threshold corresponding to 800-resolution images

INLIER_IN_MATCH_RATIO 0.05 #0.1	# number of inlier divided by all matches in the overlapping region
INLIER_IN_POINTS_RATIO 0.04 # number of inlier divided by all keypoints in the overlapping region
# ----

# [optimization and tuning]
STRAIGHTEN 0
SLOPE_PLAIN 8e-3
LM_LAMBDA 5
MULTIPASS_BA 2
# 0: only perform one-pass bundle adjustment for all images and connections (fast)
# 1: perform BA for each image added (suggested)
# 2: perform BA for each connection found (best quality, slow)
# ---

# [blending]
MULTIBAND 2	# set to 0 to disable, set to k to use k bands

@tylersavery
Copy link

FYI I came across a similar result at one point when doing some stitching. It could be completely unrelated BUT are you normalizing your EXIF data before processing the images? Many cameras will shoot photos landscape while storing information so the OS knows to rotate it.

Details below on how to fix that but again, might not be your issue at all.

You can use exiftool to normalize them like this:

exiftool -all:all= -tagsfromfile @ -exif:Orientation ./images/

or with imagemagik

for f in *.JPG *.jpg; do convert $f -auto-orient $f; done

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

No branches or pull requests

3 participants