Hi I’m using VisionWorks NVX CUDA Primitives API,
I wanted to use the nvxcuRemap function to remap the input image without distortions, I have the problem of how to create the table input.
nvxcu_error_status_e nvxcuRemap ( const nvxcu_image_t * input , const nvxcu_image_t * table , nvxcu_interpolation_type_e policy , const nvxcu_image_t * output , const nvxcu_border_t * border , const nvxcu_exec_target_t * exec_target )
I have map_x and map_y in cv::Mat but the object nvxcu_pitch_linear_image_t is only one but comparing the pitch size nvxcu with the sum of the two cv::Mat map_x and map_y are equal. What I didn’t understand is how to write in nvxcu_pitch_linear_image_t the two vectors cv::Mat.
when I had to write an single image I did this
nvxcu_pitch_linear_image_t image = { };
image.base.format = NVXCU_DF_IMAGE_RGB;
image.base.image_type = NVXCU_PITCH_LINEAR_IMAGE;
image.base.width = frameWidth;
image.base.height = frameHeight;
size_t pitch = 0ul;
uint32_t cn = 3u;
NVXIO_CUDA_SAFE_CALL( cudaMallocPitch(&image.planes[0].dev_ptr, &pitch,
image.base.width * cn, image.base.height) );
image.planes[0].pitch_in_bytes = static_cast<uint32_t>(pitch);
cv::cvtColor(frame_left, frame_left, cv::COLOR_BGR2RGB);
cudaMemcpy2D(eventData.frame.planes[0].dev_ptr,(size_t)eventData.frame.planes[0].pitch_in_bytes,frame_left.ptr(),frameWidth*cn,frameWidth*cn,frameHeight,cudaMemcpyHostToDevice);
My problem is how to load two vectors cv::Mat in an nvxcu_pitch_linear_image_t ?
Thanks