I’m new to CUDA code. I can do this very simply in C++ using OpenCV:
unsigned int imgWidth1 = 1420;
unsigned int imgHeight1 = 799;
Mat image1(cv::Size(imgWidth1, imgHeight1), CV_8UC4); //this is later converted to CV_32FC4
//plot simple graph using NumPoints vs Pressure[NumPoints]
unsigned int x = NumPoints + 20;
unsigned int y = 360 - (unsigned int) (3 * Pressure[NumPoints]) + 20;
// get pixel THIS SECTION IS WHAT I WANT TO REPLACE, REPLICATE USING CUDA FLOAT4
Vec4b color = image1.at<Vec4b>(Point(x,y));
color[0] = 255; color[1] = 255; color[2] = 255; color[3] = 255; //set pixel to white
// set pixel
image1.at<Vec4b>(Point(x,y)) = color;
But I want to get rid of OpenCV and use a CUDA float4 array for image1. I’m having a lot of trouble figuring out how to do that. It seems like it should just be initializing the float4 with the image size and then calling it with make_float4 to change the pixel. Could anyone please offer a little help?
System: Jetson TX1, Ubuntu 16.04