【问题标题】:What is the purpose of decimation when calibrating a camera with Charuco?使用 Charuco 校准相机时抽取的目的是什么?
【发布时间】:2021-09-30 04:52:00
【问题描述】:

我一直在使用ChAruCo boards 进行相机校准。

按照代码here(我的注释版本如下所示),在执行相机校准时似乎只使用其他所有图像 - 由于抽取器。

这可能是什么原因?除了节省处理能力,这似乎没有必要,因为这一步只执行一次。

def read_chessboards(chessboard_images):
# Charuco base pose estimation.

print("POSE ESTIMATION STARTS:")

# Declare lists to store corner locations and IDs
allCorners = []
allIds = []
decimator = 0

# SUB PIXEL CORNER DETECTION CRITERION
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 100, 0.00001)

# for each of the chessboard images
for im in chessboard_images:
    print("=> Processing image {0}".format(im))
    frame = cv2.imread(im)                          # read current image into frame variable
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)  # convert to grayscale
    corners, ids, rejectedImgPoints = cv2.aruco.detectMarkers(gray, ARUCO_DICT)  # detect markers present in image

    # if there are any markers detected
    if len(corners) > 0:
        # SUB PIXEL DETECTION
        for corner in corners:
            # refine corner locations
            # TODO: check if this works
            cv2.cornerSubPix(gray, corner,
                             winSize=(3, 3),
                             zeroZone=(-1, -1),
                             criteria=criteria)

        # interpolate position of ChArUco board corners.
        res2 = cv2.aruco.interpolateCornersCharuco(corners, ids, gray, board)
        print(f'Charuco corners at: {res2}')

        # if 3+ corners are detected, add to allCorners list for every other image
        if res2[1] is not None and res2[2] is not None and len(res2[1]) > 3 and decimator % 1 == 0:
            allCorners.append(res2[1])
            allIds.append(res2[2])

    # why only every other chessboard image?
    decimator += 1

imsize = gray.shape
return allCorners, allIds, imsize

【问题讨论】:

    标签: opencv image-processing camera-calibration aruco


    【解决方案1】:

    刚刚意识到 x % 1 总是计算为 0,所以它实际上并没有做任何事情。我猜它是作为可选功能包含的 - 如果您将 1 更改为其他数字。

    【讨论】:

      猜你喜欢
      • 2022-10-24
      • 1970-01-01
      • 2015-01-31
      • 1970-01-01
      • 2015-11-16
      • 2011-04-05
      • 1970-01-01
      • 1970-01-01
      • 2013-02-24
      相关资源
      最近更新 更多