-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlign.py
More file actions
32 lines (20 loc) · 699 Bytes
/
Copy pathAlign.py
File metadata and controls
32 lines (20 loc) · 699 Bytes
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
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import os
from utils import Stitcher
if __name__ == "__main__":
imageB=cv2.imread("1.bmp")
stitcher = Stitcher()
storage=np.zeros([442,512,12600])
storage[:,:,0]=cv2.cvtColor(imageB,cv2.COLOR_BGR2GRAY)
for i in range(12600):
fileref=str(i+2)+".bmp"
imageA=cv2.imread(fileref)
result = stitcher.stitch([imageA, imageB], showMatches=True)
storage[:,:,i+1]=cv2.cvtColor(result,cv2.COLOR_BGR2GRAY)
os.chdir(os.getcwd() +'\\AlignedSIFT')
np.save("Aligned.npy", storage)
for i in range(14040):
im=storage[:,:,i]
cv2.imwrite(str(i)+'.bmp',im)