I want to convert points. At the moment my code looks like this:
std::vector<cv::Point3d> homCamPoints(4);
// some assignments to homCamPoints
std::vector<cv::Point2d> inhomCamPoints(4);
convertPointsFromHomogeneous(homCamPoints, inhomCamPoints);
But I always get an exception error concerning a memory position. So, I assume that my input type is wrong, although the OpenCV documentation is saying:
- src – Input vector of N-dimensional points.
- dst – Output vector of N-1-dimensional points.
That sounds like my input types are ok. However in the internet I only found examples using cv::Mat
types, but due to time concerns I would like to avoid the restructuring at that stage.
I run my code in debugging mode. When calling the function the parameters really seem to be fine. The error then occures right after entering the function, but I can't figure it out exactly, as I can't get into the function code itself. Does anybody have an idea why this is not working? Thanks.
I tried this:
and it works without exception. Maybe your Problem is somewhere else in your code. inhomCamPoints are:
[0, 0], [1, 1], [1, 1], [1, 1]