Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Accelerate undistort() with parralelism on GPU

Dear all,

I'm currently using opencv accelerated functions from cv::cuda.

I also want to use the undistort() function, wich is already parralelised on CPU. However, the use of this function still takes too much time, and I want to compile it for GPU use.

I'm trying to make my own version of this function, but I get stucked with getInitUndistortRectifyMapComputer()

This function is calling itself in undistort.dispatch.cpp :

namespace
{
    Ptr<ParallelLoopBody> getInitUndistortRectifyMapComputer(Size _size, Mat &_map1, Mat &_map2, int _m1type,
                                                             const double *_ir, Matx33d &_matTilt,
                                                             double _u0, double _v0, double _fx, double _fy,
                                                             double _k1, double _k2, double _p1, double _p2,
                                                             double _k3, double _k4, double _k5, double _k6,
                                                             double _s1, double _s2, double _s3, double _s4)
    {
        CV_INSTRUMENT_REGION();

        CV_CPU_DISPATCH(getInitUndistortRectifyMapComputer, (_size, _map1, _map2, _m1type, _ir, _matTilt, _u0, _v0, _fx, _fy, _k1, _k2, _p1, _p2, _k3, _k4, _k5, _k6, _s1, _s2, _s3, _s4),
                        CV_CPU_DISPATCH_MODES_ALL);
    }
} // namespace

I cannot find where the function is implemented.

Also, the study of ParallelLoopBody, parallel_for_ and CV_CPU_DISPATCH led me nowhere

How can I find the source code to compile my own version of the function ??

Is there an other way to get the same result using other (opencv or not) stuff ??

Thanks,

click to hide/show revision 2
None

updated 2020-07-23 09:22:47 -0500

berak gravatar image

Accelerate undistort() with parralelism on GPU

Dear all,

I'm currently using opencv accelerated functions from cv::cuda.

I also want to use the undistort() function, wich is already parralelised on CPU. However, the use of this function still takes too much time, and I want to compile it for GPU use.

I'm trying to make my own version of this function, but I get stucked with getInitUndistortRectifyMapComputer()

This function is calling itself in undistort.dispatch.cpp :

namespace
{
    Ptr<ParallelLoopBody> getInitUndistortRectifyMapComputer(Size _size, Mat &_map1, Mat &_map2, int _m1type,
                                                             const double *_ir, Matx33d &_matTilt,
                                                             double _u0, double _v0, double _fx, double _fy,
                                                             double _k1, double _k2, double _p1, double _p2,
                                                             double _k3, double _k4, double _k5, double _k6,
                                                             double _s1, double _s2, double _s3, double _s4)
    {
        CV_INSTRUMENT_REGION();

        CV_CPU_DISPATCH(getInitUndistortRectifyMapComputer, (_size, _map1, _map2, _m1type, _ir, _matTilt, _u0, _v0, _fx, _fy, _k1, _k2, _p1, _p2, _k3, _k4, _k5, _k6, _s1, _s2, _s3, _s4),
                        CV_CPU_DISPATCH_MODES_ALL);
    }
} // namespace

I cannot find where the function is implemented.

Also, the study of ParallelLoopBody, parallel_for_ and CV_CPU_DISPATCH led me nowhere

How can I find the source code to compile my own version of the function ??

Is there an other way to get the same result using other (opencv or not) stuff ??

Thanks,