I believe JetPack 2.3 comes with OpenCV4Tegra 2.4.13. I’m trying to use some other libraries that make use of OpenCV 3 functionalities, but would still like to retain the same optimizations present in OpenCV4Tegra. Any advice on this matter?
Hi,
May I know which function in OpenCV 3 you want to use?
It’s not a specific function, but I’m having problems with
cv::Point3f
, getting errors such as invalid operator when attempting to do math with it and some ambiguous overloading related errors as well. I didn’t have these when trying to compile the same code with OpenCV 3 on a different machine, so I assumed the version differences were contributing to it.
Hi,
I think cv::Point3f works fine on current opencv4tegra(2.4.13).
I test it with
std::vector<cv::Point2f> imagePoints;
std::vector<cv::Point3f> objectPoints;
imagePoints.push_back(cv::Point2f(271.,109.));
imagePoints.push_back(cv::Point2f(65.,208.));
imagePoints.push_back(cv::Point2f(334.,459.));
imagePoints.push_back(cv::Point2f(600.,225.));
objectPoints.push_back(cv::Point3f(0., 0., 0.));
objectPoints.push_back(cv::Point3f(-511.,2181.,0.));
objectPoints.push_back(cv::Point3f(-3574.,2354.,0.));
objectPoints.push_back(cv::Point3f(-3400.,0.,0.));
std::cout << "imagePoints: " << std::endl;
std::cout << " " << imagePoints[0] << std::endl;
std::cout << " " << imagePoints[1] << std::endl;
std::cout << " " << imagePoints[2] << std::endl;
std::cout << " " << imagePoints[3] << std::endl;
std::cout << "objectPoints: " << std::endl;
std::cout << " " << objectPoints[0] << std::endl;
std::cout << " " << objectPoints[1] << std::endl;
std::cout << " " << objectPoints[2] << std::endl;
std::cout << " " << objectPoints[3] << std::endl;
I can compile and run it normally. Could you check your makefile if it link opencv correctly?
LIBRARY += -L"/usr/local/lib/" -lopencv_core -lopencv_imgproc -lopencv_highgui
Or share your use case (maybe a simple code?) for me to check?
I’m getting errors such as these
error: call of overloaded ‘Point3_(cv::Point3f&)’ is ambiguous
error: call of overloaded ‘Point3_(cv::Point3_<float>)’ is ambiguous
points.push_back(cv::Point3d(pr + gr*50.0));
error: no match for ‘operator/’ (operand types are ‘cv::Point3f {aka cv::Point3_<float>}’ and ‘double’)
x = y / norm(z);
Both pr and gr are of time cv::Point3f. points is vectorcv::Point3d
There aren’t any errors thrown when I link against OpenCV 3 on another machine. I would like to retain the optimizations in OpenCV4Tegra if possible rather than linking against OpenCV 3.1
Edit: This issue may be relevant: How do I cast Point2f to Point2d? - OpenCV Q&A Forum
Hi,
I have tried the link, and ambiguous issue can be solved by changing cv::Point to cv::Point2f
For example:
cv::circle(result, cv::Point(center), static_cast<int>(radius), cv::Scalar(0), 2); // <--- ERROR IS HERE
cv::circle(result, cv::Point2f(center), static_cast<int>(radius), cv::Scalar(0), 2); // <--- ERROR IS HERE
For your case, maybe try to change cv::Point3 to cv::point3f?