Image processing how to get an image to the device, how to process it....

What do you think is the best way to copy an image to the device? Let’s say the regular picture from
digitle cameras…

You first need to use a JPEG library to decompress the picture from disk to CPU memory, then you would use cudaMalloc() to allocate equivalent storage on the GPU, and finally cudaMemcpy() to copy the data from the host to the device.


Well, that sounds good. And what do you think about that texture way? To put the image to the GPU via textures. Isn’t that faster? Don’t know how to operate with the data after that… but I know this is also the way.

Using a texture for reading is fine, but they can’t be written to. Check the BoxFilter SDK sample how they accelerate filtering in horizontal direction using textures. This is all with OpenGL by the way.


Yeah, textures cache data and they are streamed to you. So that’s faster…
But is it really necessary to use OpenGL?! to work with textures?! Can’t I just copy the bitmap raw data there and work with them like from the global memory on the GPU?

I’ve posted a modified boxFilter SDK sample for Windows that takes live input from a webcam. If you’ve got a 2 megapixel webcam, like the better Logitech ones, you’re good to go in real time ;)

search for “Live video” and “box filter” and that should bring something up.