JavaCL - Managing Very Large Image Processing

I am working on an industrial project dealing with large image processing (50Mo per image), and the key is productivity.

I made the choice to delegate image processing to the GPU using JavaCL . I am writing several tests to determine if the approach is right. The results are clear!

More than 100 GPU colorization runs win: GPU = 172 ms versus CPU = 438 ms

It’s clear that the GPU is more powerful than the processor for this kind of computing, BUT! there is a problem, a memory problem. In fact, my graphics card has 256Mo VRam and cannot select an image larger than 8Mo!

So my question is, what is the best way to process images larger than 8Mo?

  • Tile images and processing of each tile? Will performance be a killer due to the delay between RAM and VRAM
  • Extract the original pixels as float4 vectors and send them to the GPU?
  • Change my graphics card?
  • Drop the project?
  • Have another coffee?

Thanks to everyone in advance :-)

+6
source share
2 answers

I am not familiar with JavaCL bindings, but there are images in OpenCL, and then there are buffers.

You can allocate buffers as much as possible, but there are restrictions on the size of cl_mem created with clCreateImage2D (CL_DEVICE_IMAGE2D_MAX_WIDTH and CL_DEVICE_IMAGE2D_MAX_HEIGHT). An image has some advantages over a raw buffer, such as providing hardware accelerated sampling. If you do not need a selection or you can implement your own selection inside the kernel, then a buffer is possible. Otherwise, you will have to split the input image and allow any filtering artifacts that will be displayed during processing.

Hope this helps!

+2
source

If you are open to choosing a language, I would recommend you CUVI (http://cuvilib.com). It provides off-the-shelf easy-to-use image processing features. Many color operations, filters, edge detectors, arithmetic operations, and what not. This is in C with a very neat C ++ modular interface.

And yes, you can also highlight large images!

I can help you (or anyone else) get started with CUVI. The online wiki (http://wiki.cuvilib.com) is the right place to get started.

Disclosure: I am part of the team that developed CUVI. In addition, CUVI is a commercial software.

+1
source

Source: https://habr.com/ru/post/923696/


All Articles