当前位置:   article > 正文

双目测距代码

双目测距代码
  1. #coding:utf-8
  2. #生成黑白标定图及定标代码
  3. import cv2
  4. import numpy as np
  5. import os
  6. import time
  7. import sys
  8. #单目校正后的npy文件保存路径
  9. Leftmtx_path='/home/nvidia/AI_Robot/twilight/usb_camera/output/LeftcameraMatrix.npy' #左摄像头内参数矩阵
  10. Leftdist_path='/home/nvidia/AI_Robot/twilight/usb_camera/output/LeftdistCoeff.npy' #左摄像头畸变矩阵
  11. Rightmtx_path='/home/nvidia/AI_Robot/twilight/usb_camera/output/RightcameraMatrix.npy' #右摄像头内参数矩阵
  12. Rightdist_path='/home/nvidia/AI_Robot/twilight/usb_camera/output/RightdistCoeff.npy' #右摄像头畸变矩阵
  13. #立体校正后的npy文件保存路径
  14. LeftCameraMtx_path='./output/LeftMatrix.npy'
  15. LeftCameraDist_path='./output/LeftCoeff.npy'
  16. RightCameraMtx_path='./output/RightMatrix.npy'
  17. RightCameraDist_path='./output/RightCoeff.npy'
  18. left_map1_path='./output/left_map1.npy'
  19. left_map2_path='./output/left_map2.npy'
  20. right_map1_path='./output/right_map1.npy'
  21. right_map2_path='./output/right_map2.npy'
  22. Q_path='./output/Q.npy'
  23. cal_path='./picture/cal_picture/' #标定图片存储文件夹
  24. #生成一张标准尺寸为width*height的标定图,格子尺寸为length
  25. def Calibration_create(width=450,height=350,length=50,path='./Calibration.jpg'):
  26. image = np.zeros((width,height),dtype = np.uint8)
  27. for j in range(height):
  28. for i in range(width):
  29. if((int)(i/length) + (int)(j/length))%2:
  30. image[i,j] = 255;
  31. cv2.imwrite(path,image)
  32. print 'create successfully'
  33. #计算图中可以检测到几个角点
  34. def CornersDetect(path,shape):
  35. img=cv2.imread(path)
  36. gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  37. for i in range(shape[0],2,-1):
  38. for j in range(shape[1],2,-1):
  39. ret,corners=cv2.findChessboardCorners(gray,(i,j),None)
  40. if ret==True:
  41. print shape
  42. else:
  43. print (i,j),'falied match'
  44. sys.exit(0)
  45. #验证shape大小是否能够检测成功
  46. def Corners_Verification(path,shape):
  47. img=cv2.imread(path)
  48. gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  49. ret,corners=cv2.findChessboardCorners(gray,shape,None)
  50. if ret==True:
  51. return True
  52. else:
  53. print 'detect failed'
  54. sys.exit(0)
  55. #加载标定图片并对两个摄像头分别进行单摄像头标定,shape为标定板方格横向和纵向个数
  56. def SoloCalibration(shape=(11,8)):
  57. cal_result_path='./picture/cal_result/'
  58. pic_list=os.listdir(cal_path)
  59. Leftpic_list=[]
  60. Rightpic_list=[]
  61. for name in pic_list:
  62. if 'L' in name:
  63. Leftpic_list.append(name)
  64. elif 'R' in name:
  65. Rightpic_list.append(name)
  66. #合格的图片数
  67. img_num=0
  68. #检测是不是所有图片符合检测要求,不符合结束程序
  69. for name in pic_list:
  70. status=Corners_Verification(path=cal_path+name,shape=shape)
  71. if status==True:
  72. img_num+=1
  73. elif status==None:
  74. print 'detect failed'
  75. sys.exit(0)
  76. print 'all pirtures corners detected successfully'
  77. img_num/=2
  78. # 阈值
  79. criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
  80. # 世界坐标系中的棋盘格点,例如(0,0,0), (1,0,0), (2,0,0) ....,(8,5,0),去掉Z坐标,
  81. # 记为二维矩阵
  82. objp = np.zeros((shape[0]*shape[1],3), np.float32)
  83. objp[:,:2] = np.mgrid[0:shape[0],0:shape[1]].T.reshape(-1,2) #一个框边长5mm
  84. # 储存棋盘格角点的世界坐标和图像坐标对
  85. LeftObjpoints=[]
  86. LeftImgpoints=[]
  87. RightObjpoints=[]
  88. RightImgpoints=[]
  89. #左摄像头定标
  90. for name in Leftpic_list:
  91. img=cv2.imread(cal_path+name)
  92. gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  93. ret,corners=cv2.findChessboardCorners(gray,shape,None)
  94. if ret==True:
  95. cv2.cornerSubPix(gray,corners,(11,11),(-1,-1),criteria) #精确检测点坐标
  96. LeftObjpoints.append(objp)
  97. LeftImgpoints.append(corners)
  98. cv2.drawChessboardCorners(img, shape , corners,ret)
  99. cv2.imwrite(cal_result_path+name,img)
  100. #print name,' OK'
  101. else:
  102. print 'detect failed'
  103. return None
  104. # 标定
  105. #返回标定结果、相机的内参数矩阵、畸变系数、旋转矩阵和平移向量
  106. ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(LeftObjpoints,
  107. LeftImgpoints, gray.shape[::-1], None, None)
  108. print '左摄像头定标结果'
  109. print '内参数矩阵、畸变矩阵尺寸: ',mtx.shape,dist.shape
  110. np.save(Leftmtx_path,mtx)
  111. np.save(Leftdist_path,dist)
  112. print '标定结果:'
  113. print ret
  114. print '相机内参数矩阵:'
  115. print mtx
  116. print '畸变系数'
  117. print dist
  118. print '旋转矩阵'
  119. print rvecs
  120. print '平移向量'
  121. print tvecs
  122. #右摄像头定标
  123. for name in Rightpic_list:
  124. img=cv2.imread(cal_path+name)
  125. gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  126. ret,corners=cv2.findChessboardCorners(gray,shape,None)
  127. if ret==True:
  128. cv2.cornerSubPix(gray,corners,(11,11),(-1,-1),criteria) #精确检测点坐标
  129. RightObjpoints.append(objp)
  130. RightImgpoints.append(corners)
  131. cv2.drawChessboardCorners(img, shape , corners,ret)
  132. cv2.imwrite(cal_result_path+name,img)
  133. else:
  134. print 'detect failed'
  135. return None
  136. # 标定
  137. #返回标定结果、相机的内参数矩阵、畸变系数、旋转矩阵和平移向量
  138. ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(RightObjpoints,
  139. RightImgpoints, gray.shape[::-1], None, None)
  140. print '右摄像头定标结果'
  141. print '右摄像头内参数矩阵、畸变矩阵尺寸: ',mtx.shape,dist.shape
  142. np.save(Rightmtx_path,mtx)
  143. np.save(Rightdist_path,dist)
  144. print '标定结果:'
  145. print ret
  146. print '相机内参数矩阵:'
  147. print mtx
  148. print '畸变系数'
  149. print dist
  150. print '旋转矩阵'
  151. print rvecs
  152. print '平移向量'
  153. print tvecs
  154. #单目拍摄并去畸变
  155. def SoloShot(cameraID=1):
  156. camera=cv2.VideoCapture(cameraID)
  157. ret,pic=camera.read()
  158. print pic.shape
  159. camera.release()
  160. if cameraID==0:
  161. mtx=np.load(Leftmtx_path)
  162. dist=np.load(Leftdist_path)
  163. else:
  164. mtx=np.load(Rightmtx_path)
  165. dist=np.load(Rightdist_path)
  166. pic=cv2.undistort(pic,mtx,dist)
  167. return pic
  168. #左右摄像头各拍摄一张图片并使用单目摄像头定标得到的内参数矩阵和畸变矩阵对图形进行校准,输出校准前和校准后结果
  169. def SoloCompare(output_path='./picture/compare/'):
  170. print 'soloCompare start'
  171. #获取两张图片
  172. video0=cv2.VideoCapture(0)
  173. ret,pic1=video0.read()
  174. video0.release()
  175. video1=cv2.VideoCapture(1)
  176. ret,pic2=video1.read()
  177. video1.release()
  178. #保存原图片
  179. cv2.imwrite(output_path+'LeftSoloOrigin.jpg',pic1)
  180. cv2.imwrite(output_path+'RightSoloOrigin.jpg',pic2)
  181. #加载两个摄像头的内参数矩阵和畸变矩阵
  182. Leftmtx=np.load(Leftmtx_path)
  183. Leftdist=np.load(Leftdist_path)
  184. Rightmtx=np.load(Rightmtx_path)
  185. Rightdist=np.load(Rightdist_path)
  186. #进行校准
  187. cal_pic1=cv2.undistort(pic1,Leftmtx,Leftdist)
  188. cal_pic2=cv2.undistort(pic2,Rightmtx,Rightdist)
  189. #保存校准后图片
  190. cv2.imwrite(output_path+'./LeftSoloOut.jpg',cal_pic1)
  191. cv2.imwrite(output_path+'./RightSoloOut.jpg',cal_pic2)
  192. print 'OK'
  193. #双目校准,shape为标定图规格,Lpath为左摄像头拍摄图像,Rpath为右摄像头拍摄图像
  194. def CameraCalibration(shape=(11,8)):
  195. criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
  196. objRealPoint=[] #图片角点实际物理坐标集合
  197. imgPointsL=[] #左边摄像头某一照片角点集合
  198. imgPointsR=[] #右边摄像头某一照片角点集合
  199. #获取图片列表
  200. pic_list=os.listdir(cal_path)
  201. Leftpic_list=[]
  202. Rightpic_list=[]
  203. #分为左摄像头和右摄像头两个列表
  204. for name in pic_list:
  205. if 'L' in name:
  206. Leftpic_list.append(name)
  207. elif 'R' in name:
  208. Rightpic_list.append(name)
  209. #合格的图片数
  210. img_num=0
  211. #检测是不是所有图片符合检测要求,不符合结束程序
  212. for name in pic_list:
  213. status=Corners_Verification(path=cal_path+name,shape=shape)
  214. if status==True:
  215. img_num+=1
  216. elif status==None:
  217. return None
  218. print 'all pictures corners detected successfully'
  219. img_num/=2
  220. # 世界坐标系中的棋盘格点,例如(0,0,0), (1,0,0), (2,0,0) ....,(8,5,0),去掉Z坐标,
  221. # 记为二维矩阵
  222. objp = np.zeros((shape[0]*shape[1],3), np.float32)
  223. objp[:,:2] = np.mgrid[0:shape[0],0:shape[1]].T.reshape(-1,2)
  224. #加载单摄像头标定所得内参数和畸变矩阵
  225. cameraMatrixL=np.load(Leftmtx_path)
  226. distCoeffL=np.load(Leftdist_path)
  227. cameraMatrixR=np.load(Rightmtx_path)
  228. distCoeffR=np.load(Rightdist_path)
  229. #图片预处理
  230. for i in range(img_num):
  231. if i==29:
  232. continue
  233. LImage=cv2.imread(cal_path+str(i)+'L.jpg')
  234. RImage=cv2.imread(cal_path+str(i)+'R.jpg')
  235. LGray=cv2.cvtColor(LImage,cv2.COLOR_BGR2GRAY)
  236. RGray=cv2.cvtColor(RImage,cv2.COLOR_BGR2GRAY)
  237. Lret,Lcorners=cv2.findChessboardCorners(LGray,shape,None)
  238. Rret,Rcorners=cv2.findChessboardCorners(RGray,shape,None)
  239. if Lret==True and Rret==True:
  240. cv2.cornerSubPix(LGray,Lcorners,(11,11),(-1,-1),criteria)
  241. cv2.cornerSubPix(RGray,Rcorners,(11,11),(-1,-1),criteria)
  242. objRealPoint.append(objp) #实际物理坐标
  243. imgPointsL.append(Lcorners)
  244. imgPointsR.append(Rcorners)
  245. else:
  246. print 'detect failed'
  247. return None
  248. #drawChessboardCorners(LImage, shape, Lcorners,Lret)
  249. #cv2.drawChessboardCorners(RImage, shape, Rcorners,Rret)
  250. #print cv2.CALIB_USE_INTRINSIC_GUESS
  251. #计算立体标定,输出标定结果为左摄像头内参数矩阵,右摄像头内参数矩阵,左畸变系数,右畸变系数,两摄像头之间旋转矩阵及平移矩阵,本质矩阵,基本矩阵
  252. retval,cameraMatrixL,distCoeffL,cameraMatrixR,distCoeffR,R,T,E,F=cv2.stereoCalibrate(objRealPoint,imgPointsL,imgPointsR,cameraMatrixL,distCoeffL,cameraMatrixR,distCoeffR,LGray.shape[::-1],flags=cv2.CALIB_USE_INTRINSIC_GUESS)
  253. print '基于单目定标后的双目摄像头立体定标输出参数:'
  254. print '左摄像头内参数矩阵、畸变矩阵尺寸: ',cameraMatrixL.shape,distCoeffL.shape
  255. print '右摄像头内参数矩阵、畸变矩阵尺寸: ',cameraMatrixR.shape,distCoeffR.shape
  256. print '左摄像头内参数矩阵:'
  257. print cameraMatrixL
  258. print '左摄像头畸变矩阵:'
  259. print distCoeffL
  260. print '右摄像头内参数矩阵:'
  261. print cameraMatrixR
  262. print '右摄像头畸变矩阵:'
  263. print distCoeffR
  264. #存储立体标定后获得的内参数矩阵和畸变矩阵
  265. np.save(LeftCameraMtx_path,cameraMatrixL)
  266. np.save(LeftCameraDist_path,distCoeffL)
  267. np.save(RightCameraMtx_path,cameraMatrixR)
  268. np.save(RightCameraDist_path,distCoeffR)
  269. #计算旋转校准矩阵和投影矩阵,使得两张图共面对准
  270. R1,R2,P1,P2,Q,validPixROI1,validPixROI2=cv2.stereoRectify(cameraMatrixL,distCoeffL,cameraMatrixR,distCoeffR,LGray.shape[::-1],R,T)
  271. #计算更正map
  272. left_map1,left_map2=cv2.initUndistortRectifyMap(cameraMatrixL,distCoeffL,R1,P1,LGray.shape[::-1],cv2.CV_16SC2)
  273. right_map1,right_map2=cv2.initUndistortRectifyMap(cameraMatrixR,distCoeffR,R2,P2,LGray.shape[::-1],cv2.CV_16SC2)
  274. print '映射map:'
  275. print '左摄像头映射矩阵1:'
  276. print left_map1
  277. print '左摄像头映射矩阵2:'
  278. print left_map2
  279. print '右摄像头映射矩阵1:'
  280. print right_map1
  281. print '右摄像头映射矩阵2:'
  282. print right_map2
  283. np.save(left_map1_path,left_map1)
  284. np.save(left_map2_path,left_map2)
  285. np.save(right_map1_path,right_map1)
  286. np.save(right_map2_path,right_map2)
  287. np.save(Q_path,Q)
  288. #左右摄像头各拍摄一张图片并使用双目立体定标得到的内参数矩阵和畸变矩阵对图形进行校准,输出校准前和校准后结果
  289. def CameraCompare(output_path='./picture/compare/'):
  290. #获取两张图片
  291. video0=cv2.VideoCapture(0)
  292. ret,pic1=video0.read()
  293. video0.release()
  294. video1=cv2.VideoCapture(1)
  295. ret,pic2=video1.read()
  296. video1.release()
  297. #保存原图片
  298. cv2.imwrite(output_path+'LeftCameraOrigin.jpg',pic1)
  299. cv2.imwrite(output_path+'RightCameraOrigin.jpg',pic2)
  300. #加载两个摄像头的内参数矩阵和畸变矩阵
  301. Leftmtx=np.load(LeftCameraMtx_path)
  302. Leftdist=np.load(LeftCameraDist_path)
  303. Rightmtx=np.load(RightCameraMtx_path)
  304. Rightdist=np.load(RightCameraDist_path)
  305. #进行校准
  306. cal_pic1=cv2.undistort(pic1,Leftmtx,Leftdist)
  307. cal_pic2=cv2.undistort(pic2,Rightmtx,Rightdist)
  308. #保存校准后图片
  309. cv2.imwrite(output_path+'./LeftCameraOut.jpg',cal_pic1)
  310. cv2.imwrite(output_path+'./RightCameraOut.jpg',cal_pic2)
  311. print 'OK'
  312. #计算立体更正获得深度图
  313. def depth_map( output_path='./picture/compare/' ):
  314. start_time=time.time()
  315. #获取两张图片
  316. video0=cv2.VideoCapture(0)
  317. video1=cv2.VideoCapture(1)
  318. #a=time.time()
  319. ret,pic1=video0.read()
  320. #a=time.time()
  321. video0.release()
  322. #video1=cv2.VideoCapture(1)
  323. ret2,pic2=video1.read()
  324. #b=time.time()
  325. #print b-a
  326. #video0.release()
  327. video1.release()
  328. #保存原图片
  329. cv2.imwrite(output_path+'LeftDepthOrigin.jpg',pic1)
  330. cv2.imwrite(output_path+'RightDepthOrigin.jpg',pic2)
  331. left_map1=np.load(left_map1_path)
  332. left_map2=np.load(left_map2_path)
  333. right_map1=np.load(right_map1_path)
  334. right_map2=np.load(right_map2_path)
  335. Q=np.load(Q_path)
  336. #加载两个摄像头的内参数矩阵和畸变矩阵
  337. Leftmtx=np.load(LeftCameraMtx_path)
  338. Leftdist=np.load(LeftCameraDist_path)
  339. Rightmtx=np.load(RightCameraMtx_path)
  340. Rightdist=np.load(RightCameraDist_path)
  341. #进行校准
  342. #cal_pic1=cv2.undistort(pic1,Leftmtx,Leftdist)
  343. #cal_pic2=cv2.undistort(pic2,Rightmtx,Rightdist)
  344. #根据map对图片进行重映射
  345. LeftImg_Rectified=cv2.remap(pic1,left_map1,left_map2,cv2.INTER_LINEAR)
  346. RightImg_Rectified=cv2.remap(pic2,right_map1,right_map2,cv2.INTER_LINEAR)
  347. #LeftImg_Rectified=LeftImg
  348. #RightImg_Rectified=RightImg
  349. imgL=cv2.cvtColor(LeftImg_Rectified,cv2.COLOR_BGR2GRAY)
  350. imgR=cv2.cvtColor(RightImg_Rectified,cv2.COLOR_BGR2GRAY)
  351. # 两个trackbar用来调节不同的参数查看效果
  352. '''num = cv2.getTrackbarPos("num", "depth")
  353. blockSize = cv2.getTrackbarPos("blockSize", "depth")
  354. if blockSize % 2 == 0:
  355. blockSize += 1
  356. if blockSize < 5:
  357. blockSize = 5'''
  358. # 根据Block Maching方法生成差异图(opencv里也提供了SGBM/Semi-Global Block Matching算法,有兴趣可以试试)
  359. stereo = cv2.StereoSGBM(minDisparity=0,numDisparities=256, SADWindowSize=3)
  360. disparity = stereo.compute(imgL, imgR)
  361. disp = cv2.normalize(disparity, alpha=0,beta=255, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_16UC1)
  362. #disp=cv2.threshold(disp,30,200)
  363. disp[disp>220]=0
  364. #膨胀操作
  365. kernel1=np.ones((2,2),np.uint8)
  366. kernel2=np.ones((5,5),np.uint8)
  367. erobe_disp=disp
  368. #对图像进行开运算先膨胀再腐蚀
  369. erobe_disp=cv2.morphologyEx(erobe_disp,cv2.MORPH_OPEN,kernel1,iterations=1) #去噪点
  370. erobe_disp=cv2.morphologyEx(erobe_disp,cv2.MORPH_CLOSE,kernel2,iterations=1) #填充
  371. erobe_disp[erobe_disp<25]=0
  372. erobe_disp=erobe_disp.astype(np.uint8)
  373. #双边滤波器
  374. erobe_disp=cv2.bilateralFilter(erobe_disp,d=10,sigmaColor=10,sigmaSpace=15)
  375. erobe_disp[erobe_disp<20]=0
  376. # 将图片扩展至3d空间中,其z方向的值则为当前的距离
  377. #threeD = cv2.reprojectImageTo3D(disp.astype(np.float32)/16., Q)
  378. #disp=disp.reshape(disp.shape[0],disp.shape[1],1)
  379. #disp=cv2.merge([disp,disp,disp])
  380. #disp=cv2.cvtColor(disp,cv2.COLOR_BGR2RGB)
  381. cv2.imwrite(output_path+'deep_output.jpg',disp)
  382. cv2.imwrite(output_path+'erode_deep_output.jpg',erobe_disp)
  383. #输出重映射对齐后的图像
  384. cv2.imwrite(output_path+'LeftImage_Rectified.jpg',LeftImg_Rectified)
  385. cv2.imwrite(output_path+'RightImage_Rectified.jpg',RightImg_Rectified)
  386. print disp.shape
  387. end_time=time.time()
  388. print 'time consume:%.4f' %(end_time-start_time)
  389. print 'max:',np.max(disp),'min',np.min(disp),'mean',np.mean(disp)
  390. #拍摄并计算出深度图保存为output_name
  391. def depth_shot(output_name):
  392. start_time=time.time()
  393. #获取两张图片
  394. video0=cv2.VideoCapture(0)
  395. video1=cv2.VideoCapture(1)
  396. ret,pic1=video0.read()
  397. video0.release()
  398. ret2,pic2=video1.read()
  399. video1.release()
  400. print 'shot OK'
  401. left_map1=np.load(left_map1_path)
  402. left_map2=np.load(left_map2_path)
  403. right_map1=np.load(right_map1_path)
  404. right_map2=np.load(right_map2_path)
  405. Q=np.load(Q_path)
  406. #加载两个摄像头的内参数矩阵和畸变矩阵
  407. Leftmtx=np.load(LeftCameraMtx_path)
  408. Leftdist=np.load(LeftCameraDist_path)
  409. Rightmtx=np.load(RightCameraMtx_path)
  410. Rightdist=np.load(RightCameraDist_path)
  411. #根据map对图片进行重映射
  412. LeftImg_Rectified=cv2.remap(pic1,left_map1,left_map2,cv2.INTER_LINEAR)
  413. RightImg_Rectified=cv2.remap(pic2,right_map1,right_map2,cv2.INTER_LINEAR)
  414. imgL=cv2.cvtColor(LeftImg_Rectified,cv2.COLOR_BGR2GRAY)
  415. imgR=cv2.cvtColor(RightImg_Rectified,cv2.COLOR_BGR2GRAY)
  416. # 根据Block Maching方法生成差异图(opencv里也提供了SGBM/Semi-Global Block Matching算法,有兴趣可以试试)
  417. stereo = cv2.StereoSGBM(minDisparity=0,numDisparities=256, SADWindowSize=3)
  418. disparity = stereo.compute(imgL, imgR)
  419. disp = cv2.normalize(disparity, alpha=0,beta=255, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_16UC1)
  420. #disp=cv2.threshold(disp,30,200)
  421. disp[disp>220]=0
  422. #膨胀操作
  423. kernel1=np.ones((2,2),np.uint8)
  424. kernel2=np.ones((5,5),np.uint8)
  425. erobe_disp=disp
  426. #对图像进行开运算先膨胀再腐蚀
  427. erobe_disp=cv2.morphologyEx(erobe_disp,cv2.MORPH_OPEN,kernel1,iterations=1) #去噪点
  428. erobe_disp=cv2.morphologyEx(erobe_disp,cv2.MORPH_CLOSE,kernel2,iterations=1) #填充
  429. erobe_disp[erobe_disp<25]=0
  430. erobe_disp=erobe_disp.astype(np.uint8)
  431. #双边滤波器
  432. erobe_disp=cv2.bilateralFilter(erobe_disp,d=10,sigmaColor=10,sigmaSpace=15)
  433. erobe_disp[erobe_disp<20]=0
  434. cv2.imwrite('./car_data/ori.jpg',imgL)
  435. cv2.imwrite(output_name,erobe_disp)
  436. print 'OK'
  437. if __name__=='__main__':
  438. print 'start'
  439. #Calibration_create()
  440. #CornersDetect('./picture/cal_picture/9R.jpg',(11,8))
  441. #SoloCalibration()
  442. #CameraCalibration()
  443. #depth_map()
  444. SoloCompare()
  445. #CameraCompare()

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/152886
推荐阅读
相关标签
  

闽ICP备14008679号