aruco_pose: fix crashing the nodelet if markers on the map are to small

This commit is contained in:
Oleg Kalachev
2019-06-26 23:00:49 +03:00
parent 65d359b5c2
commit b542851b24
5 changed files with 54 additions and 0 deletions

View File

@@ -87,6 +87,7 @@ void _drawPlanarBoard(Board *_board, Size outSize, OutputArray _img, int marginS
// dst_sz.width = dst_sz.height = std::min(dst_sz.width, dst_sz.height); //marker should be square
double diag = std::round(std::hypot(dst_sz.width, dst_sz.height));
int side = std::round(diag / std::sqrt(2));
side = std::max(side, 10);
dictionary.drawMarker(_board->ids[m], side, marker, borderBits);