1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2025-05-27 16:48:22 +03:00
167 changed files with 7028 additions and 4687 deletions
+14 -1
View File
@@ -99,7 +99,8 @@ void drawFrameAxes(InputOutputArray image, InputArray cameraMatrix, InputArray d
CV_CheckType(type, cn == 1 || cn == 3 || cn == 4,
"Number of channels must be 1, 3 or 4" );
CV_Assert(image.getMat().total() > 0);
cv::Mat img = image.getMat();
CV_Assert(img.total() > 0);
CV_Assert(length > 0);
// project axes points
@@ -111,6 +112,18 @@ void drawFrameAxes(InputOutputArray image, InputArray cameraMatrix, InputArray d
std::vector<Point2f> imagePoints;
projectPoints(axesPoints, rvec, tvec, cameraMatrix, distCoeffs, imagePoints);
cv::Rect imageRect(0, 0, img.cols, img.rows);
bool allIn = true;
for (size_t i = 0; i < imagePoints.size(); i++)
{
allIn &= imageRect.contains(imagePoints[i]);
}
if (!allIn)
{
CV_LOG_WARNING(NULL, "Some of projected axes endpoints are out of frame. The drawn axes may be not relaible.");
}
// draw axes lines
line(image, imagePoints[0], imagePoints[1], Scalar(0, 0, 255), thickness);
line(image, imagePoints[0], imagePoints[2], Scalar(0, 255, 0), thickness);
+1 -1
View File
@@ -17,7 +17,7 @@ class Error : public Algorithm {
public:
// set model to use getError() function
virtual void setModelParameters (const Mat &model) = 0;
// returns error of point wih @point_idx w.r.t. model
// returns error of point with @point_idx w.r.t. model
virtual float getError (int point_idx) const = 0;
virtual const std::vector<float> &getErrors (const Mat &model) = 0;
};