Please complete this task as part of your GSoC 2019 application when applying for matching tasks/ideas.
This challenge is mandatory if you apply for T763 or T1121.
- Write a C/CPP program for loading a RAW12 image (portrait-gainx2-offset2047-20ms-02.raw12) into the memory - separate the 4 channels (in memory - 8 bits). Output the intensity values of the first 5x5 pixels (square tile) R, G, G, B channels.
- Save the channels (separately) as valid image files (8 bits per pixel) named appropriately without use of any external libraries (e.g. openJPG/lodePNG). (Hint: PPM file format).
- Debayer the CFA (color filter array) data (in memory using nearest neighbour / bilinear) - output the image as a valid image file (8-bit, without use of any external library).
Additional task (for T763):
- Save the debayered RGB image as a BMP file (without use of any external libraries) - expected that you create the BMP file from scratch. As an alternative, you can save the image as a single frame in an AVI file without use of external libraries (bonus points).
Additional points (if you do one / some / all of the following):
- Use cmake for building the C/CPP program
- Abide by the C/CPP coding guidelines (https://gist.github.com/lefticus/10191322) and project structuring (create appropriate directories, header files, c/cpp files to modularize the code in meaningful ways). See collected information below.
- If you can load part of your program as a dynamic library (.so file)
- If you use a nonlinear curve for the 12 to 8 bit conversion, without ignoring the bottom 4 bits (lots of different solutions possible) and explain your choice (why did you choose that curve)
Collected information:
- RAW12: https://wiki.apertus.org/index.php/RAW12
- Bayer Pattern: https://en.wikipedia.org/wiki/Bayer_filter
- 12bit conversion: https://stackoverflow.com/questions/33768206/convert-2-bytes-into-12-bit-number
- 12bit conversion (SIMD not required): https://stackoverflow.com/questions/15443868/fastest-way-to-convert-12bit-image-to-16bit-image
- Processing RAW images in MATLAB (useful as overview; we are not asking for color-correct output)
- Debayering: https://en.wikipedia.org/wiki/Demosaicing
- PPM file format: https://en.wikipedia.org/wiki/Netpbm_format
- CPP modularity StackOverflow: https://stackoverflow.com/questions/3548357/how-do-you-carry-out-modularized-development-in-c-c
- BMP/AVI file format: https://www.springer.com/cda/content/document/cda_downloaddocument/9781848000223-c2.pdf?SGWID=0-0-45-489703-p173751347
- http://files.apertus.org/AXIOM-Beta/optimal_curve.html
Note: Using or improving upon existing code is permitted but, in the event that code authored by someone else is used, the code's original author must be credited.
To get in touch with any mentor check the Mentor Contact List.