b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

imread Mac下基于opencv做单应性矩阵求解和几何校正(2)

电脑杂谈  发布时间:2018-01-28 02:04:23  来源:网络整理

ptsB = numpy.float32([kp2[m.trainIdx].pt for m in goodMatch]).reshape(-1, 1, 2)

ransacReprojThreshold = 4

print ‘findHomography_begin’

H, status =cv2.findHomography(ptsA,ptsB,cv2.RANSAC,ransacReprojThreshold);

print(H)

print ‘findHomography’

imgOut = cv2.warpPerspective(img2, HT, (img1.shape[1],img1.shape[0]),flags=cv2.INTER_LINEAR + cv2.WARP_INVERSE_MAP)

print ‘warpPerspective’

return imgOut,H,status

print ‘begin’

image_dir = image_file(‘/Users/xxx/downloads/data’)

save_path = “/Users/xxx/downloads/results”

numbers = 0

K = numpy.array([[3.95, 0, 2.4], [0, 3.95, 1.8], [0, 0, 1]])

result = cv2.imread(image_dir[0])

for numbers in range(len(image_dir)-1):

print “this is the circle %d of image_dir” %(numbers)

if len(image_dir) < 1:
    print "not enough images"
else :
    img1 = result;
    img2 = cv2.imread(image_dir[numbers+1])
    result, H, _ = siftImageAlignment(img1, img2)
    save_file(image_dir[numbers+1],result,save_path)
print 'result'

print(“final end”)


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-63299-2.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...