colored image to greyscale image using CUDA parallel processing

前端 未结 12 1240
失恋的感觉
失恋的感觉 2021-02-04 19:10

I am trying to solve a problem in which i am supposed to change a colour image to a greyscale image. For this purpose i am using CUDA parallel approach.

The kerne code i

12条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-04 20:08

    the calculation of absolute x & y image positions is perfect. but when u need to access that particular pixel in the coloured image , shouldn't you u use the following code??

    uchar4 rgba = rgbaImage[absolute_image_position_x + (absolute_image_position_y * numCols)];
    

    I thought so, when comparing it to a code you'd write to execute the same problem in serial code. Please let me know :)

提交回复
热议问题