我必须做以下工作:
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
Run Code Online (Sandbox Code Playgroud)
第 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)
Run Code Online (Sandbox Code Playgroud)
但它会引发以下错误:
错误:OpenCV(4.5.3) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-czu11tvl\opencv\modules\calib3d\src\fundam.cpp:378: 错误:(-5:Bad参数)输入数组应该是函数 'cv::findHomography' 中的 2D 或 3D 点集
| 归档时间: |
|
| 查看次数: |
195 次 |
| 最近记录: |