-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstiching_code.py
34 lines (30 loc) · 990 Bytes
/
stiching_code.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from Stitcher import stitcher
# import the necessary packages
import argparse
import imutils
import cv2
cap = cv2.VideoCapture(0)
stitcher = stitcher()
frame1 = cv2.imread(r'C:\Users\PIYUSH\Desktop\pic1.jpg')
while True:
flag, frame = cap.read()
# load the two images and resize them to have a width of 400 pixels
# (for faster processing)
#imageA = cv2.imread(r'C:\Users\PIYUSH\Desktop\pic1.jpg')
#imageB = cv2.imread(r'C:\Users\PIYUSH\Desktop\pic2.jpg')
#frame = imutils.resize(frame, width=400)
#imageB = imutils.resize(imageB, width=400)
# stitch the images together to create a panorama
#stitcher = stitcher()
(result, vis) = stitcher.stitch([frame, frame1], showMatches=True)
frame1=frame
break
# show the images
#cv2.imshow("Image A", imageA)
#cv2.imshow("Image B", imageB)
cv2.imshow("Keypoint Matches",frame)
#cv2.imshow("Result", result)
if cv2.waitKey(10) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()