undistort.h 做下声明
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <iostream>
extern "C" void undistortcuda(float * src, float *dst,float *camera_matrix,float *dist,int width,int height);
undistort.cu
#include "cuda_runtime.h"
#include "cuda.h"
#include <iostream>
#include <string>
using namespace std;
extern "C" void undistortcuda(float * src, float *dst,float *camera_matrix,float *dist,int width,int height);
__global__ void undistort_(float * src, float *dst, float *camera_matrix, float *distCoeffs, int width, int height)
{
int xIndex = threadIdx.x + blockDim.x * blockIdx.x;
int yIndex = threadIdx.y + blockDim.y * blockIdx.y;
int idx = yIndex * width + xIndex;
float k1 = distCoeffs[0];
float k2 = distCoeffs[1];
float p1 = distCoeffs[2];
float p2 = distCoeffs[3];
float k3 = distCoeff

本文介绍了一个使用CUDA进行图像畸变校正的方法。通过并行计算技术,在GPU上实现了快速的畸变校正算法,显著提高了处理速度。在1080Ti上处理时间仅需1ms,在TX2平台上也只需3ms。

5173

被折叠的 条评论
为什么被折叠?



