Commit 4c020d69 authored by Vladislav Sovrasov's avatar Vladislav Sovrasov

reg: add python sample

parent 9608d31a
#!/usr/bin/python
import cv2
import numpy as np
import sys
img1 = cv2.imread(sys.argv[1])
img1 = img1.astype(np.float32)
shift = np.array([5., 5.])
mapTest = cv2.reg.MapShift(shift)
img2 = mapTest.warp(img1)
mapper = cv2.reg.MapperGradShift()
mappPyr = cv2.reg.MapperPyramid(mapper)
resMap = mappPyr.calculate(img1, img2)
mapShift = cv2.reg.MapTypeCaster_toShift(resMap)
print(mapShift.getShift())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment