Skip to content

Commit 9358d75

Browse files
gokberkgulaguel
and
aguel
authored
Merge pull request #3011 from gokberkgul:wrapper-drawCharucoDiamond
* Add wrapper to drawCharucoDiamond * add test to drawCharucoDiamond Co-authored-by: aguel <[email protected]>
1 parent 28771e2 commit 9358d75

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

modules/aruco/include/opencv2/aruco/charuco.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,7 @@ CV_EXPORTS_W void drawDetectedDiamonds(InputOutputArray image, InputArrayOfArray
328328
*
329329
* This function return the image of a ChArUco marker, ready to be printed.
330330
*/
331-
// TODO cannot be exported yet; conversion from/to Vec4i is not wrapped in core
332-
CV_EXPORTS void drawCharucoDiamond(const Ptr<Dictionary> &dictionary, Vec4i ids, int squareLength,
331+
CV_EXPORTS_W void drawCharucoDiamond(const Ptr<Dictionary> &dictionary, Vec4i ids, int squareLength,
333332
int markerLength, OutputArray img, int marginSize = 0,
334333
int borderBits = 1);
335334

modules/aruco/misc/python/test/test_aruco.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,10 @@ def test_idsAccessibility(self):
3030
with self.assertRaises(cv.error):
3131
board.setIds(np.array([0]))
3232

33+
def test_drawCharucoDiamond(self):
34+
aruco_dict = cv.aruco.Dictionary_get(cv.aruco.DICT_4X4_50)
35+
img = cv.aruco.drawCharucoDiamond(aruco_dict, np.array([0, 1, 2, 3]), 100, 80)
36+
self.assertTrue(img is not None)
37+
3338
if __name__ == '__main__':
3439
NewOpenCVTests.bootstrap()

0 commit comments

Comments
 (0)