fixed examples for opencv 2.4.8
This commit is contained in:
parent
86b6c48712
commit
a0bfdb9bf1
@ -93,9 +93,8 @@ Once we find the corners, we can increase their accuracy using **cv2.cornerSubPi
|
|||||||
objp = np.zeros((6*7,3), np.float32)
|
objp = np.zeros((6*7,3), np.float32)
|
||||||
objp[:,:2] = np.mgrid[0:7,0:6].T.reshape(-1,2)
|
objp[:,:2] = np.mgrid[0:7,0:6].T.reshape(-1,2)
|
||||||
|
|
||||||
# Arrays to store object points and image points from all the images.
|
# Arrays to store object points
|
||||||
objpoints = [] # 3d point in real world space
|
objpoints = [] # 3d point in real world space
|
||||||
imgpoints = [] # 2d points in image plane.
|
|
||||||
|
|
||||||
images = glob.glob('*.jpg')
|
images = glob.glob('*.jpg')
|
||||||
|
|
||||||
@ -110,16 +109,16 @@ Once we find the corners, we can increase their accuracy using **cv2.cornerSubPi
|
|||||||
if ret == True:
|
if ret == True:
|
||||||
objpoints.append(objp)
|
objpoints.append(objp)
|
||||||
|
|
||||||
corners2 = cv2.cornerSubPix(gray,corners,(11,11),(-1,-1),criteria)
|
cv2.cornerSubPix(gray,corners,(11,11),(-1,-1),criteria)
|
||||||
imgpoints.append(corners2)
|
|
||||||
|
|
||||||
# Draw and display the corners
|
# Draw and display the corners
|
||||||
img = cv2.drawChessboardCorners(img, (7,6), corners2,ret)
|
cv2.drawChessboardCorners(img, (7,6), corners,ret)
|
||||||
cv2.imshow('img',img)
|
cv2.imshow('img',img)
|
||||||
cv2.waitKey(500)
|
cv2.waitKey(500)
|
||||||
|
|
||||||
cv2.destroyAllWindows()
|
cv2.destroyAllWindows()
|
||||||
|
|
||||||
|
|
||||||
One image with pattern drawn on it is shown below:
|
One image with pattern drawn on it is shown below:
|
||||||
|
|
||||||
.. image:: images/calib_pattern.jpg
|
.. image:: images/calib_pattern.jpg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user