calibration相关

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/

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值