minor refactoring
This commit is contained in:
parent
b97d8fd656
commit
efe16c6f3e
@ -63,14 +63,14 @@ namespace cv { namespace gpu
|
||||
}
|
||||
};
|
||||
|
||||
void call(const DevMem2D_<float> src, const float* rot,
|
||||
const float* transl, DevMem2D_<float> dst)
|
||||
void call(const DevMem2D_<float3> src, const float* rot,
|
||||
const float* transl, DevMem2D_<float3> dst)
|
||||
{
|
||||
cudaSafeCall(cudaMemcpyToSymbol(crot0, rot, sizeof(float) * 3));
|
||||
cudaSafeCall(cudaMemcpyToSymbol(crot1, rot + 3, sizeof(float) * 3));
|
||||
cudaSafeCall(cudaMemcpyToSymbol(crot2, rot + 6, sizeof(float) * 3));
|
||||
cudaSafeCall(cudaMemcpyToSymbol(ctransl, transl, sizeof(float) * 3));
|
||||
transform((const DevMem2D_<float3>)src, (DevMem2D_<float3>)dst, TransformOp());
|
||||
transform(src, dst, TransformOp());
|
||||
}
|
||||
} // namespace transform_points
|
||||
|
||||
@ -99,8 +99,8 @@ namespace cv { namespace gpu
|
||||
}
|
||||
};
|
||||
|
||||
void call(const DevMem2D_<float> src, const float* rot,
|
||||
const float* transl, const float* proj, DevMem2D_<float> dst)
|
||||
void call(const DevMem2D_<float3> src, const float* rot,
|
||||
const float* transl, const float* proj, DevMem2D_<float2> dst)
|
||||
{
|
||||
cudaSafeCall(cudaMemcpyToSymbol(crot0, rot, sizeof(float) * 3));
|
||||
cudaSafeCall(cudaMemcpyToSymbol(crot1, rot + 3, sizeof(float) * 3));
|
||||
@ -108,7 +108,7 @@ namespace cv { namespace gpu
|
||||
cudaSafeCall(cudaMemcpyToSymbol(ctransl, transl, sizeof(float) * 3));
|
||||
cudaSafeCall(cudaMemcpyToSymbol(cproj0, proj, sizeof(float) * 3));
|
||||
cudaSafeCall(cudaMemcpyToSymbol(cproj1, proj + 3, sizeof(float) * 3));
|
||||
transform((const DevMem2D_<float3>)src, (DevMem2D_<float2>)dst, ProjectOp());
|
||||
transform(src, dst, ProjectOp());
|
||||
}
|
||||
} // namespace project_points
|
||||
|
||||
|
@ -52,9 +52,9 @@ void cv::gpu::projectPoints(const GpuMat&, const Mat&, const Mat&,
|
||||
|
||||
#else
|
||||
|
||||
namespace cv { namespace gpu { namespace transform_points {
|
||||
void call(const DevMem2D_<float> src, const float* rot,
|
||||
const float* transl, DevMem2D_<float> dst);
|
||||
namespace cv { namespace gpu { namespace transform_points
|
||||
{
|
||||
void call(const DevMem2D_<float3> src, const float* rot, const float* transl, DevMem2D_<float3> dst);
|
||||
}}}
|
||||
|
||||
void cv::gpu::transformPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec,
|
||||
@ -73,9 +73,9 @@ void cv::gpu::transformPoints(const GpuMat& src, const Mat& rvec, const Mat& tve
|
||||
}
|
||||
|
||||
|
||||
namespace cv { namespace gpu { namespace project_points {
|
||||
void call(const DevMem2D_<float> src, const float* rot,
|
||||
const float* transl, const float* proj, DevMem2D_<float> dst);
|
||||
namespace cv { namespace gpu { namespace project_points
|
||||
{
|
||||
void call(const DevMem2D_<float3> src, const float* rot, const float* transl, const float* proj, DevMem2D_<float2> dst);
|
||||
}}}
|
||||
|
||||
void cv::gpu::projectPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec,
|
||||
@ -92,8 +92,7 @@ void cv::gpu::projectPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec,
|
||||
Rodrigues(rvec, rot);
|
||||
|
||||
dst.create(src.size(), CV_32FC2);
|
||||
project_points::call(src, rot.ptr<float>(), tvec.ptr<float>(),
|
||||
camera_mat.ptr<float>(), dst);
|
||||
project_points::call(src, rot.ptr<float>(), tvec.ptr<float>(), camera_mat.ptr<float>(), dst);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user