gpu::buildWarpPerspectiveMaps is not thread safe (Bug #3419)
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
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