This archive contains a research implementation of: RDLS-modified color space transforms (RCT, YCoCg-R, RDgDb, and LDgEb), heuristics for denoising filter selection, and estimators of transformed image compression effects. This archive contains files: readme.txt - this file colortransf-rdls.cpp - a C++ source file of the colortransf-rdls colortransf-rdls.exe - Win32 executable gccit.bat - batch file for GCC compilation of colortransf-rdls colortransf_rdls_extcompress.bat - sample batch file to be called by colortransf-rdls to for using actual JPEG2000 (JasPer required) bitrate instead of estimated one Notes: Actual bit depth expansion of RDLS transform over non-RDLS is checked before saving components, component is outputted using the required depth, that must not exceed the specific limit for a given RDLS-modified transform component. Before outputting transformed components the transform reversibility is verified. Not optimized for speed or low memory usage. The set of denoising filters from which filters are selected for a specific image and RDLS-modified transform is defined in the DENOISE_PARAMS[] array. Filter set is reported when program starts - using filter type number (see below), filter window radius (radius 1 denotes 3x3 window, 2 is 5x5), and center point weight in the case of Smoothing. Currently, the following 7 filters are used: Null, None, and Smoothing 3x3 with center point weigts 1, 4, 16, 64, and 256. To change the filter set edit DENOISE_PARAMS[] array in colortransf-rdls.cpp and recompile. Following filters are implemented: -filter type 0: None - No denoising, filter outputs its input, RDLS becomes a regular lifting step; -filter type 1: Smoothing - the filtered sample is calculated as a weighted arithmetic mean of samples from the window (the number of samples used is smaller than the window size at the image edges), the weight of the window center point controls the filtering strength, the weights of other points are fixed to 1; -filter type 2: Median - median filter; -filter type 3: RCRS-1 - filter that replaces a sample with the window median if the sample is greater than or smaller than all other samples in the window; -filter type 4: RCRS-2 - filter that replaces a sample with the second greatest window sample value if the sample is greater than the median and the greatest; or, if it is smaller than the median and the smallest, it replaces a sample with the second smallest window sample value; -filter type 5: Null - filter output is 0 regardless of its input. For further description see below (the same will be outputted by the tool invoked with no arguments) or check the commented source file colortransf-rdls.cpp. colortransf-rdls v. 0.9, (c) 2016 Roman Starosolski, rstarosolski@polsl.pl Find best denoising for given image and a RDLS-modified transform, verify reversibility, output transformed image. Image formats: PPM P6 (for RGB image), PGM P5 (for components), PPM plane order RGB assumed, untransformed and transformed intensities assumed unsigned. This software is intended for research purposes only; it is provided "as is"; author makes no warranty of any kind, either express or implied, with respect to this software. syntax: colortransf-rdls TRANSF_NR RDLS_MODE ITERATIONS infilergb.ppm redT.pgm greenT.pgm blueT.pgm filters.txt TRANSF_NR: (* - 1-bit non-RDLS expansion, # - 1-bit additional optional RDLS-expansion): // 0 - RGB (no transformation), // components outputted in a following order: R G B // 1 - RCT (from JPEG2000 standard) / RDLS-RCT, // components outputted in a following order: Cv* Y# Cu* // 2 - YCoCg-R (from JPEG-XR standard) / RDLS-YCoCg-R // components outputted in a following order: Co* Y## Cg*# // 3 - RDgDb / RDLS-RDgDb // components outputted in a following order: R Dg* Db* // 5 - LDgEb / RDLS-LDgEb // components outputted in a following order: L# Dg* Eb*# RDLS_MODE: // 0 - no RDLS, regular lifting transform, // 1 - denoising filters selected by heuristics based on component's H0 // 2 - denoising filters selected by heuristics based on H0 of component's AVG pred. error // 3 - denoising filters selected by heuristics based on H0 of component's MED pred. error // 101, 102, 103 - filters selected by heuristics using 10k pixels or pred. errors (for images > 200x200) // 201, 202, 203 - filters selected by heuristics using 100 10x10 non-overlapping fields (for images > 200x200) // 1000 - filters selected using, instead of estimated bitrate, the actual compressed component bitrate, obtained by calling colortransf_rdls_extcompress.bat, that should compress ___uncompressed___.tmp to ___compressed___.tmp ITERATIONS: iterations in heuristics, 0 disables heuristics, -1000 do filter exhaustive search instead examples: Split lena.ppm RGB color image into red green and blue components, saved as grayscale images R.ppm G.ppm B.ppm: colortransf-rdls 0 0 0 lena.ppm R.pgm G.pgm B.pgm ignore.txt Transform lena.ppm using YCoCg-R transformation, save resulting components as Co.ppm Y.ppm Cg.ppm: colortransf-rdls 2 0 0 lena.ppm Co.pgm Y.pgm Cg.pgm ignore.txt For lena.ppm and RDLS-RDgDb transformation find denoising filters in 1 iteration of heuristics step B (which is optimal in the case of RDLS-RDgDb) based on H0 of component's MED pred. error, transform lena.ppm, verify transform reversibility, save resulting components as R.ppm Dg.ppm Db.ppm and log applied filters to filters.txt colortransf-rdls 3 3 1 lena.ppm R.pgm Dg.pgm Db.pgm filters.txt For lena.ppm and RDLS-RCT transformation find denoising filters in 2 iterations of heuristics step B based on H0 of component's MED pred. error of 10000 pseudo-randomly selected pixels, transform lena.ppm, verify transform reversibility, save resulting components as Cv.ppm Y.ppm Cu.ppm and log applied filters to filters.txt colortransf-rdls 1 103 2 lena.ppm Cv.pgm Y.pgm Cu.pgm filters.txt