ADD Matches graph for creating 360 panorama #162
-
Hi all, As the issue #54 #14 .
How can I pass the graph to stitch image? As the trick in #14 . I saw that maybe I need create correctly keypoints matching as matches_graph I expected. First of all, I use the tutorial for reproducer the stitch:
The code above equal to simply code below:
With 2 difference way: image links I am very happy for your supporting |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I total agree that images
<https://github.com/c060604/panorama/tree/master/pics> not contain fully
for creating 360 image (only 24images), I run separately
```
[a1.jpg,a2.jpg, b1.jpg, b2.jpg, c1.jpg, c2.jpg]
....
[a7.jpg,a8.jpg, b7.jpg, b8.jpg, c7.jpg, c8.jpg]
```
I have a total of 4 small parts and then I combine them to stitch again. As
you see the result in the first case.
That's why I want to define graph matches to bypass to stitch. I think
maybe I must modify in here:
```
matcher = cv2.detail_BestOf2NearestMatcher()
matches = []
range_width = -1
for i in range(len(features)):
for j in range(len(features)):
if 0 < j-i <= range_width:
match = matcher.apply(features[i], features[j])
match.src_img_idx = i
match.dst_img_idx = j
matches.append(match)
elif 0 < i-j <= range_width:
match_to_copy = matches[j * len(features) + i]
match = cv2.detail.MatchesInfo()
# swap src and dst, invert homography
match.src_img_idx = match_to_copy.dst_img_idx
match.dst_img_idx = match_to_copy.src_img_idx
match.H = np.linalg.inv(match_to_copy.H)
match.inliers_mask = match_to_copy.inliers_mask
match.num_inliers = match.num_inliers
match.confidence = match_to_copy.confidence
dmatches = []
for dmatch_to_copy in match_to_copy.matches:
dmatch = cv2.DMatch()
dmatch.distance = dmatch_to_copy.distance
dmatch.imgIdx = dmatch_to_copy.imgIdx
# swap queryIdx and trainIdx
dmatch.queryIdx = dmatch_to_copy.trainIdx
dmatch.trainIdx = dmatch_to_copy.queryIdx
dmatches.append(dmatch)
match.matches = dmatches
matches.append(match)
else:
matches.append(cv2.detail.MatchesInfo())
```
I tried with code from scratch, but the result from scratch not good as
original you suggestion: ```stitcher.Stitch(images)```
Vào Th 4, 18 thg 10, 2023 vào lúc 00:15 Lukas Weber <
***@***.***> đã viết:
… [image: 05_timelapse_img1]
<https://user-images.githubusercontent.com/32765578/275922133-4937a546-9a65-479e-a19b-7c2e7d4d01f6.jpg>
[image: 05_timelapse_img2]
<https://user-images.githubusercontent.com/32765578/275922071-d2df074d-3413-4b1b-9d93-62bbfb8e03a9.jpg>
[image: 05_timelapse_img3]
<https://user-images.githubusercontent.com/32765578/275922120-0abdd29c-f962-4951-854e-a865dfce5470.jpg>
If you run a, b and c seperately and try to stitch the results, you can
see in the timelapse quite nicely that the image dataset is of poor quality
to create a 360 degree panorama for the whole scene. Several parts are
missing.
—
Reply to this email directly, view it on GitHub
<#162 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKDIB5F7FRLSJ6CHREI7UPDX724LVAVCNFSM6AAAAAA6EFANV6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TGMBWGU4TS>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I've had another look on the dataset. I tried to stitch all a*, b* and c* images to get a feeling. stitching a* the algorithm has a hard time to connect a4 with a5. Maybe artifical features or feature masks can help here. b* stitches quite well c* is very bad So maybe solve the a* problem, stitch it with b* and try to include as many c* as possible to get a fine panorama of the scene |
Beta Was this translation helpful? Give feedback.
I've had another look on the dataset.
I tried to stitch all a*, b* and c* images to get a feeling.
stitching a* the algorithm has a hard time to connect a4 with a5. Maybe artifical features or feature masks can help here.
b* stitches quite well
c* is very bad
So maybe solve the a* problem, stitch it with b* and try to include as many c* as possible to get a fine panorama of the scene