![]() height: Number of intersection points of squares in the short side of the calibration board.It is 9 by default if you use the chessboard above. width: Number of intersection points of squares in the long side of the calibration board. ![]() ![]() Code is generalized but we need a prefix to iterate, otherwise, there can be any other file that we don’t care about.) (If the list is: image1.jpg, image2.jpg … it shows that the prefix is “image”. prefix: Images should have the same name.dirpath: The directory that we moved our images.Let’s start to the calibration code: import numpy as np import cv2 import glob # termination criteria criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) def calibrate(dirpath, prefix, image_format, square_size, width=9, height=6): """ Apply camera calibration operation for images in the given directory path. Numpy is a scientific computation package and OpenCV also uses it, that’s why we need it. Contrib will be used next blog, it is not necessary for now but definitely recommended.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |