1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-19 19:44:14 +08:00

Merge pull request #3011 from gokberkgul:wrapper-drawCharucoDiamond

* Add wrapper to drawCharucoDiamond

* add test to drawCharucoDiamond

Co-authored-by: aguel <ahmet.goekberk.guel@igd.fraunhofer.de>
This commit is contained in:
Gokberk Gul
2021-09-26 19:39:03 +02:00
committed by GitHub
parent 28771e28c6
commit 9358d75e30
2 changed files with 6 additions and 2 deletions

View File

@@ -328,8 +328,7 @@ CV_EXPORTS_W void drawDetectedDiamonds(InputOutputArray image, InputArrayOfArray
*
* This function return the image of a ChArUco marker, ready to be printed.
*/
// TODO cannot be exported yet; conversion from/to Vec4i is not wrapped in core
CV_EXPORTS void drawCharucoDiamond(const Ptr<Dictionary> &dictionary, Vec4i ids, int squareLength,
CV_EXPORTS_W void drawCharucoDiamond(const Ptr<Dictionary> &dictionary, Vec4i ids, int squareLength,
int markerLength, OutputArray img, int marginSize = 0,
int borderBits = 1);

View File

@@ -30,5 +30,10 @@ class aruco_test(NewOpenCVTests):
with self.assertRaises(cv.error):
board.setIds(np.array([0]))
def test_drawCharucoDiamond(self):
aruco_dict = cv.aruco.Dictionary_get(cv.aruco.DICT_4X4_50)
img = cv.aruco.drawCharucoDiamond(aruco_dict, np.array([0, 1, 2, 3]), 100, 80)
self.assertTrue(img is not None)
if __name__ == '__main__':
NewOpenCVTests.bootstrap()