【发布时间】:2021-10-09 21:55:36
【问题描述】:
我必须做以下工作:
1. Draw a chessboard with at least 9x6 squares.
2. Take a video using a still camera and place the chessboard on the scene to find a Homography.
3. Remove the calibration target from the scene and compute the background model.
4. Place a moving object in the scene on the same plane as the Chessboard. Just a few seconds are enough
5. Calculate a homography using the frame with the chessboard
6. For each frame with the object: a. Subtract the background and calculate the object's position in the image. B. Use a homography and calculate the object's position on the plane where the chessboard was
7. Draw on a graph as found and connect the dots
第6b点是什么意思,怎么做?
我拥有的是这样的:
我说的对吗?还是不是这样:?
更新
我试过这段代码:
chessboard_frame = cv.imread('pen.png',0) # queryImage
chessboard_template = cv.imread('boardTemplate.png',0)
pattern_size = (10,10)
_, corners1 = cv.findChessboardCorners(chessboard_frame, pattern_size)
_, corners2 = cv.findChessboardCorners(chessboard_template, pattern_size)
H, _ = cv.findHomography(corners1, corners2)
但它会引发以下错误:
错误:OpenCV(4.5.3) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-czu11tvl\opencv\modules\calib3d\src\fundam.cpp:378:错误:(- 5:Bad argument) 输入数组应该是函数 'cv::findHomography' 中的 2D 或 3D 点集
【问题讨论】:
-
查看下面的更新答案
标签: opencv homography