We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1222eef commit 0da8dc4Copy full SHA for 0da8dc4
model_api/cpp/models/include/models/results.h
@@ -230,9 +230,11 @@ static inline std::vector<SegmentedObjectWithRects> add_rotated_rects(std::vecto
230
for (size_t i = 0; i < contours.size(); i++) {
231
contour.insert(contour.end(), contours[i].begin(), contours[i].end());
232
}
233
- std::vector<cv::Point> hull;
234
- cv::convexHull(contour, hull);
235
- objects_with_rects.back().rotated_rect = cv::minAreaRect(hull);
+ if (contour.size() > 0) {
+ std::vector<cv::Point> hull;
+ cv::convexHull(contour, hull);
236
+ objects_with_rects.back().rotated_rect = cv::minAreaRect(hull);
237
+ }
238
239
return objects_with_rects;
240
0 commit comments