import cv2
import numpy as np
def showcircle(circletxt):
img1=np.ones([480,640])*255
file =open(circletxt,'r')
num =int(file.readline())
for i in range(num):
point = file.readline()
x = point.split(' ')[0] #x表示行
y = point.spilt(' ')[1]
cv2.circle(img1,[x,y],2,[0,0,0])
img2 =cv2.imread()
imgconcat =cv2.hconcat([img1,img2]) #两张图片都是320x240的,就是要小一点
cv2.imshow("detectcircle", imgconcat)
cv2.waitKey(0)
def showmatch(matchtxt):
imgL =cv2.imread() #读取对应的txt
imgR= np.ones([480, 640]) * 255
imgconcat=cv2.hconcat([imgL,imgR])
file = open(circletxt, 'r')
num = int(file.readline())
for i in range(num):
point = file.readline()
xL= point.split(' ')[0] #
yL= point.spilt(' ')[1]
xR =point.split(' ')[2]
yR =point.split(' ')[3]
cv2.circle(imgconcat, [xL, yL], 2, [0, 0, 0])
cv2.circle(imgconcat,[xR,yR+640],2,[255,0,0])
cv2.line(imgconcat,(xL,yL),(xR,yR+640),(255,255,0),2)
cv2.imshow("showmatch",imgconcat)
cv2.waitKey(0)
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
circletxt =""
showcircle(circletxt)
matchtxt=""
showcircle(matchtxt)
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
calibration相关
最新推荐文章于 2024-11-04 21:51:40 发布