Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions modules/objdetect/misc/python/test/test_objdetect_aruco.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@

class aruco_objdetect_test(NewOpenCVTests):

def test_board(self):
p1 = np.array([[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]], dtype=np.float32)
p2 = np.array([[1, 0, 0], [1, 1, 0], [2, 1, 0], [2, 0, 0]], dtype=np.float32)
objPoints = np.array([p1, p2])
dictionary = cv.aruco.getPredefinedDictionary(cv.aruco.DICT_4X4_50)
ids = np.array([0, 1])

board = cv.aruco.Board(objPoints, dictionary, ids)
np.testing.assert_array_equal(board.getIds().squeeze(), ids)
np.testing.assert_array_equal(np.ravel(np.array(board.getObjPoints())), np.ravel(np.concatenate([p1, p2])))

def test_idsAccessibility(self):

ids = np.arange(17)
Expand Down
1 change: 0 additions & 1 deletion modules/objdetect/src/aruco/aruco_board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ Board::Board():

Board::Board(InputArrayOfArrays objPoints, const Dictionary &dictionary, InputArray ids):
Board(new Board::Impl(dictionary)) {
CV_Assert(ids.size() == objPoints.size());
CV_Assert(objPoints.total() == ids.total());
CV_Assert(objPoints.type() == CV_32FC3 || objPoints.type() == CV_32FC1);

Expand Down