图像新型拼接

编程入门 行业动态 更新时间:2024-10-27 22:19:03

<a href=https://www.elefans.com/category/jswz/34/1771430.html style=图像新型拼接"/>

图像新型拼接

道路摄像头拼接

拼接道路上的摄像头,比较麻烦,如图所示

前后的摄像头都是如此,那么如何拼接摄像头画面呢,像下面这样拼接

测试代码

测试一下代码,使用python

import cv2
import numpy as npimg = cv2.imread("test.jpg")
height, width = img.shape[:2]
# print(height, width)# 变换前的四个点
srcArr = np.float32([[450, 280], [width-350, 280], [0, height], [width,height]])
# 变换后的四个点
#dstArr = np.float32([[0, 0], [width, 0], [0, height], [width,height]])
dstArr = np.float32([[450-200, 0], [width-350+200, 0], [0, height], [width,height]])# 求解获取变换矩阵
MM = cv2.getPerspectiveTransform(srcArr, dstArr)
print(MM)
# 输出复原图像
dsize = (int(width/2), int(height/2))
dst = cv2.warpPerspective(img, MM, (width, height))
dst = cv2.resize(dst,dsize)
cv2.imshow("test",dst)
cv2.waitKey(0)

最后要使用c++ 去真的拼接

更多推荐

图像新型拼接

本文发布于:2023-11-16 11:53:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619375.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!