gpu::buildWarpPerspectiveMaps is not thread safe (Bug #3419)


Added by Todd Pepper over 11 years ago. Updated over 9 years ago.


Status:Open Start date:2013-12-04
Priority:Normal Due date:
Assignee:Anatoly Baksheev % Done:

0%

Category:gpu (cuda)
Target version:-
Affected version:2.4.0 - 2.4.6 Operating System:Linux
Difficulty: HW Platform:Any
Pull request:

Description

It looks like gpu::buildWarpPerspectiveMaps is not thread safe due to the use of the float array c_warpMat below. I first noticed this when debugging an issue in porting my tile warping application from CPU to GPU. The gpu::warpPerspective and gpu::buildWarpPerspectiveMaps calls require mutex locking in order to work properly in a multithreaded application. It looks like this locking is only required due to the use of the c_warpMat. This will also affect the Affine transforms.


namespace cv { namespace gpu { namespace device
{
    namespace imgproc
    {
        __constant__ float c_warpMat[3 * 3];

        struct AffineTransform
        {
            static __device__ __forceinline__ float2 calcCoord(int x, int y)
            {
                const float xcoo = c_warpMat[0] * x + c_warpMat[1] * y + c_warpMat[2];
                const float ycoo = c_warpMat[3] * x + c_warpMat[4] * y + c_warpMat[5];

                return make_float2(xcoo, ycoo);
            }
        };


Associated revisions

Revision 047b1ca4
Added by Vadim Pisarevsky over 10 years ago

Merge pull request #3419 from samyak-268:2.4

History

Updated by Nikita Manovich about 11 years ago

  • Status changed from New to Open

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4654

Also available in: Atom PDF