Friday, 4 June 2010

GPU 5x5 Bayer Conversion

The standard Bayer mosaic conversion algorithms used in machine vision typically employ fast bi-linear interpolation method in order to reconstruct a full 24-bit per pixel colour image.  Numerous other, more sophisticated algorithms exist in the public domain, but very few are implemented in a sensible machine vision library.  Since most industrial vision tasks are not aimed at recovering very high-fidelity images for human consumption, the Bayer conversion quality does not seem to have been a priority.  Its strange really, given that it is easy to spend $10k on a color machine vision camera, capture device and lens, only to put the captured images through the basic Bayer de-mosaic algorithm at the last moment.

In order to try and improve the situation, we've implemented various Bayer algorithms, including our own adaptive version of the 5x5 Malvar-He-Cutler interpolation algorithm.  Our implementation of the Malvar algorithm (we call Ultra Mode) is noticeably sharper and has less color fringing than the standard method.

The 2-frame gif below shows the difference on a long-range image taken with a well-known machine vision camera.  OK - granted its not a drastic difference and the gif encoding doesn't help, but sometimes this fidelity change can be important.  Given that our implementation runs on any CUDA enabled GPU faster than a basic CPU bi-linear algorithm, there isn't really a down-side to using the better method. 





Vision Experts

7 comments:

  1. Hi, i want to know how faster is the GPU-based bi-linear algorithm related to CPU-based. I want also try to implement a GPU version. I wrote a (using CUDA)code for features detection and tracking algorithm "the KLT algorithm".
    my email:stofkhabouze@googlemail.com
    Best regards
    M.K.

    ReplyDelete
  2. Hi Stof
    I have some more info here:
    http://www.visionexperts.co.uk/?vxBayer

    ReplyDelete
  3. Interesting post!GPU is the best application in computer system.It provide the clear graphic.

    Machine Vision Integrator

    ReplyDelete
  4. Hi there, awesome site. I thought the topics you posted on were very interesting.
    Image Processing Company in Chennai

    ReplyDelete
  5. your blog is really good. useful content. Thanks for posting.I have similar page Kindly visit my page also Photo Retouching Services in India|Photo Editing Services India

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Thanks for posting the useful information to my vision. This is excellent information.
    vision inspection machine

    ReplyDelete